Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) GetActor(ctx context.Context, actorName string) (*internalpb.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 *internalpb.WireActor) error
- func (c *Cluster) Start(ctx context.Context) error
- func (c *Cluster) Stop(ctx context.Context) error
- type Interface
- 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 Interface ¶ added in v0.6.0
type Interface interface { // Start starts the Cluster engine Start(ctx context.Context) error // Stop stops the Cluster engine Stop(ctx context.Context) error // NodeHost returns the Cluster node host address NodeHost() string // NodeRemotingPort returns the Cluster node remoting port NodeRemotingPort() int // PutActor replicates onto the Cluster the metadata of an actor PutActor(ctx context.Context, actor *internalpb.WireActor) error // GetActor fetches an actor from the Cluster GetActor(ctx context.Context, actorName string) (*internalpb.WireActor, error) // GetPartition returns the partition where a given actor is stored GetPartition(actorName string) int }
Interface defines the Cluster interface
type Option ¶
type Option interface { // Apply sets the Option value of a config. Apply(cl *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