options

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DefaultProxyListenPort is the default port that the HTTP frontend will listen on
	DefaultProxyListenPort = 8480
	// DefaultProxyListenAddress is the default address that the HTTP frontend will listen on
	DefaultProxyListenAddress = ""

	// DefaultTLSProxyListenPort is the default port that the TLS frontend endpoint will listen on
	DefaultTLSProxyListenPort = 8483
	// DefaultTLSProxyListenAddress is the default address that the TLS frontend endpoint will listen on
	DefaultTLSProxyListenAddress = ""

	// DefaultReadHeaderTimeout is the default amount of time allowed to read request headers by the frontend proxy server
	DefaultReadHeaderTimeout = 10 * time.Second

	// DefaultMaxRequestBodySizeBytes is the default maximum body size permitted by clients in a POST, PUT or PATCH request
	DefaultMaxRequestBodySizeBytes int64 = 10 * 1024 * 1024 // 10 MB

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// ListenAddress is IP address for the main http listener for the application
	ListenAddress string `yaml:"listen_address,omitempty"`
	// ListenPort is TCP Port for the main http listener for the application
	ListenPort int `yaml:"listen_port,omitempty"`
	// TLSListenAddress is IP address for the tls  http listener for the application
	TLSListenAddress string `yaml:"tls_listen_address,omitempty"`
	// TLSListenPort is the TCP Port for the tls http listener for the application
	TLSListenPort int `yaml:"tls_listen_port,omitempty"`
	// ConnectionsLimit indicates how many concurrent front end connections trickster will handle at any time
	ConnectionsLimit int `yaml:"connections_limit,omitempty"`
	// MaxRequestBodySize indicates the maximum allowed size of the request body.
	// If the body is too large, Trickster will truncate the payload or return a
	// 413 Payload Too Large response depending upon truncate_request_body_too_big.
	// Use 0 for no body allowed, and < 0 for no maximum.
	MaxRequestBodySizeBytes *int64 `yaml:"max_request_body_size_bytes"`
	// TruncateRequestBodyTooLarge, when true, will truncate the request body to
	// MaxRequestBodySizeBytes when larger, without returning a 413 Payload Too Large
	TruncateRequestBodyTooLarge bool `yaml:"truncate_request_body_too_large"`
	// ReadHeaderTimeout is the amount of time allowed to read request headers.
	ReadHeaderTimeout time.Duration `yaml:"read_header_timeout,omitempty"`
	// ServeTLS indicates whether to listen and serve on the TLS port, meaning
	// at least one backend options has a valid certificate and key file configured.
	ServeTLS bool `yaml:"-"`
}

FrontendConfig is a collection of configurations for the main http frontend for the application

func New

func New() *Options

New returns a new Frontend Options with default values

func (*Options) Clone

func (o *Options) Clone() *Options

Clone returns a clone of the Options

func (*Options) Equal

func (o *Options) Equal(o2 *Options) bool

Equal returns true if the FrontendConfigs are identical in value.

func (*Options) Initialize

func (o *Options) Initialize() error

func (*Options) Validate

func (o *Options) Validate(f TLSConfigFunc) error

type TLSConfigFunc

type TLSConfigFunc func() (*tls.Config, error)

Jump to

Keyboard shortcuts

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