config

package
v0.0.0-...-e6f4ba9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestHeaderContentLengthValidator

func RequestHeaderContentLengthValidator(req http.Request, bodyMaxSize int64) int

RequestHeaderContentLengthValidator for Content-Length header in request

Types

type AdditionalHeaders

type AdditionalHeaders map[string]string

AdditionalHeaders type fields in yaml configuration will parse list of special headers

func (*AdditionalHeaders) UnmarshalYAML

func (ah *AdditionalHeaders) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML for AdditionalHeaders

type Client

type Client struct {
	// Additional not AWS S3 specific headers proxy will add to original request
	AdditionalRequestHeaders AdditionalHeaders `yaml:"AdditionalRequestHeaders,omitempty"`
	// Additional headers inseted to client response
	AdditionalResponseHeaders AdditionalHeaders `yaml:"AdditionalResponseHeaders,omitempty"`
	// Transports configuration
	Transports transport.Transports `yaml:"Transports,omitempty"`
	// DialTimeout limits wait period for connection dial
	DialTimeout metrics.Interval `yaml:"DialTimeout"`
}

Client keeps backend client configuration

type HumanSizeUnits

type HumanSizeUnits struct {
	SizeInBytes int64
}

HumanSizeUnits type for max. payload body size in bytes

func (*HumanSizeUnits) UnmarshalYAML

func (hsu *HumanSizeUnits) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML for HumanSizeUnits

type Server

type Server struct {
	// Maximum accepted body size
	BodyMaxSize HumanSizeUnits `yaml:"BodyMaxSize,omitempty"`
	// Max number of incoming requests to process in parallel
	MaxConcurrentRequests   int32  `yaml:"MaxConcurrentRequests" validate:"min=1"`
	Listen                  string `yaml:"Listen,omitempty" validate:"regexp=^(([0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)?[:][0-9]+)$"`
	TechnicalEndpointListen string `yaml:"TechnicalEndpointListen,omitempty" validate:"regexp=^(([0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)?[:][0-9]+)$"`
	HealthCheckEndpoint     string `yaml:"HealthCheckEndpoint,omitempty" validate:"regexp=^([/a-z0-9]+)$"`
	// ReadTimeout is client request max duration
	ReadTimeout metrics.Interval `yaml:"ReadTimeout" validate:"nonzero"`
	// WriteTimeout is server request max processing time
	WriteTimeout metrics.Interval `yaml:"WriteTimeout" validate:"nonzero"`
	// ShutdownTimeout is gracefull shoutdown duration limit
	ShutdownTimeout metrics.Interval `yaml:"ShutdownTimeout" validate:"nonzero"`
}

Server struct handles basic http server parameters

type Service

type Service struct {
	Server Server `yaml:"Server,omitempty"`
	Client Client `yaml:"Client,omitempty"`
}

Service section

Jump to

Keyboard shortcuts

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