Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteScript(alias string, store ScriptStore) error
- func EditScript(alias string, store ScriptStore) (*models.DocumentedScript, error)
- func GetRecentHistory(n int, allSessions bool, store HistoryGetter) (lines []models.HistoryRecord, err error)
- func GetStore(readonly bool) *database.BoltDB
- func IgnoreCommand(command string, store IgnoreStore) error
- func IgnoreHistory(lineCount int, allVariations, remove bool, store IgnoreStore) error
- func ImportHistory(store HistoryStore) error
- func MarshalEdit(s models.DocumentedScript) []byte
- func QueryHistory(regex string, all bool, store HistoryStore) (lines []models.HistoryRecord, err error)
- func QueryScripts(query string, store ScriptStore) (scripts []models.DocumentedScript, err error)
- func RandomID() (id []byte)
- func RestoreScript(alias string, store ScriptStore) (*models.DocumentedScript, error)
- func RunScript(ctx context.Context, script models.DocumentedScript, args []string, ...) error
- func SaveHistory(line string, dupeCount int, store HistoryStore) (promptDoc bool, err error)
- func SaveScript(toSave models.DocumentedScript, overwrite bool, store ScriptStore) (err error)
- func ShouldIgnore(command string, store IgnoreChecker) bool
- func UnmarshalEdit(contents, originalShell string) (ds models.DocumentedScript, err error)
- func UnmarshalLine(line string, ds *models.DocumentedScript) (processed bool)
- type Closable
- type HistoryGetter
- type HistoryStore
- type IgnoreChecker
- type IgnoreStore
- type ScriptStore
Constants ¶
View Source
const Header = "exported from COACH - https://github.com/alittlebrighter/coach"
Variables ¶
View Source
var (
DBPath string
)
Functions ¶
func DeleteScript ¶ added in v1.2.0
func DeleteScript(alias string, store ScriptStore) error
func EditScript ¶
func EditScript(alias string, store ScriptStore) (*models.DocumentedScript, error)
func GetRecentHistory ¶
func GetRecentHistory(n int, allSessions bool, store HistoryGetter) (lines []models.HistoryRecord, err error)
func IgnoreCommand ¶ added in v1.2.0
func IgnoreCommand(command string, store IgnoreStore) error
func IgnoreHistory ¶ added in v1.2.0
func IgnoreHistory(lineCount int, allVariations, remove bool, store IgnoreStore) error
func ImportHistory ¶ added in v1.2.0
func ImportHistory(store HistoryStore) error
func MarshalEdit ¶
func MarshalEdit(s models.DocumentedScript) []byte
func QueryHistory ¶ added in v1.3.0
func QueryHistory(regex string, all bool, store HistoryStore) (lines []models.HistoryRecord, err error)
func QueryScripts ¶
func QueryScripts(query string, store ScriptStore) (scripts []models.DocumentedScript, err error)
func RestoreScript ¶ added in v1.2.0
func RestoreScript(alias string, store ScriptStore) (*models.DocumentedScript, error)
func SaveHistory ¶
func SaveHistory(line string, dupeCount int, store HistoryStore) (promptDoc bool, err error)
func SaveScript ¶
func SaveScript(toSave models.DocumentedScript, overwrite bool, store ScriptStore) (err error)
func ShouldIgnore ¶ added in v1.2.0
func ShouldIgnore(command string, store IgnoreChecker) bool
func UnmarshalEdit ¶
func UnmarshalEdit(contents, originalShell string) (ds models.DocumentedScript, err error)
func UnmarshalLine ¶ added in v1.2.0
func UnmarshalLine(line string, ds *models.DocumentedScript) (processed bool)
Types ¶
type HistoryGetter ¶ added in v1.2.0
type HistoryStore ¶
type HistoryStore interface { Save(id []byte, value interface{}, overwrite bool) error SaveBatch(<-chan database.HasID, []byte) <-chan error CheckDupeCmds(string, int) bool PruneHistory(max int) error QueryHistory(regex *regexp.Regexp, user string, all bool) ([]models.HistoryRecord, error) HistoryGetter IgnoreChecker }
type IgnoreChecker ¶ added in v1.2.0
type IgnoreStore ¶ added in v1.2.0
type IgnoreStore interface { IgnoreWord(word, username string) (err error) UnignoreWord(word, username string) (err error) IgnoreCommand(command, username string) (err error) UnignoreCommand(command, username string) (err error) IgnoreChecker HistoryGetter }
type ScriptStore ¶
type ScriptStore interface { Save(id []byte, value interface{}, overwrite bool) error GetScript(id []byte) *models.DocumentedScript QueryScripts(...string) ([]models.DocumentedScript, error) DeleteScript(id []byte) error IgnoreStore Closable }
Click to show internal directories.
Click to hide internal directories.