2020-06-05 23:36:31 +00:00
|
|
|
package stream
|
|
|
|
|
|
|
|
type Topic int32
|
|
|
|
|
|
|
|
// TODO: remove underscores
|
2020-06-15 22:49:00 +00:00
|
|
|
// TODO: type string instead of int?
|
2020-06-05 23:36:31 +00:00
|
|
|
const (
|
|
|
|
Topic_ServiceHealth Topic = 0
|
|
|
|
Topic_ServiceHealthConnect Topic = 1
|
|
|
|
Topic_ACLTokens Topic = 2
|
|
|
|
Topic_ACLPolicies Topic = 3
|
|
|
|
Topic_ACLRoles Topic = 4
|
|
|
|
)
|
|
|
|
|
|
|
|
// TODO:
|
|
|
|
type Event struct {
|
|
|
|
Topic Topic
|
|
|
|
Key string
|
|
|
|
Index uint64
|
|
|
|
Payload interface{}
|
|
|
|
}
|
|
|
|
|
2020-06-15 22:49:00 +00:00
|
|
|
func (e Event) IsEndOfSnapshot() bool {
|
2020-06-05 23:36:31 +00:00
|
|
|
return e.Payload == endOfSnapshot{}
|
|
|
|
}
|
|
|
|
|
2020-06-15 22:49:00 +00:00
|
|
|
func (e Event) IsResumeStream() bool {
|
|
|
|
return e.Payload == ResumeStream{}
|
|
|
|
}
|
|
|
|
|
2020-06-05 23:36:31 +00:00
|
|
|
type endOfSnapshot struct{}
|
2020-06-15 22:49:00 +00:00
|
|
|
|
|
|
|
type ResumeStream struct{}
|