config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: GPL-3.0 Imports: 7 Imported by: 5

Documentation

Overview

Package config provides a simple config management implementation based on JSON files.

Index

Constants

View Source
const (
	UpdateDefaultChannel   = "stable"
	UpdateDefaultServerUrl = "https://updatecells.pydio.com/"
	UpdateDefaultPublicKey = `` /* 424-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func Save

func Save() error

func SyncClientDataDir

func SyncClientDataDir() string

func Watch

func Watch() chan interface{}

func WriteToFile

func WriteToFile(config *Global) error

Types

type Global

type Global struct {
	Tasks   []*Task
	Logs    *Logs
	Updates *Updates
	// contains filtered or unexported fields
}

func Default

func Default() *Global

func LoadFromFile

func LoadFromFile() (*Global, error)

func (*Global) CreateTask

func (g *Global) CreateTask(t *Task) error

func (*Global) Items

func (g *Global) Items() (items []string)

func (*Global) RemoveTask

func (g *Global) RemoveTask(task *Task) error

func (*Global) UpdateGlobals

func (g *Global) UpdateGlobals(logs *Logs, updates *Updates) error

func (*Global) UpdateTask

func (g *Global) UpdateTask(task *Task) error

type Logs

type Logs struct {
	Folder         string
	MaxFilesNumber int
	MaxFilesSize   int
	MaxAgeDays     int
}

func NewLogs

func NewLogs() *Logs

type Task

type Task struct {
	Uuid           string
	Label          string
	LeftURI        string
	RightURI       string
	Direction      string
	SelectiveRoots []string

	Realtime     bool
	LoopInterval string
	HardInterval string
}

type TaskChange

type TaskChange struct {
	Type string
	Task *Task
}

type Updates

type Updates struct {
	Frequency       string
	DownloadAuto    bool
	UpdateChannel   string
	UpdateUrl       string
	UpdatePublicKey string
}

func NewUpdates

func NewUpdates() *Updates

Jump to

Keyboard shortcuts

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