store

package
v0.0.0-...-0325638 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliasHasNoOverlap

func AliasHasNoOverlap(alias string) bool

func ArrayToJsonArray

func ArrayToJsonArray(arr []string) (string, error)

func JsonArrayToArray

func JsonArrayToArray(jsonArr string) ([]string, error)

Types

type Alias

type Alias struct {
	Name    string
	Command []string
}

type Result

type Result struct {
	Command  []string
	Executed time.Time
}

type Store

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

func New

func New() (*Store, error)

func (*Store) AddAlias

func (s *Store) AddAlias(cmd []string, alias string) error

func (*Store) AddHistory

func (s *Store) AddHistory(command []string) error

func (*Store) GenerateNewAlises

func (s *Store) GenerateNewAlises(window time.Duration, amount int) error

func (*Store) GetAliases

func (s *Store) GetAliases() ([]Alias, error)

func (*Store) GetHistory

func (s *Store) GetHistory() ([]Result, error)

func (*Store) HasAliasWithCommand

func (s *Store) HasAliasWithCommand(jsonArr string) (bool, error)

Jump to

Keyboard shortcuts

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