history

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const VersionMdKey = "version"

Variables

This section is empty.

Functions

func DebugDBFileError

func DebugDBFileError() error

func GetHistoryDBFileName

func GetHistoryDBFileName() (string, error)

func GetLocalIpAddr

func GetLocalIpAddr() string

func HistoryDisabledFile added in v0.5.0

func HistoryDisabledFile() bool

func InsertHistoryItem

func InsertHistoryItem(item *HistoryItem) error

func ReNumberHistory

func ReNumberHistory() error

func RemoveDB

func RemoveDB() error

func RemoveHistoryItems

func RemoveHistoryItems(removeAll bool, startId int, endId int) (int, error)

returns (numRemoved, error)

func UpdateHistoryItem

func UpdateHistoryItem(item *HistoryItem) error

Types

type HistoryEnv added in v0.4.0

type HistoryEnv struct {
	Cwd        string
	ProjectDir string
}

func MakeHistoryEnv added in v0.4.0

func MakeHistoryEnv() HistoryEnv

does not return errors

func (HistoryEnv) TruncatePath added in v0.4.0

func (henv HistoryEnv) TruncatePath(fullPath string) string

type HistoryItem

type HistoryItem struct {
	HistoryId       int64
	Ts              int64
	ScVersion       string
	ProjectDir      string // set if playbook file is relative to project root
	ProjectName     string // set if playbook file is relative to project root
	PlaybookFile    string // can have prefix "^" or "." (".." will be resolved away)
	PlaybookCommand string
	ScriptType      string // language
	Metadata        string
	Cwd             string
	HostName        string
	IpAddr          string
	SysUser         string
	CmdLine         string
	DurationMs      sql.NullInt64 // update
	ExitCode        sql.NullInt64 // update
}

func BuildHistoryItem

func BuildHistoryItem() *HistoryItem

func QueryHistory

func QueryHistory(query HistoryQuery) ([]*HistoryItem, error)

func (*HistoryItem) CompactString

func (item *HistoryItem) CompactString(henv HistoryEnv) string

func (*HistoryItem) DecodeCmdLine

func (item *HistoryItem) DecodeCmdLine() []string

func (*HistoryItem) EncodeCmdLine

func (item *HistoryItem) EncodeCmdLine(args []string)

func (*HistoryItem) FullString

func (item *HistoryItem) FullString(henv HistoryEnv) string

func (*HistoryItem) MarshalJSON

func (item *HistoryItem) MarshalJSON() ([]byte, error)

func (*HistoryItem) ScriptString

func (item *HistoryItem) ScriptString(henv HistoryEnv) string

type HistoryQuery

type HistoryQuery struct {
	ShowAll bool
	ShowNum int
}

Jump to

Keyboard shortcuts

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