mtd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "mtd"

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 = [3]string{"register", "retrieve", "hmrc_callback"}

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 MakeInvalidRequest

func MakeInvalidRequest(err error) *goa.ServiceError

MakeInvalidRequest builds a goa.ServiceError from an error.

func MakeKeyAlreadyExists

func MakeKeyAlreadyExists(err error) *goa.ServiceError

MakeKeyAlreadyExists builds a goa.ServiceError from an error.

func MakeKeyHasNoToken

func MakeKeyHasNoToken(err error) *goa.ServiceError

MakeKeyHasNoToken builds a goa.ServiceError from an error.

func MakeKeyIPMismatch

func MakeKeyIPMismatch(err error) *goa.ServiceError

MakeKeyIPMismatch builds a goa.ServiceError from an error.

func MakeKeyLengthError

func MakeKeyLengthError(err error) *goa.ServiceError

MakeKeyLengthError builds a goa.ServiceError from an error.

func MakeMatchingKeyNotFound

func MakeMatchingKeyNotFound(err error) *goa.ServiceError

MakeMatchingKeyNotFound builds a goa.ServiceError from an error.

func NewHmrcCallbackEndpoint

func NewHmrcCallbackEndpoint(s Service) goa.Endpoint

NewHmrcCallbackEndpoint returns an endpoint function that calls the method "hmrc_callback" of service "mtd".

func NewRegisterEndpoint

func NewRegisterEndpoint(s Service) goa.Endpoint

NewRegisterEndpoint returns an endpoint function that calls the method "register" of service "mtd".

func NewRetrieveEndpoint

func NewRetrieveEndpoint(s Service) goa.Endpoint

NewRetrieveEndpoint returns an endpoint function that calls the method "retrieve" of service "mtd".

Types

type Client

type Client struct {
	RegisterEndpoint     goa.Endpoint
	RetrieveEndpoint     goa.Endpoint
	HmrcCallbackEndpoint goa.Endpoint
}

Client is the "mtd" service client.

func NewClient

func NewClient(register, retrieve, hmrcCallback goa.Endpoint) *Client

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

func (*Client) HmrcCallback

func (c *Client) HmrcCallback(ctx context.Context, p *CodePayload) (err error)

HmrcCallback calls the "hmrc_callback" endpoint of the "mtd" service.

func (*Client) Register

func (c *Client) Register(ctx context.Context, p *StatePayload) (err error)

Register calls the "register" endpoint of the "mtd" service.

func (*Client) Retrieve

func (c *Client) Retrieve(ctx context.Context, p *StatePayload) (res string, err error)

Retrieve calls the "retrieve" endpoint of the "mtd" service.

type CodePayload

type CodePayload struct {
	// AES1 digest string to identify client
	State *string
	// HMRC string to identify client
	Code *string
	// Error String
	Error *string
	// Error String
	ErrorDescription *string
	// Error String
	ErrorCode *string
}

CodePayload is the payload type of the mtd service hmrc_callback method.

type Endpoints

type Endpoints struct {
	Register     goa.Endpoint
	Retrieve     goa.Endpoint
	HmrcCallback goa.Endpoint
}

Endpoints wraps the "mtd" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type Service

type Service interface {
	// Store key that will store oauth token
	Register(context.Context, *StatePayload) (err error)
	// Store key that will store oauth token
	Retrieve(context.Context, *StatePayload) (res string, err error)
	// Authentication code response
	HmrcCallback(context.Context, *CodePayload) (err error)
}

Service is the mtd service interface.

type StatePayload

type StatePayload struct {
	// AES1 digest string to identify client
	State *string
}

StatePayload is the payload type of the mtd service register method.

Jump to

Keyboard shortcuts

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