models

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetShellHistoryInBytes

func GetShellHistoryInBytes() ([]byte, error)

func WriteLocalShellHistory

func WriteLocalShellHistory(shellHistory ShellHistory, shell Shell) error

Types

type BashShell

type BashShell struct{}

func (BashShell) DecodeHistoryItem

func (b BashShell) DecodeHistoryItem(encodedHistoryString string) (HistoryItem, error)

func (BashShell) EncodeHistoryItem

func (b BashShell) EncodeHistoryItem(historyItem HistoryItem) string

func (BashShell) GetShellHistoryFromBytes

func (b BashShell) GetShellHistoryFromBytes(shellHistory []byte) (ShellHistory, error)

type HistoryItem

type HistoryItem struct {
	Command   string `json:"command"`
	TimeStamp int    `json:"time_stamp"`
}

type Shell

type Shell interface {
	EncodeHistoryItem(item HistoryItem) string
	DecodeHistoryItem(encodedHistoryItem string) (HistoryItem, error)
	GetShellHistoryFromBytes(historyBytes []byte) (ShellHistory, error)
}

type ShellHistory

type ShellHistory struct {
	History []HistoryItem
}

func GetShellHistory

func GetShellHistory(shell Shell) (ShellHistory, error)

func MergeShellHistories

func MergeShellHistories(shellHistoryOne ShellHistory, shellHistoryTwo ShellHistory) ShellHistory

func (ShellHistory) ConvertToString

func (s ShellHistory) ConvertToString(shell Shell) string

func (ShellHistory) GetLatestUpdatedTime

func (s ShellHistory) GetLatestUpdatedTime() int

type ShellHistoryGist

type ShellHistoryGist struct {
	Context context.Context
	Client  *github.Client
}

func NewShellHistoryGist

func NewShellHistoryGist() (ShellHistoryGist, error)

func (ShellHistoryGist) ConvertToJSONStringForGist

func (s ShellHistoryGist) ConvertToJSONStringForGist(history ShellHistory) string

func (ShellHistoryGist) CreateShellHistoryGist

func (s ShellHistoryGist) CreateShellHistoryGist(shellHistory ShellHistory) error

func (ShellHistoryGist) GetShellHistoryFromGist

func (s ShellHistoryGist) GetShellHistoryFromGist() (ShellHistory, error)

func (ShellHistoryGist) GetShellHistoryFromJSONString

func (s ShellHistoryGist) GetShellHistoryFromJSONString(shellHistoryStr string) (ShellHistory, error)

func (ShellHistoryGist) GetShellHistoryGistObject

func (s ShellHistoryGist) GetShellHistoryGistObject(content string) github.Gist

func (ShellHistoryGist) ShellHistoryGistDetails

func (s ShellHistoryGist) ShellHistoryGistDetails() *github.Gist

func (ShellHistoryGist) UpsertShellHistoryGist

func (s ShellHistoryGist) UpsertShellHistoryGist(shellHistory ShellHistory) error

type ZSHShell

type ZSHShell struct{}

func (ZSHShell) DecodeHistoryItem

func (z ZSHShell) DecodeHistoryItem(encodedHistoryString string) (HistoryItem, error)

func (ZSHShell) EncodeHistoryItem

func (z ZSHShell) EncodeHistoryItem(historyItem HistoryItem) string

func (ZSHShell) GetShellHistoryFromBytes

func (z ZSHShell) GetShellHistoryFromBytes(shellHistory []byte) (ShellHistory, error)

Jump to

Keyboard shortcuts

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