server

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeProbeRequest

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

DecodeProbeRequest returns a decoder for requests sent to the Injective Price Oracle API probe endpoint.

func EncodeProbeError

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

EncodeProbeError returns an encoder for errors returned by the probe Injective Price Oracle API endpoint.

func EncodeProbeResponse

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

EncodeProbeResponse returns an encoder for responses returned by the Injective Price Oracle API probe endpoint.

func HandleInjectivePriceOracleAPIOrigin

func HandleInjectivePriceOracleAPIOrigin(h http.Handler) http.Handler

HandleInjectivePriceOracleAPIOrigin applies the CORS response headers corresponding to the origin for the service Injective Price Oracle API.

func Mount

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

Mount configures the mux to serve the Injective Price Oracle API endpoints.

func MountCORSHandler

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

MountCORSHandler configures the mux to serve the CORS endpoints for the service Injective Price Oracle API.

func MountProbeHandler

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

MountProbeHandler configures the mux to serve the "Injective Price Oracle API" service "probe" endpoint.

func NewCORSHandler

func NewCORSHandler() http.Handler

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

func NewInjectivePriceOracleAPIProbeDecoder

func NewInjectivePriceOracleAPIProbeDecoder(mux goahttp.Muxer, injectivePriceOracleAPIProbeDecoderFn InjectivePriceOracleAPIProbeDecoderFunc) func(r *http.Request) goahttp.Decoder

NewInjectivePriceOracleAPIProbeDecoder returns a decoder to decode the multipart request for the "Injective Price Oracle API" service "probe" endpoint.

func NewProbeHandler

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

NewProbeHandler creates a HTTP handler which loads the HTTP request and calls the "Injective Price Oracle API" service "probe" endpoint.

func NewProbePayload

func NewProbePayload(body *ProbeRequestBody, key *string) *injectivepriceoracleapi.ProbePayload

NewProbePayload builds a Injective Price Oracle API service probe endpoint payload.

func ProbeInjectivePriceOracleAPIPath

func ProbeInjectivePriceOracleAPIPath() string

ProbeInjectivePriceOracleAPIPath returns the URL path to the Injective Price Oracle API service probe HTTP endpoint.

func ValidateProbeRequestBody

func ValidateProbeRequestBody(body *ProbeRequestBody) (err error)

ValidateProbeRequestBody runs the validations defined on ProbeRequestBody

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 InjectivePriceOracleAPIProbeDecoderFunc

type InjectivePriceOracleAPIProbeDecoderFunc func(*multipart.Reader, **injectivepriceoracleapi.ProbePayload) error

InjectivePriceOracleAPIProbeDecoderFunc is the type to decode multipart request for the "Injective Price Oracle API" service "probe" endpoint.

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 ProbeInternalResponseBody

type ProbeInternalResponseBody 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"`
}

ProbeInternalResponseBody is the type of the "Injective Price Oracle API" service "probe" endpoint HTTP response body for the "internal" error.

func NewProbeInternalResponseBody

func NewProbeInternalResponseBody(res *goa.ServiceError) *ProbeInternalResponseBody

NewProbeInternalResponseBody builds the HTTP response body from the result of the "probe" endpoint of the "Injective Price Oracle API" service.

type ProbeInvalidArgResponseBody

type ProbeInvalidArgResponseBody 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"`
}

ProbeInvalidArgResponseBody is the type of the "Injective Price Oracle API" service "probe" endpoint HTTP response body for the "invalid_arg" error.

func NewProbeInvalidArgResponseBody

func NewProbeInvalidArgResponseBody(res *goa.ServiceError) *ProbeInvalidArgResponseBody

NewProbeInvalidArgResponseBody builds the HTTP response body from the result of the "probe" endpoint of the "Injective Price Oracle API" service.

type ProbeRequestBody

type ProbeRequestBody struct {
	// TOML file contents
	Content []byte `form:"content,omitempty" json:"content,omitempty" xml:"content,omitempty"`
}

ProbeRequestBody is the type of the "Injective Price Oracle API" service "probe" endpoint HTTP request body.

type ProbeResponseBody

type ProbeResponseBody struct {
	// Result of the probe
	Result string `form:"result" json:"result" xml:"result"`
}

ProbeResponseBody is the type of the "Injective Price Oracle API" service "probe" endpoint HTTP response body.

func NewProbeResponseBody

func NewProbeResponseBody(res *injectivepriceoracleapi.ProbeResponse) *ProbeResponseBody

NewProbeResponseBody builds the HTTP response body from the result of the "probe" endpoint of the "Injective Price Oracle API" service.

type ProbeUnauthorizedResponseBody

type ProbeUnauthorizedResponseBody 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"`
}

ProbeUnauthorizedResponseBody is the type of the "Injective Price Oracle API" service "probe" endpoint HTTP response body for the "unauthorized" error.

func NewProbeUnauthorizedResponseBody

func NewProbeUnauthorizedResponseBody(res *goa.ServiceError) *ProbeUnauthorizedResponseBody

NewProbeUnauthorizedResponseBody builds the HTTP response body from the result of the "probe" endpoint of the "Injective Price Oracle API" service.

type Server

type Server struct {
	Mounts []*MountPoint
	Probe  http.Handler
	CORS   http.Handler
}

Server lists the Injective Price Oracle API service endpoint HTTP handlers.

func New

func New(
	e *injectivepriceoracleapi.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,
	injectivePriceOracleAPIProbeDecoderFn InjectivePriceOracleAPIProbeDecoderFunc,
) *Server

New instantiates HTTP handlers for all the Injective Price Oracle API 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

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

Mount configures the mux to serve the Injective Price Oracle API 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