settings

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestAPI

type RestAPI struct {
	MaxSizeMusicFileMB int64 `sets:"max_size_music_file_mb"`
	MaxSizeImageFileKB int64 `sets:"max_size_image_file_kb"`
}

RestAPI is a settings of the rest api server

type Settings

type Settings struct {
	// contains filtered or unexported fields
}

Settings updates settings in the system

func Init

func Init(setsData map[string]string, updaters ...Updater) (*Settings, error)

Init creates the new settings manager and updates all systems

func (*Settings) UpdateSettings

func (s *Settings) UpdateSettings(setsData map[string]string) error

UpdateSettings gets settings from db and updates all updaters setsData must to contain settings for all systmes

type Tasker

type Tasker struct {
	// File will be convert to file with this bitrate by default as a middle bitrate file.
	MiddleBitrate int64 `sets:"middle_bitrate"`

	// This enables the Threshold procedure to decide whether
	// to convert to a high bitrate file or just copy middle file.
	// Threshold procedure related to threshold_to_high_bitrate and max_high_bitrate values.
	ThresholdEnabled bool `sets:"threshold_enabled"`
	// If bitrate of the origin file greater then this value then file will
	// be convert to file with High bitrate but not greater then max value.
	// If origin file less then threshold then
	// middle bitrate file will be copy as high bitrate file.
	// Too big value (like a 99999) disabled converting to high bitrate file.
	ThresholdToHighBitrate int64 `sets:"threshold_to_high_bitrate"`
	// If origin file less then max value then it will convert
	// with origin bitrate otherwise will be set this value.
	// 0 - always will be convert with origin bitrate but threshold_to_high_bitrate must to be 0 too.
	MaxHighBitrate int64 `sets:"max_high_bitrate"`

	// It always will be convert to high bitrate file. It is related to force_high_bitrate
	ForceConvertToHighBitrateEnabled bool `sets:"force_convert_to_high_bitrate_enabled"`
	// It is value of the bitrate for force convert to high.
	ForceHighBitrate int64 `sets:"force_high_bitrate"`
}

Tasker is a config of the default bitrate settings in the tasker

type Updater

type Updater interface {
	GetSettingsPrefix() string
	CheckSettingsIsValid(s interface{}) error
	ApplySettings(s interface{}) error
}

Updater allows to refresh its current settings

Jump to

Keyboard shortcuts

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