config

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DebugPort uint16 `validate:"required"`
	TimeZone  string `validate:"required"`
	*Sentry
	*GPIO
	*Telegram
	*Raspistill
	*Cron
}

func New

func New(path string) (*Config, error)

type Cron

type Cron struct {
	Jobs []*CronJob
}

type CronJob

type CronJob struct {
	Spec            string `validate:"required"`
	WithLightSwitch bool
	LightState      bool
	WithPhoto       bool
}

type Duration

type Duration time.Duration

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type GPIO

type GPIO struct {
	LightPin string `validate:"required"`
}

type Raspistill

type Raspistill struct {
	Quality uint8    `validate:"min=1,max=100"`
	Timeout Duration `validate:"required"`
}

type Sentry

type Sentry struct {
	DNS     string   `validate:"required,url"`
	Timeout Duration `validate:"required"`
}

type Telegram

type Telegram struct {
	BotToken      string   `validate:"required"`
	ChatID        int64    `validate:"required"`
	ClientTimeout Duration `validate:"required"`
}

Jump to

Keyboard shortcuts

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