Documentation ¶
Index ¶
- Variables
- func Get(name string, kind string) (*actor.PID, remote.ResponseStatusCode)
- func GetMemberPIDs(kind string) actor.PIDSet
- func RemoveCache(name string)
- func SetLogLevel(level log.Level)
- func Shutdown(graceful bool)
- func Start(clusterName, address string, provider ClusterProvider)
- func StartWithConfig(config *ClusterConfig)
- type ClusterConfig
- func (c *ClusterConfig) WithInitialMemberStatusValue(val MemberStatusValue) *ClusterConfig
- func (c *ClusterConfig) WithMemberStatusValueSerializer(serializer MemberStatusValueSerializer) *ClusterConfig
- func (c *ClusterConfig) WithMemberStrategyBuilder(builder func(kind string) MemberStrategy) *ClusterConfig
- func (c *ClusterConfig) WithRemotingOption(remotingOption []remote.RemotingOption) *ClusterConfig
- func (c *ClusterConfig) WithTimeout(t time.Duration) *ClusterConfig
- type ClusterProvider
- type ClusterTopologyEvent
- type Grain
- type GrainCallOptions
- type GrainContext
- type GrainErrorResponse
- func (*GrainErrorResponse) Descriptor() ([]byte, []int)
- func (this *GrainErrorResponse) Equal(that interface{}) bool
- func (m *GrainErrorResponse) GetErr() string
- func (m *GrainErrorResponse) Marshal() (dAtA []byte, err error)
- func (m *GrainErrorResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GrainErrorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GrainErrorResponse) ProtoMessage()
- func (m *GrainErrorResponse) Reset()
- func (m *GrainErrorResponse) Size() (n int)
- func (this *GrainErrorResponse) String() string
- func (m *GrainErrorResponse) Unmarshal(dAtA []byte) error
- func (m *GrainErrorResponse) XXX_DiscardUnknown()
- func (m *GrainErrorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GrainErrorResponse) XXX_Merge(src proto.Message)
- func (m *GrainErrorResponse) XXX_Size() int
- func (m *GrainErrorResponse) XXX_Unmarshal(b []byte) error
- type GrainRequest
- func (*GrainRequest) Descriptor() ([]byte, []int)
- func (this *GrainRequest) Equal(that interface{}) bool
- func (m *GrainRequest) GetMessageData() []byte
- func (m *GrainRequest) GetMethodIndex() int32
- func (m *GrainRequest) Marshal() (dAtA []byte, err error)
- func (m *GrainRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GrainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GrainRequest) ProtoMessage()
- func (m *GrainRequest) Reset()
- func (m *GrainRequest) Size() (n int)
- func (this *GrainRequest) String() string
- func (m *GrainRequest) Unmarshal(dAtA []byte) error
- func (m *GrainRequest) XXX_DiscardUnknown()
- func (m *GrainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GrainRequest) XXX_Merge(src proto.Message)
- func (m *GrainRequest) XXX_Size() int
- func (m *GrainRequest) XXX_Unmarshal(b []byte) error
- type GrainResponse
- func (*GrainResponse) Descriptor() ([]byte, []int)
- func (this *GrainResponse) Equal(that interface{}) bool
- func (m *GrainResponse) GetMessageData() []byte
- func (m *GrainResponse) Marshal() (dAtA []byte, err error)
- func (m *GrainResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GrainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GrainResponse) ProtoMessage()
- func (m *GrainResponse) Reset()
- func (m *GrainResponse) Size() (n int)
- func (this *GrainResponse) String() string
- func (m *GrainResponse) Unmarshal(dAtA []byte) error
- func (m *GrainResponse) XXX_DiscardUnknown()
- func (m *GrainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GrainResponse) XXX_Merge(src proto.Message)
- func (m *GrainResponse) XXX_Size() int
- func (m *GrainResponse) XXX_Unmarshal(b []byte) error
- type MemberAvailableEvent
- type MemberJoinedEvent
- type MemberLeftEvent
- type MemberMeta
- type MemberRejoinedEvent
- type MemberStatus
- type MemberStatusEvent
- type MemberStatusValue
- type MemberStatusValueSerializer
- type MemberStrategy
- type MemberUnavailableEvent
- type NilMemberStatusValueSerializer
- type Rendezvous
- type SimpleRoundRobin
- type TakeOwnership
- func (*TakeOwnership) Descriptor() ([]byte, []int)
- func (this *TakeOwnership) Equal(that interface{}) bool
- func (m *TakeOwnership) GetName() string
- func (m *TakeOwnership) GetPid() *actor.PID
- func (m *TakeOwnership) Marshal() (dAtA []byte, err error)
- func (m *TakeOwnership) MarshalTo(dAtA []byte) (int, error)
- func (m *TakeOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TakeOwnership) ProtoMessage()
- func (m *TakeOwnership) Reset()
- func (m *TakeOwnership) Size() (n int)
- func (this *TakeOwnership) String() string
- func (m *TakeOwnership) Unmarshal(dAtA []byte) error
- func (m *TakeOwnership) XXX_DiscardUnknown()
- func (m *TakeOwnership) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TakeOwnership) XXX_Merge(src proto.Message)
- func (m *TakeOwnership) XXX_Size() int
- func (m *TakeOwnership) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetMemberPIDs ¶
GetMemberPIDs returns PIDs of members for the specified kind
func SetLogLevel ¶
SetLogLevel sets the log level for the logger.
SetLogLevel is safe to call concurrently
func Start ¶
func Start(clusterName, address string, provider ClusterProvider)
func StartWithConfig ¶
func StartWithConfig(config *ClusterConfig)
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Name string Address string ClusterProvider ClusterProvider RemotingOption []remote.RemotingOption TimeoutTime time.Duration InitialMemberStatusValue MemberStatusValue MemberStatusValueSerializer MemberStatusValueSerializer MemberStrategyBuilder func(kind string) MemberStrategy }
func NewClusterConfig ¶
func NewClusterConfig(name string, address string, clusterProvider ClusterProvider) *ClusterConfig
func (*ClusterConfig) WithInitialMemberStatusValue ¶
func (c *ClusterConfig) WithInitialMemberStatusValue(val MemberStatusValue) *ClusterConfig
func (*ClusterConfig) WithMemberStatusValueSerializer ¶
func (c *ClusterConfig) WithMemberStatusValueSerializer(serializer MemberStatusValueSerializer) *ClusterConfig
func (*ClusterConfig) WithMemberStrategyBuilder ¶
func (c *ClusterConfig) WithMemberStrategyBuilder(builder func(kind string) MemberStrategy) *ClusterConfig
func (*ClusterConfig) WithRemotingOption ¶
func (c *ClusterConfig) WithRemotingOption(remotingOption []remote.RemotingOption) *ClusterConfig
func (*ClusterConfig) WithTimeout ¶
func (c *ClusterConfig) WithTimeout(t time.Duration) *ClusterConfig
type ClusterProvider ¶
type ClusterProvider interface { RegisterMember(clusterName string, address string, port int, knownKinds []string, statusValue MemberStatusValue, serializer MemberStatusValueSerializer) error MonitorMemberStatusChanges() UpdateMemberStatusValue(statusValue MemberStatusValue) error DeregisterMember() error Shutdown() error }
type ClusterTopologyEvent ¶
type ClusterTopologyEvent []*MemberStatus
type GrainCallOptions ¶
func DefaultGrainCallOptions ¶
func DefaultGrainCallOptions() *GrainCallOptions
func NewGrainCallOptions ¶
func NewGrainCallOptions() *GrainCallOptions
func (*GrainCallOptions) WithRetry ¶
func (config *GrainCallOptions) WithRetry(count int) *GrainCallOptions
func (*GrainCallOptions) WithRetryAction ¶
func (config *GrainCallOptions) WithRetryAction(act func(i int)) *GrainCallOptions
func (*GrainCallOptions) WithTimeout ¶
func (config *GrainCallOptions) WithTimeout(timeout time.Duration) *GrainCallOptions
type GrainContext ¶
type GrainContext interface { // Self returns the PID for the current actor Self() *actor.PID // Returns a slice of the actors children Children() []*actor.PID // Watch registers the actor as a monitor for the specified PID Watch(pid *actor.PID) // Unwatch unregisters the actor as a monitor for the specified PID Unwatch(pid *actor.PID) // Sender returns the PID of actor that sent currently processed message Sender() *actor.PID // Message returns the current message to be processed Message() interface{} // Tell sends a message to the given PID Send(pid *actor.PID, message interface{}) // Request sends a message to the given PID and also provides a Sender PID Request(pid *actor.PID, message interface{}) // RequestFuture sends a message to a given PID and returns a Future RequestFuture(pid *actor.PID, message interface{}, timeout time.Duration) *actor.Future // Spawn starts a new child actor based on props and named with a unique id Spawn(props *actor.Props) *actor.PID // SpawnPrefix starts a new child actor based on props and named using a prefix followed by a unique id SpawnPrefix(props *actor.Props, prefix string) *actor.PID // SpawnNamed starts a new child actor based on props and named using the specified name // // ErrNameExists will be returned if id already exists SpawnNamed(props *actor.Props, id string) (*actor.PID, error) }
type GrainErrorResponse ¶
type GrainErrorResponse struct {
Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
}
func (*GrainErrorResponse) Descriptor ¶
func (*GrainErrorResponse) Descriptor() ([]byte, []int)
func (*GrainErrorResponse) Equal ¶
func (this *GrainErrorResponse) Equal(that interface{}) bool
func (*GrainErrorResponse) GetErr ¶
func (m *GrainErrorResponse) GetErr() string
func (*GrainErrorResponse) Marshal ¶
func (m *GrainErrorResponse) Marshal() (dAtA []byte, err error)
func (*GrainErrorResponse) MarshalTo ¶
func (m *GrainErrorResponse) MarshalTo(dAtA []byte) (int, error)
func (*GrainErrorResponse) MarshalToSizedBuffer ¶
func (m *GrainErrorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GrainErrorResponse) ProtoMessage ¶
func (*GrainErrorResponse) ProtoMessage()
func (*GrainErrorResponse) Reset ¶
func (m *GrainErrorResponse) Reset()
func (*GrainErrorResponse) Size ¶
func (m *GrainErrorResponse) Size() (n int)
func (*GrainErrorResponse) String ¶
func (this *GrainErrorResponse) String() string
func (*GrainErrorResponse) Unmarshal ¶
func (m *GrainErrorResponse) Unmarshal(dAtA []byte) error
func (*GrainErrorResponse) XXX_DiscardUnknown ¶
func (m *GrainErrorResponse) XXX_DiscardUnknown()
func (*GrainErrorResponse) XXX_Marshal ¶
func (m *GrainErrorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GrainErrorResponse) XXX_Merge ¶
func (m *GrainErrorResponse) XXX_Merge(src proto.Message)
func (*GrainErrorResponse) XXX_Size ¶
func (m *GrainErrorResponse) XXX_Size() int
func (*GrainErrorResponse) XXX_Unmarshal ¶
func (m *GrainErrorResponse) XXX_Unmarshal(b []byte) error
type GrainRequest ¶
type GrainRequest struct { MethodIndex int32 `protobuf:"varint,1,opt,name=method_index,json=methodIndex,proto3" json:"method_index,omitempty"` MessageData []byte `protobuf:"bytes,2,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` }
func (*GrainRequest) Descriptor ¶
func (*GrainRequest) Descriptor() ([]byte, []int)
func (*GrainRequest) Equal ¶
func (this *GrainRequest) Equal(that interface{}) bool
func (*GrainRequest) GetMessageData ¶
func (m *GrainRequest) GetMessageData() []byte
func (*GrainRequest) GetMethodIndex ¶
func (m *GrainRequest) GetMethodIndex() int32
func (*GrainRequest) Marshal ¶
func (m *GrainRequest) Marshal() (dAtA []byte, err error)
func (*GrainRequest) MarshalToSizedBuffer ¶
func (m *GrainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GrainRequest) ProtoMessage ¶
func (*GrainRequest) ProtoMessage()
func (*GrainRequest) Reset ¶
func (m *GrainRequest) Reset()
func (*GrainRequest) Size ¶
func (m *GrainRequest) Size() (n int)
func (*GrainRequest) String ¶
func (this *GrainRequest) String() string
func (*GrainRequest) Unmarshal ¶
func (m *GrainRequest) Unmarshal(dAtA []byte) error
func (*GrainRequest) XXX_DiscardUnknown ¶
func (m *GrainRequest) XXX_DiscardUnknown()
func (*GrainRequest) XXX_Marshal ¶
func (m *GrainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GrainRequest) XXX_Merge ¶
func (m *GrainRequest) XXX_Merge(src proto.Message)
func (*GrainRequest) XXX_Size ¶
func (m *GrainRequest) XXX_Size() int
func (*GrainRequest) XXX_Unmarshal ¶
func (m *GrainRequest) XXX_Unmarshal(b []byte) error
type GrainResponse ¶
type GrainResponse struct {
MessageData []byte `protobuf:"bytes,1,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"`
}
func (*GrainResponse) Descriptor ¶
func (*GrainResponse) Descriptor() ([]byte, []int)
func (*GrainResponse) Equal ¶
func (this *GrainResponse) Equal(that interface{}) bool
func (*GrainResponse) GetMessageData ¶
func (m *GrainResponse) GetMessageData() []byte
func (*GrainResponse) Marshal ¶
func (m *GrainResponse) Marshal() (dAtA []byte, err error)
func (*GrainResponse) MarshalToSizedBuffer ¶
func (m *GrainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GrainResponse) ProtoMessage ¶
func (*GrainResponse) ProtoMessage()
func (*GrainResponse) Reset ¶
func (m *GrainResponse) Reset()
func (*GrainResponse) Size ¶
func (m *GrainResponse) Size() (n int)
func (*GrainResponse) String ¶
func (this *GrainResponse) String() string
func (*GrainResponse) Unmarshal ¶
func (m *GrainResponse) Unmarshal(dAtA []byte) error
func (*GrainResponse) XXX_DiscardUnknown ¶
func (m *GrainResponse) XXX_DiscardUnknown()
func (*GrainResponse) XXX_Marshal ¶
func (m *GrainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GrainResponse) XXX_Merge ¶
func (m *GrainResponse) XXX_Merge(src proto.Message)
func (*GrainResponse) XXX_Size ¶
func (m *GrainResponse) XXX_Size() int
func (*GrainResponse) XXX_Unmarshal ¶
func (m *GrainResponse) XXX_Unmarshal(b []byte) error
type MemberAvailableEvent ¶
type MemberAvailableEvent struct {
MemberMeta
}
func (*MemberAvailableEvent) MemberStatusEvent ¶
func (*MemberAvailableEvent) MemberStatusEvent()
type MemberJoinedEvent ¶
type MemberJoinedEvent struct {
MemberMeta
}
func (*MemberJoinedEvent) MemberStatusEvent ¶
func (*MemberJoinedEvent) MemberStatusEvent()
type MemberLeftEvent ¶
type MemberLeftEvent struct {
MemberMeta
}
func (*MemberLeftEvent) MemberStatusEvent ¶
func (*MemberLeftEvent) MemberStatusEvent()
type MemberMeta ¶
func (*MemberMeta) GetKinds ¶
func (e *MemberMeta) GetKinds() []string
func (*MemberMeta) Name ¶
func (e *MemberMeta) Name() string
type MemberRejoinedEvent ¶
type MemberRejoinedEvent struct {
MemberMeta
}
func (*MemberRejoinedEvent) MemberStatusEvent ¶
func (*MemberRejoinedEvent) MemberStatusEvent()
type MemberStatus ¶
type MemberStatus struct { MemberID string Host string Port int Kinds []string Alive bool StatusValue MemberStatusValue }
func (*MemberStatus) Address ¶
func (m *MemberStatus) Address() string
type MemberStatusEvent ¶
type MemberStatusEvent interface { MemberStatusEvent() GetKinds() []string }
type MemberStatusValue ¶
type MemberStatusValue interface {
IsSame(val MemberStatusValue) bool
}
type MemberStatusValueSerializer ¶
type MemberStatusValueSerializer interface { Serialize(val MemberStatusValue) string Deserialize(val string) MemberStatusValue }
type MemberStrategy ¶
type MemberStrategy interface { GetAllMembers() []*MemberStatus AddMember(member *MemberStatus) UpdateMember(member *MemberStatus) RemoveMember(member *MemberStatus) GetPartition(key string) string GetActivator() string }
type MemberUnavailableEvent ¶
type MemberUnavailableEvent struct {
}func (*MemberUnavailableEvent) MemberStatusEvent ¶
func (*MemberUnavailableEvent) MemberStatusEvent()
type NilMemberStatusValueSerializer ¶
type NilMemberStatusValueSerializer struct{}
func (*NilMemberStatusValueSerializer) Deserialize ¶
func (s *NilMemberStatusValueSerializer) Deserialize(val string) MemberStatusValue
func (*NilMemberStatusValueSerializer) Serialize ¶
func (s *NilMemberStatusValueSerializer) Serialize(val MemberStatusValue) string
type Rendezvous ¶
type Rendezvous struct {
// contains filtered or unexported fields
}
func NewRendezvous ¶
func NewRendezvous(memberStrategy MemberStrategy) *Rendezvous
func (*Rendezvous) GetByRdv ¶
func (r *Rendezvous) GetByRdv(key string) string
Get returns the node with the highest score for the given key. If this Hash has no nodes, an empty string is returned.
func (*Rendezvous) UpdateRdv ¶
func (r *Rendezvous) UpdateRdv()
type SimpleRoundRobin ¶
type SimpleRoundRobin struct {
// contains filtered or unexported fields
}
func NewSimpleRoundRobin ¶
func NewSimpleRoundRobin(memberStrategy MemberStrategy) *SimpleRoundRobin
func (*SimpleRoundRobin) GetByRoundRobin ¶
func (r *SimpleRoundRobin) GetByRoundRobin() string
type TakeOwnership ¶
type TakeOwnership struct { Pid *actor.PID `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` }
func (*TakeOwnership) Descriptor ¶
func (*TakeOwnership) Descriptor() ([]byte, []int)
func (*TakeOwnership) Equal ¶
func (this *TakeOwnership) Equal(that interface{}) bool
func (*TakeOwnership) GetName ¶
func (m *TakeOwnership) GetName() string
func (*TakeOwnership) GetPid ¶
func (m *TakeOwnership) GetPid() *actor.PID
func (*TakeOwnership) Marshal ¶
func (m *TakeOwnership) Marshal() (dAtA []byte, err error)
func (*TakeOwnership) MarshalToSizedBuffer ¶
func (m *TakeOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TakeOwnership) ProtoMessage ¶
func (*TakeOwnership) ProtoMessage()
func (*TakeOwnership) Reset ¶
func (m *TakeOwnership) Reset()
func (*TakeOwnership) Size ¶
func (m *TakeOwnership) Size() (n int)
func (*TakeOwnership) String ¶
func (this *TakeOwnership) String() string
func (*TakeOwnership) Unmarshal ¶
func (m *TakeOwnership) Unmarshal(dAtA []byte) error
func (*TakeOwnership) XXX_DiscardUnknown ¶
func (m *TakeOwnership) XXX_DiscardUnknown()
func (*TakeOwnership) XXX_Marshal ¶
func (m *TakeOwnership) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TakeOwnership) XXX_Merge ¶
func (m *TakeOwnership) XXX_Merge(src proto.Message)
func (*TakeOwnership) XXX_Size ¶
func (m *TakeOwnership) XXX_Size() int
func (*TakeOwnership) XXX_Unmarshal ¶
func (m *TakeOwnership) XXX_Unmarshal(b []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.