settings

package
v0.24.15 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrServerModeIsNotSet     = "server mode is not set"
	ErrServerMode             = "server mode error"
	ErrCertFileIsNotSet       = "certificate file is not set"
	ErrKeyFileIsNotSet        = "key file is not set"
	ErrFileExtensionIsNotSet  = "file extension is not set"
	ErrMimeTypeIsNotSet       = "MIME type is not set"
	ErrDbClientPoolSize       = "DB client pool size is not set"
	ErrHttpCacheControlMaxAge = "HTTP cache control max-age error"
)
View Source
const (
	ContentDispositionInline = "inline"

	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

	// Database Host Name.
	DbHost string

	// Database Ports.
	DbPortA uint16
	DbPortB uint16

	// DbClientPoolSize is the size of a pool of DB clients.
	DbClientPoolSize int

	// File Extension & MIME Type.
	// Extension which is appended to all files served.
	FileExtension string
	MimeType      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
}

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