config

package
v0.0.0-...-2896897 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnknownKey   = "unknown config key"
	ErrInvalidValue = "invalid value for key"
)
View Source
const (
	ExitUnknownKey   = 1
	ExitInvalidValue = 2
)
View Source
const (
	Token       = "token"
	GuessSyntax = "guess-syntax"
)
View Source
const (
	EnvDpasteToken = "DPASTE_TOKEN"
)
View Source
const (
	FlagDpasteToken = "token"
)

Variables

This section is empty.

Functions

func DefaultConfigFile

func DefaultConfigFile() string

Types

type Config

type Config struct {
	Token       string `yaml:"token,omitempty"`
	GuessSyntax bool   `yaml:"guess-syntax"`
}

func LoadConfig

func LoadConfig(path string) (config Config, err error)

func (Config) Get

func (c Config) Get(key string) (string, error)

func (Config) MustGet

func (c Config) MustGet(key string) string

func (*Config) Set

func (c *Config) Set(key, value string) error

func (Config) Write

func (c Config) Write(path string) (err error)

Jump to

Keyboard shortcuts

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