config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 7 Imported by: 12

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

Types

type Config

type Config struct {
	General GeneralConfig `toml:"General"`
	Gist    GistConfig    `toml:"Gist"`
	GitLab  GitLabConfig  `toml:"GitLab"`
	GHEGist GHEGistConfig `toml:"GHEGist"`
}

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 toml

type FlagConfig

type FlagConfig struct {
	Debug        bool
	Query        string
	FilterTag    string
	Command      bool
	Delimiter    string
	OneLine      bool
	Color        bool
	Tag          bool
	UseMultiLine bool
	UseEditor    bool
}

FlagConfig is a struct of flag

var Flag FlagConfig

Flag is global flag variable

type GHEGistConfig added in v0.8.1

type GHEGistConfig struct {
	BaseUrl     string `toml:"base_url"`
	UploadUrl   string `toml:"upload_url"`
	FileName    string `toml:"file_name"`
	AccessToken string `toml:"access_token"`
	GistID      string `toml:"gist_id"`
	Public      bool   `toml:"public"`
	AutoSync    bool   `toml:"auto_sync"`
}

GHEGistConfig is a struct of config for Gist of Github Enterprise

type GeneralConfig

type GeneralConfig struct {
	SnippetFile string   `toml:"snippetfile"`
	Editor      string   `toml:"editor"`
	Column      int      `toml:"column"`
	SelectCmd   string   `toml:"selectcmd"`
	Backend     string   `toml:"backend"`
	SortBy      string   `toml:"sortby"`
	Cmd         []string `toml:"cmd"`
}

GeneralConfig is a struct of general config

type GistConfig

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

GistConfig is a struct of config for Gist

type GitLabConfig added in v0.3.1

type GitLabConfig struct {
	FileName    string `toml:"file_name"`
	AccessToken string `toml:"access_token"`
	Url         string `toml:"url"`
	ID          string `toml:"id"`
	Visibility  string `toml:"visibility"`
	AutoSync    bool   `toml:"auto_sync"`
	Insecure    bool   `toml:"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