Documentation ¶
Index ¶
- Variables
- type Event
- type EventType
- type Interface
- type Node
- func (n *Node) AdvertisedAddress() string
- func (n *Node) Events() <-chan *Event
- func (n *Node) GetActor(ctx context.Context, actorName string) (*internalpb.WireActor, error)
- func (n *Node) GetPartition(actorName string) int
- func (n *Node) KeyExists(ctx context.Context, key string) (bool, error)
- func (n *Node) NodeHost() string
- func (n *Node) NodeRemotingPort() int
- func (n *Node) PutActor(ctx context.Context, actor *internalpb.WireActor) error
- func (n *Node) RemoveActor(ctx context.Context, actorName string) error
- func (n *Node) SetKey(ctx context.Context, key string) error
- func (n *Node) Start(ctx context.Context) error
- func (n *Node) 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 Interface ¶ added in v1.5.0
type Interface interface { // Start starts the Node engine Start(ctx context.Context) error // Stop stops the Node engine Stop(ctx context.Context) error // NodeHost returns the cluster startNode host address NodeHost() string // NodeRemotingPort returns the cluster startNode remoting port NodeRemotingPort() int // PutActor replicates onto the Node the metadata of an actor PutActor(ctx context.Context, actor *internalpb.WireActor) error // GetActor fetches an actor from the Node GetActor(ctx context.Context, actorName string) (*internalpb.WireActor, error) // GetPartition returns the partition where a given actor is stored GetPartition(actorName string) int // SetKey sets a given key to the cluster SetKey(ctx context.Context, key string) error // KeyExists checks the existence of a given key KeyExists(ctx context.Context, key string) (bool, error) // RemoveActor removes a given actor from the cluster. // An actor is removed from the cluster when this actor has been passivated. RemoveActor(ctx context.Context, actorName string) error // Events returns a channel where cluster events are published Events() <-chan *Event // AdvertisedAddress returns the cluster node cluster address that is known by the // peers in the cluster AdvertisedAddress() string }
Interface defines the Node interface
type Node ¶ added in v1.5.0
type Node struct {
// contains filtered or unexported fields
}
Node represents the Node
func NewNode ¶ added in v1.5.0
func NewNode(name string, serviceDiscovery *discovery.ServiceDiscovery, opts ...Option) (*Node, error)
NewNode creates an instance of cluster Node
func (*Node) AdvertisedAddress ¶ added in v1.5.0
AdvertisedAddress returns the cluster node cluster address that is known by the peers in the cluster
func (*Node) GetPartition ¶ added in v1.5.0
GetPartition returns the partition where a given actor is stored
func (*Node) NodeRemotingPort ¶ added in v1.5.0
NodeRemotingPort returns the Node remoting port
func (*Node) RemoveActor ¶ added in v1.5.0
RemoveActor removes a given actor from the cluster. An actor is removed from the cluster when this actor has been passivated.
type Option ¶ added in v1.5.0
type Option interface { // Apply sets the Option value of a config. Apply(cl *Node) }
Option is the interface that applies a configuration option.
func WithHasher ¶ added in v1.5.0
WithHasher sets the custom hasher
func WithLogger ¶ added in v1.5.0
WithLogger sets the logger
func WithPartitionsCount ¶ added in v1.5.0
WithPartitionsCount sets the total number of partitions
func WithReadTimeout ¶ added in v1.5.0
WithReadTimeout sets the Node read timeout. This timeout specifies the timeout of a data retrieval
func WithShutdownTimeout ¶ added in v1.5.0
WithShutdownTimeout sets the Node shutdown timeout.
func WithWriteTimeout ¶ added in v1.5.0
WithWriteTimeout sets the Node write timeout. This timeout specifies the timeout of a data replication
type OptionFunc ¶ added in v1.5.0
type OptionFunc func(cl *Node)
OptionFunc implements the Option interface.
func (OptionFunc) Apply ¶ added in v1.5.0
func (f OptionFunc) Apply(c *Node)
Apply applies the Node's option