Documentation
¶
Index ¶
- type Config
- type Connector
- type Heartbeat
- type Heartbeater
- type Leases
- type Option
- func WithHeartbeatInterval(interval time.Duration) Option
- func WithHeartbeatTimeout(timeout time.Duration) Option
- func WithLeaseTTL(ttl time.Duration) Option
- func WithNodeName(nodeName string) Option
- func WithRand(r *rand.Rand) Option
- func WithRange(r Range) Option
- func WithVNodeCount(count uint32) Option
- func WithValueListener(listener ValueListener) Option
- type Range
- type Report
- type Ring
- type Schema
- type Status
- type VNode
- type ValueListener
- type ValueListenerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
NodeName string
Range Range
VNodeCount uint32
HeartbeatTimeout time.Duration
HeartbeatInterval time.Duration
LeaseTTL time.Duration
Rand *rand.Rand
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() *Config
type Heartbeat ¶
type Heartbeat struct {
// contains filtered or unexported fields
}
func NewHeartbeat ¶
type Heartbeater ¶
type Leases ¶
type Leases struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(cfg *Config)
func WithHeartbeatInterval ¶
func WithHeartbeatTimeout ¶
func WithLeaseTTL ¶
func WithNodeName ¶
func WithVNodeCount ¶
func WithValueListener ¶
func WithValueListener(listener ValueListener) Option
type Schema ¶
type Schema interface {
RefreshLeases(ctx context.Context, db dbtx.DBTX, nodeName string, ttl time.Duration) (Ring, error)
ApproveLease(ctx context.Context, db dbtx.DBTX, vnodes []uint32) error
InsertLease(ctx context.Context, db dbtx.DBTX, vnode uint32, name string, ttl time.Duration, status string) error
}
type ValueListener ¶
type ValueListenerFunc ¶
func (ValueListenerFunc) ValuesChanged ¶
func (fn ValueListenerFunc) ValuesChanged(values, added, removed []uint32) error
Click to show internal directories.
Click to hide internal directories.