config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

This is a minimalist config package. It uses a flat structure and simple obfuscation to avoid over-the-shoulder or casual viewing of passwords on the file system. Future implemenations may improve upon the data structure and allow for user provided passwords that will better protect the locally stored password. Or we can try to find a config library that supports:

  • getting / setting values in a structured way (like Viper)
  • securely prompting for values (I suppose this could be externalized)
  • encrypting / decrypting / obfuscating stored values
  • loading and saving configuration (not just reading)

Index

Constants

View Source
const DefaultConfigFileName = ".graven.yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() Config

func (Config) Get

func (c Config) Get(group, name string) string

func (Config) GetSecret added in v0.10.0

func (c Config) GetSecret(group, name string) (string, error)

func (Config) PromptPlainText added in v0.10.0

func (c Config) PromptPlainText(group, name, prompt string) error

func (Config) PromptSecret added in v0.10.0

func (c Config) PromptSecret(group, name, prompt string) error

func (Config) Read

func (c Config) Read() error

func (Config) Set

func (c Config) Set(group, name string, value string)

func (Config) Write

func (c Config) Write() error

Jump to

Keyboard shortcuts

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