ttn

package
v0.0.0-...-b9360c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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

type Client struct {
	WebhookEndpoint goa.Endpoint
}

Client is the "ttn" service client.

func NewClient

func NewClient(webhook goa.Endpoint) *Client

NewClient initializes a "ttn" service client given the endpoints.

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

type Endpoints struct {
	Webhook goa.Endpoint
}

Endpoints wraps the "ttn" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "ttn" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "ttn" service 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

type WebhookPayload struct {
	Auth          *string
	ContentLength int64
	ContentType   string
	Token         *string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL