config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseAddress = "127.0.0.1"
)

Variables

This section is empty.

Functions

func Load

func Load(filename string) error

Load function convert a loaded JSON config file to a config struct return err if secret param is empty

func Unload

func Unload()

Types

type Backup

type Backup struct {
	When           string `json:"when"`
	Method         string `json:"method"`
	EncryptionKey  string `json:"encryptionKey"`
	Archive        bool   `json:"archive"`
	FilePerArchive int    `json:"filePerArchive"`
}

func GetBackupConfig

func GetBackupConfig() Backup

func (Backup) IsEmpty

func (c Backup) IsEmpty() bool

type Configuration

type Configuration struct {
	Address          string `json:"address"`
	Port             int    `json:"port"`
	MotionConfigFile string `json:"motionConfigFile"`
	Username         string `json:"username"`
	Password         string `json:"password"`
	Ssl              SSL    `json:"ssl"`
	Backup           Backup `json:"backup"`
	Notify           Notify `json:"notify"`
}

func GetConfig

func GetConfig() Configuration

func (Configuration) IsEmpty

func (c Configuration) IsEmpty() bool

type Notify

type Notify struct {
	Method  string   `json:"method"`
	Token   string   `json:"token"`
	To      []string `json:"to"`
	Message string   `json:"message"`
	Photo   int      `json:"photo"`
}

func GetNotifyConfig

func GetNotifyConfig() Notify

func (Notify) IsEmpty

func (c Notify) IsEmpty() bool

type SSL added in v0.0.5

type SSL struct {
	CertFile string `json:"cert"`
	KeyFile  string `json:"key"`
}

Jump to

Keyboard shortcuts

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