historyentries

package
v0.0.0-...-2de8f8b Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2015 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 GetCommandsMode

type GetCommandsMode uint8

GetCommandsMode defines the mode GetCommands has to work.

const (
	GetCommandsAll GetCommandsMode = iota
	GetCommandsRange
	GetCommandsSingle
	GetCommandsPrecise
)

Defines a list of possible GetCommandsMode variants.

type HistoryEntry

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

HistoryEntry stores a command with its context.

func (HistoryEntry) GetCommand

func (he HistoryEntry) GetCommand() string

GetCommand returns a command line which was executed.

func (HistoryEntry) GetFormattedTime

func (he HistoryEntry) GetFormattedTime(env *environments.Environment) string

GetFormattedTime returns formatted time stamp of the history entry.

func (HistoryEntry) GetNumber

func (he HistoryEntry) GetNumber() uint

GetNumber returns a history number (may be executed with ! later).

func (HistoryEntry) GetTime

func (he HistoryEntry) GetTime() *time.Time

GetTime returns a time structure of the history entry.

func (HistoryEntry) GetTimestamp

func (he HistoryEntry) GetTimestamp() int64

GetTimestamp returns a timestamp of the history entry.

func (HistoryEntry) GetTraceName

func (he HistoryEntry) GetTraceName() string

GetTraceName returns a trace name of the history entry.

func (HistoryEntry) HasHistory

func (he HistoryEntry) HasHistory() bool

HasHistory tells if history entry has a trace stored.

func (HistoryEntry) String

func (he HistoryEntry) String() string

String makes a string representation of the structure

func (HistoryEntry) ToString

func (he HistoryEntry) ToString(env *environments.Environment) string

ToString converts history entry to the string representation according to the environment setting.

type Keeper

type Keeper interface {
	Init() *HistoryEntry
	Commit(*HistoryEntry, chan *HistoryEntry) *HistoryEntry
	Continue() bool
	Result() interface{}
}

Keeper stores history entries with some own strategy. Please use getKeeper to get a proper implementation.

func GetCommands

func GetCommands(mode GetCommandsMode, filter *utils.Regexp, env *environments.Environment, varargs ...int) (commands Keeper, err error)

GetCommands returns a keeper for the commands based on given mode and regular expression. varargs is the auxiliary list of numbers which makes sense in the context of GetCommandsMode setting only.

type Parser

type Parser func(Keeper, *bufio.Scanner, *utils.Regexp, chan *HistoryEntry) (Keeper, error)

Parser is a signature for a function which parses file and returns a Keeper.

type ShellSpecificParser

type ShellSpecificParser func(Keeper, string, uint, *HistoryEntry, *utils.Regexp, chan *HistoryEntry) (bool, uint, *HistoryEntry)

ShellSpecificParser is a signature for a function which implements shell specific logic for parsing.

Jump to

Keyboard shortcuts

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