settings

package
v0.24.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ErrSyntax = "syntax error"

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSettings

type DataSettings struct {
	// 1. Folder with data files.
	Folder string

	// 2. File extension.
	// This extension is concatenated with UIDs of cached items to get the full
	// file name of the item. Each record (item) is stored in a separate file.
	FileExtension string

	// 3. Maximum size of cache in bytes.
	CacheVolumeMax int

	// 4. Maximum size of a single cached item in bytes.
	CachedItemVolumeMax int

	// 5. Expiration time of a single cached item in seconds.
	// 1 Hour = 3600 Seconds,
	// 1 Day = 86400 Seconds.
	CachedItemTTL uint
}

func ParseDataSettings

func ParseDataSettings(line1, line2 string) (ds *DataSettings, err error)

func (*DataSettings) Check

func (ds *DataSettings) Check() (err error)

type Settings

type Settings struct {
	// Path to the settings file.
	// Settings are positional for simplicity.
	File string

	// Host name.
	ServerHost string

	// Main port.
	// A port which is used for read-only operations.
	MainPort uint16

	// Auxiliary port.
	// A port which is used for non-read operations.
	AuxPort uint16

	// Data settings.
	Data *DataSettings
}

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