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
Constants ¶
const APIName = "activity"
APIName is the name of the API as defined in the design.
const APIVersion = "0.0.1"
APIVersion is the version of the API as defined in the design.
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.
func (*Client) Listen ¶
func (c *Client) Listen(ctx context.Context) (res ListenClientStream, err error)
Listen calls the "listen" endpoint of the "notifications" service. Listen may return the following errors:
- "unauthorized" (type *goa.ServiceError)
- "forbidden" (type *goa.ServiceError)
- "not-found" (type *goa.ServiceError)
- "bad-request" (type *goa.ServiceError)
- error: internal error
func (*Client) Seen ¶
func (c *Client) Seen(ctx context.Context, p *SeenPayload) (err error)
Seen calls the "seen" endpoint of the "notifications" service. Seen may return the following errors:
- "unauthorized" (type *goa.ServiceError)
- "forbidden" (type *goa.ServiceError)
- "not-found" (type *goa.ServiceError)
- "bad-request" (type *goa.ServiceError)
- error: internal error
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]any".
Send(map[string]any) error
// SendWithContext streams instances of "map[string]any" with context.
SendWithContext(context.Context, map[string]any) error
// Recv reads instances of "map[string]any" from the stream.
Recv() (map[string]any, error)
// RecvWithContext reads instances of "map[string]any" from the stream with
// context.
RecvWithContext(context.Context) (map[string]any, error)
// Close closes the stream.
Close() error
}
ListenClientStream allows streaming instances of map[string]any to the client.
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]any".
Send(map[string]any) error
// SendWithContext streams instances of "map[string]any" with context.
SendWithContext(context.Context, map[string]any) error
// Recv reads instances of "map[string]any" from the stream.
Recv() (map[string]any, error)
// RecvWithContext reads instances of "map[string]any" from the stream with
// context.
RecvWithContext(context.Context) (map[string]any, error)
// Close closes the stream.
Close() error
}
ListenServerStream allows streaming instances of map[string]any to the client.
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.