Documentation
¶
Overview ¶
package server provides the Agent HTTP server, which is the service, configured with the Agent Management Service.
package server provides the Agent HTTP server, which is the service, configured with the Agent Management Service.
Index ¶
Constants ¶
const ( // Server Hostname and port are not configurable since the manager needs to know them for the Envoy cluster creation ServerHostname string = "127.0.0.1" ServerPort uint32 = 8090 HeaderMockID = "X-Kusk-Mock-ID" HeaderMockResponseInsert = "X-Kusk-Mocked" )
Variables ¶
This section is empty.
Functions ¶
func NegotiateContentType ¶
NegotiateContentType negotiates the content types based on the given request data (with possible Accept Header) and offered by http server (e.g. present for mocking) media types.
func NewHTTPServer ¶
func NewMainHandler ¶
func NewMainHandler() *mainHandler
Types ¶
type AcceptRange ¶
type AcceptRange struct { Type string Subtype string Weight float64 Parameters map[string]string // contains filtered or unexported fields }
AcceptRange represents an accept range as defined in https://tools.ietf.org/html/rfc7231#section-5.3.2
Accept = #( media-range [ accept-params ] )
media-range = ( "*/*" / ( type "/" "*" ) / ( type "/" subtype ) ) *( OWS ";" OWS parameter ) accept-params = weight *( accept-ext ) accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]
func AcceptMediaTypes ¶
func AcceptMediaTypes(r *http.Request) []AcceptRange
AcceptMediaTypes builds a list of AcceptRange from the given HTTP request.
func ParseAcceptRange ¶
func ParseAcceptRange(accept string) AcceptRange
ParseAcceptRange parses a single accept string into an AcceptRange.
func ParseAcceptRanges ¶
func ParseAcceptRanges(accepts string) []AcceptRange
ParseAcceptRanges parses an Accept header into a list of AcceptRange
func (AcceptRange) RawString ¶
func (a AcceptRange) RawString() string
RawString returns the raw string in the request specifying the accept range.