Documentation ¶
Index ¶
- func BuildWebhookPayload(ttnWebhookToken string, ttnWebhookContentType string, ...) (*ttn.WebhookPayload, error)
- func BuildWebhookStreamPayload(payload interface{}, fpath string) (*ttn.WebhookRequestData, error)
- func DecodeWebhookResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)
- func EncodeWebhookRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error
- func NewWebhookBadRequest(body *WebhookBadRequestResponseBody) *goa.ServiceError
- func NewWebhookForbidden(body *WebhookForbiddenResponseBody) *goa.ServiceError
- func NewWebhookNotFound(body *WebhookNotFoundResponseBody) *goa.ServiceError
- func NewWebhookUnauthorized(body WebhookUnauthorizedResponseBody) ttn.Unauthorized
- func ValidateWebhookBadRequestResponseBody(body *WebhookBadRequestResponseBody) (err error)
- func ValidateWebhookForbiddenResponseBody(body *WebhookForbiddenResponseBody) (err error)
- func ValidateWebhookNotFoundResponseBody(body *WebhookNotFoundResponseBody) (err error)
- func WebhookTtnPath() string
- type Client
- type WebhookBadRequestResponseBody
- type WebhookForbiddenResponseBody
- type WebhookNotFoundResponseBody
- type WebhookUnauthorizedResponseBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWebhookPayload ¶
func BuildWebhookPayload(ttnWebhookToken string, ttnWebhookContentType string, ttnWebhookContentLength string, ttnWebhookAuth string) (*ttn.WebhookPayload, error)
BuildWebhookPayload builds the payload for the ttn webhook endpoint from CLI flags.
func BuildWebhookStreamPayload ¶
func BuildWebhookStreamPayload(payload interface{}, fpath string) (*ttn.WebhookRequestData, error)
// BuildWebhookStreamPayload creates a streaming endpoint request payload from the method payload and the path to the file to be streamed
func DecodeWebhookResponse ¶
func DecodeWebhookResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)
DecodeWebhookResponse returns a decoder for responses returned by the ttn webhook endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeWebhookResponse may return the following errors:
- "forbidden" (type *goa.ServiceError): http.StatusForbidden
- "not-found" (type *goa.ServiceError): http.StatusNotFound
- "bad-request" (type *goa.ServiceError): http.StatusBadRequest
- "unauthorized" (type ttn.Unauthorized): http.StatusUnauthorized
- error: internal error
func EncodeWebhookRequest ¶
func EncodeWebhookRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error
EncodeWebhookRequest returns an encoder for requests sent to the ttn webhook server.
func NewWebhookBadRequest ¶
func NewWebhookBadRequest(body *WebhookBadRequestResponseBody) *goa.ServiceError
NewWebhookBadRequest builds a ttn service webhook endpoint bad-request error.
func NewWebhookForbidden ¶
func NewWebhookForbidden(body *WebhookForbiddenResponseBody) *goa.ServiceError
NewWebhookForbidden builds a ttn service webhook endpoint forbidden error.
func NewWebhookNotFound ¶
func NewWebhookNotFound(body *WebhookNotFoundResponseBody) *goa.ServiceError
NewWebhookNotFound builds a ttn service webhook endpoint not-found error.
func NewWebhookUnauthorized ¶
func NewWebhookUnauthorized(body WebhookUnauthorizedResponseBody) ttn.Unauthorized
NewWebhookUnauthorized builds a ttn service webhook endpoint unauthorized error.
func ValidateWebhookBadRequestResponseBody ¶
func ValidateWebhookBadRequestResponseBody(body *WebhookBadRequestResponseBody) (err error)
ValidateWebhookBadRequestResponseBody runs the validations defined on webhook_bad-request_response_body
func ValidateWebhookForbiddenResponseBody ¶
func ValidateWebhookForbiddenResponseBody(body *WebhookForbiddenResponseBody) (err error)
ValidateWebhookForbiddenResponseBody runs the validations defined on webhook_forbidden_response_body
func ValidateWebhookNotFoundResponseBody ¶
func ValidateWebhookNotFoundResponseBody(body *WebhookNotFoundResponseBody) (err error)
ValidateWebhookNotFoundResponseBody runs the validations defined on webhook_not-found_response_body
func WebhookTtnPath ¶
func WebhookTtnPath() string
WebhookTtnPath returns the URL path to the ttn service webhook HTTP endpoint.
Types ¶
type Client ¶
type Client struct { // Webhook Doer is the HTTP client used to make requests to the webhook // endpoint. WebhookDoer goahttp.Doer // CORS Doer is the HTTP client used to make requests to the endpoint. CORSDoer goahttp.Doer // RestoreResponseBody controls whether the response bodies are reset after // decoding so they can be read again. RestoreResponseBody bool // contains filtered or unexported fields }
Client lists the ttn service endpoint HTTP clients.
func NewClient ¶
func NewClient( scheme string, host string, doer goahttp.Doer, enc func(*http.Request) goahttp.Encoder, dec func(*http.Response) goahttp.Decoder, restoreBody bool, ) *Client
NewClient instantiates HTTP clients for all the ttn service servers.
func (*Client) BuildWebhookRequest ¶
BuildWebhookRequest instantiates a HTTP request object with method and path set to call the "ttn" service "webhook" endpoint
type WebhookBadRequestResponseBody ¶
type WebhookBadRequestResponseBody struct { // Name is the name of this class of errors. Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` // ID is a unique identifier for this particular occurrence of the problem. ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` // Is the error temporary? Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` // Is the error a timeout? Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` // Is the error a server-side fault? Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` }
WebhookBadRequestResponseBody is the type of the "ttn" service "webhook" endpoint HTTP response body for the "bad-request" error.
type WebhookForbiddenResponseBody ¶
type WebhookForbiddenResponseBody struct { // Name is the name of this class of errors. Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` // ID is a unique identifier for this particular occurrence of the problem. ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` // Is the error temporary? Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` // Is the error a timeout? Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` // Is the error a server-side fault? Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` }
WebhookForbiddenResponseBody is the type of the "ttn" service "webhook" endpoint HTTP response body for the "forbidden" error.
type WebhookNotFoundResponseBody ¶
type WebhookNotFoundResponseBody struct { // Name is the name of this class of errors. Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` // ID is a unique identifier for this particular occurrence of the problem. ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` // Message is a human-readable explanation specific to this occurrence of the // problem. Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` // Is the error temporary? Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` // Is the error a timeout? Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` // Is the error a server-side fault? Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` }
WebhookNotFoundResponseBody is the type of the "ttn" service "webhook" endpoint HTTP response body for the "not-found" error.
type WebhookUnauthorizedResponseBody ¶
type WebhookUnauthorizedResponseBody string
WebhookUnauthorizedResponseBody is the type of the "ttn" service "webhook" endpoint HTTP response body for the "unauthorized" error.