models

package
v0.0.0-...-7e86dca Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BucketName = "history"

Variables

Functions

func ClearDB

func ClearDB() error

func DB

func DB() (*bolt.DB, error)

Types

type Histories

type Histories []History

func AllHistories

func AllHistories() (Histories, error)

func GetHistories

func GetHistories(args []string) (Histories, error)

func (Histories) Len

func (a Histories) Len() int

func (Histories) Less

func (a Histories) Less(i, j int) bool

func (Histories) Swap

func (a Histories) Swap(i, j int)

type History

type History struct {
	ID       uint64    `json:"id"`
	Time     time.Time `json:"time"`
	CmdArgs  []string  `json:"cmd"`
	Results  string    `json:"results"`
	Error    string    `json:"error"`
	ExitCode int       `json:"exit_code"`
}

func LastHistory

func LastHistory() (History, error)

func (History) Bytes

func (h History) Bytes() []byte

func (History) Print

func (h History) Print()

func (History) PrintShort

func (h History) PrintShort()

func (History) PrintShortVerbose

func (h History) PrintShortVerbose()

func (*History) Save

func (h *History) Save() error

func (History) String

func (h History) String() string

func (History) TimeString

func (h History) TimeString() string

func (History) Verdict

func (h History) Verdict() string

Jump to

Keyboard shortcuts

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