cmd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 11 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(ctx context.Context, word string) ([]dictionary.Definition, error)
}

type VocabRepo

type VocabRepo interface {
	AddWordsToList(ctx context.Context, words []string) ([]string, error)
	RemoveWordsFromList(ctx context.Context, words []string) ([]string, error)
	GetWordsInList(ctx context.Context) ([]string, error)
}

Jump to

Keyboard shortcuts

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