config

package
v4.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RawBody if turned on, RR will not parse the incoming HTTP body and will send it as is
	RawBody bool `mapstructure:"raw_body"`

	// Host and port to handle as http server.
	Address string `mapstructure:"address"`

	// AccessLogs turn on/off, logged at Info log level, default: false
	AccessLogs bool `mapstructure:"access_logs"`

	// List of the middleware names (order will be preserved)
	Middleware []string `mapstructure:"middleware"`

	// Pool configures worker pool.
	Pool *pool.Config `mapstructure:"pool"`

	// InternalErrorCode used to override default 500 (InternalServerError) http code
	InternalErrorCode uint64 `mapstructure:"internal_error_code"`

	// MaxRequestSize specified max size for payload body in megabytes, set 0 to unlimited.
	MaxRequestSize uint64 `mapstructure:"max_request_size"`

	// SSLConfig defines https server options.
	SSLConfig *https.SSL `mapstructure:"ssl"`

	// FCGIConfig configuration. You can use FastCGI without HTTP server.
	FCGIConfig *fcgi.FCGI `mapstructure:"fcgi"`

	// HTTP2Config configuration
	HTTP2Config *https.HTTP2 `mapstructure:"http2"`

	// Uploads configures uploads configuration.
	Uploads *Uploads `mapstructure:"uploads"`

	// private
	UID int
	GID int
}

Config configures RoadRunner HTTP server.

func (*Config) EnableFCGI

func (c *Config) EnableFCGI() bool

EnableFCGI is true when FastCGI server must be enabled.

func (*Config) EnableHTTP

func (c *Config) EnableHTTP() bool

EnableHTTP is true when http server must run.

func (*Config) EnableTLS

func (c *Config) EnableTLS() bool

EnableTLS returns true if pool must listen TLS connections.

func (*Config) InitDefaults

func (c *Config) InitDefaults() error

InitDefaults must populate HTTP values using given HTTP source. Must return error if HTTP is not valid.

func (*Config) Valid

func (c *Config) Valid() error

Valid validates the configuration.

type Uploads

type Uploads struct {
	// Dir contains name of directory to control access to.
	Dir string `mapstructure:"dir"`

	// Forbid specifies list of file extensions which are forbidden for access.
	// Example: .php, .exe, .bat, .htaccess and etc.
	Forbid []string `mapstructure:"forbid"`

	// Allowed files
	Allow []string `mapstructure:"allow"`

	// internal
	Forbidden map[string]struct{} `mapstructure:"-"`
	Allowed   map[string]struct{} `mapstructure:"-"`
}

Uploads describes file location and controls access to them.

func (*Uploads) InitDefaults

func (cfg *Uploads) InitDefaults() error

InitDefaults sets missing values to their default values.

Jump to

Keyboard shortcuts

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