cluster

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster represents the Cluster

func New

func New(disco discovery.Discovery, logger log.Logger, opts ...Option) *Cluster

New creates an instance of Cluster

func (*Cluster) GetActor

func (c *Cluster) GetActor(ctx context.Context, actorName string) (*goaktpb.WireActor, error)

GetActor fetches an actor from the cluster

func (*Cluster) NodeHost

func (c *Cluster) NodeHost() string

NodeHost returns the cluster node Host

func (*Cluster) PutActor

func (c *Cluster) PutActor(ctx context.Context, actor *goaktpb.WireActor) error

PutActor replicates onto the cluster the metadata of an actor

func (*Cluster) Start

func (c *Cluster) Start(ctx context.Context) error

Start starts the Cluster. When the join address is not set a brand-new cluster is started. However, when the join address is set the given Cluster joins an existing cluster at the joinAddr.

func (*Cluster) Stop

func (c *Cluster) Stop() error

Stop stops the Cluster gracefully

type Option

type Option interface {
	// Apply sets the Option value of a config.
	Apply(cluster *Cluster)
}

Option is the interface that applies a configuration option.

func WithDataDir

func WithDataDir(datadir string) Option

WithDataDir sets the data dir

type OptionFunc

type OptionFunc func(cluster *Cluster)

OptionFunc implements the Option interface.

func (OptionFunc) Apply

func (f OptionFunc) Apply(c *Cluster)

Jump to

Keyboard shortcuts

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