Documentation ¶
Index ¶
- func DecodeExportRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)
- func DecodeImportRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)
- func EncodeExportResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error
- func EncodeImportResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error
- func ExportInfohubPath(exportName string) string
- func ImportInfohubPath() string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountExportHandler(mux goahttp.Muxer, h http.Handler)
- func MountImportHandler(mux goahttp.Muxer, h http.Handler)
- func NewExportHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewExportRequest(exportName string) *infohub.ExportRequest
- func NewImportHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewImportRequest(body []byte) *infohub.ImportRequest
- type ImportResponseBody
- type MountPoint
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeExportRequest ¶
func DecodeExportRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)
DecodeExportRequest returns a decoder for requests sent to the infohub Export endpoint.
func DecodeImportRequest ¶
func DecodeImportRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)
DecodeImportRequest returns a decoder for requests sent to the infohub Import endpoint.
func EncodeExportResponse ¶
func EncodeExportResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error
EncodeExportResponse returns an encoder for responses returned by the infohub Export endpoint.
func EncodeImportResponse ¶
func EncodeImportResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error
EncodeImportResponse returns an encoder for responses returned by the infohub Import endpoint.
func ExportInfohubPath ¶
ExportInfohubPath returns the URL path to the infohub service Export HTTP endpoint.
func ImportInfohubPath ¶
func ImportInfohubPath() string
ImportInfohubPath returns the URL path to the infohub service Import HTTP endpoint.
func MountExportHandler ¶
MountExportHandler configures the mux to serve the "infohub" service "Export" endpoint.
func MountImportHandler ¶
MountImportHandler configures the mux to serve the "infohub" service "Import" endpoint.
func NewExportHandler ¶
func NewExportHandler( 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(ctx context.Context, err error) goahttp.Statuser, ) http.Handler
NewExportHandler creates a HTTP handler which loads the HTTP request and calls the "infohub" service "Export" endpoint.
func NewExportRequest ¶
func NewExportRequest(exportName string) *infohub.ExportRequest
NewExportRequest builds a infohub service Export endpoint payload.
func NewImportHandler ¶
func NewImportHandler( 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(ctx context.Context, err error) goahttp.Statuser, ) http.Handler
NewImportHandler creates a HTTP handler which loads the HTTP request and calls the "infohub" service "Import" endpoint.
func NewImportRequest ¶
func NewImportRequest(body []byte) *infohub.ImportRequest
NewImportRequest builds a infohub service Import endpoint payload.
Types ¶
type ImportResponseBody ¶
type ImportResponseBody struct { // importIds is an array of unique identifiers used as Cache keys to retrieve // the imported data entries later. ImportIds []string `form:"importIds" json:"importIds" xml:"importIds"` }
ImportResponseBody is the type of the "infohub" service "Import" endpoint HTTP response body.
func NewImportResponseBody ¶
func NewImportResponseBody(res *infohub.ImportResult) *ImportResponseBody
NewImportResponseBody builds the HTTP response body from the result of the "Import" endpoint of the "infohub" 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 Server ¶
type Server struct { Mounts []*MountPoint Export http.Handler Import http.Handler }
Server lists the infohub service endpoint HTTP handlers.
func New ¶
func New( e *infohub.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(ctx context.Context, err error) goahttp.Statuser, ) *Server
New instantiates HTTP handlers for all the infohub 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) MethodNames ¶
MethodNames returns the methods served.