ventry

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entries

type Entries map[string]*Vers

Entries one or more versions.

type Rollback added in v0.1.2

type Rollback map[string]Vers

Rollback is how we keep a history (for now a single item)

type VEntry

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

Vers is a file locked instance of entries

func Open

func Open(path string, creat bool) (*VEntry, error)

Open a version entries file.

func (*VEntry) Add

func (v *VEntry) Add(name string, ent *Vers)

Add will update/add an entry

func (*VEntry) Bump

func (v *VEntry) Bump(name, what string) error

Bump will inc the value of version field

func (*VEntry) Close

func (v *VEntry) Close()

Unlock and close file

func (*VEntry) Delete

func (v *VEntry) Delete(name string) error

Delete will remove the entry

func (*VEntry) Dump

func (v *VEntry) Dump(format string) error

Dump will dump entries

func (*VEntry) LPath

func (v *VEntry) LPath() string

LPath returns the current lock file path

func (*VEntry) Path

func (v *VEntry) Path() string

Path returns the current path

func (*VEntry) Print

func (v *VEntry) Print(name, format string) error

Print will dump name(d) entries

func (*VEntry) Read

func (v *VEntry) Read(retry int) error

Read reads the entries file, populates the hash

func (*VEntry) Rm

func (v *VEntry) Rm(name string)

Rm will remove an entry

func (*VEntry) Undo added in v0.1.2

func (v *VEntry) Undo(name string) error

Undo restore previous value

func (*VEntry) Write

func (v *VEntry) Write(retry int) error

Write will write the entries to stable store.

type VFile added in v0.1.2

type VFile struct {
	Version Entries
	Prev    Rollback
}

VFile represents the format we write to the version file it has the current version and a history/rollback hash and array

type Vers

type Vers struct {
	Tag    string
	Prefix string
	Suffix string
	Major  int
	Minor  int
	Patch  int
}

Vers tracks single program version.

Jump to

Keyboard shortcuts

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