bootstrap

package
v0.0.0-...-fbf4a61 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOldConfiguration = errors.New("configuration is outdated")
	ErrNoConfiguraton   = errors.New("can't fetch configuration")
)

Functions

This section is empty.

Types

type AlertsMonitor

type AlertsMonitor interface {
	Observe(context.Context, []*types.Message) error
}

type BootstrapClient

type BootstrapClient interface {
	Configuration(context.Context) (*types.Configuration, error)
	Join(context.Context, uint64, *types.Node) error
}

type Broadcaster

type Broadcaster interface {
	Send(context.Context, []*types.Message) error
}

type Client

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

func NewClient

func NewClient(logger *zap.SugaredLogger, net Network) Client

func (Client) GetConfiguration

func (c Client) GetConfiguration(ctx context.Context, nodes []*types.Node) (*types.Configuration, error)

func (Client) Join

func (c Client) Join(ctx context.Context, instanceID uint64, node, peer *types.Node) error

type Network

type Network interface {
	RegisterBootstrap(Service)
	BootstrapClient(context.Context, *types.Node) (BootstrapClient, error)
}

type Service

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

func New

func New(logger *zap.SugaredLogger,
	nodeID uint64,
	configuration *types.LastConfiguration,
	net Network,
	am AlertsMonitor,
	bf Broadcaster,
) Service

func (Service) Configuration

func (s Service) Configuration() *types.Configuration

func (Service) Join

func (s Service) Join(ctx context.Context, instanceID uint64, node *types.Node) error

Jump to

Keyboard shortcuts

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