Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) GetActor(ctx context.Context, actorName string) (*goaktpb.WireActor, error)
- func (c *Cluster) GetPartition(actorName string) int
- func (c *Cluster) NodeHost() string
- func (c *Cluster) NodeRemotingPort() int
- func (c *Cluster) PutActor(ctx context.Context, actor *goaktpb.WireActor) error
- func (c *Cluster) Start(ctx context.Context) error
- func (c *Cluster) Stop(ctx context.Context) error
- type Option
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrActorNotFound is return when an actor is not found ErrActorNotFound = errors.New("actor not found") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents the Cluster
func New ¶
func New(name string, serviceDiscovery *discovery.ServiceDiscovery, opts ...Option) (*Cluster, error)
New creates an instance of Cluster
func (*Cluster) GetPartition ¶ added in v0.3.0
GetPartition returns the partition where a given actor is stored
func (*Cluster) NodeRemotingPort ¶ added in v0.3.0
NodeRemotingPort returns the cluster node remoting port
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 WithHasher ¶ added in v0.5.0
WithHasher sets the custom hasher
func WithLogger ¶ added in v0.3.0
WithLogger sets the logger
func WithPartitionsCount ¶ added in v0.3.0
WithPartitionsCount sets the total number of partitions
func WithReadTimeout ¶ added in v0.3.0
WithReadTimeout sets the cluster read timeout. This timeout specifies the timeout of a data retrieval
func WithShutdownTimeout ¶ added in v0.3.0
WithShutdownTimeout sets the cluster shutdown timeout.
func WithWriteTimeout ¶ added in v0.3.0
WithWriteTimeout sets the cluster write timeout. This timeout specifies the timeout of a data replication
type OptionFunc ¶
type OptionFunc func(cluster *Cluster)
OptionFunc implements the Option interface.
func (OptionFunc) Apply ¶
func (f OptionFunc) Apply(c *Cluster)