common

package
v0.0.0-...-769f768 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "common"

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{"health_check"}

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 MakeClientClosedRequest

func MakeClientClosedRequest(err error) *goa.ServiceError

MakeClientClosedRequest builds a goa.ServiceError from an error.

func MakeConflict

func MakeConflict(err error) *goa.ServiceError

MakeConflict builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeGatewayTimeout

func MakeGatewayTimeout(err error) *goa.ServiceError

MakeGatewayTimeout builds a goa.ServiceError from an error.

func MakeInternalServerError

func MakeInternalServerError(err error) *goa.ServiceError

MakeInternalServerError builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeNotImplemented

func MakeNotImplemented(err error) *goa.ServiceError

MakeNotImplemented builds a goa.ServiceError from an error.

func MakeServiceUnavailable

func MakeServiceUnavailable(err error) *goa.ServiceError

MakeServiceUnavailable builds a goa.ServiceError from an error.

func MakeTooManyRequests

func MakeTooManyRequests(err error) *goa.ServiceError

MakeTooManyRequests builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewHealthCheckEndpoint

func NewHealthCheckEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint

NewHealthCheckEndpoint returns an endpoint function that calls the method "health_check" of service "common".

Types

type Auther

type Auther interface {
	// BasicAuth implements the authorization logic for the Basic security scheme.
	BasicAuth(ctx context.Context, user, pass string, schema *security.BasicScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	HealthCheckEndpoint goa.Endpoint
}

Client is the "common" service client.

func NewClient

func NewClient(healthCheck goa.Endpoint) *Client

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

func (*Client) HealthCheck

func (c *Client) HealthCheck(ctx context.Context, p *HealthCheckPayload) (res *HealthCheckResponse, err error)

HealthCheck calls the "health_check" endpoint of the "common" service.

type Endpoints

type Endpoints struct {
	HealthCheck goa.Endpoint
}

Endpoints wraps the "common" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "common" service endpoints.

type HealthCheckPayload

type HealthCheckPayload struct {
	Username string
	Password string
}

HealthCheckPayload is the payload type of the common service health_check method.

type HealthCheckResponse

type HealthCheckResponse struct {
	Status string
}

HealthCheckResponse is the result type of the common service health_check method.

type Service

type Service interface {
	// HealthCheck implements health_check.
	HealthCheck(context.Context, *HealthCheckPayload) (res *HealthCheckResponse, err error)
}

Service is the common service interface.

Jump to

Keyboard shortcuts

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