server

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlsoDoublySecureSecuredServicePath

func AlsoDoublySecureSecuredServicePath() string

AlsoDoublySecureSecuredServicePath returns the URL path to the secured_service service also_doubly_secure HTTP endpoint.

func DecodeAlsoDoublySecureRequest

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

DecodeAlsoDoublySecureRequest returns a decoder for requests sent to the secured_service also_doubly_secure endpoint.

func DecodeDoublySecureRequest

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

DecodeDoublySecureRequest returns a decoder for requests sent to the secured_service doubly_secure endpoint.

func DecodeSecureRequest

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

DecodeSecureRequest returns a decoder for requests sent to the secured_service secure endpoint.

func DecodeSigninRequest

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

DecodeSigninRequest returns a decoder for requests sent to the secured_service signin endpoint.

func DoublySecureSecuredServicePath

func DoublySecureSecuredServicePath() string

DoublySecureSecuredServicePath returns the URL path to the secured_service service doubly_secure HTTP endpoint.

func EncodeAlsoDoublySecureError

func EncodeAlsoDoublySecureError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeAlsoDoublySecureError returns an encoder for errors returned by the also_doubly_secure secured_service endpoint.

func EncodeAlsoDoublySecureResponse

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

EncodeAlsoDoublySecureResponse returns an encoder for responses returned by the secured_service also_doubly_secure endpoint.

func EncodeDoublySecureError

func EncodeDoublySecureError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeDoublySecureError returns an encoder for errors returned by the doubly_secure secured_service endpoint.

func EncodeDoublySecureResponse

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

EncodeDoublySecureResponse returns an encoder for responses returned by the secured_service doubly_secure endpoint.

func EncodeSecureError

func EncodeSecureError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeSecureError returns an encoder for errors returned by the secure secured_service endpoint.

func EncodeSecureResponse

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

EncodeSecureResponse returns an encoder for responses returned by the secured_service secure endpoint.

func EncodeSigninError

func EncodeSigninError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeSigninError returns an encoder for errors returned by the signin secured_service endpoint.

func EncodeSigninResponse

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

EncodeSigninResponse returns an encoder for responses returned by the secured_service signin endpoint.

func Mount

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

Mount configures the mux to serve the secured_service endpoints.

func MountAlsoDoublySecureHandler

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

MountAlsoDoublySecureHandler configures the mux to serve the "secured_service" service "also_doubly_secure" endpoint.

func MountDoublySecureHandler

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

MountDoublySecureHandler configures the mux to serve the "secured_service" service "doubly_secure" endpoint.

func MountSecureHandler

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

MountSecureHandler configures the mux to serve the "secured_service" service "secure" endpoint.

func MountSigninHandler

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

MountSigninHandler configures the mux to serve the "secured_service" service "signin" endpoint.

func NewAlsoDoublySecureHandler

func NewAlsoDoublySecureHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewAlsoDoublySecureHandler creates a HTTP handler which loads the HTTP request and calls the "secured_service" service "also_doubly_secure" endpoint.

func NewAlsoDoublySecurePayload

func NewAlsoDoublySecurePayload(key *string, oauthToken *string, token *string) *securedservice.AlsoDoublySecurePayload

NewAlsoDoublySecurePayload builds a secured_service service also_doubly_secure endpoint payload.

func NewDoublySecureHandler

func NewDoublySecureHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewDoublySecureHandler creates a HTTP handler which loads the HTTP request and calls the "secured_service" service "doubly_secure" endpoint.

func NewDoublySecurePayload

func NewDoublySecurePayload(key string, token string) *securedservice.DoublySecurePayload

NewDoublySecurePayload builds a secured_service service doubly_secure endpoint payload.

func NewSecureHandler

func NewSecureHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewSecureHandler creates a HTTP handler which loads the HTTP request and calls the "secured_service" service "secure" endpoint.

func NewSecurePayload

func NewSecurePayload(fail *bool, token string) *securedservice.SecurePayload

NewSecurePayload builds a secured_service service secure endpoint payload.

func NewSigninHandler

func NewSigninHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewSigninHandler creates a HTTP handler which loads the HTTP request and calls the "secured_service" service "signin" endpoint.

func NewSigninPayload

func NewSigninPayload() *securedservice.SigninPayload

NewSigninPayload builds a secured_service service signin endpoint payload.

func SecureSecuredServicePath

func SecureSecuredServicePath() string

SecureSecuredServicePath returns the URL path to the secured_service service secure HTTP endpoint.

func SigninSecuredServicePath

func SigninSecuredServicePath() string

SigninSecuredServicePath returns the URL path to the secured_service service signin HTTP endpoint.

Types

type AlsoDoublySecureInvalidScopesResponseBody

type AlsoDoublySecureInvalidScopesResponseBody string

AlsoDoublySecureInvalidScopesResponseBody is the type of the "secured_service" service "also_doubly_secure" endpoint HTTP response body for the "invalid-scopes" error.

func NewAlsoDoublySecureInvalidScopesResponseBody

func NewAlsoDoublySecureInvalidScopesResponseBody(res securedservice.InvalidScopes) AlsoDoublySecureInvalidScopesResponseBody

NewAlsoDoublySecureInvalidScopesResponseBody builds the HTTP response body from the result of the "also_doubly_secure" endpoint of the "secured_service" service.

type AlsoDoublySecureUnauthorizedResponseBody

type AlsoDoublySecureUnauthorizedResponseBody string

AlsoDoublySecureUnauthorizedResponseBody is the type of the "secured_service" service "also_doubly_secure" endpoint HTTP response body for the "unauthorized" error.

func NewAlsoDoublySecureUnauthorizedResponseBody

func NewAlsoDoublySecureUnauthorizedResponseBody(res securedservice.Unauthorized) AlsoDoublySecureUnauthorizedResponseBody

NewAlsoDoublySecureUnauthorizedResponseBody builds the HTTP response body from the result of the "also_doubly_secure" endpoint of the "secured_service" service.

type DoublySecureInvalidScopesResponseBody

type DoublySecureInvalidScopesResponseBody string

DoublySecureInvalidScopesResponseBody is the type of the "secured_service" service "doubly_secure" endpoint HTTP response body for the "invalid-scopes" error.

func NewDoublySecureInvalidScopesResponseBody

func NewDoublySecureInvalidScopesResponseBody(res securedservice.InvalidScopes) DoublySecureInvalidScopesResponseBody

NewDoublySecureInvalidScopesResponseBody builds the HTTP response body from the result of the "doubly_secure" endpoint of the "secured_service" service.

type DoublySecureUnauthorizedResponseBody

type DoublySecureUnauthorizedResponseBody string

DoublySecureUnauthorizedResponseBody is the type of the "secured_service" service "doubly_secure" endpoint HTTP response body for the "unauthorized" error.

func NewDoublySecureUnauthorizedResponseBody

func NewDoublySecureUnauthorizedResponseBody(res securedservice.Unauthorized) DoublySecureUnauthorizedResponseBody

NewDoublySecureUnauthorizedResponseBody builds the HTTP response body from the result of the "doubly_secure" endpoint of the "secured_service" service.

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 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 SecureInvalidScopesResponseBody

type SecureInvalidScopesResponseBody string

SecureInvalidScopesResponseBody is the type of the "secured_service" service "secure" endpoint HTTP response body for the "invalid-scopes" error.

func NewSecureInvalidScopesResponseBody

func NewSecureInvalidScopesResponseBody(res securedservice.InvalidScopes) SecureInvalidScopesResponseBody

NewSecureInvalidScopesResponseBody builds the HTTP response body from the result of the "secure" endpoint of the "secured_service" service.

type SecureUnauthorizedResponseBody

type SecureUnauthorizedResponseBody string

SecureUnauthorizedResponseBody is the type of the "secured_service" service "secure" endpoint HTTP response body for the "unauthorized" error.

func NewSecureUnauthorizedResponseBody

func NewSecureUnauthorizedResponseBody(res securedservice.Unauthorized) SecureUnauthorizedResponseBody

NewSecureUnauthorizedResponseBody builds the HTTP response body from the result of the "secure" endpoint of the "secured_service" service.

type Server

type Server struct {
	Mounts           []*MountPoint
	Signin           http.Handler
	Secure           http.Handler
	DoublySecure     http.Handler
	AlsoDoublySecure http.Handler
}

Server lists the secured_service service endpoint HTTP handlers.

func New

func New(
	e *securedservice.Endpoints,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the secured_service service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.

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.

type SigninResponseBody

type SigninResponseBody struct {
	// JWT token
	JWT string `form:"jwt" json:"jwt" xml:"jwt"`
	// API Key
	APIKey string `form:"api_key" json:"api_key" xml:"api_key"`
	// OAuth2 token
	OauthToken string `form:"oauth_token" json:"oauth_token" xml:"oauth_token"`
}

SigninResponseBody is the type of the "secured_service" service "signin" endpoint HTTP response body.

func NewSigninResponseBody

func NewSigninResponseBody(res *securedservice.Creds) *SigninResponseBody

NewSigninResponseBody builds the HTTP response body from the result of the "signin" endpoint of the "secured_service" service.

type SigninUnauthorizedResponseBody

type SigninUnauthorizedResponseBody string

SigninUnauthorizedResponseBody is the type of the "secured_service" service "signin" endpoint HTTP response body for the "unauthorized" error.

func NewSigninUnauthorizedResponseBody

func NewSigninUnauthorizedResponseBody(res securedservice.Unauthorized) SigninUnauthorizedResponseBody

NewSigninUnauthorizedResponseBody builds the HTTP response body from the result of the "signin" endpoint of the "secured_service" service.

Jump to

Keyboard shortcuts

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