cli

package
v0.0.0-...-d06d904 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Blue = "\033[34m"
View Source
var CliContext godoo.ICliContext
View Source
var Cyan = "\033[36m"
View Source
var Gray = "\033[37m"
View Source
var Green = "\033[32m"
View Source
var Purple = "\033[35m"
View Source
var Red = "\033[31m"
View Source
var Reset = "\033[0m"
View Source
var White = "\033[97m"
View Source
var Yellow = "\033[33m"

Functions

This section is empty.

Types

type AddCommand

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

AddCommand implements the ICommand interface and lets the user add new items to storage

func NewAddCommand

func NewAddCommand(config *godoo.ConfigVals) *AddCommand

Returns a new AddCommand, but also sets up the flagset and parser

func (*AddCommand) BuildItemFromInput

func (aCmd *AddCommand) BuildItemFromInput() (godoo.TodoItem, error)

Populates a godoo.TodoItem with user-supplied data for transer to database

func (*AddCommand) ParseInput

func (aCmd *AddCommand) ParseInput() error

ParseInput implements method from ICommand interface

func (*AddCommand) Run

func (aCmd *AddCommand) Run(w io.Writer) error

Run implements method from ICommand interface

type EditCommand

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

func NewEditCommand

func NewEditCommand(conf *godoo.ConfigVals) *EditCommand

Sets up flag info & parser before returning a new edit comman

func (*EditCommand) BuildItemFromInput

func (eCmd *EditCommand) BuildItemFromInput() (godoo.TodoItem, error)

Populates a godoo.TodoItem with user-supplied data to pass to database for querying/editing

func (*EditCommand) DetermineQueryType

func (eCmd *EditCommand) DetermineQueryType(qType godoo.QueryType) ([]godoo.UserQueryOption, error)

Interprets user input to determine intentions in both the search and edit portions of input. If no edit options provided, returns error.

func (*EditCommand) ParseInput

func (eCmd *EditCommand) ParseInput() error

ParseInput implements method from ICommand interface

func (*EditCommand) Run

func (eCmd *EditCommand) Run(w io.Writer) error

Implements ICommand Run() method

type GetCommand

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

func NewGetCommand

func NewGetCommand(c *godoo.ConfigVals) *GetCommand

Returns new get command after setting up flag info and flag-parser

func (*GetCommand) BuildItemFromInput

func (gCmd *GetCommand) BuildItemFromInput() (godoo.TodoItem, error)

Populates a godoo.TodoItem with user-supplied data to query database

func (*GetCommand) DetermineQueryType

func (gCmd *GetCommand) DetermineQueryType(qType godoo.QueryType) ([]godoo.UserQueryOption, error)

Determines the different elements by which the user is searching for an item

func (*GetCommand) ParseInput

func (g *GetCommand) ParseInput() error

ParseInput implements method from ICommand interface

func (*GetCommand) Run

func (gCmd *GetCommand) Run(w io.Writer) error

Implements Run() method from ICommand interface

type InstanceTypeNotRecognised

type InstanceTypeNotRecognised struct{}

type InvalidArgumentError

type InvalidArgumentError struct{}

func (*InvalidArgumentError) Error

func (i *InvalidArgumentError) Error() string

type NoEditInstructionsError

type NoEditInstructionsError struct{}

func (*NoEditInstructionsError) Error

func (n *NoEditInstructionsError) Error() string

type UnableToDetermineQueryTypeError

type UnableToDetermineQueryTypeError struct{}

func (*UnableToDetermineQueryTypeError) Error

Jump to

Keyboard shortcuts

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