Documentation ¶
Index ¶
Constants ¶
const (
EventTopicReadyServers stream.StringTopic = "ready-servers"
)
Variables ¶
This section is empty.
Functions ¶
func IsServerReady ¶ added in v1.14.0
func IsServerReady(srv *autopilot.ServerState) bool
IsServerReady determines whether the given server (from the autopilot state) is "ready" - by which we mean that they would be an acceptable target for stale queries.
Types ¶
type Config ¶
type Config struct { GetStore func() StateStore Publisher Publisher // contains filtered or unexported fields }
type EventPayloadReadyServers ¶
type EventPayloadReadyServers []ReadyServerInfo
EventPayloadReadyServers
func ExtractEventPayload ¶
func ExtractEventPayload(event stream.Event) (EventPayloadReadyServers, error)
func (EventPayloadReadyServers) HasReadPermission ¶
func (e EventPayloadReadyServers) HasReadPermission(authz acl.Authorizer) bool
func (EventPayloadReadyServers) Subject ¶
func (e EventPayloadReadyServers) Subject() stream.Subject
func (EventPayloadReadyServers) ToSubscriptionEvent ¶
func (e EventPayloadReadyServers) ToSubscriptionEvent(idx uint64) *pbsubscribe.Event
type ReadyServerInfo ¶
type ReadyServerInfo struct { ID string Address string TaggedAddresses map[string]string ExtGRPCPort int Version string }
ReadyServerInfo includes information about a server that is ready to handle incoming requests.
func (*ReadyServerInfo) Equal ¶
func (info *ReadyServerInfo) Equal(other *ReadyServerInfo) bool
type ReadyServersEventPublisher ¶
type ReadyServersEventPublisher struct { Config // contains filtered or unexported fields }
ReadyServersEventPublisher is capable to tracking changes to ready servers between consecutive calls to PublishReadyServersEvents. It will then publish "ready-servers" events as necessary.
func NewReadyServersEventPublisher ¶
func NewReadyServersEventPublisher(config Config) *ReadyServersEventPublisher
func (*ReadyServersEventPublisher) HandleSnapshot ¶
func (r *ReadyServersEventPublisher) HandleSnapshot(_ stream.SubscribeRequest, buf stream.SnapshotAppender) (uint64, error)
HandleSnapshot is the EventPublisher callback to generate a snapshot for the "ready-servers" event streams.
func (*ReadyServersEventPublisher) PublishReadyServersEvents ¶
func (r *ReadyServersEventPublisher) PublishReadyServersEvents(state *autopilot.State)
PublishReadyServersEvents will publish a "ready-servers" event if the list of ready servers has changed since the last time events were published.