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 ¶
Click to show internal directories.
Click to hide internal directories.