config

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfigDir

func GetDefaultConfigDir() (dir string, err error)

GetDefaultConfigDir returns the default config directory

func GetUserConfigDir

func GetUserConfigDir() (dir string, err error)

func Touch

func Touch(fileName string) error

Types

type Config

type Config struct {
	General GeneralConfig `yaml:"General"`
	Gist    GistConfig    `yaml:"Gist"`
	GitLab  GitLabConfig  `yaml:"GitLab"`
	Daemon  DaemonConfig  `yaml:"Daemon"`
}

Config is a struct of config

var Conf Config

Conf is global config variable

func (*Config) Load

func (cfg *Config) Load(file string) error

Load loads a config yaml

type DaemonConfig

type DaemonConfig struct {
	Port int `yaml:"port"`
}

type FlagConfig

type FlagConfig struct {
	Debug        bool
	Query        string
	FilterTag    string
	Command      bool
	Copy         bool
	Delimiter    string
	OneLine      bool
	Color        bool
	Tag          bool
	Detach       bool
	HasClipboard bool
}

FlagConfig is a struct of flag

var Flag FlagConfig

Flag is global flag variable

type GeneralConfig

type GeneralConfig struct {
	SnippetFile   string `yaml:"snippetfile"`
	CredFile      string `yaml:"credfile"`
	AliasFile     string `yaml:"aliasfile"`
	BackupFile    string `yaml:"backupfile"`
	ClipboardFile string `yaml:"clipboardfile"`
	SvcFile       string `yaml:"svcfile"`
	SyncFile      string `yaml:"syncfile"`
	// General purpose app state
	StateFile string   `yaml:"statefile"`
	Editor    string   `yaml:"editor"`
	Column    int      `yaml:"column"`
	Backend   string   `yaml:"backend"`
	SortBy    string   `yaml:"sortby"`
	Cmd       []string `yaml:"cmd"`
}

GeneralConfig is a struct of general config

type GistConfig

type GistConfig struct {
	FileName    string `yaml:"file_name"`
	AccessToken string `yaml:"access_token"`
	GistID      string `yaml:"gist_id"`
	Public      bool   `yaml:"public"`
	AutoSync    bool   `yaml:"auto_sync"`
}

GistConfig is a struct of config for Gist

type GitLabConfig

type GitLabConfig struct {
	FileName    string `yaml:"file_name"`
	AccessToken string `yaml:"access_token"`
	Url         string `yaml:"url"`
	ID          string `yaml:"id"`
	Visibility  string `yaml:"visibility"`
	AutoSync    bool   `yaml:"auto_sync"`
	Insecure    bool   `yaml:"skip_ssl"`
}

GitLabConfig is a struct of config for GitLabSnippet

Jump to

Keyboard shortcuts

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