Documentation
¶
Index ¶
Constants ¶
View Source
const ( BackoffMinInterval = 1 * time.Second BackoffMaxInterval = 60 * time.Second BackoffMultiplier = 1.5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { ICluster // contains filtered or unexported fields }
func NewCluster ¶
func NewCluster(conf *ClusterCfg) *Cluster
type ClusterCfg ¶
type ClusterCfg struct { Pid int Addr string Hub IHub Mux *http.ServeMux RunLeader bool RunFollower bool LeaderAddr string KafkaBrokers []string KafkaTopic string KafkaGroupId string EnableClientMsg bool EventManager store.IEventStore CleanEvents bool EventTTLDays int32 EventPayloadMaxBytes int32 SessionQuota int32 }
type IHub ¶
type IHub interface { Run(context.Context, chan<- *pb.FollowerMsg, <-chan *pb.LeaderMsg, chan<- struct{}) Kickoff(string) Online() Offline() }
IHub provides interfaces of local Hub.
type IKafkaReader ¶
type IKafkaWriter ¶
type KafkaMsgValue ¶
type KafkaMsgValue struct { Body string `json:"body,omitempty"` // event body in JSON format ToUids []int32 `json:"uids,omitempty"` }
kafka message value.
type SessionStore ¶
memory cluster session store.
type Standalone ¶
Standalone is a standalone server, with out running leader and follower. It is equivalent to one node cluster with gRPC client and server
func NewStandalone ¶
func NewStandalone(conf *ClusterCfg) *Standalone
func (*Standalone) Run ¶
func (s *Standalone) Run(ctx context.Context, stopNotifyCh chan<- struct{})
Source Files
¶
Click to show internal directories.
Click to hide internal directories.