{"modulePath":"github.com/justtrackio/gosoline","version":"v0.69.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\n## Constants\n\n```go\nconst (\n\tApiViewKey               = \"X-Api-View\"\n\tContentTypeText          = \"text/plain; charset=utf-8\"\n\tContentTypeHtml          = \"text/html; charset=utf-8\"\n\tContentTypeJson          = \"application/json; charset=utf-8\"\n\tContentTypeProtobuf      = \"application/x-protobuf\"\n\tHttpStatusClientWentAway = 499\n)\n```\n\n```go\nconst (\n\tMetricHttpActiveRequestCount = \"active_request.count\"\n\tMetricHttpConnectionCount    = \"connection.count\"\n)\n```\n\n```go\nconst (\n\t// MetricHttpRequestDuration records an HTTP server request's latency with response status.\n\t// Statusless counters report request totals; response counters report status by route and server.\n\tMetricHttpRequestDuration  = \"request.duration\"\n\tMetricHttpRejectedRequests = \"rejected.requests\"\n)\n```\n\n```go\nconst (\n\tBaseProfiling = \"/debug/profiling\"\n\tCmdLine       = \"/cmdline\"\n\tProfile       = \"/profile\"\n\tSymbol        = \"/symbol\"\n\tTrace         = \"/trace\"\n\tAllocs        = \"/allocs\"\n\tBlock         = \"/block\"\n\tGoRoutine     = \"/goroutine\"\n\tHeap          = \"/heap\"\n\tMutex         = \"/mutex\"\n\tThreadCreate  = \"/threadcreate\"\n)\n```\n\n## Variables\n\n```go\nvar ErrAccessForbidden = errors.New(\"cant access resource\")\n```\n\n## Functions\n\n```go\nfunc AddCustomTypeFuncs(customTypeFuncs []CustomTypeFunc) error\n```\n\n```go\nfunc AddCustomValidators(customValidators []CustomValidator) error\n```\n\n```go\nfunc AddProfilingEndpoints(r *gin.Engine)\n```\n\n```go\nfunc AddStructValidators(structValidators []StructValidator) error\n```\n\n```go\nfunc AddValidateAlias(aliases []ValidateAlias) error\n```\n\n```go\nfunc ConcurrentRequestLimitMiddleware(settings ConcurrencySettings) gin.HandlerFunc\n```\nConcurrentRequestLimitMiddleware limits the number of concurrently handled requests. When the limit is reached, it rejects new requests immediately instead of queueing them.\n\n```go\nfunc Cors(config cfg.Config) (gin.HandlerFunc, error)\n```\n\n```go\nfunc CreateDownloadHandler(handler HandlerWithStream) gin.HandlerFunc\n```\nCreateDownloadHandler creates a gin.HandlerFunc that handles the stream request and uses the query parameters as input binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `query:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateHandler(handler HandlerWithoutInput) gin.HandlerFunc\n```\nCreateHandler creates a gin.HandlerFunc that handles the request without data binding and without passing the body to the handler\n\n```go\nfunc CreateJsonHandler(handler HandlerWithInput) gin.HandlerFunc\n```\nCreateJsonHandler creates a gin.HandlerFunc that handles the request with json binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `json:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateMultiPartFormHandler(handler HandlerWithInput) gin.HandlerFunc\n```\nCreateMultiPartFormHandler creates a gin.HandlerFunc that handles the request with Form multipart data binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  File *multipart.FileHeader `form:\"file\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateMultipleBindingsHandler(handler HandlerWithMultipleBindings) gin.HandlerFunc\n```\nCreateMultipleBindingsHandler creates a gin.HandlerFunc that handles the request with the bindings the input struct specifies Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `json:\"a\" binding:\"required\"`\n\t  B string `form:\"b\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateProtobufHandler(handler HandlerWithInput) gin.HandlerFunc\n```\nCreateProtobufHandler creates a gin.HandlerFunc that handles the request with protobuf binding Example input struct from handler.GetInput():\n\n\ttype example struct{ // \u003c- this struct must implement ProtobufDecodable\n\t  A string `json:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateQueryHandler(handler HandlerWithInput) gin.HandlerFunc\n```\nCreateQueryHandler creates a gin.HandlerFunc that handles the request and uses the query parameters as input binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `form:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateRawHandler(handler HandlerWithoutInput) gin.HandlerFunc\n```\nCreateRawHandler creates a gin.HandlerFunc that handles the request without input binding and passes the body to the handler as a string\n\n```go\nfunc CreateReaderHandler(handler HandlerWithoutInput) gin.HandlerFunc\n```\nCreateReaderHandler creates a gin.HandlerFunc that handles the request without input binding and passes the body to the handler as io.ReadCloser\n\n```go\nfunc CreateSseHandler(handler HandlerWithStream) gin.HandlerFunc\n```\nCreateSseHandler creates a gin.HandlerFunc that handles the stream request and uses the query parameters as input binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `query:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateStaticHandler(files embed.FS, dir string, excludes ...string) (func(c *gin.Context), error)\n```\n\n```go\nfunc CreateStreamHandler(handler HandlerWithStream) gin.HandlerFunc\n```\nCreateStreamHandler creates a gin.HandlerFunc that handles the stream request and uses the json body as input binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `json:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc CreateUriHandler(handler HandlerWithInput) gin.HandlerFunc\n```\nCreateUriHandler creates a gin.HandlerFunc that handles the request and uses the uri parameters as input binding Example input struct from handler.GetInput():\n\n\ttype example struct{\n\t  A string `uri:\"a\" binding:\"required\"`\n\t}\n\n```go\nfunc GetStringFromRequest(request *Request, name string) (*string, bool)\n```\n\n```go\nfunc GetUintFromRequest(request *Request, name string) (*uint, bool)\n```\n\n```go\nfunc HttpTest[Body HttpBody](method, path, requestPath string, body Body, handler gin.HandlerFunc, requestOptions ...func(r *http.Request)) *httptest.ResponseRecorder\n```\n\n```go\nfunc HttpserverSettingsKey(name string) string\n```\n\n```go\nfunc LoggingMiddleware(logger log.Logger, settings LoggingSettings) gin.HandlerFunc\n```\n\n```go\nfunc MaxBodySizeMiddleware(maxBytes int64) gin.HandlerFunc\n```\nMaxBodySizeMiddleware limits the size of incoming request bodies. When maxBytes is greater than zero, any request body larger than maxBytes is rejected with 413 Request Entity Too Large before handler code reads it.\n\n```go\nfunc New(name string, definer Definer) kernel.ModuleFactory\n```\n\n```go\nfunc NewConnectionLifeCycleInterceptor(connectionLifeCycleAdvisor ConnectionLifeCycleAdvisor) gin.HandlerFunc\n```\nNewConnectionLifeCycleInterceptor creates a gin.HandlerFunc that uses the ConnectionLifeCycleAdvisor to determine whether the connection to the remote address should be closed.\n\n```go\nfunc NewConnectionLimitListener(\n\tctx context.Context,\n\tlogger log.Logger,\n\tlistener net.Listener,\n\tsettings ConcurrencySettings,\n\tmanager ConnectionPressureManager,\n) net.Listener\n```\n\n```go\nfunc NewCountingBodyReader(reader io.ReadCloser) (countingReader io.ReadCloser, readBytes *int)\n```\n\n```go\nfunc NewCountingBodyWriter(writer gin.ResponseWriter) (countingWriter gin.ResponseWriter, writtenBytes *int)\n```\n\n```go\nfunc NewGZipBodyReader(body io.ReadCloser) (io.ReadCloser, *int, error)\n```\n\n```go\nfunc NewHealthCheck() kernel.ModuleFactory\n```\n\n```go\nfunc NewLoggingMiddlewareWithInterfaces(logger log.Logger, settings LoggingSettings, clock clock.Clock) gin.HandlerFunc\n```\n\n```go\nfunc NewMetricMiddleware(name string, metricRecorder ServerMetricRecorder) (middleware gin.HandlerFunc, setupHandler func(definitions []Definition))\n```\n\n```go\nfunc NewWithSettings(ctx context.Context, name string, definer Definer, settings *Settings) kernel.ModuleFactory\n```\n\n```go\nfunc ProfilingModuleFactory(_ context.Context, config cfg.Config, _ log.Logger) (map[string]kernel.ModuleFactory, error)\n```\n\n```go\nfunc ProvideConnectionLifeCycleInterceptor(ctx context.Context, config cfg.Config, logger log.Logger, serverName string) (gin.HandlerFunc, error)\n```\nProvideConnectionLifeCycleInterceptor provides a ConnectionLifeCycleAdvisorInterceptor that controls closing of connections based on the ConnectionLifeCycleAdvisor.\n\n```go\nfunc RecoveryWithSentry(logger log.Logger) gin.HandlerFunc\n```\n\n```go\nfunc SamplingMiddleware(ctx context.Context, config cfg.Config, logger log.Logger) (gin.HandlerFunc, error)\n```\n\n```go\nfunc WithCustomModifier(modifier Modifier)\n```\n\n```go\nfunc WithErrorHandler(handler ErrorHandler)\n```\n\n## Types\n\n```go\ntype CompressionExcludeSettings struct {\n\tExtension []string `cfg:\"extension\"`\n\tPath      []string `cfg:\"path\"`\n\tPathRegex []string `cfg:\"path_regex\"`\n}\n```\nCompressionExcludeSettings allow enabling of gzip support.\n\n```go\ntype CompressionSettings struct {\n\tLevel         string `cfg:\"level\"         default:\"default\" validate:\"oneof=none default best fast 0 1 2 3 4 5 6 7 8 9\"`\n\tDecompression bool   `cfg:\"decompression\" default:\"true\"`\n\t// Exclude files by path, extension, or regular expression from being considered for compression.\n\t// Useful if you are serving a format unknown to Gosoline.\n\tExclude CompressionExcludeSettings `cfg:\"exclude\"`\n}\n```\nCompressionSettings control gzip support for requests and responses. By default, compressed requests are accepted and compressed responses are returned (if accepted by the client).\n\n```go\ntype ConcurrencySettings struct {\n\t// MaxRequests is the maximum number of concurrently handled requests.\n\t// A value of 0 disables request limiting.\n\tMaxRequests int `cfg:\"max_requests\" default:\"0\" validate:\"min=0\"`\n\t// MaxConnections is the target maximum number of concurrently open connections.\n\t// A value of 0 disables connection pressure management.\n\tMaxConnections int `cfg:\"max_connections\" default:\"0\" validate:\"min=0\"`\n\t// OverloadStatusCode is returned when MaxRequests is reached.\n\tOverloadStatusCode int `cfg:\"overload_status_code\" default:\"503\" validate:\"min=100,max=599\"`\n\t// RetryAfter is written as Retry-After header when MaxRequests is reached.\n\t// A value of 0 omits the header.\n\tRetryAfter time.Duration `cfg:\"retry_after\" default:\"0\" validate:\"min=0\"`\n}\n```\nConcurrencySettings configures pressure limits for a HTTP server.\n\n```go\ntype ConnectionLifeCycleAdvisor interface {\n\t// ShouldCloseConnection checks whether the connection to the remote address should be closed.\n\tShouldCloseConnection(remoteAddr string, headers http.Header) bool\n}\n```\n\n```go\nfunc NewConnectionLifeCycleAdvisor(config cfg.Config, serverName string) (ConnectionLifeCycleAdvisor, error)\n```\n\n```go\nfunc NewConnectionLifeCycleAdvisorWithInterfaces(\n\tprovidedClock clock.Clock,\n\tsettings ConnectionLifeCycleAdvisorSettings,\n) ConnectionLifeCycleAdvisor\n```\n\n```go\nfunc ProvideConnectionLifeCycleAdvisor(ctx context.Context, config cfg.Config, _ log.Logger, serverName string) (ConnectionLifeCycleAdvisor, error)\n```\nProvideConnectionLifeCycleAdvisor returns a ConnectionLifeCycleAdvisor. This is a component that tracks the lifecycle of client connections based on configurable policies. On that basis it provides recommendations on whether a connection should be closed or not. This is useful to prevent clients from keeping connections open, eg in k8s where load balancing only happens on new connections.\n\n```go\ntype ConnectionLifeCycleAdvisorSettings struct {\n\tEnabled                   bool          `cfg:\"enabled\"           default:\"true\"`\n\tMaxConnectionAge          time.Duration `cfg:\"max_age\"           default:\"1m\"`\n\tMaxConnectionRequestCount int           `cfg:\"max_request_count\" default:\"0\"`\n}\n```\nConnectionLifeCycleAdvisorSettings configures the traffic distributor middleware controlling maximum life of client connections.\n\n```go\ntype ConnectionPressureManager interface {\n\tCloseOldestIdleConnection() (bool, error)\n\tIdleConnectionAvailable() \u003c-chan struct{}\n\tConnState(net.Conn, http.ConnState)\n}\n```\n\n```go\nfunc NewConnectionPressureManager(ctx context.Context, metrics ServerMetricRecorder) ConnectionPressureManager\n```\n\n```go\nfunc NewConnectionPressureManagerWithInterfaces(\n\tctx context.Context,\n\tclock clock.Clock,\n\tmetricsRecorder ServerMetricRecorder,\n) ConnectionPressureManager\n```\n\n```go\ntype CustomTypeFunc struct {\n\tFunc  validator.CustomTypeFunc\n\tTypes []any\n}\n```\nA CustomTypeFunc allows you to convert one type to another type before validation. This allows you to validate custom types with the built-in functions for, e.g., integers or strings.\n\n```go\ntype CustomValidator struct {\n\tName      string\n\tValidator validator.Func\n}\n```\nA CustomValidator allows you to validate single fields with custom rules. If you need to validate a whole struct, you need to use a StructValidator. See [https://github.com/go-playground/validator/issues/470](https://github.com/go-playground/validator/issues/470) for more details.\n\n```go\ntype Definer func(ctx context.Context, config cfg.Config, logger log.Logger) (*Definitions, error)\n```\n\n```go\ntype Definition struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype Definitions struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (d *Definitions) DELETE(relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) GET(relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) Group(relativePath string) *Definitions\n```\n\n```go\nfunc (d *Definitions) Handle(httpMethod, relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) OPTIONS(relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) PATCH(relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) POST(relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) PUT(relativePath string, handlers ...gin.HandlerFunc)\n```\n\n```go\nfunc (d *Definitions) Use(middleware ...gin.HandlerFunc)\n```\n\n```go\ntype ErrorHandler func(statusCode int, err error) *Response\n```\n\n```go\nfunc GetErrorHandler() ErrorHandler\n```\n\n```go\ntype HandlerMetadata struct {\n\t// Method is the route method of this Handler.\n\tMethod string `json:\"method\"`\n\t// Path is the route path ot this handler.\n\tPath string `json:\"path\"`\n}\n```\nHandlerMetadata stores the Path and Method of this Handler.\n\n```go\ntype HandlerWithInput interface {\n\tHandlerWithoutInput\n\tGetInput() any\n}\n```\n\n```go\ntype HandlerWithMultipleBindings interface {\n\tHandlerWithInput\n\tGetBindings() []binding.Binding\n}\n```\n\n```go\ntype HandlerWithStream interface {\n\tGetInput() any\n\tHandle(ginContext *gin.Context, requestContext context.Context, request *Request) (err error)\n}\n```\n\n```go\ntype HandlerWithoutInput interface {\n\tHandle(requestContext context.Context, request *Request) (response *Response, err error)\n}\n```\n\n```go\ntype HealthCheckSettings struct {\n\tPort    int             `cfg:\"port\"    default:\"8090\"`\n\tPath    string          `cfg:\"path\"    default:\"/health\"`\n\tTimeout TimeoutSettings `cfg:\"timeout\"`\n}\n```\n\n```go\ntype HttpBody interface {\n\tstring | []byte\n}\n```\n\n```go\ntype HttpServer struct {\n\tkernel.EssentialModule\n\tkernel.ApplicationStage\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWithInterfaces(\n\tctx context.Context,\n\tlogger log.Logger,\n\trouter *gin.Engine,\n\ttracer tracing.Instrumentor,\n\tsettings *Settings,\n\tmetricRecorder ServerMetricRecorder,\n) (*HttpServer, error)\n```\n\n```go\nfunc (s *HttpServer) GetPort() (*int, error)\n```\n\n```go\nfunc (s *HttpServer) IsHealthy(_ context.Context) (bool, error)\n```\n\n```go\nfunc (s *HttpServer) Run(ctx context.Context) error\n```\n\n```go\ntype HttpServerHealthCheck struct {\n\tkernel.BackgroundModule\n\tkernel.EssentialStage\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewHealthCheckWithInterfaces(logger log.Logger, router *gin.Engine, healthChecker kernel.HealthChecker, settings *HealthCheckSettings) *HttpServerHealthCheck\n```\n\n```go\nfunc (a *HttpServerHealthCheck) Run(ctx context.Context) error\n```\n\n```go\ntype LoggingSettings struct {\n\tRequestBody       bool     `cfg:\"request_body\"`\n\tRequestBodyBase64 bool     `cfg:\"request_body_base64\"`\n\tRequestHeaders    []string `cfg:\"request_headers\"`\n}\n```\n\n```go\ntype Modifier interface {\n\tStruct(ctx context.Context, v any) error\n}\n```\n\n```go\ntype NetConn interface {\n\tnet.Conn\n}\n```\n\n```go\ntype NetListener interface {\n\tnet.Listener\n}\n```\n\n```go\ntype Profiling struct {\n\tkernel.BackgroundModule\n\tkernel.ApplicationStage\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewProfilingWithInterfaces(logger log.Logger, router *gin.Engine, settings *ProfilingSettings) *Profiling\n```\n\n```go\nfunc (p *Profiling) Run(ctx context.Context) error\n```\n\n```go\ntype ProfilingApiSettings struct {\n\tPort int `cfg:\"port\" default:\"8091\"`\n}\n```\n\n```go\ntype ProfilingSettings struct {\n\tEnabled bool                 `cfg:\"enabled\" default:\"false\"`\n\tApi     ProfilingApiSettings `cfg:\"api\"`\n}\n```\n\n```go\ntype ProtobufDecodable interface {\n\t// EmptyMessage should provide an empty instance of the message format to decode from.\n\tEmptyMessage() proto.Message\n\t// FromMessage should extract the data from the message and write it to the receiver.\n\tFromMessage(message proto.Message) error\n}\n```\nProtobufDecodable allows CreateProtobufHandler to decode the request body via protobuf.\n\n```go\ntype ProtobufEncodable interface {\n\t// ToMessage turns the response value into a protobuf message representation\n\tToMessage() (proto.Message, error)\n}\n```\nProtobufEncodable is required for NewProtobufResponse to create the protobuf response.\n\n```go\ntype Request struct {\n\tBody     any\n\tClientIp string\n\tCookies  map[string]string\n\tHeader   http.Header\n\tMethod   string\n\tParams   gin.Params\n\tUrl      *url.URL\n}\n```\n\n```go\ntype Response struct {\n\tBody        any\n\tContentType *string // might be nil\n\tHeader      http.Header\n\tStatusCode  int\n}\n```\nDon't create a response directly, use New\\*Response instead\n\n```go\nfunc NewHtmlResponse(body any, options ...ResponseOption) *Response\n```\n\n```go\nfunc NewJsonResponse(body any, options ...ResponseOption) *Response\n```\n\n```go\nfunc NewProtobufResponse(body ProtobufEncodable, options ...ResponseOption) (*Response, error)\n```\n\n```go\nfunc NewRedirectResponse(url string, options ...ResponseOption) *Response\n```\n\n```go\nfunc NewResponse(body any, contentType string, statusCode int, header http.Header, options ...ResponseOption) *Response\n```\n\n```go\nfunc NewStatusResponse(statusCode int, options ...ResponseOption) *Response\n```\n\n```go\nfunc (r *Response) AddHeader(key, value string)\n```\n\n```go\nfunc (r *Response) WithBody(body any) *Response\n```\n\n```go\nfunc (r *Response) WithContentType(contentType string) *Response\n```\n\n```go\ntype ResponseBodyWriterError struct {\n\tErr error\n}\n```\n\n```go\nfunc (e ResponseBodyWriterError) Error() string\n```\n\n```go\nfunc (e ResponseBodyWriterError) Is(err error) bool\n```\n\n```go\nfunc (e ResponseBodyWriterError) Unwrap() error\n```\n\n```go\ntype ResponseOption func(resp *Response)\n```\n\n```go\nfunc WithStatusCode(statusCode int) ResponseOption\n```\n\n```go\ntype RouterSettings struct {\n\tUseRawPath bool `cfg:\"use_raw_path\" default:\"false\"`\n}\n```\n\n```go\ntype ServerMetadata struct {\n\tName     string            `json:\"name\"`\n\tHandlers []HandlerMetadata `json:\"handlers\"`\n}\n```\n\n```go\ntype ServerMetricRecorder interface {\n\tTrackRequestStarted(ctx context.Context)\n\tTrackRequestCompleted(ctx context.Context)\n\tTrackConnectionOpened(ctx context.Context)\n\tTrackConnectionClosed(ctx context.Context)\n\tRun(ctx context.Context) error\n}\n```\n\n```go\ntype Settings struct {\n\t// Port the API listens to.\n\tPort string `cfg:\"port\"        default:\"8080\"`\n\t// Mode is either debug, release, test.\n\tMode string `cfg:\"mode\"        default:\"release\" validate:\"oneof=release debug test\"`\n\t// Compression settings.\n\tCompression CompressionSettings `cfg:\"compression\"`\n\t// Gin Router settings.\n\tRouter RouterSettings `cfg:\"router\"`\n\t// Timeout settings.\n\tTimeout TimeoutSettings `cfg:\"timeout\"`\n\t// Logging settings\n\tLogging LoggingSettings `cfg:\"logging\"`\n\t// MaxBodyBytes is the maximum size of an incoming request body in bytes.\n\t// A value of 0 disables the limit. Default: 10 MiB.\n\tMaxBodyBytes int64 `cfg:\"max_body_bytes\" default:\"10485760\"`\n\t// Concurrency settings control request and connection pressure limits.\n\tConcurrency ConcurrencySettings `cfg:\"concurrency\"`\n}\n```\nSettings structure for an API server.\n\n```go\ntype StructValidator struct {\n\tStruct    any\n\tValidator validator.StructLevelFunc\n}\n```\nA StructValidator validates every instance of a struct type with the given validation. It is a little bit unfortunate because you now can't have different validation rules for a struct at different places.\n\n```go\ntype TimeoutSettings struct {\n\t// You need to give at least 1s as timeout.\n\t// Read timeout is the maximum duration for reading the entire request, including the body.\n\tRead time.Duration `cfg:\"read\"     default:\"60s\" validate:\"min=1000000000\"`\n\t// Write timeout is the maximum duration before timing out writes of the response.\n\tWrite time.Duration `cfg:\"write\"    default:\"60s\" validate:\"min=1000000000\"`\n\t// Idle timeout is the maximum amount of time to wait for the next request when keep-alives are enabled\n\tIdle time.Duration `cfg:\"idle\"     default:\"60s\" validate:\"min=1000000000\"`\n\t// Drain timeout is the maximum amount of time to wait after receiving the kernel stop signal and actually shutting down the server\n\tDrain time.Duration `cfg:\"drain\"    default:\"0\"   validate:\"min=0\"`\n\t// Shutdown timeout is the maximum amount of time to wait for serving active requests before stopping the server\n\tShutdown time.Duration `cfg:\"shutdown\" default:\"60s\" validate:\"min=1000000000\"`\n}\n```\nTimeoutSettings configures IO timeouts.\n\n```go\ntype ValidateAlias struct {\n\tAlias string\n\tTags  string\n}\n```\nA ValidateAlias allows you to map one or more tags to a different name, making your validation rules easier to read.\n\n","path":"github.com/justtrackio/gosoline/pkg/httpserver","name":"httpserver","synopsis":"","isRedistributable":true}
