config

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NameRegexp = "^[a-zA-Z0-9\\-]{1,32}$"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

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

func (AuthConfig) Enabled

func (c AuthConfig) Enabled() bool

func (AuthConfig) HtaccessFile

func (c AuthConfig) HtaccessFile() string

func (AuthConfig) JwtSecret

func (c AuthConfig) JwtSecret() []byte

func (AuthConfig) JwtValidityPeriod

func (c AuthConfig) JwtValidityPeriod() time.Duration

type Config

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

func ReadConfig

func ReadConfig(yamlStr []byte) (config Config, err []error)

func ReadConfigFile

func ReadConfigFile(exe, source string) (config Config, err []error)

func (Config) Auth

func (c Config) Auth() AuthConfig

func (Config) Devices

func (c Config) Devices() []*DeviceConfig

func (Config) GetViewNames

func (c Config) GetViewNames() (ret []string)

func (Config) HttpServer

func (c Config) HttpServer() HttpServerConfig

func (Config) LogConfig

func (c Config) LogConfig() bool

func (Config) LogDebug

func (c Config) LogDebug() bool

func (Config) LogWorkerStart

func (c Config) LogWorkerStart() bool

func (Config) MarshalYAML

func (c Config) MarshalYAML() (interface{}, error)

func (Config) MqttClients

func (c Config) MqttClients() []*MqttClientConfig

func (Config) PrintConfig

func (c Config) PrintConfig() (err error)

func (Config) ProjectTitle

func (c Config) ProjectTitle() string

func (Config) Version

func (c Config) Version() int

func (Config) Views

func (c Config) Views() []*ViewConfig

type DeviceConfig

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

func (DeviceConfig) Device

func (c DeviceConfig) Device() string

func (DeviceConfig) Kind

func (c DeviceConfig) Kind() DeviceKind

func (DeviceConfig) LogComDebug

func (c DeviceConfig) LogComDebug() bool

func (DeviceConfig) LogDebug

func (c DeviceConfig) LogDebug() bool

func (DeviceConfig) Name

func (c DeviceConfig) Name() string

func (DeviceConfig) SkipCategories added in v1.6.0

func (c DeviceConfig) SkipCategories() []string

func (DeviceConfig) SkipFields added in v1.6.0

func (c DeviceConfig) SkipFields() []string

type DeviceKind

type DeviceKind int

device kind

const (
	UndefinedKind DeviceKind = iota
	RandomBmvKind
	RandomSolarKind
	VedirectKind
)

func DeviceKindFromString

func DeviceKindFromString(s string) DeviceKind

func (DeviceKind) String

func (dk DeviceKind) String() string

type HttpServerConfig

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

func (HttpServerConfig) Bind

func (c HttpServerConfig) Bind() string

func (HttpServerConfig) ConfigExpires

func (c HttpServerConfig) ConfigExpires() time.Duration

func (HttpServerConfig) EnableDocs

func (c HttpServerConfig) EnableDocs() bool

func (HttpServerConfig) Enabled

func (c HttpServerConfig) Enabled() bool

func (HttpServerConfig) FrontendExpires

func (c HttpServerConfig) FrontendExpires() time.Duration

func (HttpServerConfig) FrontendPath

func (c HttpServerConfig) FrontendPath() string

func (HttpServerConfig) FrontendProxy

func (c HttpServerConfig) FrontendProxy() *url.URL

func (HttpServerConfig) LogRequests

func (c HttpServerConfig) LogRequests() bool

func (HttpServerConfig) Port

func (c HttpServerConfig) Port() int

type MqttClientConfig

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

func (MqttClientConfig) AvailabilityTopic

func (c MqttClientConfig) AvailabilityTopic() string

func (MqttClientConfig) Broker

func (c MqttClientConfig) Broker() *url.URL

Broker always returns a non-nil pointer.

func (MqttClientConfig) ClientId

func (c MqttClientConfig) ClientId() string

func (MqttClientConfig) ConnectRetryDelay added in v1.7.0

func (c MqttClientConfig) ConnectRetryDelay() time.Duration

func (MqttClientConfig) ConnectTimeout added in v1.7.0

func (c MqttClientConfig) ConnectTimeout() time.Duration

func (MqttClientConfig) KeepAlive added in v1.7.0

func (c MqttClientConfig) KeepAlive() time.Duration

func (MqttClientConfig) LogDebug added in v1.3.0

func (c MqttClientConfig) LogDebug() bool

func (MqttClientConfig) LogMessages

func (c MqttClientConfig) LogMessages() bool

func (MqttClientConfig) Name

func (c MqttClientConfig) Name() string

func (MqttClientConfig) Password

func (c MqttClientConfig) Password() string

func (MqttClientConfig) ProtocolVersion added in v1.7.0

func (c MqttClientConfig) ProtocolVersion() int

func (MqttClientConfig) Qos

func (c MqttClientConfig) Qos() byte

func (MqttClientConfig) RealtimeEnable

func (c MqttClientConfig) RealtimeEnable() bool

func (MqttClientConfig) RealtimeRetain

func (c MqttClientConfig) RealtimeRetain() bool

func (MqttClientConfig) RealtimeTopic

func (c MqttClientConfig) RealtimeTopic() string

func (MqttClientConfig) TelemetryInterval

func (c MqttClientConfig) TelemetryInterval() time.Duration

func (MqttClientConfig) TelemetryRetain

func (c MqttClientConfig) TelemetryRetain() bool

func (MqttClientConfig) TelemetryTopic

func (c MqttClientConfig) TelemetryTopic() string

func (MqttClientConfig) TopicPrefix

func (c MqttClientConfig) TopicPrefix() string

func (MqttClientConfig) User

func (c MqttClientConfig) User() string

type ViewConfig

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

func (ViewConfig) Autoplay

func (c ViewConfig) Autoplay() bool

func (ViewConfig) DeviceNames

func (c ViewConfig) DeviceNames() []string

func (ViewConfig) Devices

func (c ViewConfig) Devices() []*ViewDeviceConfig

func (ViewConfig) Hidden

func (c ViewConfig) Hidden() bool

func (ViewConfig) IsAllowed

func (c ViewConfig) IsAllowed(user string) bool

func (ViewConfig) IsPublic

func (c ViewConfig) IsPublic() bool

func (ViewConfig) Name

func (c ViewConfig) Name() string

func (ViewConfig) SkipCategories added in v1.6.0

func (c ViewConfig) SkipCategories() []string

func (ViewConfig) SkipFields added in v1.6.0

func (c ViewConfig) SkipFields() []string

func (ViewConfig) Title

func (c ViewConfig) Title() string

type ViewDeviceConfig

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

func (ViewDeviceConfig) Name

func (c ViewDeviceConfig) Name() string

func (ViewDeviceConfig) Title

func (c ViewDeviceConfig) Title() string

Jump to

Keyboard shortcuts

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