server

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeListRequest

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

DecodeListRequest returns a decoder for requests sent to the pipeline list endpoint.

func DecodeProcessingRequest added in v0.34.0

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

DecodeProcessingRequest returns a decoder for requests sent to the pipeline processing endpoint.

func DecodeShowRequest

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

DecodeShowRequest returns a decoder for requests sent to the pipeline show endpoint.

func EncodeListResponse

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

EncodeListResponse returns an encoder for responses returned by the pipeline list endpoint.

func EncodeProcessingError added in v0.34.0

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

EncodeProcessingError returns an encoder for errors returned by the processing pipeline endpoint.

func EncodeProcessingResponse added in v0.34.0

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

EncodeProcessingResponse returns an encoder for responses returned by the pipeline processing endpoint.

func EncodeShowError

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

EncodeShowError returns an encoder for errors returned by the show pipeline endpoint.

func EncodeShowResponse

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

EncodeShowResponse returns an encoder for responses returned by the pipeline show endpoint.

func HandlePipelineOrigin added in v0.31.0

func HandlePipelineOrigin(h http.Handler) http.Handler

HandlePipelineOrigin applies the CORS response headers corresponding to the origin for the service pipeline.

func ListPipelinePath

func ListPipelinePath() string

ListPipelinePath returns the URL path to the pipeline service list HTTP endpoint.

func Mount

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

Mount configures the mux to serve the pipeline endpoints.

func MountCORSHandler

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

MountCORSHandler configures the mux to serve the CORS endpoints for the service pipeline.

func MountListHandler

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

MountListHandler configures the mux to serve the "pipeline" service "list" endpoint.

func MountProcessingHandler added in v0.34.0

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

MountProcessingHandler configures the mux to serve the "pipeline" service "processing" endpoint.

func MountShowHandler

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

MountShowHandler configures the mux to serve the "pipeline" service "show" endpoint.

func NewCORSHandler

func NewCORSHandler() http.Handler

NewCORSHandler creates a HTTP handler which returns a simple 200 response.

func NewListHandler

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

NewListHandler creates a HTTP handler which loads the HTTP request and calls the "pipeline" service "list" endpoint.

func NewListPayload

func NewListPayload(name *string) *pipeline.ListPayload

NewListPayload builds a pipeline service list endpoint payload.

func NewProcessingHandler added in v0.34.0

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

NewProcessingHandler creates a HTTP handler which loads the HTTP request and calls the "pipeline" service "processing" endpoint.

func NewProcessingPayload added in v0.34.0

func NewProcessingPayload(id string) *pipeline.ProcessingPayload

NewProcessingPayload builds a pipeline service processing endpoint payload.

func NewShowHandler

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

NewShowHandler creates a HTTP handler which loads the HTTP request and calls the "pipeline" service "show" endpoint.

func NewShowPayload

func NewShowPayload(id string) *pipeline.ShowPayload

NewShowPayload builds a pipeline service show endpoint payload.

func ProcessingPipelinePath added in v0.34.0

func ProcessingPipelinePath(id string) string

ProcessingPipelinePath returns the URL path to the pipeline service processing HTTP endpoint.

func ShowPipelinePath

func ShowPipelinePath(id string) string

ShowPipelinePath returns the URL path to the pipeline service show HTTP endpoint.

Types

type EnduroStoredPipelineResponse

type EnduroStoredPipelineResponse struct {
	// Identifier of the pipeline
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Name of the pipeline
	Name string `form:"name" json:"name" xml:"name"`
	// Maximum concurrent transfers
	Capacity *int64 `form:"capacity,omitempty" json:"capacity,omitempty" xml:"capacity,omitempty"`
	// Current transfers
	Current *int64 `form:"current,omitempty" json:"current,omitempty" xml:"current,omitempty"`
}

EnduroStoredPipelineResponse is used to define fields on response body 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 ListResponseBody

type ListResponseBody []*EnduroStoredPipelineResponse

ListResponseBody is the type of the "pipeline" service "list" endpoint HTTP response body.

func NewListResponseBody

func NewListResponseBody(res []*pipeline.EnduroStoredPipeline) ListResponseBody

NewListResponseBody builds the HTTP response body from the result of the "list" endpoint of the "pipeline" 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 ProcessingNotFoundResponseBody added in v0.34.0

type ProcessingNotFoundResponseBody struct {
	// Message of error
	Message string `form:"message" json:"message" xml:"message"`
	// Identifier of missing pipeline
	ID string `form:"id" json:"id" xml:"id"`
}

ProcessingNotFoundResponseBody is the type of the "pipeline" service "processing" endpoint HTTP response body for the "not_found" error.

func NewProcessingNotFoundResponseBody added in v0.34.0

func NewProcessingNotFoundResponseBody(res *pipeline.PipelineNotFound) *ProcessingNotFoundResponseBody

NewProcessingNotFoundResponseBody builds the HTTP response body from the result of the "processing" endpoint of the "pipeline" service.

type Server

type Server struct {
	Mounts     []*MountPoint
	List       http.Handler
	Show       http.Handler
	Processing http.Handler
	CORS       http.Handler
}

Server lists the pipeline service endpoint HTTP handlers.

func New

func New(
	e *pipeline.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 pipeline 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) Mount added in v0.34.0

func (s *Server) Mount(mux goahttp.Muxer)

Mount configures the mux to serve the pipeline 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.

type ShowNotFoundResponseBody

type ShowNotFoundResponseBody struct {
	// Message of error
	Message string `form:"message" json:"message" xml:"message"`
	// Identifier of missing pipeline
	ID string `form:"id" json:"id" xml:"id"`
}

ShowNotFoundResponseBody is the type of the "pipeline" service "show" endpoint HTTP response body for the "not_found" error.

func NewShowNotFoundResponseBody

func NewShowNotFoundResponseBody(res *pipeline.PipelineNotFound) *ShowNotFoundResponseBody

NewShowNotFoundResponseBody builds the HTTP response body from the result of the "show" endpoint of the "pipeline" service.

type ShowResponseBody

type ShowResponseBody struct {
	// Identifier of the pipeline
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Name of the pipeline
	Name string `form:"name" json:"name" xml:"name"`
	// Maximum concurrent transfers
	Capacity *int64 `form:"capacity,omitempty" json:"capacity,omitempty" xml:"capacity,omitempty"`
	// Current transfers
	Current *int64 `form:"current,omitempty" json:"current,omitempty" xml:"current,omitempty"`
}

ShowResponseBody is the type of the "pipeline" service "show" endpoint HTTP response body.

func NewShowResponseBody

func NewShowResponseBody(res *pipelineviews.EnduroStoredPipelineView) *ShowResponseBody

NewShowResponseBody builds the HTTP response body from the result of the "show" endpoint of the "pipeline" service.

Jump to

Keyboard shortcuts

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