content

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKeyLoadError added in v0.6.0

func IsKeyLoadError(err error) bool

func IsManifestLoadError added in v0.6.0

func IsManifestLoadError(err error) bool

func MakeDatafilePath

func MakeDatafilePath(ctx Context, filemeta Filemeta) string

Types

type Context added in v0.6.0

type Context struct {
	WorkingPath string   // working dir
	ProjectPath string   // path of the parent for .lockgit
	LockgitPath string   // path to .lockgit
	DataPath    string   // path to .lockgit/data
	ConfigPath  string   // path to .lockgit/data/lgconfig
	Config      LgConfig // Config data

	Key []byte // key bytes loaded from lgconfig (if key is present)
}

func FromPath added in v0.6.0

func FromPath(path string) (Context, error)

Return a Context provided a base to begin traversal from. The context will be from the first .lockgit directory found

func (Context) ImportManifest added in v0.6.0

func (c Context) ImportManifest() (Manifest, error)

func (Context) ProjRelPath added in v0.6.1

func (c Context) ProjRelPath(absPath string) string

func (Context) RelPath added in v0.6.0

func (c Context) RelPath(absPath string) string

type Datafile

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

func NewDatafile

func NewDatafile(ctx Context, absPath string) (Datafile, error)

func ReadDatafile

func ReadDatafile(ctx Context, filemeta Filemeta) (Datafile, error)

func (Datafile) DecodeData

func (d Datafile) DecodeData() ([]byte, error)

func (Datafile) Equal added in v0.8.0

func (d Datafile) Equal(other Datafile) bool

func (Datafile) Id added in v0.8.0

func (d Datafile) Id() []byte

func (Datafile) MatchesCurrent added in v0.8.0

func (d Datafile) MatchesCurrent(filemeta Filemeta) bool

Tests if a potential Datafile update matches the one already in the vault

func (Datafile) Path

func (d Datafile) Path() string

func (Datafile) Perm

func (d Datafile) Perm() int

func (Datafile) Serialize

func (d Datafile) Serialize() []byte

func (Datafile) Write

func (d Datafile) Write(filemeta Filemeta)

type Filemeta

type Filemeta struct {
	AbsPath string
	RelPath string
	Id      []byte
}

Meta data about a secret

func NewFilemeta

func NewFilemeta(absPath string, datafile Datafile) Filemeta

func (Filemeta) IdString added in v0.8.0

func (f Filemeta) IdString() string

func (Filemeta) String

func (f Filemeta) String() string

type KeyLoadError added in v0.6.0

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

func (*KeyLoadError) Error added in v0.6.0

func (err *KeyLoadError) Error() string

type LgConfig added in v0.6.0

type LgConfig struct {
	Ver      int
	Id       string
	Patterns []string
}

func NewLgConfig added in v0.6.0

func NewLgConfig() LgConfig

func ReadConfig added in v0.6.0

func ReadConfig(ctx Context) (LgConfig, error)

func (*LgConfig) AddPattern added in v0.7.0

func (c *LgConfig) AddPattern(pattern string) bool

func (LgConfig) FindPattern added in v0.7.0

func (c LgConfig) FindPattern(path string) int

func (*LgConfig) RemovePattern added in v0.7.0

func (c *LgConfig) RemovePattern(pattern string) bool

func (LgConfig) Write added in v0.6.0

func (config LgConfig) Write(path string)

type Manifest

type Manifest struct {
	Files []Filemeta
	// contains filtered or unexported fields
}

func ImportManifest

func ImportManifest(ctx Context) (Manifest, error)

func (*Manifest) Add

func (m *Manifest) Add(filemeta Filemeta)

func (Manifest) Export

func (m Manifest) Export()

func (Manifest) Find

func (m Manifest) Find(projRelPath string) int

type ManifestLoadError added in v0.6.0

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

func (*ManifestLoadError) Error added in v0.6.0

func (err *ManifestLoadError) Error() string

Jump to

Keyboard shortcuts

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