Documentation ¶
Index ¶
- Constants
- Variables
- func NewDefaultEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
- func NewSecureEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUnsecureEndpoint(s Service) goa.Endpoint
- type Auther
- type Client
- type DefaultPayload
- type Endpoints
- type SecurePayload
- type Service
Constants ¶
const APIName = "hierarchy"
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 = "api_key_service"
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{"default", "secure", "unsecure"}
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 NewDefaultEndpoint ¶
func NewDefaultEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewDefaultEndpoint returns an endpoint function that calls the method "default" of service "api_key_service".
func NewSecureEndpoint ¶
func NewSecureEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewSecureEndpoint returns an endpoint function that calls the method "secure" of service "api_key_service".
func NewUnsecureEndpoint ¶
NewUnsecureEndpoint returns an endpoint function that calls the method "unsecure" of service "api_key_service".
Types ¶
type Auther ¶
type Auther interface { // APIKeyAuth implements the authorization logic for the APIKey security scheme. APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error) // 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 { DefaultEndpoint goa.Endpoint SecureEndpoint goa.Endpoint UnsecureEndpoint goa.Endpoint }
Client is the "api_key_service" service client.
func (*Client) Default ¶
func (c *Client) Default(ctx context.Context, p *DefaultPayload) (err error)
Default calls the "default" endpoint of the "api_key_service" service.
type DefaultPayload ¶
type DefaultPayload struct { // API key used for authentication Key string }
DefaultPayload is the payload type of the api_key_service service default method.
type Endpoints ¶
Endpoints wraps the "api_key_service" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "api_key_service" service with endpoints.
type SecurePayload ¶
type SecurePayload struct { // JWT used for authentication Token string }
SecurePayload is the payload type of the api_key_service service secure method.
type Service ¶
type Service interface { // Default implements default. Default(context.Context, *DefaultPayload) (err error) // This method requires a valid JWT token. Secure(context.Context, *SecurePayload) (err error) // This method is not secured. Unsecure(context.Context) (err error) }
The svc service is secured with API key based authentication