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 NewEmailEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewErrorEndpoint(s Service) goa.Endpoint
- func NewGetEndpoint(s Service) goa.Endpoint
- type Auther
- type Client
- type EmailPayload
- type Endpoints
- type GetPayload
- type Service
- type Unauthorized
Constants ¶
const ServiceName = "test"
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 = [3]string{"get", "error", "email"}
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 NewEmailEndpoint ¶
func NewEmailEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewEmailEndpoint returns an endpoint function that calls the method "email" of service "test".
func NewErrorEndpoint ¶
NewErrorEndpoint returns an endpoint function that calls the method "error" of service "test".
func NewGetEndpoint ¶
NewGetEndpoint returns an endpoint function that calls the method "get" of service "test".
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 { GetEndpoint goa.Endpoint ErrorEndpoint goa.Endpoint EmailEndpoint goa.Endpoint }
Client is the "test" service client.
func (*Client) Email ¶
func (c *Client) Email(ctx context.Context, p *EmailPayload) (err error)
Email calls the "email" endpoint of the "test" service.
type EmailPayload ¶
EmailPayload is the payload type of the test service email method.
type Endpoints ¶
Endpoints wraps the "test" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "test" service with endpoints.
type GetPayload ¶
type GetPayload struct {
ID *int64
}
GetPayload is the payload type of the test service get method.
type Service ¶
type Service interface { // Get implements get. Get(context.Context, *GetPayload) (err error) // Error implements error. Error(context.Context) (err error) // Email implements email. Email(context.Context, *EmailPayload) (err error) }
Service is the test 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".