prefs

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RcPath

func RcPath() (string, error)

RcPath returns the arigatorc filepath

func ValidatePublicKey

func ValidatePublicKey(filePath string) error

ValidatePublicKey checks the publickey path for valid file

Types

type Core

type Core struct {
	PublicKeyFile string `ini:"public_key_file,omitempty"`
	CABundleFile  string `ini:"ca_bundle_file,omitempty"`
	RegistryURI   string `ini:"registry_uri,omitempty"`
	Context       bool   `ini:"context,omitempty"`
}

Core contains core option values

type Defaults

type Defaults struct {
	Organization string `ini:"org,omitempty"`
	Project      string `ini:"project,omitempty"`
	Environment  string `ini:"environment,omitempty"`
	Service      string `ini:"service,omitempty"`
}

Defaults contains default values for use in command argument flags

type Preferences

type Preferences struct {
	Core     Core     `ini:"core"`
	Defaults Defaults `ini:"defaults"`
}

Preferences represents the configuration as user has in their arigatorc file

func NewPreferences

func NewPreferences(useDefaults bool) (*Preferences, error)

NewPreferences returns a new instance of preferences struct

func (Preferences) CountFields

func (prefs Preferences) CountFields(fieldName string) int

CountFields returns the number of defined fields on sub-field struct

func (Preferences) SetValue

func (prefs Preferences) SetValue(key string, value string) (Preferences, error)

SetValue for ini key on preferences struct

type PublicKey

type PublicKey struct {
	PublicKey base64.Value `json:"public_key"`
}

PublicKey is en ed25519 public key.

func LoadPublicKey

func LoadPublicKey(prefs *Preferences) (*PublicKey, error)

LoadPublicKey reads the publickey file from disk and parses the json

Jump to

Keyboard shortcuts

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