Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MasterAgent ¶
type MasterAgent struct { Address string http.Handler MasterService }
MasterAgent for a agent of master node
func NewMasterAgent ¶
func NewMasterAgent(service MasterService, address string) *MasterAgent
NewMasterAgent allocates a new MasterAgent to handle the HTTP API
type MasterService ¶
type MasterService interface { AssignNode(userID int64, queueName string, squadName string) (string, error) AddNode(info models.NodeInfo) }
MasterService can distributes a node for a consume
type QueueAgent ¶
type QueueAgent struct { Address string http.Handler QueueService }
QueueAgent for a queue HTTP agent
func NewQueueAgent ¶
func NewQueueAgent(service QueueService, address string) *QueueAgent
NewQueueAgent allocates and returns a new QueueAgent
type QueueService ¶
type QueueService interface { ApplyMessageIDRange(userID int64, queueName string, size int) (maxID int64, err error) PushMessage(userID int64, queueName, content string, index int64) error PullMessages(userID int64, queueName, squadName string, length int) ([]models.Message, error) ReportMaxReceivedMessageID(userID int64, queueName, squadName string, messageID int64) error Info() models.NodeInfo }
QueueService defines what a queue admin should do
Click to show internal directories.
Click to hide internal directories.