Documentation
¶
Index ¶
- Constants
- func GetLastHistoryLineNum(ctx context.Context, screenId string) (int, error)
- func GetLineCmdsFromHistoryItems(ctx context.Context, historyItems []*HistoryItemType) ([]*sstore.LineType, []*sstore.CmdType, error)
- func InsertHistoryItem(ctx context.Context, hitem *HistoryItemType) error
- func PurgeHistoryByIds(ctx context.Context, historyIds []string) error
- type HistoryInfoType
- type HistoryItemType
- type HistoryQueryOpts
- type HistoryQueryResult
- type HistoryViewData
Constants ¶
View Source
const DefaultMaxHistoryItems = 1000
View Source
const HistoryCols = "" /* 206-byte string literal not displayed */
View Source
const HistoryQueryChunkSize = 1000
Variables ¶
This section is empty.
Functions ¶
func GetLastHistoryLineNum ¶
func InsertHistoryItem ¶
func InsertHistoryItem(ctx context.Context, hitem *HistoryItemType) error
Types ¶
type HistoryInfoType ¶
type HistoryInfoType struct {
HistoryType string `json:"historytype"`
SessionId string `json:"sessionid,omitempty"`
ScreenId string `json:"screenid,omitempty"`
Items []*HistoryItemType `json:"items"`
Show bool `json:"show"`
}
func (HistoryInfoType) GetType ¶
func (HistoryInfoType) GetType() string
type HistoryItemType ¶
type HistoryItemType struct {
HistoryId string `json:"historyid"`
Ts int64 `json:"ts"`
UserId string `json:"userid"`
SessionId string `json:"sessionid"`
ScreenId string `json:"screenid"`
LineId string `json:"lineid"`
HadError bool `json:"haderror"`
CmdStr string `json:"cmdstr"`
Remote sstore.RemotePtrType `json:"remote"`
IsMetaCmd bool `json:"ismetacmd"`
ExitCode *int64 `json:"exitcode,omitempty"`
DurationMs *int64 `json:"durationms,omitempty"`
FeState sstore.FeStateType `json:"festate,omitempty"`
Tags map[string]bool `json:"tags,omitempty"`
LineNum int64 `json:"linenum" dbmap:"-"`
Status string `json:"status"`
// only for updates
Remove bool `json:"remove" dbmap:"-"`
// transient (string because of different history orderings)
HistoryNum string `json:"historynum" dbmap:"-"`
}
func GetHistoryItemByLineNum ¶
func (*HistoryItemType) FromMap ¶
func (h *HistoryItemType) FromMap(m map[string]interface{}) bool
func (*HistoryItemType) ToMap ¶
func (h *HistoryItemType) ToMap() map[string]interface{}
type HistoryQueryOpts ¶
type HistoryQueryResult ¶
type HistoryQueryResult struct {
MaxItems int
Items []*HistoryItemType
Offset int // the offset shown to user
RawOffset int // internal offset
HasMore bool
NextRawOffset int // internal offset used by pager for next query
// contains filtered or unexported fields
}
func GetHistoryItems ¶
func GetHistoryItems(ctx context.Context, opts HistoryQueryOpts) (*HistoryQueryResult, error)
type HistoryViewData ¶
Click to show internal directories.
Click to hide internal directories.