Documentation ¶
Index ¶
- Constants
- Variables
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeForbidden(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func NewListenEndpoint(s Service) goa.Endpoint
- func NewSeenEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- type Auther
- type Client
- type Endpoints
- type ListenClientStream
- type ListenEndpointInput
- type ListenServerStream
- type SeenPayload
- type Service
- type Unauthorized
Constants ¶
const ServiceName = "notifications"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [2]string{"listen", "seen"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeBadRequest ¶
func MakeBadRequest(err error) *goa.ServiceError
MakeBadRequest builds a goa.ServiceError from an error.
func MakeForbidden ¶
func MakeForbidden(err error) *goa.ServiceError
MakeForbidden builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func MakeUnauthorized ¶
func MakeUnauthorized(err error) *goa.ServiceError
MakeUnauthorized builds a goa.ServiceError from an error.
func NewListenEndpoint ¶
NewListenEndpoint returns an endpoint function that calls the method "listen" of service "notifications".
func NewSeenEndpoint ¶
func NewSeenEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewSeenEndpoint returns an endpoint function that calls the method "seen" of service "notifications".
Types ¶
type Auther ¶
type Auther interface { // JWTAuth implements the authorization logic for the JWT security scheme. JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error) }
Auther defines the authorization functions to be implemented by the service.
type Client ¶
Client is the "notifications" service client.
type Endpoints ¶
Endpoints wraps the "notifications" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "notifications" service with endpoints.
type ListenClientStream ¶
type ListenClientStream interface { // Send streams instances of "map[string]interface{}". Send(map[string]interface{}) error // Recv reads instances of "map[string]interface{}" from the stream. Recv() (map[string]interface{}, error) // Close closes the stream. Close() error }
ListenClientStream is the interface a "listen" endpoint client stream must satisfy.
type ListenEndpointInput ¶
type ListenEndpointInput struct { // Stream is the server stream used by the "listen" method to send data. Stream ListenServerStream }
ListenEndpointInput holds both the payload and the server stream of the "listen" method.
type ListenServerStream ¶
type ListenServerStream interface { // Send streams instances of "map[string]interface{}". Send(map[string]interface{}) error // Recv reads instances of "map[string]interface{}" from the stream. Recv() (map[string]interface{}, error) // Close closes the stream. Close() error }
ListenServerStream is the interface a "listen" endpoint server stream must satisfy.
type SeenPayload ¶
SeenPayload is the payload type of the notifications service seen method.
type Service ¶
type Service interface { // Listen implements listen. Listen(context.Context, ListenServerStream) (err error) // Seen implements seen. Seen(context.Context, *SeenPayload) (err error) }
Service is the notifications service interface.
type Unauthorized ¶
type Unauthorized string
credentials are invalid
func (Unauthorized) Error ¶
func (e Unauthorized) Error() string
Error returns an error description.
func (Unauthorized) ErrorName ¶
func (e Unauthorized) ErrorName() string
ErrorName returns "unauthorized".