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 NewWebhookEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- type Auther
- type Client
- type Endpoints
- type Service
- type Unauthorized
- type WebhookPayload
- type WebhookRequestData
Constants ¶
const ServiceName = "ttn"
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 = [1]string{"webhook"}
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 NewWebhookEndpoint ¶
func NewWebhookEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewWebhookEndpoint returns an endpoint function that calls the method "webhook" of service "ttn".
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 "ttn" service client.
func (*Client) Webhook ¶
func (c *Client) Webhook(ctx context.Context, p *WebhookPayload, req io.ReadCloser) (err error)
Webhook calls the "webhook" endpoint of the "ttn" service.
type Endpoints ¶
Endpoints wraps the "ttn" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "ttn" service with endpoints.
type Service ¶
type Service interface { // Webhook implements webhook. Webhook(context.Context, *WebhookPayload, io.ReadCloser) (err error) }
Service is the ttn 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".
type WebhookPayload ¶
WebhookPayload is the payload type of the ttn service webhook method.
type WebhookRequestData ¶
type WebhookRequestData struct { // Payload is the method payload. Payload *WebhookPayload // Body streams the HTTP request body. Body io.ReadCloser }
WebhookRequestData holds both the payload and the HTTP request body reader of the "webhook" method.