config

package
v0.0.0-...-d2bf310 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEnvironment = errors.New("invalid environment")

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerURL string `env:"SERVER_URL,required"`

	ZonesFile               string `env:"ZONES_FILE,required"`
	AuthToken               string `env:"AUTH_TOKEN,required"`
	DailyProgramsFile       string `env:"DAILY_PROGRAMS_FILE,required"`
	OddProgramsFile         string `env:"ODD_PROGRAMS_FILE,required"`
	EvenProgramsFile        string `env:"EVEN_PROGRAMS_FILE,required"`
	WeeklyProgramsFile      string `env:"WEEKLY_PROGRAMS_FILE,required"`
	TemperatureProgramsFile string `env:"TEMPERATURE_PROGRAMS_FILE,required"`
	ExecutionLogsFile       string `env:"EXECUTION_LOGS_FILE,required"`
	TelegramToken           string `env:"TELEGRAM_TOKEN,required"`
	TelegramChatID          int    `env:"TELEGRAM_CHAT_ID,required"`
	TelegramBotEnabled      bool   `env:"TELEGRAM_BOT_ENABLED,required"`
	NatsServerURL           string `env:"NATS_SERVER_URL,required"`
	EventsDirectory         string `env:"EVENTS_DIRECTORY,required"`
	// contains filtered or unexported fields
}

func New

func New() (*Config, error)

type EmptyEnvironmentKeyError

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

func NewEmptyEnvironmentKeyError

func NewEmptyEnvironmentKeyError(key string) EmptyEnvironmentKeyError

func (EmptyEnvironmentKeyError) Error

func (i EmptyEnvironmentKeyError) Error() string

type Environment

type Environment struct {
	Value string `env:"ENVIRONMENT,required"`
}

type EnvironmentType

type EnvironmentType int
const (
	DevelopmentEnvironment EnvironmentType = iota + 1
	ProductionEnvironment
)

func ParseEnvironment

func ParseEnvironment(s string) (EnvironmentType, error)

func (EnvironmentType) IsProduction

func (e EnvironmentType) IsProduction() bool

Jump to

Keyboard shortcuts

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