Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupConfig

type BackupConfig struct {
	BackupNeededWarningDays int    `yaml:"backup_needed_warning_days"`
	BackupMaxCount          int    `yaml:"backup_max_count"`
	AutoBackup              bool   `yaml:"auto_backup"`
	AutoBackupIntervalDays  int    `yaml:"auto_backup_interval_days"`
	BackupFolder            string `yaml:"backup_folder"`
}

func GetDefaultBackupConfig

func GetDefaultBackupConfig(dataFolder string) BackupConfig

func (*BackupConfig) Equal

func (bc *BackupConfig) Equal(other *BackupConfig) bool

func (BackupConfig) String

func (bc BackupConfig) String() string

type GistConfig

type GistConfig struct {
	Authorization    string        `yaml:"authorization"`
	GistId           string        `yaml:"gist_id"`
	AutoSync         bool          `yaml:"auto_sync"`
	GistDescription  string        `yaml:"gist_description"`
	LastSync         time.Time     `yaml:"last_sync"`
	AutoSyncInterval time.Duration `yaml:"auto_sync_interval"`
}

func GetDefaultGistConfig

func GetDefaultGistConfig() GistConfig

func (*GistConfig) Equal

func (c *GistConfig) Equal(other *GistConfig) bool

func (*GistConfig) SetToken

func (c *GistConfig) SetToken(token string) error

func (*GistConfig) String

func (c *GistConfig) String() string

type LocalConfig

type LocalConfig struct {
	ToDoListName string       `yaml:"todo_list_name"`
	Gist         GistConfig   `yaml:"gist"`
	Backup       BackupConfig `yaml:"backup"`
}

func GetDefaultLocalConfig

func GetDefaultLocalConfig(dataFolder string) *LocalConfig

func LoadFromFile

func LoadFromFile(filename string) (cfg LocalConfig, err error)

func (*LocalConfig) BackupPrefix

func (c *LocalConfig) BackupPrefix() string

func (*LocalConfig) Equal

func (c *LocalConfig) Equal(other any) bool

func (*LocalConfig) Parse

func (c *LocalConfig) Parse(data []byte) error

func (*LocalConfig) ParseNew

func (c *LocalConfig) ParseNew(data []byte) (interfaces.Backupable, error)

func (*LocalConfig) Save

func (c *LocalConfig) Save(fileName string) error

func (*LocalConfig) String

func (c *LocalConfig) String() string

Jump to

Keyboard shortcuts

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