ctx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Key = KeyType{}

Functions

func AssertAutoSychronization

func AssertAutoSychronization(c *cli.Context) error

func AssertSave

func AssertSave(c *cli.Context) (err error)

func AssertSychronization

func AssertSychronization(c *cli.Context) error

func ChainedContext

func ChainedContext(functions ...func(c *cli.Context) error) func(c *cli.Context) error

func LocalConfigRequired added in v0.1.0

func LocalConfigRequired(c *cli.Context) (err error)

LocalConfigRequired Assert configuration exists and is valid

func OptionalId

func OptionalId(c *cli.Context) error

OptionalId Asserts that the ID is valid and exists in the collection

func RequiredTodoId added in v0.1.0

func RequiredTodoId(c *cli.Context) error

RequiredTodoId Asserts that the ID is valid and exists in the collection

Types

type Context

type Context struct {
	DataFolder          string
	LocalConfigFile     string
	LocalCollectionFile string
	LocalConfig         *config.LocalConfig
	Collection          *todo.Collection
	Error               error
	ExitMessage         string
	ExitWarning         bool
	Id                  int // Id is the first argument that is a number
	CurrentToDo         *todo.Item
	Args                []string // Args is the list of arguments that are not numbers
	ErrorPrefix         string
}

func ContextFromCli

func ContextFromCli(c *cli.Context) *Context

func ContextFromCtx

func ContextFromCtx(c *cli.Context) *Context

func (*Context) GistSync added in v0.1.0

func (config *Context) GistSync() (log []string, err error)

func (*Context) SetExitError added in v0.1.0

func (ctx *Context) SetExitError(err error, format string, args ...interface{}) error

SetExitError sets the error and the exit message.

func (*Context) SetExitSuccess added in v0.1.0

func (ctx *Context) SetExitSuccess(format string, args ...interface{}) error

func (*Context) SetExitWarning added in v0.1.0

func (ctx *Context) SetExitWarning(format string, args ...interface{}) error

type KeyType added in v0.1.0

type KeyType struct{}

Jump to

Keyboard shortcuts

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