config

package
v0.0.0-...-9423480 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParamDefaultFile []byte

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Hour              int64                `yaml:"hour"`
	Minute            int64                `yaml:"minute"`
	WebradioId        *apimodel.WebradioId `yaml:"webradio_id"`
	PlaylistId        *apimodel.PlaylistId `yaml:"playlist_id"`
	Enabled           bool                 `yaml:"enabled"`
	NoAlarmOnWeekends bool                 `yaml:"no_alarm_on_weekends"`
}

func (*Alarm) AddMinute

func (sc *Alarm) AddMinute(minutes int64)

type ApiParam

type ApiParam struct {
	Enabled bool   `yaml:"enabled"`
	SslPort int64  `yaml:"ssl_port"`
	ApiKey  string `yaml:"api_key"`
}

type MifasolParam

type MifasolParam struct {
	ConfigDir        string `yaml:"-"`
	ServerHostname   string `yaml:"hostname"`
	ServerPort       int64  `yaml:"port"`
	ServerSsl        bool   `yaml:"ssl"`
	ServerSelfSigned bool   `yaml:"self_signed"`
	Username         string `yaml:"username"`
	Password         string `yaml:"password"`
	Timeout          int64  `yaml:"timeout"`
}

func (*MifasolParam) GetCert

func (c *MifasolParam) GetCert() []byte

func (MifasolParam) GetPassword

func (c MifasolParam) GetPassword() string

func (MifasolParam) GetServerHostname

func (c MifasolParam) GetServerHostname() string

func (MifasolParam) GetServerPort

func (c MifasolParam) GetServerPort() int64

func (MifasolParam) GetServerSelfSigned

func (c MifasolParam) GetServerSelfSigned() bool

func (MifasolParam) GetServerSsl

func (c MifasolParam) GetServerSsl() bool

func (MifasolParam) GetTimeout

func (c MifasolParam) GetTimeout() int64

func (MifasolParam) GetUsername

func (c MifasolParam) GetUsername() string

func (*MifasolParam) SetCert

func (c *MifasolParam) SetCert(cert []byte) error

type ServerConfig

type ServerConfig struct {
	ConfigDir      string
	DebugMode      bool
	SimulationMode bool

	*ServerParam
	*ServerState
}

func NewServerConfig

func NewServerConfig(configDir string, debugMode bool, simulationMode bool) *ServerConfig

func (*ServerConfig) GetCompleteParamFilename

func (sc *ServerConfig) GetCompleteParamFilename() string

func (*ServerConfig) GetCompletePlaylistFolder

func (sc *ServerConfig) GetCompletePlaylistFolder() string

func (*ServerConfig) GetCompleteStateFilename

func (sc *ServerConfig) GetCompleteStateFilename() string

func (*ServerConfig) SaveParam

func (sc *ServerConfig) SaveParam()

type ServerParam

type ServerParam struct {
	SnoozeDuration int64                 `yaml:"snooze_duration"`
	WebradioGroups map[int64][]*Webradio `yaml:"webradio_groups"`
	MifasolParam   *MifasolParam         `yaml:"mifasol,omitempty"`
	ApiParam       ApiParam              `yaml:"api"`
}

type ServerState

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

func NewsServerState

func NewsServerState(completeStateFilename string) *ServerState

func (*ServerState) Alarm

func (ss *ServerState) Alarm() Alarm

func (*ServerState) FlushSave

func (ss *ServerState) FlushSave()

func (*ServerState) SetAlarm

func (ss *ServerState) SetAlarm(alarm Alarm)

func (*ServerState) SetVolume

func (ss *ServerState) SetVolume(volume int64)

func (*ServerState) Volume

func (ss *ServerState) Volume() int64

type ServerStateConfig

type ServerStateConfig struct {
	Volume int64 `yaml:"volume"`
	Alarm  Alarm `yaml:"alarm"`
}

type Webradio

type Webradio struct {
	Name       string              `yaml:"name"`
	Url        string              `yaml:"url"`
	WebradioId apimodel.WebradioId `yaml:"-"`
}

Jump to

Keyboard shortcuts

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