open-consul/agent/consul/stream/event.go
Daniel Nephin 2020e9c7c7 ProcessChanges: use stream.Event
Also remove secretHash, which was used to hash tokens. We don't expose
these tokens anywhere, so we can use the string itself instead of a
Hash.

Fix acl_events_test.go for storing a structs type.
2020-07-14 15:57:45 -04:00

34 lines
614 B
Go

package stream
type Topic int32
// TODO: remove underscores
// TODO: type string instead of int?
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{}
}
func (e Event) IsEndOfSnapshot() bool {
return e.Payload == endOfSnapshot{}
}
func (e Event) IsResumeStream() bool {
return e.Payload == ResumeStream{}
}
type endOfSnapshot struct{}
type ResumeStream struct{}