Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type LocalStorage
- func (s *LocalStorage) Cleanup() error
- func (s *LocalStorage) GetHistory(limit int) ([]string, error)
- func (s *LocalStorage) GetHistoryIndex() (int, error)
- func (s *LocalStorage) GetIdFromSession(index int) (string, error)
- func (s *LocalStorage) GetMeasurements() ([]byte, error)
- func (s *LocalStorage) GetProfile() *Profile
- func (s *LocalStorage) Init(dirName string) error
- func (s *LocalStorage) LoadConfig() (*Config, error)
- func (s *LocalStorage) Migrate() error
- func (s *LocalStorage) Remove() error
- func (s *LocalStorage) SaveCommandToHistory(index string, time int64, ids string, cmd string) error
- func (s *LocalStorage) SaveConfig() error
- func (s *LocalStorage) SaveIdToSession(id string) error
- func (s *LocalStorage) UpdateSessionDir() error
- type MigrationFunc
- type Profile
Constants ¶
View Source
const ( // <version>|<index>|<time>|<id>|<command> HistoryItemVersion1 string = "1" )
Variables ¶
View Source
var ( ErrNoPreviousMeasurements = errors.New("no previous measurements found") ErrInvalidIndex = errors.New("invalid index") ErrIndexOutOfRange = errors.New("index out of range") )
View Source
var (
ErrReadHistory = errors.New("failed to read history")
)
Functions ¶
This section is empty.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
func NewLocalStorage ¶
func NewLocalStorage(utils utils.Utils) *LocalStorage
func (*LocalStorage) Cleanup ¶ added in v1.4.2
func (s *LocalStorage) Cleanup() error
func (*LocalStorage) GetHistory ¶ added in v1.4.2
func (s *LocalStorage) GetHistory(limit int) ([]string, error)
func (*LocalStorage) GetHistoryIndex ¶ added in v1.4.2
func (s *LocalStorage) GetHistoryIndex() (int, error)
func (*LocalStorage) GetIdFromSession ¶ added in v1.4.2
func (s *LocalStorage) GetIdFromSession(index int) (string, error)
Returns the measurement ID at the given index from the session history
func (*LocalStorage) GetMeasurements ¶ added in v1.4.2
func (s *LocalStorage) GetMeasurements() ([]byte, error)
func (*LocalStorage) GetProfile ¶
func (s *LocalStorage) GetProfile() *Profile
func (*LocalStorage) Init ¶
func (s *LocalStorage) Init(dirName string) error
func (*LocalStorage) LoadConfig ¶
func (s *LocalStorage) LoadConfig() (*Config, error)
func (*LocalStorage) Migrate ¶ added in v1.4.2
func (s *LocalStorage) Migrate() error
func (*LocalStorage) Remove ¶
func (s *LocalStorage) Remove() error
func (*LocalStorage) SaveCommandToHistory ¶ added in v1.4.2
func (*LocalStorage) SaveConfig ¶
func (s *LocalStorage) SaveConfig() error
func (*LocalStorage) SaveIdToSession ¶ added in v1.4.2
func (s *LocalStorage) SaveIdToSession(id string) error
func (*LocalStorage) UpdateSessionDir ¶ added in v1.4.2
func (s *LocalStorage) UpdateSessionDir() error
type MigrationFunc ¶ added in v1.4.2
type MigrationFunc func() error
type Profile ¶
type Profile struct {
Token *globalping.Token `json:"token"`
}
Click to show internal directories.
Click to hide internal directories.