Documentation
¶
Index ¶
- func AggregateMessages(out OutputChannel, messages []OutputMessage)
- func EnsureLineBreak(out OutputChannel)
- func FormatUsage(spec CommandSpec) string
- func RegisterCommand(factory CommandFactory)
- func RegisterContext(name, description string, opts ...ContextOption)
- func RegisterLegacyCommand(ctx string, cmd LegacyCommand)
- func ResetEngine(options ...Option)
- func Run(rl *readline.Instance) error
- func SetHelpHeader(header string)
- func SetOutputLevel(level OutputLevel)
- func SetOutputWriter(w io.Writer) io.Writer
- func SetPrompt(prompt string)
- func UseMiddleware(mw ...Middleware)
- type ArgSpec
- type ArgType
- type ArgsParser
- type Command
- type CommandEntry
- type CommandError
- type CommandFactory
- type CommandInput
- type CommandRegistry
- func (r *CommandRegistry) Commands(ctx string, includeHidden bool) []CommandSpec
- func (r *CommandRegistry) Context(name string) (ContextSpec, bool)
- func (r *CommandRegistry) Contexts(includeHidden bool) []ContextSpec
- func (r *CommandRegistry) LoadPlugins(dir string) error
- func (r *CommandRegistry) NamespaceCommands(namespace string) []CommandSpec
- func (r *CommandRegistry) RegisterCommand(factory CommandFactory)
- func (r *CommandRegistry) RegisterContext(spec ContextSpec)
- func (r *CommandRegistry) Resolve(ctx, name string) (CommandEntry, bool)
- func (r *CommandRegistry) ResolveContextName(name string) (string, bool)
- func (r *CommandRegistry) UnregisterCommand(ctx, name string)
- type CommandRegistryWriter
- type CommandResult
- type CommandRuntime
- type CommandSpec
- type CommandStatus
- type ContextManager
- func (m *ContextManager) Current() ExecutionContext
- func (m *ContextManager) Navigate(name string, payload any) error
- func (m *ContextManager) Pop() error
- func (m *ContextManager) PopToRoot() error
- func (m *ContextManager) Prompt(base string) string
- func (m *ContextManager) Push(name string, payload any) error
- func (m *ContextManager) ResolveAliases(name string) (string, bool)
- func (m *ContextManager) Stack() []ExecutionContext
- type ContextOption
- type ContextSpec
- type DefaultOutputChannel
- func (c *DefaultOutputChannel) Buffer() *bytes.Buffer
- func (c *DefaultOutputChannel) Error(msg string)
- func (c *DefaultOutputChannel) Info(msg string)
- func (c *DefaultOutputChannel) Level() OutputLevel
- func (c *DefaultOutputChannel) SetLevel(level OutputLevel)
- func (c *DefaultOutputChannel) Warn(msg string)
- func (c *DefaultOutputChannel) WriteJSON(v any)
- func (c *DefaultOutputChannel) WriteTable(headers []string, rows [][]string)
- func (c *DefaultOutputChannel) Writer() io.Writer
- type Engine
- func (e *Engine) Contexts() *ContextManager
- func (e *Engine) RegisterCommand(factory CommandFactory)
- func (e *Engine) RegisterContext(spec ContextSpec)
- func (e *Engine) Registry() *CommandRegistry
- func (e *Engine) Run(rl *readline.Instance) error
- func (e *Engine) Services() ServiceRegistry
- func (e *Engine) Session() SessionStore
- func (e *Engine) SetHelpHeader(header string)
- func (e *Engine) SetOutputLevel(level OutputLevel)
- func (e *Engine) SetOutputWriter(w io.Writer) io.Writer
- func (e *Engine) SetPrompt(prompt string)
- type Example
- type ExecutionContext
- type FlagSpec
- type LegacyAdapter
- type LegacyCommand
- type MemorySessionStore
- type Middleware
- type NextFunc
- type Option
- type OutputChannel
- type OutputLevel
- type OutputMessage
- type ServiceRegistry
- type SessionStore
- type SeverityLevel
- type SimpleServiceRegistry
- type TaskFunc
- type TaskHandle
- type TaskManager
- type TaskOptions
- type TaskStatus
- type ValueSet
- func (v ValueSet) Bool(name string) bool
- func (v ValueSet) DecodeJSON(name string, dest any) error
- func (v ValueSet) Duration(name string) time.Duration
- func (v ValueSet) Float(name string) float64
- func (v ValueSet) Int(name string) int
- func (v ValueSet) Raw(name string) (any, bool)
- func (v ValueSet) String(name string) string
- func (v ValueSet) Strings(name string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateMessages ¶ added in v1.0.1
func AggregateMessages(out OutputChannel, messages []OutputMessage)
AggregateMessages renders structured messages to an output channel.
func EnsureLineBreak ¶ added in v1.0.2
func EnsureLineBreak(out OutputChannel)
EnsureLineBreak guarantees the next prompt starts on a fresh line.
func FormatUsage ¶ added in v1.0.1
func FormatUsage(spec CommandSpec) string
FormatUsage renders a usage string from command spec.
func RegisterCommand ¶
func RegisterCommand(factory CommandFactory)
RegisterCommand registers a command factory with the default engine.
func RegisterContext ¶
func RegisterContext(name, description string, opts ...ContextOption)
RegisterContext registers a context with optional modifiers.
func RegisterLegacyCommand ¶ added in v1.0.1
func RegisterLegacyCommand(ctx string, cmd LegacyCommand)
RegisterLegacyCommand adapts a legacy command into the new runtime.
func ResetEngine ¶ added in v1.0.1
func ResetEngine(options ...Option)
ResetEngine replaces the default engine (primarily for tests).
func SetHelpHeader ¶
func SetHelpHeader(header string)
SetHelpHeader customises the help header for the default engine.
func SetOutputLevel ¶ added in v1.0.1
func SetOutputLevel(level OutputLevel)
SetOutputLevel adjusts default verbosity for the default engine.
func SetOutputWriter ¶ added in v1.0.1
SetOutputWriter sets the writer used for command output, returning the previous writer.
func SetPrompt ¶
func SetPrompt(prompt string)
SetPrompt customises the base prompt for the default engine.
func UseMiddleware ¶ added in v1.0.1
func UseMiddleware(mw ...Middleware)
UseMiddleware appends middleware to the default engine.
Types ¶
type ArgSpec ¶ added in v1.0.1
type ArgSpec struct {
Name string
Type ArgType
Required bool
Repeatable bool
Description string
Default any
EnumValues []string
}
ArgSpec defines positional argument metadata.
type ArgType ¶ added in v1.0.1
type ArgType string
ArgType enumerates supported argument data types.
type ArgsParser ¶ added in v1.0.1
type ArgsParser struct{}
ArgsParser parses raw args into typed value sets according to specs.
func NewArgsParser ¶ added in v1.0.1
func NewArgsParser() *ArgsParser
NewArgsParser constructs an ArgsParser.
func (*ArgsParser) Parse ¶ added in v1.0.1
func (p *ArgsParser) Parse(raw []string, spec CommandSpec) (ValueSet, ValueSet, error)
Parse parses raw arguments with provided spec metadata.
type Command ¶
type Command interface {
Spec() CommandSpec
Execute(rt CommandRuntime, input CommandInput) CommandResult
}
Command is the primary interface implemented by concrete commands.
type CommandEntry ¶ added in v1.0.1
type CommandEntry struct {
Factory CommandFactory
Spec CommandSpec
}
CommandEntry stores command factory and resolved names.
type CommandError ¶ added in v1.0.1
type CommandError struct {
Err error
Message string
Severity SeverityLevel
Hints []string
Recoverable bool
}
CommandError wraps an error with user facing metadata.
type CommandFactory ¶ added in v1.0.1
type CommandFactory interface {
Spec() CommandSpec
New(rt CommandRuntime) (Command, error)
}
CommandFactory builds command instances with access to runtime services.
func NewLegacyAdapter ¶ added in v1.0.1
func NewLegacyAdapter(cmd LegacyCommand, ctx string) CommandFactory
NewLegacyAdapter creates a CommandFactory from a legacy command.
type CommandInput ¶ added in v1.0.1
type CommandInput struct {
Context context.Context
Raw []string
Args ValueSet
Flags ValueSet
Pipeline any
}
CommandInput contains parsed arguments, flags, and runtime context.
type CommandRegistry ¶ added in v1.0.1
type CommandRegistry struct {
// contains filtered or unexported fields
}
CommandRegistry manages contexts and command registrations.
func NewCommandRegistry ¶ added in v1.0.1
func NewCommandRegistry() *CommandRegistry
NewCommandRegistry constructs a registry.
func (*CommandRegistry) Commands ¶ added in v1.0.1
func (r *CommandRegistry) Commands(ctx string, includeHidden bool) []CommandSpec
Commands returns command names for a context.
func (*CommandRegistry) Context ¶ added in v1.0.1
func (r *CommandRegistry) Context(name string) (ContextSpec, bool)
Context retrieves a context specification.
func (*CommandRegistry) Contexts ¶ added in v1.0.1
func (r *CommandRegistry) Contexts(includeHidden bool) []ContextSpec
Contexts lists registered contexts.
func (*CommandRegistry) LoadPlugins ¶ added in v1.0.1
func (r *CommandRegistry) LoadPlugins(dir string) error
LoadPlugins loads Go plugins from directory.
func (*CommandRegistry) NamespaceCommands ¶ added in v1.0.1
func (r *CommandRegistry) NamespaceCommands(namespace string) []CommandSpec
NamespaceCommands returns commands across contexts matching prefix.
func (*CommandRegistry) RegisterCommand ¶ added in v1.0.1
func (r *CommandRegistry) RegisterCommand(factory CommandFactory)
RegisterCommand registers a command factory.
func (*CommandRegistry) RegisterContext ¶ added in v1.0.1
func (r *CommandRegistry) RegisterContext(spec ContextSpec)
RegisterContext registers a new context spec.
func (*CommandRegistry) Resolve ¶ added in v1.0.1
func (r *CommandRegistry) Resolve(ctx, name string) (CommandEntry, bool)
Resolve finds a command entry for a context.
func (*CommandRegistry) ResolveContextName ¶ added in v1.0.1
func (r *CommandRegistry) ResolveContextName(name string) (string, bool)
ResolveContextName returns canonical context name, considering aliases.
func (*CommandRegistry) UnregisterCommand ¶ added in v1.0.1
func (r *CommandRegistry) UnregisterCommand(ctx, name string)
UnregisterCommand removes a command by name.
type CommandRegistryWriter ¶ added in v1.0.1
type CommandRegistryWriter interface {
RegisterContext(spec ContextSpec)
RegisterCommand(factory CommandFactory)
}
CommandRegistryWriter exposes safe registration subset for plugins.
type CommandResult ¶ added in v1.0.1
type CommandResult struct {
Status CommandStatus
Error *CommandError
Payload any
Messages []OutputMessage
NextContext string
Pipeline any
}
CommandResult conveys the outcome of command execution.
func RecoveryMiddleware ¶ added in v1.0.1
func RecoveryMiddleware(rt CommandRuntime, input CommandInput, entry CommandEntry, next NextFunc) CommandResult
RecoveryMiddleware recovers from panics in commands.
func TimingMiddleware ¶ added in v1.0.1
func TimingMiddleware(rt CommandRuntime, input CommandInput, entry CommandEntry, next NextFunc) CommandResult
TimingMiddleware measures execution duration.
type CommandRuntime ¶ added in v1.0.1
type CommandRuntime interface {
Session() SessionStore
Services() ServiceRegistry
Output() OutputChannel
ContextManager() *ContextManager
TaskManager() *TaskManager
Cancellation() context.Context
PushContext(name string, payload any) error
PopContext() error
PipelineData() any
SetPipelineData(v any)
}
CommandRuntime presents runtime services to commands.
type CommandSpec ¶ added in v1.0.1
type CommandSpec struct {
Name string
Aliases []string
Summary string
Description string
Examples []Example
Args []ArgSpec
Flags []FlagSpec
Permissions []string
Hidden bool
Tags []string
Category string
Context string
Usage string
AllowPipes bool
DefaultAlias string
}
CommandSpec describes command metadata for discovery and help.
type CommandStatus ¶ added in v1.0.1
type CommandStatus string
CommandStatus indicates the result of a command invocation.
const ( StatusSuccess CommandStatus = "success" StatusFailed CommandStatus = "failed" StatusPartial CommandStatus = "partial" StatusPending CommandStatus = "pending" )
type ContextManager ¶ added in v1.0.1
type ContextManager struct {
// contains filtered or unexported fields
}
ContextManager manages context stack and transitions.
func NewContextManager ¶ added in v1.0.1
func NewContextManager(registry *CommandRegistry) *ContextManager
NewContextManager constructs a manager.
func (*ContextManager) Current ¶ added in v1.0.1
func (m *ContextManager) Current() ExecutionContext
Current returns the active context on the stack.
func (*ContextManager) Navigate ¶ added in v1.0.1
func (m *ContextManager) Navigate(name string, payload any) error
Navigate sets the stack to the specified context, replacing current.
func (*ContextManager) Pop ¶ added in v1.0.1
func (m *ContextManager) Pop() error
Pop removes the top context if not root.
func (*ContextManager) PopToRoot ¶ added in v1.0.1
func (m *ContextManager) PopToRoot() error
PopToRoot resets stack to root context.
func (*ContextManager) Prompt ¶ added in v1.0.1
func (m *ContextManager) Prompt(base string) string
Prompt returns the prompt for current context.
func (*ContextManager) Push ¶ added in v1.0.1
func (m *ContextManager) Push(name string, payload any) error
Push adds a context to the stack.
func (*ContextManager) ResolveAliases ¶ added in v1.0.1
func (m *ContextManager) ResolveAliases(name string) (string, bool)
ResolveAliases returns canonical context name.
func (*ContextManager) Stack ¶ added in v1.0.1
func (m *ContextManager) Stack() []ExecutionContext
Stack returns a copy of the current stack.
type ContextOption ¶ added in v1.0.1
type ContextOption func(*ContextSpec)
ContextOption mutates a ContextSpec before registration.
func WithContextAliases ¶ added in v1.0.1
func WithContextAliases(aliases ...string) ContextOption
WithContextAliases adds aliases for a context name.
func WithContextPrompt ¶ added in v1.0.1
func WithContextPrompt(prompt string) ContextOption
WithContextPrompt sets a custom prompt template for the context.
func WithContextTags ¶ added in v1.0.1
func WithContextTags(tags ...string) ContextOption
WithContextTags assigns tags to a context.
type ContextSpec ¶ added in v1.0.1
type ContextSpec struct {
Name string
Parent string
Description string
Prompt string
Aliases []string
Tags []string
Hidden bool
}
ContextSpec defines metadata for an execution context.
type DefaultOutputChannel ¶ added in v1.0.1
type DefaultOutputChannel struct {
// contains filtered or unexported fields
}
DefaultOutputChannel is an in-memory channel writing to io.Writer.
func NewOutputChannel ¶ added in v1.0.1
func NewOutputChannel(w io.Writer) *DefaultOutputChannel
NewOutputChannel builds an OutputChannel targeting provided writer.
func (*DefaultOutputChannel) Buffer ¶ added in v1.0.1
func (c *DefaultOutputChannel) Buffer() *bytes.Buffer
Buffer exposes captured output, useful in tests.
func (*DefaultOutputChannel) Error ¶ added in v1.0.1
func (c *DefaultOutputChannel) Error(msg string)
Error writes an error message.
func (*DefaultOutputChannel) Info ¶ added in v1.0.1
func (c *DefaultOutputChannel) Info(msg string)
Info writes an informational message.
func (*DefaultOutputChannel) Level ¶ added in v1.0.1
func (c *DefaultOutputChannel) Level() OutputLevel
Level returns current verbosity.
func (*DefaultOutputChannel) SetLevel ¶ added in v1.0.1
func (c *DefaultOutputChannel) SetLevel(level OutputLevel)
SetLevel updates verbosity.
func (*DefaultOutputChannel) Warn ¶ added in v1.0.1
func (c *DefaultOutputChannel) Warn(msg string)
Warn writes a warning message.
func (*DefaultOutputChannel) WriteJSON ¶ added in v1.0.1
func (c *DefaultOutputChannel) WriteJSON(v any)
WriteJSON renders JSON output respecting verbosity.
func (*DefaultOutputChannel) WriteTable ¶ added in v1.0.1
func (c *DefaultOutputChannel) WriteTable(headers []string, rows [][]string)
WriteTable renders tabular output without border markers.
func (*DefaultOutputChannel) Writer ¶ added in v1.0.1
func (c *DefaultOutputChannel) Writer() io.Writer
Writer returns the underlying writer.
type Engine ¶ added in v1.0.1
type Engine struct {
// contains filtered or unexported fields
}
Engine orchestrates command resolution and execution.
func DefaultEngine ¶ added in v1.0.1
func DefaultEngine() *Engine
DefaultEngine returns the shared default engine instance.
func (*Engine) Contexts ¶ added in v1.0.1
func (e *Engine) Contexts() *ContextManager
Contexts returns the context manager.
func (*Engine) RegisterCommand ¶ added in v1.0.1
func (e *Engine) RegisterCommand(factory CommandFactory)
RegisterCommand registers a command factory.
func (*Engine) RegisterContext ¶ added in v1.0.1
func (e *Engine) RegisterContext(spec ContextSpec)
RegisterContext adds a context specification to the registry.
func (*Engine) Registry ¶ added in v1.0.1
func (e *Engine) Registry() *CommandRegistry
Registry exposes the command registry for external registration.
func (*Engine) Services ¶ added in v1.0.1
func (e *Engine) Services() ServiceRegistry
Services exposes the service registry.
func (*Engine) Session ¶ added in v1.0.1
func (e *Engine) Session() SessionStore
Session exposes the session store.
func (*Engine) SetHelpHeader ¶ added in v1.0.1
SetHelpHeader updates the help header string.
func (*Engine) SetOutputLevel ¶ added in v1.0.1
func (e *Engine) SetOutputLevel(level OutputLevel)
SetOutputLevel updates output verbosity.
func (*Engine) SetOutputWriter ¶ added in v1.0.1
SetOutputWriter swaps the engine's writer for command output, returning the previous writer.
type ExecutionContext ¶ added in v1.0.1
type ExecutionContext struct {
Spec ContextSpec
State map[string]any
Payload any
}
ExecutionContext is an active context on the stack.
type FlagSpec ¶ added in v1.0.1
type FlagSpec struct {
Name string
Shorthand string
Type ArgType
Required bool
Description string
Default any
EnumValues []string
Hidden bool
}
FlagSpec defines flag metadata.
type LegacyAdapter ¶ added in v1.0.1
type LegacyAdapter struct {
// contains filtered or unexported fields
}
LegacyAdapter wraps a LegacyCommand into the new Command interface.
func (*LegacyAdapter) Execute ¶ added in v1.0.1
func (a *LegacyAdapter) Execute(rt CommandRuntime, input CommandInput) CommandResult
Execute delegates to the legacy command, capturing output.
func (*LegacyAdapter) Spec ¶ added in v1.0.1
func (a *LegacyAdapter) Spec() CommandSpec
Spec returns metadata for the wrapped command.
type LegacyCommand ¶ added in v1.0.1
LegacyCommand describes the original interface from the minimal framework.
type MemorySessionStore ¶ added in v1.0.1
type MemorySessionStore struct {
// contains filtered or unexported fields
}
MemorySessionStore is an in-memory implementation of SessionStore.
func NewSessionStore ¶ added in v1.0.1
func NewSessionStore() *MemorySessionStore
NewSessionStore constructs a MemorySessionStore.
func (*MemorySessionStore) Delete ¶ added in v1.0.1
func (s *MemorySessionStore) Delete(key string)
Delete removes a key.
func (*MemorySessionStore) Get ¶ added in v1.0.1
func (s *MemorySessionStore) Get(key string) (any, bool)
Get retrieves a value.
func (*MemorySessionStore) Keys ¶ added in v1.0.1
func (s *MemorySessionStore) Keys() []string
Keys lists stored keys.
func (*MemorySessionStore) Set ¶ added in v1.0.1
func (s *MemorySessionStore) Set(key string, value any)
Set stores a key/value pair.
type Middleware ¶ added in v1.0.1
type Middleware func(CommandRuntime, CommandInput, CommandEntry, NextFunc) CommandResult
Middleware wraps command execution with cross-cutting logic.
type NextFunc ¶ added in v1.0.1
type NextFunc func(CommandRuntime, CommandInput) CommandResult
NextFunc represents the next handler in the middleware chain.
type Option ¶ added in v1.0.1
type Option func(*Engine)
Option configures the engine.
func WithHelpHeader ¶ added in v1.0.1
WithHelpHeader customises the help header string.
func WithMiddleware ¶ added in v1.0.1
func WithMiddleware(mw ...Middleware) Option
WithMiddleware appends middleware functions.
func WithOutputLevel ¶ added in v1.0.1
func WithOutputLevel(level OutputLevel) Option
WithOutputLevel sets default output verbosity.
func WithOutputWriter ¶ added in v1.0.1
WithOutputWriter overrides the engine output writer.
func WithPrompt ¶ added in v1.0.1
WithPrompt sets the base prompt prefix.
func WithServices ¶ added in v1.0.1
func WithServices(register func(ServiceRegistry)) Option
WithServices seeds the service registry.
type OutputChannel ¶ added in v1.0.1
type OutputChannel interface {
Level() OutputLevel
SetLevel(level OutputLevel)
Info(msg string)
Warn(msg string)
Error(msg string)
WriteJSON(v any)
WriteTable(headers []string, rows [][]string)
Writer() io.Writer
Buffer() *bytes.Buffer
}
OutputChannel controls command output levels and formats.
type OutputLevel ¶ added in v1.0.1
type OutputLevel int
OutputLevel enumerates verbosity levels.
const ( OutputQuiet OutputLevel = iota OutputNormal OutputVerbose OutputDebug )
type OutputMessage ¶ added in v1.0.1
type OutputMessage struct {
Level SeverityLevel
Format string
Content string
}
OutputMessage allows commands to suggest standardised output.
type ServiceRegistry ¶ added in v1.0.1
ServiceRegistry exposes shared dependencies to commands.
type SessionStore ¶ added in v1.0.1
type SessionStore interface {
Get(key string) (any, bool)
Set(key string, value any)
Delete(key string)
Keys() []string
}
SessionStore provides shared state across commands during a session.
type SeverityLevel ¶ added in v1.0.1
type SeverityLevel string
SeverityLevel indicates the severity of an error surfaced to the user.
const ( SeverityInfo SeverityLevel = "info" SeverityWarning SeverityLevel = "warning" SeverityError SeverityLevel = "error" )
type SimpleServiceRegistry ¶ added in v1.0.1
type SimpleServiceRegistry struct {
// contains filtered or unexported fields
}
SimpleServiceRegistry is a basic map-backed ServiceRegistry.
func NewServiceRegistry ¶ added in v1.0.1
func NewServiceRegistry() *SimpleServiceRegistry
NewServiceRegistry constructs a SimpleServiceRegistry.
func (*SimpleServiceRegistry) Get ¶ added in v1.0.1
func (r *SimpleServiceRegistry) Get(name string) (any, bool)
Get retrieves a service.
func (*SimpleServiceRegistry) Register ¶ added in v1.0.1
func (r *SimpleServiceRegistry) Register(name string, value any)
Register stores a service instance.
type TaskFunc ¶ added in v1.0.1
type TaskFunc func(ctx context.Context, output OutputChannel) error
TaskFunc represents an asynchronous job.
type TaskHandle ¶ added in v1.0.1
type TaskHandle struct {
ID string
Name string
Status TaskStatus
Error error
Metadata map[string]any
// contains filtered or unexported fields
}
TaskHandle represents a running task.
type TaskManager ¶ added in v1.0.1
type TaskManager struct {
// contains filtered or unexported fields
}
TaskManager supervises background tasks.
func NewTaskManager ¶ added in v1.0.1
func NewTaskManager(output OutputChannel) *TaskManager
NewTaskManager constructs a TaskManager.
func (*TaskManager) Cancel ¶ added in v1.0.1
func (m *TaskManager) Cancel(id string) bool
Cancel cancels a task by ID.
func (*TaskManager) DescribeTask ¶ added in v1.0.1
func (m *TaskManager) DescribeTask(id string) (*TaskHandle, bool)
DescribeTask returns handle by ID.
func (*TaskManager) SetOutputChannel ¶ added in v1.0.1
func (m *TaskManager) SetOutputChannel(out OutputChannel)
SetOutputChannel updates the output destination for future task logs.
func (*TaskManager) Spawn ¶ added in v1.0.1
func (m *TaskManager) Spawn(name string, fn TaskFunc, opts TaskOptions) *TaskHandle
Spawn launches an async task.
func (*TaskManager) Tasks ¶ added in v1.0.1
func (m *TaskManager) Tasks() []*TaskHandle
Tasks lists tasks.
type TaskOptions ¶ added in v1.0.1
TaskOptions configure async tasks.
type TaskStatus ¶ added in v1.0.1
type TaskStatus string
TaskStatus enumerates async task states.
const ( TaskPending TaskStatus = "pending" TaskRunning TaskStatus = "running" TaskSucceeded TaskStatus = "succeeded" TaskFailed TaskStatus = "failed" TaskCancelled TaskStatus = "cancelled" )
type ValueSet ¶ added in v1.0.1
type ValueSet struct {
// contains filtered or unexported fields
}
ValueSet provides typed accessors for parsed arguments or flags.
func (ValueSet) DecodeJSON ¶ added in v1.0.1
DecodeJSON decodes the value into the provided destination.