package
0.55.1
Repository: https://github.com/ovh/cds.git
Documentation: pkg.go.dev

# Functions

Accepted is a helper function used by asynchronous handlers.
CheckSessionJWT validate given session jwt token.
DefaultHeaders is a set of default header for the router.
FormBool return true if the form value is set to true|TRUE|yes|YES|1.
FormInt return a int.
FormInt64 return a int64.
FormUInt return a uint.
GetPrometheustMetricsHandler returns a Handler to exposer prometheus views.
ParseServiceConfig parse any object to craft a sdk.ServiceConfig.
UnmarshalBody read the request body and tries to json.unmarshal it.
UnmarshalRequest unmarshal the request into the specified entity.
VersionHandler returns version of current uservice.
Write is a helper function.
WriteError is a helper function to return error in a language the called understand.
WriteJSON is a helper function to marshal json, handle errors and set Content-Type for the best.
WriteMarshal is a helper function to marshal json/yaml, handle errors and set Content-Type for the best Response format could be application/json or appliation/x-yaml, depends on the Accept header default response is application/x-yaml.
WriteProcessTime writes the duration of the call in the responsewriter.

# Constants

# Structs

APIServiceConfiguration is an exposed type for CDS API.
Common is the struct representing a CDS µService.
HandlerConfig is the configuration for one handler.
HatcheryCommonConfiguration is the base configuration for all hatcheries.
RouterConfig contains a map of handler configuration.

# Interfaces

BeforeStart has to be implemented if you want to run some code after the ApplyConfiguration and before the Serve of a Service.
Service is the interface for a engine service Lifecycle: ApplyConfiguration->?BeforeStart->Init->Signin->Register->Start->Serve->Heartbeat.

# Type aliases

AsynchronousHandler defines the HTTP asynchronous handler used in CDS engine.
AsynchronousHandlerFunc defines the way to instantiate a handler.
Handler defines the HTTP handler used in CDS engine.
HandlerConfigParam is a type used in handler configuration, to set specific config on a route given a method.
HandlerFunc defines the way to instantiate a handler.
Middleware defines the HTTP Middleware used in CDS engine.
RouterConfigParam is the type of anonymous function returned by POST, GET and PUT functions.