config

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConfigNotFound is returned on load if the config was not found
	ErrConfigNotFound = fmt.Errorf("config not found")
	// ErrConfigNotParsed is returned on load if the config could not be decoded
	ErrConfigNotParsed = fmt.Errorf("config not parseable")
)

Functions

func PwStoreDir

func PwStoreDir(mount string) string

PwStoreDir reads the password store dir from the environment or returns the default location ~/.password-store if the env is not set

Types

type Config

type Config struct {
	AskForMore  bool                 `json:"askformore"`  // ask for more data on generate
	AutoImport  bool                 `json:"autoimport"`  // import missing public keys w/o asking
	AutoSync    bool                 `json:"autosync"`    // push to git remote after commit, pull before push if necessary
	ClipTimeout int                  `json:"cliptimeout"` // clear clipboard after seconds
	Debug       bool                 `json:"-"`
	FsckFunc    store.FsckCallback   `json:"-"`
	ImportFunc  store.ImportCallback `json:"-"`
	Mounts      map[string]string    `json:"mounts,omitempty"`
	NoColor     bool                 `json:"-"`
	NoPager     bool                 `json:"-"`
	NoConfirm   bool                 `json:"noconfirm"`   // do not confirm recipients when encrypting
	Path        string               `json:"path"`        // path to the root store
	SafeContent bool                 `json:"safecontent"` // avoid showing passwords in terminal
	Version     string               `json:"version"`
}

Config is the gopass config structure

func Load

func Load() *Config

Load will try to load the config from one of the default locations

func New

func New() *Config

New creates a new config with sane default values

func (*Config) ConfigMap

func (c *Config) ConfigMap() map[string]string

ConfigMap returns a map of stringified config values for easy printing

func (*Config) Save

func (c *Config) Save() error

Save saves the config

func (*Config) SetConfigValue

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

SetConfigValue will try to set the given key to the value in the config struct

Jump to

Keyboard shortcuts

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