settings

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrFileIsNotSet                     = "file is not set"
	ErrServerHostIsNotSet               = "server host is not set"
	ErrServerPortIsNotSet               = "server port is not set"
	ErrServerModeIsNotSet               = "server mode is not set"
	ErrServerMode                       = "server mode error"
	ErrCertFileIsNotSet                 = "certificate file is not set"
	ErrKeyFileIsNotSet                  = "key file is not set"
	ErrHttpCacheControlMaxAge           = "HTTP cache control max-age error"
	ErrProxyTargetServerAddressIsNotSet = "proxy target server address is not set"
	ErrIPARCDbFileIsNotSet              = "IPARC database file is not set"
)
View Source
const (
	ServerModeHttp    = "HTTP"
	ServerModeIdHttp  = 1
	ServerModeHttps   = "HTTPS"
	ServerModeIdHttps = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	// Path to the File with these Settings.
	File string

	// Server's Host Name.
	ServerHost string

	// Server's Listen Port.
	ServerPort uint16

	// ServerMode is an HTTP mode selector.
	// Possible values are: HTTP and HTTPS.
	ServerModeStr string
	ServerModeId  byte

	// Server's Certificate and Key.
	CertFile string
	KeyFile  string

	// HttpCacheControlMaxAge is time in seconds for which this server's
	// response is fresh (valid). After this period clients will be refreshing
	// the stale content by re-requesting it from the server.
	HttpCacheControlMaxAge uint

	// Allowed Origin for cross-origin requests (CORS).
	AllowedOriginForCORS string

	// Where to redirect the requests.
	ProxyTargetServerAddress string

	// Path to IPARC database ZIP file.
	IPARCDbFile string
}

Settings is Server's settings.

func NewSettingsFromFile

func NewSettingsFromFile(filePath string) (stn *Settings, err error)

func (*Settings) Check

func (stn *Settings) Check() (err error)

Jump to

Keyboard shortcuts

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