Documentation ¶
Index ¶
- Variables
- type Channel
- type Domotics
- type Echo
- type Handler
- type News
- type Service
- func (s *Service) BroadcastUpdate(ctx context.Context, statement *Statement) error
- func (s *Service) ReceiveStatements(*ReceiveStatementsRequest, MessageService_ReceiveStatementsServer) error
- func (s *Service) RegisterChannel(c Channel)
- func (s *Service) RegisterHandler(handler Handler)
- func (s *Service) RegisterUser(context.Context, *RegisterUserRequest) (*users.User, error)
- func (s *Service) SendStatement(ctx context.Context, req *SendStatementRequest) (*Statement, error)
- type SlackBot
- type Transit
- type Weather
Constants ¶
This section is empty.
Variables ¶
var ( // ErrContentTypeNotSupported is returned if the specified content type isn't supported ErrContentTypeNotSupported = status.New(codes.InvalidArgument, "content type not supported") // ErrStatementNotHandled is returned if a particular handler fails to process the statement ErrStatementNotHandled = status.New(codes.FailedPrecondition, "statement not handled") // ErrStatementIgnored is returned if no registered handlers chose to process the statement ErrStatementIgnored = status.New(codes.InvalidArgument, "statement not handled") // ErrStatementDisallowed is returned if the requesting user cannot make this statement ErrStatementDisallowed = status.New(codes.PermissionDenied, "statement user cannot make this request") )
Functions ¶
This section is empty.
Types ¶
type Domotics ¶
type Domotics struct {
// contains filtered or unexported fields
}
Domotics is a device-request handler
func NewDomotics ¶
func NewDomotics(logger *zap.Logger, svc *Service, bridgeClient bridge.BridgeServiceClient) *Domotics
NewDomotics creates a new domotics handler
type Handler ¶
type Handler interface {
ProcessStatement(context.Context, *SendStatementRequest) (*Statement, error)
}
Handler describes an implementation to process statements and potentially take actions on them
type News ¶
type News struct {
// contains filtered or unexported fields
}
News is a news-request handler
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a messaging service.
func NewService ¶
NewService creates a new messaging service.
func (*Service) BroadcastUpdate ¶
BroadcastUpdate sends a specified statement update to all registered handlers.
func (*Service) ReceiveStatements ¶
func (s *Service) ReceiveStatements(*ReceiveStatementsRequest, MessageService_ReceiveStatementsServer) error
ReceiveStatements is used to broadcast info a receiver.
func (*Service) RegisterChannel ¶
RegisterChannel adds another implementation to the broadcast chain.
func (*Service) RegisterHandler ¶
RegisterHandler adds another implementation to the call chain.
func (*Service) RegisterUser ¶
RegisterUser adds another user/endpoint mapping.
type SlackBot ¶
type SlackBot struct {
// contains filtered or unexported fields
}
SlackBot is a message service implementation.
func NewSlackBot ¶
NewSlackBot creates a new slackbot using the supplied slack implementation.
type Transit ¶
type Transit struct {
// contains filtered or unexported fields
}
Transit is a transit-request handler
func NewTransit ¶
func NewTransit(logger *zap.Logger, client transit.TransitServiceClient) *Transit
NewTransit creates a new transit handler