serf

package
v0.0.0-...-d1cd037 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionFn

type OptionFn func(b *Serf)

func Addr

func Addr(serfAddr string) OptionFn

func InitMembers

func InitMembers(serfMembers []string) OptionFn

func Logger

func Logger(logger *simplelog.Logger) OptionFn

type Serf

type Serf struct {
	// contains filtered or unexported fields
}

Serf manages membership of Jocko cluster using Hashicorp Serf

func New

func New(opts ...OptionFn) (*Serf, error)

New Serf object

func (*Serf) Addr

func (s *Serf) Addr() string

Addr of serf agent

func (*Serf) Bootstrap

func (s *Serf) Bootstrap(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error

Bootstrap saves the node metadata and starts the serf agent Info of node updates is returned on reconcileCh channel

func (*Serf) Cluster

func (s *Serf) Cluster() []*jocko.ClusterMember

Cluster is the list of all nodes connected to Serf

func (*Serf) ID

func (s *Serf) ID() int32

ID of this serf node

func (*Serf) Join

func (s *Serf) Join(addrs ...string) (int, error)

Join an existing serf cluster

func (*Serf) Member

func (s *Serf) Member(memberID int32) *jocko.ClusterMember

Member returns broker details of node with given ID

func (*Serf) Shutdown

func (s *Serf) Shutdown() error

Shutdown Serf agent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL