Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) ClusterEvents() <-chan ClusterEvent
- func (c *Cluster) IsIndexer() bool
- func (c *Cluster) IsSearcher() bool
- func (c *Cluster) IsSeedNode() bool
- func (c *Cluster) Join(seeds []string) (int, error)
- func (c *Cluster) Leave(timeout time.Duration) error
- func (c *Cluster) LocalNodeMetadata() (*NodeMetadata, error)
- func (c *Cluster) LocalNodeName() string
- func (c *Cluster) LookupIndexer(key string) string
- func (c *Cluster) LookupSearchers(key string, numNodes int) []string
- func (c *Cluster) NodeAddress(nodeName string) (string, error)
- func (c *Cluster) NodeMetadata(nodeName string) (*NodeMetadata, error)
- func (c *Cluster) NodePort(nodeName string) (uint16, error)
- func (c *Cluster) NodeState(nodeName string) (NodeState, error)
- func (c *Cluster) Nodes() []string
- func (c *Cluster) Start() error
- func (c *Cluster) Stop() error
- type ClusterEvent
- type NodeEvent
- type NodeEventDelegate
- type NodeEventType
- type NodeMetadata
- type NodeMetadataDelegate
- func (d *NodeMetadataDelegate) GetBroadcasts(overhead, limit int) [][]byte
- func (d *NodeMetadataDelegate) LocalState(join bool) []byte
- func (d *NodeMetadataDelegate) MergeRemoteState(buf []byte, join bool)
- func (d *NodeMetadataDelegate) NodeMeta(limit int) []byte
- func (d *NodeMetadataDelegate) NotifyMsg(msg []byte)
- type NodeRole
- type NodeState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NodeEventType_name = map[NodeEventType]string{ NodeEventTypeUnknown: "unknown", NodeEventTypeJoin: "join", NodeEventTypeLeave: "leave", NodeEventTypeUpdate: "update", } NodeEventType_value = map[string]NodeEventType{ "unknown": NodeEventTypeUnknown, "join": NodeEventTypeJoin, "leave": NodeEventTypeLeave, "update": NodeEventTypeUpdate, } )
Enum value maps for NodeEventType.
View Source
var ( NodeState_name = map[NodeState]string{ NodeStateUnknown: "unknown", NodeStateAlive: "alive", NodeStateSuspect: "suspect", NodeStateDead: "dead", NodeStateLeft: "left", } NodeState_value = map[string]NodeState{ "unknown": NodeStateUnknown, "alive": NodeStateAlive, "suspect": NodeStateSuspect, "dead": NodeStateDead, "left": NodeStateLeft, } )
Enum value maps for NodeState.
View Source
var ( NodeRole_name = map[NodeRole]string{ NodeRoleUnknown: "unknown", NodeRoleIndexer: "indexer", NodeRoleSearcher: "searcher", } NodeRole_value = map[string]NodeRole{ "unknown": NodeRoleUnknown, "indexer": NodeRoleIndexer, "searcher": NodeRoleSearcher, } )
Enum value maps for NodeRole.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func NewCluster ¶
func (*Cluster) ClusterEvents ¶
func (c *Cluster) ClusterEvents() <-chan ClusterEvent
func (*Cluster) IsSearcher ¶
func (*Cluster) IsSeedNode ¶
func (*Cluster) LocalNodeMetadata ¶
func (c *Cluster) LocalNodeMetadata() (*NodeMetadata, error)
func (*Cluster) LocalNodeName ¶
func (*Cluster) LookupIndexer ¶
func (*Cluster) LookupSearchers ¶
func (*Cluster) NodeMetadata ¶
func (c *Cluster) NodeMetadata(nodeName string) (*NodeMetadata, error)
type ClusterEvent ¶
type NodeEvent ¶
type NodeEvent struct { Type NodeEventType NodeName string NodeMetadata *NodeMetadata NodeState NodeState }
type NodeEventDelegate ¶
type NodeEventDelegate struct { NodeEvents chan NodeEvent // contains filtered or unexported fields }
func NewNodeEventDelegate ¶
func NewNodeEventDelegate(logger *zap.Logger) *NodeEventDelegate
func (*NodeEventDelegate) NotifyJoin ¶
func (d *NodeEventDelegate) NotifyJoin(node *memberlist.Node)
func (*NodeEventDelegate) NotifyLeave ¶
func (d *NodeEventDelegate) NotifyLeave(node *memberlist.Node)
func (*NodeEventDelegate) NotifyUpdate ¶
func (d *NodeEventDelegate) NotifyUpdate(node *memberlist.Node)
type NodeEventType ¶
type NodeEventType int
const ( NodeEventTypeUnknown NodeEventType = iota NodeEventTypeJoin NodeEventTypeLeave NodeEventTypeUpdate )
type NodeMetadata ¶
type NodeMetadata struct { GrpcPort int `json:"grpc_port"` HttpPort int `json:"http_port"` Roles []NodeRole `json:"roles"` }
func NewNodeMetadata ¶
func NewNodeMetadata() *NodeMetadata
func NewNodeMetadataWithBytes ¶
func NewNodeMetadataWithBytes(data []byte) (*NodeMetadata, error)
func (*NodeMetadata) IsIndexer ¶
func (m *NodeMetadata) IsIndexer() bool
func (*NodeMetadata) IsSearcher ¶
func (m *NodeMetadata) IsSearcher() bool
func (*NodeMetadata) Marshal ¶
func (m *NodeMetadata) Marshal() ([]byte, error)
type NodeMetadataDelegate ¶
type NodeMetadataDelegate struct {
// contains filtered or unexported fields
}
func NewNodeMetadataDelegate ¶
func NewNodeMetadataDelegate(metadata NodeMetadata, logger *zap.Logger) *NodeMetadataDelegate
func (*NodeMetadataDelegate) GetBroadcasts ¶
func (d *NodeMetadataDelegate) GetBroadcasts(overhead, limit int) [][]byte
func (*NodeMetadataDelegate) LocalState ¶
func (d *NodeMetadataDelegate) LocalState(join bool) []byte
func (*NodeMetadataDelegate) MergeRemoteState ¶
func (d *NodeMetadataDelegate) MergeRemoteState(buf []byte, join bool)
func (*NodeMetadataDelegate) NodeMeta ¶
func (d *NodeMetadataDelegate) NodeMeta(limit int) []byte
func (*NodeMetadataDelegate) NotifyMsg ¶
func (d *NodeMetadataDelegate) NotifyMsg(msg []byte)
Click to show internal directories.
Click to hide internal directories.