Documentation
¶
Index ¶
- Constants
- type ActiveContext
- type ActiveContextGetter
- type Adder
- type CLIFlagDefinitions
- type CLIFlagIOWrapper
- type Coder
- type CoderBufferedReadWriter
- type CoderReadWriter
- type Collection
- type CollectionMutable
- type CommandComponentWriter
- type Comparable
- type CompoundKeyer
- type ContainsKeyer
- type ContextState
- type DecoderFrom
- type DecoderFromBufferedReader
- type DecoderFromReader
- type Delta
- type DirectoryLayoutBaseEnvVar
- type DirectoryLayoutPath
- type DirectoryLayoutXDG
- type EncoderTo
- type EncoderToBufferedWriter
- type EncoderToWriter
- type EnvVars
- type EnvVarsAdder
- type Equaler
- type Equatable
- type ErrorHiddenWrapper
- type ErrorManyUnwrapper
- type ErrorOneUnwrapper
- type ErrorRetryable
- type FlagValue
- type FuncActiveContext
- type FuncIter
- type FuncIterIO
- type FuncIterKey
- type FuncIterWithKey
- type FuncMakePrinter
- type FuncRepool
- type FuncRetry
- type FuncRetryAborted
- type FuncSetString
- type FuncString
- type FuncStringWriterFormat
- type FuncTransform
- type FuncWriter
- type FuncWriterElementInterface
- type FuncWriterFormat
- type IOWrapper
- type Iterable
- type Keyer
- type Lenner
- type Lessor
- type LockSmith
- type LockSmithGetter
- type Pool
- type PoolPtr
- type Printer
- type Ptr
- type Pull
- type Pull2
- type ReadWrapper
- type Resetable
- type ResetablePtr
- type ResetableWithError
- type Resetter
- type ResetterPtr
- type RuneDecoder
- type Seq
- type Seq2
- type SeqError
- type Set
- type SetGetter
- type SetMutable
- type Setter
- type SetterPtr
- type StringCoder
- type StringEncoderTo
- type StringKeyer
- type StringKeyerPtr
- type StringSetterPtr
- type Stringer
- type StringerPtr
- type StringerSetter
- type StringerSetterPtr
- type StringerWithHeadAndTail
- type Tridex
- type TridexMutable
- type Value
- type ValuePtr
- type WriteWrapper
- type WriterAndStringWriter
Constants ¶
View Source
const ( ContextStateUnknown = ContextState(iota) ContextStateUnstarted // all states that are > than `ContextStateStarted` are considered terminal, // so the order here is important ContextStateStarted ContextStateSucceeded ContextStateFailed ContextStateAborted )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveContext ¶
type ActiveContext interface {
context.Context
Cause() error
GetState() ContextState
// TODO disambiguate between errors and exceptions
// TODO rename this to Complete
Cancel(error)
// `After` runs a function after the context is complete (regardless of
// any errors). `After`s are run in the reverse order of when they are
// called,
// like
// defers but on a whole-program level.
After(FuncActiveContext)
// `Must` executes a function even if the context has been cancelled. If
// the function returns an error, `Must` cancels the context. It is
// meant for
// defers that must be executed, like closing files, flushing buffers,
// releasing locks.
Must(FuncActiveContext)
}
type ActiveContextGetter ¶
type ActiveContextGetter interface {
GetActiveContext() ActiveContext
}
type CLIFlagDefinitions ¶
type CLIFlagDefinitions interface {
BoolVar(variable *bool, name string, defaultValue bool, usage string)
StringVar(variable *string, name string, defaultValue string, usage string)
Var(value FlagValue, name string, usage string)
Func(name, usage string, funk func(string) error)
IntVar(variable *int, name string, defaultValue int, usage string)
}
TODO add completion options
type Coder ¶
type Coder[OBJECT any, READER any, WRITER any] interface { DecoderFrom[OBJECT, READER] EncoderTo[OBJECT, WRITER] }
type CoderBufferedReadWriter ¶
type CollectionMutable ¶
type CollectionMutable[ELEMENT any] interface { Collection[ELEMENT] Resetable }
type CommandComponentWriter ¶
type CommandComponentWriter interface {
SetFlagDefinitions(CLIFlagDefinitions)
}
type Comparable ¶
type Comparable[SELF any] interface { Lenner RuneDecoder Shift(int) SELF }
type CompoundKeyer ¶
type CompoundKeyer[T any] []StringKeyer[T]
func (CompoundKeyer[T]) GetKey ¶
func (ck CompoundKeyer[T]) GetKey(e T) string
type ContextState ¶
type ContextState uint8
func (ContextState) Error ¶
func (state ContextState) Error() string
func (ContextState) Is ¶
func (state ContextState) Is(target error) bool
func (ContextState) IsComplete ¶
func (state ContextState) IsComplete() bool
func (ContextState) String ¶
func (i ContextState) String() string
type DecoderFrom ¶
type DecoderFromBufferedReader ¶
type DecoderFromBufferedReader[OBJECT any] = DecoderFrom[OBJECT, *bufio.Reader]
type DecoderFromReader ¶
type DecoderFromReader[OBJECT any] = DecoderFrom[OBJECT, io.Reader]
type Delta ¶
type Delta[ELEMENT any] interface { GetAdded() Set[ELEMENT] GetRemoved() Set[ELEMENT] }
type DirectoryLayoutBaseEnvVar ¶
type DirectoryLayoutBaseEnvVar interface {
Stringer
GetBaseEnvVarName() string
GetBaseEnvVarValue() string
MakePath(...string) DirectoryLayoutPath
}
type DirectoryLayoutPath ¶
type DirectoryLayoutPath interface {
Stringer
GetBaseEnvVar() DirectoryLayoutBaseEnvVar
GetTarget() string
GetTemplate() string
}
type DirectoryLayoutXDG ¶
type DirectoryLayoutXDG interface {
GetDirHome() DirectoryLayoutBaseEnvVar
GetDirCwd() DirectoryLayoutBaseEnvVar
GetDirData() DirectoryLayoutBaseEnvVar
GetDirConfig() DirectoryLayoutBaseEnvVar
GetDirState() DirectoryLayoutBaseEnvVar
GetDirCache() DirectoryLayoutBaseEnvVar
GetDirRuntime() DirectoryLayoutBaseEnvVar
CloneWithUtilityName(string) DirectoryLayoutXDG
}
type EncoderTo ¶
type EncoderToBufferedWriter ¶
type ErrorHiddenWrapper ¶
type ErrorHiddenWrapper interface {
ErrorOneUnwrapper
ShouldHideUnwrap() bool
}
When printing error trees, `error_coders` uses the presence of `ShouldHideUnwrap()` and its return value to determine if the parent error should be printed.
type ErrorRetryable ¶
type ErrorRetryable interface {
error
Recover(ActiveContext, FuncRetry, FuncRetryAborted)
}
type FlagValue ¶
type FlagValue interface {
StringerSetter
}
Value is the interface to the dynamic value stored in a flag. (The default value is represented as a string.)
If a Value has an IsBoolFlag() bool method returning true, the command-line parser makes -name equivalent to -name=true rather than using the next command-line argument.
Set is called once, in command line order, for each flag present. The flag package may call the [String] method with a zero-valued receiver, such as a nil pointer.
type FuncActiveContext ¶
type FuncActiveContext = func(ActiveContext) error
type FuncMakePrinter ¶
type FuncMakePrinter[OUT any] func(WriterAndStringWriter) FuncIter[OUT]
type FuncRepool ¶
type FuncRepool func()
type FuncRetry ¶
type FuncRetry func()
type FuncStringWriterFormat ¶
type FuncStringWriterFormat[T any] func(WriterAndStringWriter, T) (int64, error)
type FuncWriterElementInterface ¶
type FuncWriterElementInterface[ELEMENT any] func( WriterAndStringWriter, ELEMENT, ) (int64, error)
type IOWrapper ¶
type IOWrapper interface {
ReadWrapper
WriteWrapper
}
type Pool ¶
type Pool[T any] interface { GetWithRepool() (T, FuncRepool) }
type Printer ¶
type Resetable ¶
type Resetable interface {
Reset()
}
type ResetablePtr ¶
type ResetterPtr ¶
type Set ¶
type SetMutable ¶
type StringCoder ¶
type StringCoder[T any] interface { DecoderFromReader[T] StringEncoderTo[T] }
type StringEncoderTo ¶
type StringKeyerPtr ¶
type StringKeyerPtr[T any, TPtr Ptr[T]] interface { StringKeyer[T] GetKeyPtr(TPtr) string }
type StringerWithHeadAndTail ¶
type Tridex ¶
type ValuePtr ¶
type ValuePtr[SELF Value] interface { Resetable ResetablePtr[SELF] StringerSetterPtr[SELF] }
type WriterAndStringWriter ¶
type WriterAndStringWriter interface {
io.Writer
io.StringWriter
}
Source Files
¶
- coder.go
- collections.go
- command.go
- context.go
- contextstate_string.go
- directory.go
- elements.go
- errors.go
- io.go
- iter.go
- keyers.go
- lock.go
- main.go
- pools.go
- printer.go
- string.go
- value.go
Click to show internal directories.
Click to hide internal directories.