Documentation ¶
Index ¶
- type GetCommandsMode
- type HistoryEntry
- func (he HistoryEntry) GetCommand() string
- func (he HistoryEntry) GetFormattedTime(env *environments.Environment) string
- func (he HistoryEntry) GetNumber() uint
- func (he HistoryEntry) GetTime() *time.Time
- func (he HistoryEntry) GetTimestamp() int64
- func (he HistoryEntry) GetTraceName() string
- func (he HistoryEntry) HasHistory() bool
- func (he HistoryEntry) String() string
- func (he HistoryEntry) ToString(env *environments.Environment) string
- type Keeper
- type Parser
- type ShellSpecificParser
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 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.