settings

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewFilePerm   = 0644
	NewFolderPerm = 0644
	TmpFileExt    = ".tmp"
	OldFileExt    = ".old"
	JsonFileExt   = ".json"
)
View Source
const (
	ErrFileIsNotSet           = "file is not set"
	ErrJsonDataFolderIsNotSet = "JSON data folder is not set"
	ErrCategoryPathsAreNotSet = "category paths are not set"
	ErrTopNewsCountIsNotSet   = "top news count is not set"
	ErrServerAddressIsNotSet  = "server address is not set"
)

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

	// JSON Data Folder.
	JsonDataFolder string

	// Category Paths.
	CategoryPaths []string

	// Should we create category folders if they do not exist ?
	ShouldCreateCategoryFolder bool

	// Number of top items to be shown on the index page with full detail (i.e.
	// with an icon and a description text). All other items are shown briefly
	// (only date-time and a title are shown).
	TopNewsCount int

	// Addresses of servers.
	MainServerAddress string
	IconServerAddress string
	JpegServerAddress string
	JsonServerAddress string
}

Settings is Server's settings.

func NewSettingsFromFile

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

func (*Settings) CategoryExists

func (stn *Settings) CategoryExists(category string) bool

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