util

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GIT_ADD    = 0
	GIT_EDIT   = 1
	GIT_DELETE = 2
)
View Source
const (
	BpkdfIterations = 8192
	BpkdfKeySize    = 32
)

Variables

This section is empty.

Functions

func AssertVaultExists

func AssertVaultExists()

func FormatAttributes

func FormatAttributes(path string, attrs AttributeMap, print bool)

func FormatDirectory

func FormatDirectory(path string, level int)

func FormatKeyList

func FormatKeyList(keys []MasterKey)

func GetVaultPath

func GetVaultPath() string

func GitClone

func GitClone(url string)

func GitCommit

func GitCommit(file string, op int, message string)

func GitCommitRename added in v0.2.0

func GitCommitRename(oldFile, newFile string)

func GitInit

func GitInit()

func GitPull

func GitPull()

func GitPush

func GitPush()

func GitRemote

func GitRemote(url string)

func IsValidPath added in v0.2.0

func IsValidPath(path string) bool

func RemoveFromSlice

func RemoveFromSlice(arr []string, item string) []string

func RunGitCommand

func RunGitCommand(suppress bool, args ...string) error

func ShouldFileBeWalked

func ShouldFileBeWalked(path string) (bool, error)

func StringArrayContains

func StringArrayContains(arr []string, item string) bool

Types

type Attribute

type Attribute struct {
	Value    string `json:"value"`
	EyesOnly bool   `json:"eyesonly"`
	File     bool   `json:"file"`
}

type AttributeMap

type AttributeMap map[string]*Attribute

func (AttributeMap) EyesOnlyCount

func (m AttributeMap) EyesOnlyCount() int

func (AttributeMap) FindFirstEyesOnly

func (m AttributeMap) FindFirstEyesOnly() string

type MasterKey

type MasterKey struct {
	Comment   string `json:"comment"`
	CreatedOn int    `json:"created_on"`
	Salt      string `json:"salt"`
	Nonce     string `json:"nonce"`
	Data      string `json:"data"`
}

type Secret

type Secret struct {
	Salt  string `json:"salt"`
	Nonce string `json:"nonce"`
	Data  string `json:"data"`
}

type VaultMeta

type VaultMeta struct {
	UUID       string      `json:"uuid"`
	MasterKeys []MasterKey `json:"master_keys"`
}

Jump to

Keyboard shortcuts

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