Documentation ¶
Index ¶
- Constants
- Variables
- func MakeInvalidRequest(err error) *goa.ServiceError
- func MakeKeyAlreadyExists(err error) *goa.ServiceError
- func MakeKeyHasNoToken(err error) *goa.ServiceError
- func MakeKeyIPMismatch(err error) *goa.ServiceError
- func MakeKeyLengthError(err error) *goa.ServiceError
- func MakeMatchingKeyNotFound(err error) *goa.ServiceError
- func NewHmrcCallbackEndpoint(s Service) goa.Endpoint
- func NewRegisterEndpoint(s Service) goa.Endpoint
- func NewRetrieveEndpoint(s Service) goa.Endpoint
- type Client
- type CodePayload
- type Endpoints
- type Service
- type StatePayload
Constants ¶
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 ¶
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 ¶
NewHmrcCallbackEndpoint returns an endpoint function that calls the method "hmrc_callback" of service "mtd".
func NewRegisterEndpoint ¶
NewRegisterEndpoint returns an endpoint function that calls the method "register" of service "mtd".
func NewRetrieveEndpoint ¶
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 (*Client) HmrcCallback ¶
func (c *Client) HmrcCallback(ctx context.Context, p *CodePayload) (err error)
HmrcCallback calls the "hmrc_callback" 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 ¶
Endpoints wraps the "mtd" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "mtd" service with 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.