Documentation
¶
Index ¶
Constants ¶
View Source
const IDSize = 16
View Source
const LastReadLength = 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ServerAddr string // server endpoint for polling // separate endpoint for notifications? PublicKey [32]byte }
func (Config) DialService ¶
type DB ¶
type DB interface { Put(deaddropID DeadDropID, message *pb.Notification) error Fetch(deaddropID DeadDropID, handler func(messages []*pb.Notification) (dropPrefix int, err error)) error }
type DeadDropClient ¶
type DeadDropClient struct {
// contains filtered or unexported fields
}
func NewRandomDeadDropClient ¶
func NewRandomDeadDropClient(conf *Config) (*DeadDropClient, error)
func (*DeadDropClient) MakeAddressV1 ¶
func (dcl *DeadDropClient) MakeAddressV1(id uint16) []byte
func (*DeadDropClient) Poll ¶
func (dcl *DeadDropClient) Poll(ctx context.Context) ([]*pb.Notification, error)
type DeadDropID ¶
type InMemoryDB ¶
type InMemoryDB struct {
// contains filtered or unexported fields
}
func (*InMemoryDB) Fetch ¶
func (memdb *InMemoryDB) Fetch(deaddropID DeadDropID, handler func(messages []*pb.Notification) (dropPrefix int, err error)) error
func (*InMemoryDB) Put ¶
func (memdb *InMemoryDB) Put(deaddropID DeadDropID, message *pb.Notification) error
type NotifierClient ¶
type NotifierClient struct {
// contains filtered or unexported fields
}
func NewNotifierClient ¶
func NewNotifierClient(conf *Config) (*NotifierClient, error)
type PollServer ¶
type PollServer struct { pb.UnimplementedNotifierServer // contains filtered or unexported fields }
func (*PollServer) FetchNotifications ¶
func (ps *PollServer) FetchNotifications(ctx context.Context, req *pb.FetchRequest) (*pb.FetchResponse, error)
func (*PollServer) PostNotificationV1 ¶
func (ps *PollServer) PostNotificationV1(ctx context.Context, req *pb.PostRequestV1) (*pb.Empty, error)
Click to show internal directories.
Click to hide internal directories.