Documentation ¶
Index ¶
- type ConfigValueSource
- type HatsConfig
- func (c *HatsConfig) GetCustomSetting(name string, defaultValue string) string
- func (c *HatsConfig) GetHatsBaseUrl() string
- func (c *HatsConfig) GetHomeAssistantBaseUrl() string
- func (c *HatsConfig) GetHomeAssistantWebsocketUrl() string
- func (c *HatsConfig) GetLogLevel() slog.Level
- func (c *HatsConfig) GetNatsBaseUrl() string
- func (c *HatsConfig) InfisicalConfigured() bool
- func (c *HatsConfig) SetValues(source ConfigValueSource, inputs ...map[string]string) *HatsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigValueSource ¶
type ConfigValueSource string
const ConfigValueSourceDefault ConfigValueSource = "default"
const ConfigValueSourceEnv ConfigValueSource = "env"
const ConfigValueSourceInfisical ConfigValueSource = "infisical"
type HatsConfig ¶
type HatsConfig struct { LogLevl string `config:"LOG_LEVEL" default:"INFO"` InfisicalHost string `config:"INFISICAL_HOST" default:"http://infisical:8080"` InfisicalClientID string `config:"INFISICAL_CLIENT" default:""` InfisicalClientSecret string `config:"INFISICAL_SECRET" default:""` InfisicalProjectID string `config:"INFISICAL_PROJECT" default:""` InfisicalEnvironment string `config:"INFISICAL_ENVIRONMENT" default:"prod"` HomeAssistantHost string `config:"HASS_HOST" default:"127.0.0.1"` HomeAssistantPort string `config:"HASS_PORT" default:"8123"` HomeAssistantSecure bool `config:"HASS_SECURE" default:"false"` HomeAssistantToken string `config:"HASS_TOKEN" default:""` NatsHost string `config:"NATS_HOST" default:"127.0.0.1"` NatsPort string `config:"NATS_PORT" default:"4222"` NatsToken string `config:"NATS_TOKEN" default:""` NatsClientName string `config:"NATS_CLIENT_NAME" default:"hats"` HatsHost string `config:"HATS_HOST" default:"hats"` HatsPort string `config:"HATS_PORT" default:"8888"` HatsToken string `config:"HATS_TOKEN" default:""` HatsSecure bool `config:"HATS_SECURE" default:"false"` NtfyHost string `config:"NTFY_HOST" default:"https://ntfy.sh"` NtfyToken string `config:"NTFY_TOKEN" default:""` SyncthingHost string `config:"SYNCTHING_HOST" default:"http://127.0.0.1:8384"` SyncthingToken string `config:"SYNCTHING_TOKEN" default:""` GokapiHost string `config:"GOKAPI_HOST" default:"http://gokapi:53842"` GokapiToken string `config:"GOKAPI_TOKEN" default:""` QbittorrentHost string `config:"QBITTORRENT_HOST" default:"http://qbittorrent:8080"` QbittorrentUser string `config:"QBITTORRENT_USER" default:""` QbittorrentPassword string `config:"QBITTORRENT_PASS" default:""` ConfigDir string `config:"CONFIG_DIR" default:"/config"` // contains filtered or unexported fields }
func New ¶
func New() (*HatsConfig, error)
func (*HatsConfig) GetCustomSetting ¶
func (c *HatsConfig) GetCustomSetting(name string, defaultValue string) string
func (*HatsConfig) GetHatsBaseUrl ¶
func (c *HatsConfig) GetHatsBaseUrl() string
func (*HatsConfig) GetHomeAssistantBaseUrl ¶
func (c *HatsConfig) GetHomeAssistantBaseUrl() string
func (*HatsConfig) GetHomeAssistantWebsocketUrl ¶
func (c *HatsConfig) GetHomeAssistantWebsocketUrl() string
func (*HatsConfig) GetLogLevel ¶
func (c *HatsConfig) GetLogLevel() slog.Level
func (*HatsConfig) GetNatsBaseUrl ¶
func (c *HatsConfig) GetNatsBaseUrl() string
func (*HatsConfig) InfisicalConfigured ¶
func (c *HatsConfig) InfisicalConfigured() bool
func (*HatsConfig) SetValues ¶
func (c *HatsConfig) SetValues(source ConfigValueSource, inputs ...map[string]string) *HatsConfig
Click to show internal directories.
Click to hide internal directories.