Documentation
¶
Index ¶
- func Heartbeat(ctx context.Context, store kv.Store, node Node, ttl time.Duration, ...) error
- func Release(ctx context.Context, store kv.Store, name, owner string) error
- type Config
- type Coordinator
- func (c *Coordinator) Heartbeat(ctx context.Context) error
- func (c *Coordinator) Node() Node
- func (c *Coordinator) Nodes(ctx context.Context) ([]Node, error)
- func (c *Coordinator) ReleaseLeadership(ctx context.Context, name string) error
- func (c *Coordinator) RenewLeadership(ctx context.Context, name string) (Lease, bool, error)
- func (c *Coordinator) TryLead(ctx context.Context, name string) (Lease, bool, error)
- type Lease
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config) (*Coordinator, error)
func (*Coordinator) Node ¶
func (c *Coordinator) Node() Node
func (*Coordinator) ReleaseLeadership ¶
func (c *Coordinator) ReleaseLeadership(ctx context.Context, name string) error
func (*Coordinator) RenewLeadership ¶
type Lease ¶
type Lease struct {
Name string `json:"name"`
Owner string `json:"owner"`
ExpiresAt time.Time `json:"expires_at"`
Token string `json:"token,omitempty"`
}
type Node ¶
type Node struct {
ID string `json:"id"`
Address string `json:"address,omitempty"`
Version string `json:"version,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
StartedAt time.Time `json:"started_at"`
LastSeen time.Time `json:"last_seen"`
Draining bool `json:"draining"`
}
Node describes one fh process participating in a cluster. The package is
Click to show internal directories.
Click to hide internal directories.