Documentation
¶
Index ¶
- type Comms
- func (nb *Comms) AuthenticateToken(_ context.Context, msg *messages.AuthenticatedMessage) (*messages.Ack, error)
- func (nb *Comms) PollNdf(host *connect.Host, ndfHash []byte) (*pb.NDF, error)
- func (nb *Comms) ReceiveNotificationBatch(ctx context.Context, msg *messages.AuthenticatedMessage) (*messages.Ack, error)
- func (nb *Comms) RegisterForNotifications(_ context.Context, msg *pb.NotificationRegisterRequest) (*messages.Ack, error)
- func (nb *Comms) RegisterToken(ctx context.Context, msg *pb.RegisterTokenRequest) (*messages.Ack, error)
- func (nb *Comms) RegisterTrackedID(ctx context.Context, msg *pb.RegisterTrackedIdRequest) (*messages.Ack, error)
- func (nb *Comms) RequestNdf(host *connect.Host, message *pb.NDFHash) (*pb.NDF, error)
- func (nb *Comms) RequestToken(context.Context, *messages.Ping) (*messages.AssignToken, error)
- func (nb *Comms) UnregisterForNotifications(_ context.Context, msg *pb.NotificationUnregisterRequest) (*messages.Ack, error)
- func (nb *Comms) UnregisterToken(ctx context.Context, msg *pb.UnregisterTokenRequest) (*messages.Ack, error)
- func (nb *Comms) UnregisterTrackedID(ctx context.Context, msg *pb.UnregisterTrackedIdRequest) (*messages.Ack, error)
- type Handler
- type Implementation
- func (s *Implementation) ReceiveNotificationBatch(notifBatch *pb.NotificationBatch, auth *connect.Auth) error
- func (s *Implementation) RegisterForNotifications(request *pb.NotificationRegisterRequest) error
- func (s *Implementation) RegisterToken(msg *pb.RegisterTokenRequest) error
- func (s *Implementation) RegisterTrackedID(msg *pb.RegisterTrackedIdRequest) error
- func (s *Implementation) UnregisterForNotifications(request *pb.NotificationUnregisterRequest) error
- func (s *Implementation) UnregisterToken(msg *pb.UnregisterTokenRequest) error
- func (s *Implementation) UnregisterTrackedID(msg *pb.UnregisterTrackedIdRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comms ¶
type Comms struct { *connect.ProtoComms *pb.UnimplementedNotificationBotServer *messages.UnimplementedGenericServer // contains filtered or unexported fields }
NotificationBot object used to implement endpoints and top-level comms functionality
func StartNotificationBot ¶
func StartNotificationBot(id *id.ID, localServer string, handler Handler, certPEMblock, keyPEMblock []byte) *Comms
Starts a new server on the address:port specified by localServer and a callback interface for server operations with given path to public and private key for TLS connection
func (*Comms) AuthenticateToken ¶
func (nb *Comms) AuthenticateToken(_ context.Context, msg *messages.AuthenticatedMessage) (*messages.Ack, error)
Handles validation of reverse-authentication tokens
func (*Comms) ReceiveNotificationBatch ¶
func (*Comms) RegisterForNotifications ¶
func (nb *Comms) RegisterForNotifications(_ context.Context, msg *pb.NotificationRegisterRequest) (*messages.Ack, error)
RegisterForNotifications event handler which registers a client with the notification bot
func (*Comms) RegisterToken ¶
func (*Comms) RegisterTrackedID ¶
func (*Comms) RequestNdf ¶
NotificationBot -> Permissioning Fixme: figure out what to do with notification bot and unified polling
func (*Comms) RequestToken ¶
Handles reception of reverse-authentication token requests
func (*Comms) UnregisterForNotifications ¶
func (nb *Comms) UnregisterForNotifications(_ context.Context, msg *pb.NotificationUnregisterRequest) (*messages.Ack, error)
UnregisterForNotifications event handler which unregisters a client with the notification bot
func (*Comms) UnregisterToken ¶
func (*Comms) UnregisterTrackedID ¶
type Handler ¶
type Handler interface { // RegisterForNotifications event handler which registers a client with the notification bot RegisterForNotifications(msg *pb.NotificationRegisterRequest) error // UnregisterForNotifications event handler which unregisters a client with the notification bot UnregisterForNotifications(msg *pb.NotificationUnregisterRequest) error // ReceiveNotificationBatch receives the batch of notification data from gateway. ReceiveNotificationBatch(notifBatch *pb.NotificationBatch, auth *connect.Auth) error RegisterTrackedID(msg *pb.RegisterTrackedIdRequest) error UnregisterTrackedID(msg *pb.UnregisterTrackedIdRequest) error RegisterToken(msg *pb.RegisterTokenRequest) error UnregisterToken(msg *pb.UnregisterTokenRequest) error }
Handler interface for the Notification Bot
type Implementation ¶
type Implementation struct {
Functions implementationFunctions
}
Implementation allows users of the client library to set the functions that implement the node functions
func NewImplementation ¶
func NewImplementation() *Implementation
NewImplementation returns a Implementation struct with all of the function pointers returning nothing and printing an error.
func (*Implementation) ReceiveNotificationBatch ¶
func (s *Implementation) ReceiveNotificationBatch(notifBatch *pb.NotificationBatch, auth *connect.Auth) error
ReceiveNotificationBatch receives the batch of notification data from gateway.
func (*Implementation) RegisterForNotifications ¶
func (s *Implementation) RegisterForNotifications(request *pb.NotificationRegisterRequest) error
RegisterForNotifications event handler which registers a client with the notification bot
func (*Implementation) RegisterToken ¶
func (s *Implementation) RegisterToken(msg *pb.RegisterTokenRequest) error
func (*Implementation) RegisterTrackedID ¶
func (s *Implementation) RegisterTrackedID(msg *pb.RegisterTrackedIdRequest) error
func (*Implementation) UnregisterForNotifications ¶
func (s *Implementation) UnregisterForNotifications(request *pb.NotificationUnregisterRequest) error
UnregisterForNotifications event handler which unregisters a client with the notification bot
func (*Implementation) UnregisterToken ¶
func (s *Implementation) UnregisterToken(msg *pb.UnregisterTokenRequest) error
func (*Implementation) UnregisterTrackedID ¶
func (s *Implementation) UnregisterTrackedID(msg *pb.UnregisterTrackedIdRequest) error