Documentation
¶
Index ¶
- func GetListenHost(port int) string
- func Listen(ctx context.Context, shard uint, topic string, prefixes [][]byte) chan []byte
- func ListenSingle(ctx context.Context, shard uint, topic string, start []byte, prefixes [][]byte) error
- func ReceiveNew(shard uint, topic string, uid []byte)
- type Db
- type Msg
- type MsgDone
- type PubSub
- type Request
- type RequestCount
- type RequestDelete
- type RequestOld
- type RequestSingle
- type Server
- func (s *Server) DeleteMessages(ctx context.Context, request *queue_pb.MessageUids) (*queue_pb.ErrorReply, error)
- func (s *Server) GetMessage(_ context.Context, request *queue_pb.RequestSingle) (*queue_pb.Message, error)
- func (s *Server) GetMessageCount(ctx context.Context, request *queue_pb.CountRequest) (*queue_pb.TopicCount, error)
- func (s *Server) GetMessages(ctx context.Context, request *queue_pb.Request) (*queue_pb.Messages, error)
- func (s *Server) GetStreamMessages(request *queue_pb.RequestStream, server queue_pb.Queue_GetStreamMessagesServer) error
- func (s *Server) Run() error
- func (s *Server) SaveMessages(_ context.Context, messages *queue_pb.Messages) (*queue_pb.ErrorReply, error)
- func (s *Server) SaveMsgs(msgs []*Msg) error
- func (s *Server) Serve() error
- func (s *Server) Start() error
- func (s *Server) StartMessageChan()
- func (s *Server) Stop()
- type Subscribe
- type TopicInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListenHost ¶
func ListenSingle ¶
func ListenSingle(ctx context.Context, shard uint, topic string, start []byte, prefixes [][]byte) error
ListenSingle returns nil if a matching new item is found, otherwise an error
func ReceiveNew ¶
Types ¶
type Db ¶
type Db interface {
GetMsg(*RequestSingle) (*Msg, error)
GetMsgs(*Request) ([]*Msg, error)
SaveMsgs([]*Msg) error
GetCount(*RequestCount) (uint64, error)
GetTopicList() ([]TopicInfo, error)
DeleteMessages(*RequestDelete) error
}
type MsgDone ¶
func NewMsgDone ¶
type Request ¶
type Request struct {
Topic string
Prefixes [][]byte // Filter only these prefixes, e.g. prefix = "b". Ignore Start if more than 1, except overload
Start []byte // Seek to this location to start, e.g. seek to "baltimore", can be overloaded to say last item
Uids [][]byte // When set, Start and Prefixes are ignored
Max uint32
Wait bool
Newest bool
Context context.Context
}
type RequestCount ¶
type RequestDelete ¶
type RequestSingle ¶
type Server ¶
type Server struct {
Port int
Shard uint
Stopped bool
MsgDoneChan chan *MsgDone
Timeout time.Duration
Grpc *grpc.Server
queue_pb.UnimplementedQueueServer
// contains filtered or unexported fields
}
func (*Server) DeleteMessages ¶
func (s *Server) DeleteMessages(ctx context.Context, request *queue_pb.MessageUids) (*queue_pb.ErrorReply, error)
func (*Server) GetMessage ¶
func (*Server) GetMessageCount ¶
func (s *Server) GetMessageCount(ctx context.Context, request *queue_pb.CountRequest) (*queue_pb.TopicCount, error)
func (*Server) GetMessages ¶
func (*Server) GetStreamMessages ¶
func (s *Server) GetStreamMessages(request *queue_pb.RequestStream, server queue_pb.Queue_GetStreamMessagesServer) error
func (*Server) SaveMessages ¶
func (*Server) StartMessageChan ¶
func (s *Server) StartMessageChan()
Click to show internal directories.
Click to hide internal directories.