Documentation ¶
Index ¶
- func AddCheckpoint(name string, path string) error
- func ChangeDirectory(name string) (string, error)
- func CleanArgs(args []string, flags Flags) (string, error)
- func DestroyDatabase() error
- func ErrorHandler(err error)
- func FetchCheckpoint(name string) (string, error)
- func GetCurrentDirectory() (string, error)
- func GetDatabase() (*leveldb.DB, error)
- func GetDatabasePath() (string, error)
- func GetFolder(name string) (string, error)
- func RemoveCheckpoint(name string) (string, error)
- func WriteToConsole(msgs []string, code int)
- func WriteToTable(checkpoints Checkpoints)
- type Checkpoint
- type Checkpoints
- type Flags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCheckpoint ¶
AddCheckpoint adds a single key value pair in the form of name and path of a checkpoint to the database
func ChangeDirectory ¶
ChangeDirectory is a wrapper function for fetch checkpoint which either changes the path or fetches the path from the database
func DestroyDatabase ¶
func DestroyDatabase() error
DestroyDatabase removes the directory where the leveldb stores the checkpoints
func ErrorHandler ¶
func ErrorHandler(err error)
ErrorHandler used to handle the errors encountered by the CLI
func FetchCheckpoint ¶
FetchCheckpoint return the string path of a checkpoint in the database
func GetCurrentDirectory ¶
GetCurrentDirectory is used to return the directory from where the CLI was called
func GetDatabase ¶
GetDatabase returns a levelDB object that can be used to access the database
func GetDatabasePath ¶
GetDatabasePath return the path of the database
func RemoveCheckpoint ¶
RemoveCheckpoint removes a single checkpoint from the database
func WriteToConsole ¶
WriteToConsole writes to the console with the given code
func WriteToTable ¶
func WriteToTable(checkpoints Checkpoints)
WriteToTable takes a list of checkpoints and displays them in table format
Types ¶
type Checkpoint ¶
Checkpoint is used to hold context for the data
type Checkpoints ¶
type Checkpoints []Checkpoint
Checkpoints is a slice of checkpoint
func ShowCheckpoints ¶
func ShowCheckpoints() (Checkpoints, error)
ShowCheckpoints return a list of all the checkpoints