configdef

package
v0.0.0-...-49f6bda Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigAlreadyExists = xerror.New("config file already exists")

Functions

This section is empty.

Types

type Camera

type Camera struct {
	Title           string          `json:"title" validate:"empty=false"`
	Address         string          `json:"address"`
	PersistLoc      string          `json:"persist_location" validate:"empty=false"`
	MaxClipAgeDays  int             `json:"max_clip_age_days" validate:"gte=1 & lte=30"`
	MockWriter      bool            `json:"mock_writer"`
	MockCapturer    bool            `json:"mock_capturer"`
	FPS             int             `json:"fps" validate:"gte=1 & lte=30"`
	DateTimeLabel   bool            `json:"date_time_label"`
	DateTimeFormat  string          `json:"date_time_format"`
	SecondsPerClip  int             `json:"seconds_per_clip" validate:"gte=1 & lte=3"`
	Disabled        bool            `json:"disabled"`
	Week            schedule.Week   `json:"schedule"`
	ReolinkAdvanced ReolinkAdvanced `json:"reolink_advanced"`
}

type CreateResolver

type CreateResolver interface {
	Creator
	Resolver
}

type Creator

type Creator interface {
	Create() error
}

type Destroyer

type Destroyer interface {
	Destory() error
}

type ReolinkAdvanced

type ReolinkAdvanced struct {
	Enabled    bool   `json:"enabled"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	APIAddress string `json:"api_address"`
}

type Resolver

type Resolver interface {
	Resolve() (Values, error)
}

type Values

type Values struct {
	Debug   bool     `json:"debug"`
	Secret  string   `json:"secret"`
	Cameras []Camera `json:"cameras"`
}

func (Values) RunValidate

func (v Values) RunValidate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳