process

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const UrlParameterBlockNonce = "blockNonce"

UrlParameterBlockNonce represents the name of a URL parameter

View Source
const UrlParameterHintEpoch = "hintEpoch"

UrlParameterHintEpoch represents the name of a URL parameter

Variables

This section is empty.

Functions

func NewDemuxer added in v1.0.1

func NewDemuxer(handlers map[string]http.Handler, rootHandler http.Handler) *demuxer

NewDemuxer can create a demuxer able to call different http handlers based on the request.RequestURI. the default handler should be registered with the * key

func NewHostsFinder

func NewHostsFinder(configGateways []config.GatewayConfig) (*hostsFinder, error)

NewHostsFinder will create a new hosts finder instance

func NewRequestsProcessor

func NewRequestsProcessor(hostFinder HostFinder) (*requestsProcessor, error)

NewRequestsProcessor creates a new requests processor

func RespondWithError

func RespondWithError(writer http.ResponseWriter, err error, statusCode int)

RespondWithError should be called when the request cannot be satisfied due to an internal error

Types

type GenericAPIResponse

type GenericAPIResponse struct {
	Data  interface{} `json:"data"`
	Error string      `json:"error"`
	Code  ReturnCode  `json:"code"`
}

GenericAPIResponse defines the structure of all responses on API endpoints

type HostFinder

type HostFinder interface {
	FindHost(urlValues map[string][]string) (config.GatewayConfig, error)
	IsInterfaceNil() bool
}

HostFinder is able to return a valid host based on a search criteria

type ReturnCode

type ReturnCode string

ReturnCode defines the type defines to identify return codes

const (
	// ReturnCodeRequestError defines a request which hasn't been executed successfully due to a bad request received
	ReturnCodeRequestError ReturnCode = "bad_request"
)

Jump to

Keyboard shortcuts

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