cmd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddCommand

func NewAddCommand(cfg *Config) *cobra.Command

NewAddCommand constructs the add command

func NewDefineCommand

func NewDefineCommand(cfg *Config) *cobra.Command

NewDefineCommand constructs the define command

func NewListCommand

func NewListCommand(cfg *Config) *cobra.Command

NewListCommand constructs the list command

func NewRemoveCommand

func NewRemoveCommand(cfg *Config) *cobra.Command

NewRemoveCommand constructs the remove command

func NewRootCmd

func NewRootCmd(cfg *Config) *cobra.Command

NewRootCmd creates and returns an instance of the root command

Types

type Config

type Config struct {
	Out   io.Writer
	Vocab VocabRepo
	Dict  Definer
}

Config represents the CLI configuration

type Definer

type Definer interface {
	Define(word string) ([]dictionary.Definition, error)
}

type VocabRepo

type VocabRepo interface {
	Load() (vocab.List, error)
	Save(vl vocab.List) error
}

Jump to

Keyboard shortcuts

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