server

package
v2.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatbytesTextPath

func ConcatbytesTextPath(a string, b string) string

ConcatbytesTextPath returns the URL path to the text service concatbytes HTTP endpoint.

func ConcatbytesfieldTextPath

func ConcatbytesfieldTextPath(a string, b string) string

ConcatbytesfieldTextPath returns the URL path to the text service concatbytesfield HTTP endpoint.

func ConcatstringfieldTextPath

func ConcatstringfieldTextPath(a string, b string) string

ConcatstringfieldTextPath returns the URL path to the text service concatstringfield HTTP endpoint.

func ConcatstringsTextPath

func ConcatstringsTextPath(a string, b string) string

ConcatstringsTextPath returns the URL path to the text service concatstrings HTTP endpoint.

func DecodeConcatbytesRequest

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

DecodeConcatbytesRequest returns a decoder for requests sent to the text concatbytes endpoint.

func DecodeConcatbytesfieldRequest

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

DecodeConcatbytesfieldRequest returns a decoder for requests sent to the text concatbytesfield endpoint.

func DecodeConcatstringfieldRequest

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

DecodeConcatstringfieldRequest returns a decoder for requests sent to the text concatstringfield endpoint.

func DecodeConcatstringsRequest

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

DecodeConcatstringsRequest returns a decoder for requests sent to the text concatstrings endpoint.

func EncodeConcatbytesResponse

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

EncodeConcatbytesResponse returns an encoder for responses returned by the text concatbytes endpoint.

func EncodeConcatbytesfieldResponse

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

EncodeConcatbytesfieldResponse returns an encoder for responses returned by the text concatbytesfield endpoint.

func EncodeConcatstringfieldResponse

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

EncodeConcatstringfieldResponse returns an encoder for responses returned by the text concatstringfield endpoint.

func EncodeConcatstringsResponse

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

EncodeConcatstringsResponse returns an encoder for responses returned by the text concatstrings endpoint.

func Mount

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

Mount configures the mux to serve the text endpoints.

func MountConcatbytesHandler

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

MountConcatbytesHandler configures the mux to serve the "text" service "concatbytes" endpoint.

func MountConcatbytesfieldHandler

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

MountConcatbytesfieldHandler configures the mux to serve the "text" service "concatbytesfield" endpoint.

func MountConcatstringfieldHandler

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

MountConcatstringfieldHandler configures the mux to serve the "text" service "concatstringfield" endpoint.

func MountConcatstringsHandler

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

MountConcatstringsHandler configures the mux to serve the "text" service "concatstrings" endpoint.

func MountGenHTTPOpenapiJSON

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

MountGenHTTPOpenapiJSON configures the mux to serve GET request made to "/swagger.json".

func NewConcatbytesHandler

func NewConcatbytesHandler(
	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

NewConcatbytesHandler creates a HTTP handler which loads the HTTP request and calls the "text" service "concatbytes" endpoint.

func NewConcatbytesPayload

func NewConcatbytesPayload(a string, b string) *text.ConcatbytesPayload

NewConcatbytesPayload builds a text service concatbytes endpoint payload.

func NewConcatbytesfieldHandler

func NewConcatbytesfieldHandler(
	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

NewConcatbytesfieldHandler creates a HTTP handler which loads the HTTP request and calls the "text" service "concatbytesfield" endpoint.

func NewConcatbytesfieldPayload

func NewConcatbytesfieldPayload(a string, b string) *text.ConcatbytesfieldPayload

NewConcatbytesfieldPayload builds a text service concatbytesfield endpoint payload.

func NewConcatstringfieldHandler

func NewConcatstringfieldHandler(
	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

NewConcatstringfieldHandler creates a HTTP handler which loads the HTTP request and calls the "text" service "concatstringfield" endpoint.

func NewConcatstringfieldPayload

func NewConcatstringfieldPayload(a string, b string) *text.ConcatstringfieldPayload

NewConcatstringfieldPayload builds a text service concatstringfield endpoint payload.

func NewConcatstringsHandler

func NewConcatstringsHandler(
	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

NewConcatstringsHandler creates a HTTP handler which loads the HTTP request and calls the "text" service "concatstrings" endpoint.

func NewConcatstringsPayload

func NewConcatstringsPayload(a string, b string) *text.ConcatstringsPayload

NewConcatstringsPayload builds a text service concatstrings endpoint payload.

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

type Server struct {
	Mounts            []*MountPoint
	Concatstrings     http.Handler
	Concatbytes       http.Handler
	Concatstringfield http.Handler
	Concatbytesfield  http.Handler
}

Server lists the text service endpoint HTTP handlers.

func New

func New(
	e *text.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 text 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.

Jump to

Keyboard shortcuts

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