professor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSourceNotSet error = errors.New("source not set")

ErrSourceNotSet thrown when the source is not set.

Functions

This section is empty.

Types

type OptFunc

type OptFunc func(profe *Professor)

OptFunc used for setting optional configs.

type Professor

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

Professor handles the explanation of commands.

func New

func New(source Source, logger *slog.Logger, opts ...OptFunc) Professor

New returns a new Professor.

func (Professor) Explain

func (p Professor) Explain(ctx context.Context, cmd command.Command) (string, error)

Explain the passed command. If the source is not set, then it will return ErrSourceNotSet.

type Source

type Source interface {
	Prompt(context.Context, string) (string, error)
}

Source is the source of information for the professor.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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