server

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeHmrcCallbackRequest

func DecodeHmrcCallbackRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeHmrcCallbackRequest returns a decoder for requests sent to the mtd hmrc_callback endpoint.

func DecodeRegisterRequest

func DecodeRegisterRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeRegisterRequest returns a decoder for requests sent to the mtd register endpoint.

func DecodeRetrieveRequest

func DecodeRetrieveRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeRetrieveRequest returns a decoder for requests sent to the mtd retrieve endpoint.

func EncodeHmrcCallbackError

func EncodeHmrcCallbackError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error

EncodeHmrcCallbackError returns an encoder for errors returned by the hmrc_callback mtd endpoint.

func EncodeHmrcCallbackResponse

func EncodeHmrcCallbackResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeHmrcCallbackResponse returns an encoder for responses returned by the mtd hmrc_callback endpoint.

func EncodeRegisterError

func EncodeRegisterError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error

EncodeRegisterError returns an encoder for errors returned by the register mtd endpoint.

func EncodeRegisterResponse

func EncodeRegisterResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeRegisterResponse returns an encoder for responses returned by the mtd register endpoint.

func EncodeRetrieveError

func EncodeRetrieveError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error

EncodeRetrieveError returns an encoder for errors returned by the retrieve mtd endpoint.

func EncodeRetrieveResponse

func EncodeRetrieveResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeRetrieveResponse returns an encoder for responses returned by the mtd retrieve endpoint.

func HmrcCallbackMtdPath

func HmrcCallbackMtdPath() string

HmrcCallbackMtdPath returns the URL path to the mtd service hmrc_callback HTTP endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the mtd endpoints.

func MountHmrcCallbackHandler

func MountHmrcCallbackHandler(mux goahttp.Muxer, h http.Handler)

MountHmrcCallbackHandler configures the mux to serve the "mtd" service "hmrc_callback" endpoint.

func MountRegisterHandler

func MountRegisterHandler(mux goahttp.Muxer, h http.Handler)

MountRegisterHandler configures the mux to serve the "mtd" service "register" endpoint.

func MountRetrieveHandler

func MountRetrieveHandler(mux goahttp.Muxer, h http.Handler)

MountRetrieveHandler configures the mux to serve the "mtd" service "retrieve" endpoint.

func NewHmrcCallbackCodePayload

func NewHmrcCallbackCodePayload(code *string, state *string, error *string, errorDescription *string, errorCode *string) *mtd.CodePayload

NewHmrcCallbackCodePayload builds a mtd service hmrc_callback endpoint payload.

func NewHmrcCallbackHandler

func NewHmrcCallbackHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewHmrcCallbackHandler creates a HTTP handler which loads the HTTP request and calls the "mtd" service "hmrc_callback" endpoint.

func NewRegisterHandler

func NewRegisterHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRegisterHandler creates a HTTP handler which loads the HTTP request and calls the "mtd" service "register" endpoint.

func NewRegisterStatePayload

func NewRegisterStatePayload(state string) *mtd.StatePayload

NewRegisterStatePayload builds a mtd service register endpoint payload.

func NewRetrieveHandler

func NewRetrieveHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRetrieveHandler creates a HTTP handler which loads the HTTP request and calls the "mtd" service "retrieve" endpoint.

func NewRetrieveStatePayload

func NewRetrieveStatePayload(state string) *mtd.StatePayload

NewRetrieveStatePayload builds a mtd service retrieve endpoint payload.

func RegisterMtdPath

func RegisterMtdPath(state string) string

RegisterMtdPath returns the URL path to the mtd service register HTTP endpoint.

func RetrieveMtdPath

func RetrieveMtdPath(state string) string

RetrieveMtdPath returns the URL path to the mtd service retrieve HTTP endpoint.

Types

type ErrorNamer

type ErrorNamer interface {
	ErrorName() string
}

ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.

type HmrcCallbackInvalidRequestResponseBody

type HmrcCallbackInvalidRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

HmrcCallbackInvalidRequestResponseBody is the type of the "mtd" service "hmrc_callback" endpoint HTTP response body for the "invalid_request" error.

func NewHmrcCallbackInvalidRequestResponseBody

func NewHmrcCallbackInvalidRequestResponseBody(res *goa.ServiceError) *HmrcCallbackInvalidRequestResponseBody

NewHmrcCallbackInvalidRequestResponseBody builds the HTTP response body from the result of the "hmrc_callback" endpoint of the "mtd" service.

type HmrcCallbackKeyLengthErrorResponseBody

type HmrcCallbackKeyLengthErrorResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

HmrcCallbackKeyLengthErrorResponseBody is the type of the "mtd" service "hmrc_callback" endpoint HTTP response body for the "key_length_error" error.

func NewHmrcCallbackKeyLengthErrorResponseBody

func NewHmrcCallbackKeyLengthErrorResponseBody(res *goa.ServiceError) *HmrcCallbackKeyLengthErrorResponseBody

NewHmrcCallbackKeyLengthErrorResponseBody builds the HTTP response body from the result of the "hmrc_callback" endpoint of the "mtd" service.

type HmrcCallbackMatchingKeyNotFoundResponseBody

type HmrcCallbackMatchingKeyNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

HmrcCallbackMatchingKeyNotFoundResponseBody is the type of the "mtd" service "hmrc_callback" endpoint HTTP response body for the "matching_key_not_found" error.

func NewHmrcCallbackMatchingKeyNotFoundResponseBody

func NewHmrcCallbackMatchingKeyNotFoundResponseBody(res *goa.ServiceError) *HmrcCallbackMatchingKeyNotFoundResponseBody

NewHmrcCallbackMatchingKeyNotFoundResponseBody builds the HTTP response body from the result of the "hmrc_callback" endpoint of the "mtd" service.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type RegisterKeyAlreadyExistsResponseBody

type RegisterKeyAlreadyExistsResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RegisterKeyAlreadyExistsResponseBody is the type of the "mtd" service "register" endpoint HTTP response body for the "key_already_exists" error.

func NewRegisterKeyAlreadyExistsResponseBody

func NewRegisterKeyAlreadyExistsResponseBody(res *goa.ServiceError) *RegisterKeyAlreadyExistsResponseBody

NewRegisterKeyAlreadyExistsResponseBody builds the HTTP response body from the result of the "register" endpoint of the "mtd" service.

type RegisterKeyIPMismatchResponseBody

type RegisterKeyIPMismatchResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RegisterKeyIPMismatchResponseBody is the type of the "mtd" service "register" endpoint HTTP response body for the "key_ip_mismatch" error.

func NewRegisterKeyIPMismatchResponseBody

func NewRegisterKeyIPMismatchResponseBody(res *goa.ServiceError) *RegisterKeyIPMismatchResponseBody

NewRegisterKeyIPMismatchResponseBody builds the HTTP response body from the result of the "register" endpoint of the "mtd" service.

type RegisterKeyLengthErrorResponseBody

type RegisterKeyLengthErrorResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RegisterKeyLengthErrorResponseBody is the type of the "mtd" service "register" endpoint HTTP response body for the "key_length_error" error.

func NewRegisterKeyLengthErrorResponseBody

func NewRegisterKeyLengthErrorResponseBody(res *goa.ServiceError) *RegisterKeyLengthErrorResponseBody

NewRegisterKeyLengthErrorResponseBody builds the HTTP response body from the result of the "register" endpoint of the "mtd" service.

type RetrieveInvalidRequestResponseBody

type RetrieveInvalidRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RetrieveInvalidRequestResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "invalid_request" error.

func NewRetrieveInvalidRequestResponseBody

func NewRetrieveInvalidRequestResponseBody(res *goa.ServiceError) *RetrieveInvalidRequestResponseBody

NewRetrieveInvalidRequestResponseBody builds the HTTP response body from the result of the "retrieve" endpoint of the "mtd" service.

type RetrieveKeyHasNoTokenResponseBody

type RetrieveKeyHasNoTokenResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RetrieveKeyHasNoTokenResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "key_has_no_token" error.

func NewRetrieveKeyHasNoTokenResponseBody

func NewRetrieveKeyHasNoTokenResponseBody(res *goa.ServiceError) *RetrieveKeyHasNoTokenResponseBody

NewRetrieveKeyHasNoTokenResponseBody builds the HTTP response body from the result of the "retrieve" endpoint of the "mtd" service.

type RetrieveKeyIPMismatchResponseBody

type RetrieveKeyIPMismatchResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RetrieveKeyIPMismatchResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "key_ip_mismatch" error.

func NewRetrieveKeyIPMismatchResponseBody

func NewRetrieveKeyIPMismatchResponseBody(res *goa.ServiceError) *RetrieveKeyIPMismatchResponseBody

NewRetrieveKeyIPMismatchResponseBody builds the HTTP response body from the result of the "retrieve" endpoint of the "mtd" service.

type RetrieveMatchingKeyNotFoundResponseBody

type RetrieveMatchingKeyNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

RetrieveMatchingKeyNotFoundResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "matching_key_not_found" error.

func NewRetrieveMatchingKeyNotFoundResponseBody

func NewRetrieveMatchingKeyNotFoundResponseBody(res *goa.ServiceError) *RetrieveMatchingKeyNotFoundResponseBody

NewRetrieveMatchingKeyNotFoundResponseBody builds the HTTP response body from the result of the "retrieve" endpoint of the "mtd" service.

type Server

type Server struct {
	Mounts       []*MountPoint
	Register     http.Handler
	Retrieve     http.Handler
	HmrcCallback http.Handler
}

Server lists the mtd service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the mtd service endpoints.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

Jump to

Keyboard shortcuts

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