Documentation
¶
Index ¶
- Variables
- func CallMethod(me Resolver, args []reflect.Value) []reflect.Value
- func DependanciesOf(str string, m FMap) ([]string, error)
- func DependantsOf(str string, m FMap) ([]string, error)
- func EndOfChain() reflect.Value
- func EndOfChainPtr() *reflect.Value
- func EnumAsInput(me Enum, m *genericInput) *enumInput
- func FieldByName(me Resolver, name string) reflect.Value
- func FindArguments(str string, fmap FMap) ([]reflect.Value, error)
- func FindBrothers(str string, me FMap, listFunc ListFunc) ([]string, error)
- func HandleOutput(ctx context.Context, handler OutputHandler, out Output) error
- func IsResolverFor(m Resolver) map[string]bool
- func ListOfArgs(m Resolver) []reflect.Type
- func ListOfReturns(m Resolver) []reflect.Type
- func MenthodIsShared(run Resolver) bool
- func MethodName(m Resolver) string
- func NewGenericEnumInput(f reflect.StructField, m Resolver, enum ...Enum) (*enumInput, error)
- func NewGenericInput(f reflect.StructField, m Resolver) *genericInput
- func NewSimpleValueInput[T any](f reflect.StructField, m Resolver) *simpleValueInput[T]
- func RunResolvingArguments(outputHandler OutputHandler, fmap FMap, str string, binder *Binder, ...) error
- func SetBinding[T any](con *Binder, val T)
- func SetBindingWithLock[T any](con *Binder, val T) func()
- func StructFields(me Resolver) []reflect.StructField
- type ArgumentStrategy
- type Binder
- type BoolInput
- type CommandStrategy
- type DurationInput
- type Enum
- type EnumResolverFunc
- type FMap
- type FileOutput
- type Input
- type InputType
- type InputWithOptions
- type IntArrayInput
- type IntInput
- type JSONOutput
- type ListFunc
- type LongRunningOutput
- type Method
- type MethodProvider
- type Middleware
- type MiddlewareFunc
- type MiddlewareProvider
- type NamedMethod
- type NewSnakeOpts
- type NilOutput
- type Output
- type OutputHandler
- type RawTextOutput
- type Refreshable
- type Resolver
- func MustGetResolverFor[M any](inter Method) Resolver
- func MustGetResolverFor2[M1, M2 any](inter Method) Resolver
- func MustGetResolverFor3[M1, M2, M3 any](inter Method) Resolver
- func NewMiddlewareResolver(mw Middleware) Resolver
- func NewNoopAsker[A any]() Resolver
- func NewNoopMethod[A any]() Resolver
- type Snake
- type SnakeImplementation
- type Strategy
- type StringArrayInput
- type StringEnumInput
- type StringInput
- type TableOutput
- type TypedResolver
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidMethodSignature = errors.New("invalid method signatured")
)
Functions ¶
func CallMethod ¶ added in v0.26.0
func EndOfChain ¶ added in v0.26.0
func EndOfChainPtr ¶ added in v0.26.0
func EnumAsInput ¶ added in v0.26.0
func EnumAsInput(me Enum, m *genericInput) *enumInput
func FindArguments ¶ added in v0.26.0
func FindBrothers ¶ added in v0.26.0
func HandleOutput ¶ added in v0.26.0
func HandleOutput(ctx context.Context, handler OutputHandler, out Output) error
func IsResolverFor ¶ added in v0.26.0
func ListOfArgs ¶ added in v0.26.0
func ListOfReturns ¶ added in v0.26.0
func MenthodIsShared ¶ added in v0.26.0
func MethodName ¶ added in v0.26.0
func NewGenericEnumInput ¶ added in v0.26.0
func NewGenericEnumInput(f reflect.StructField, m Resolver, enum ...Enum) (*enumInput, error)
func NewGenericInput ¶ added in v0.26.0
func NewGenericInput(f reflect.StructField, m Resolver) *genericInput
func NewSimpleValueInput ¶ added in v0.26.0
func NewSimpleValueInput[T any](f reflect.StructField, m Resolver) *simpleValueInput[T]
func RunResolvingArguments ¶ added in v0.26.0
func RunResolvingArguments(outputHandler OutputHandler, fmap FMap, str string, binder *Binder, middlewares ...Middleware) error
func SetBinding ¶ added in v0.26.0
func SetBindingWithLock ¶ added in v0.26.0
func StructFields ¶ added in v0.26.0
func StructFields(me Resolver) []reflect.StructField
Types ¶
type ArgumentStrategy ¶ added in v0.26.0
type ArgumentStrategy struct {
// contains filtered or unexported fields
}
func New1ArgumentStrategy ¶ added in v0.26.0
func New1ArgumentStrategy[A any]() *ArgumentStrategy
func New2ArgumentStrategy ¶ added in v0.26.0
func New2ArgumentStrategy[A any, B any]() *ArgumentStrategy
func New3ArgumentStrategy ¶ added in v0.26.0
func New3ArgumentStrategy[A any, B any, C any]() *ArgumentStrategy
func New4ArgumentStrategy ¶ added in v0.26.0
func New4ArgumentStrategy[A any, B any, C any, D any]() *ArgumentStrategy
func (*ArgumentStrategy) ValidateResponseTypes ¶ added in v0.26.0
func (me *ArgumentStrategy) ValidateResponseTypes(out []reflect.Type) error
type Binder ¶ added in v0.26.0
type Binder struct {
// contains filtered or unexported fields
}
func RefreshDependencies ¶ added in v0.27.0
func ResolveAllShared ¶ added in v0.26.0
type CommandStrategy ¶ added in v0.26.0
type CommandStrategy struct {
}
func NewCommandStrategy ¶ added in v0.26.0
func NewCommandStrategy() *CommandStrategy
func (*CommandStrategy) ValidateResponseTypes ¶ added in v0.26.0
func (me *CommandStrategy) ValidateResponseTypes(out []reflect.Type) error
type DurationInput ¶ added in v0.26.0
type Enum ¶ added in v0.26.0
type EnumResolverFunc ¶ added in v0.26.0
type FileOutput ¶ added in v0.26.0
func (*FileOutput) IsOutput ¶ added in v0.26.0
func (*FileOutput) IsOutput()
type Input ¶ added in v0.26.0
type Input interface {
Name() string
Ptr() any
Parent() Resolver
SetValue(any) error
Type() InputType
}
func DependancyInputs ¶ added in v0.26.0
type InputType ¶ added in v0.27.0
type InputType string
var ( StringInputType InputType = InputType("string") IntInputType InputType = InputType("int") BoolInputType InputType = InputType("bool") StringArrayInputType InputType = InputType("[]string") IntArrayInputType InputType = InputType("[]int") DurationInputType InputType = InputType("time.Duration") StringEnumInputType InputType = InputType("enum") UnknownInputType InputType = InputType("unknown") )
func AllInputTypes ¶ added in v0.27.0
func AllInputTypes() []InputType
type InputWithOptions ¶ added in v0.26.0
type InputWithOptions interface {
Options() []string
}
type IntArrayInput ¶ added in v0.26.0
type IntArrayInput = simpleValueInput[[]int]
type JSONOutput ¶ added in v0.26.0
type JSONOutput struct {
Data json.RawMessage
}
func (*JSONOutput) IsOutput ¶ added in v0.26.0
func (*JSONOutput) IsOutput()
type LongRunningOutput ¶ added in v0.26.0
func (*LongRunningOutput) IsOutput ¶ added in v0.26.0
func (*LongRunningOutput) IsOutput()
type MethodProvider ¶ added in v0.26.0
type Middleware ¶ added in v0.26.0
type Middleware interface {
Wrap(MiddlewareFunc) MiddlewareFunc
}
type MiddlewareFunc ¶ added in v0.26.0
func WrapWithMiddleware ¶ added in v0.26.0
func WrapWithMiddleware(base MiddlewareFunc, middlewares ...Middleware) MiddlewareFunc
type MiddlewareProvider ¶ added in v0.26.0
type MiddlewareProvider interface {
Middlewares() []Middleware
}
type NamedMethod ¶ added in v0.26.0
type NamedMethod interface {
Name() string
}
type NewSnakeOpts ¶ added in v0.13.0
type NewSnakeOpts struct {
Resolvers []Resolver
OverrideEnumResolver EnumResolverFunc
}
type OutputHandler ¶ added in v0.26.0
type OutputHandler interface {
HandleLongRunningOutput(ctx context.Context, out *LongRunningOutput) error
HandleRawTextOutput(ctx context.Context, out *RawTextOutput) error
HandleTableOutput(ctx context.Context, out *TableOutput) error
HandleJSONOutput(ctx context.Context, out *JSONOutput) error
HandleNilOutput(ctx context.Context, out *NilOutput) error
HandleFileOutput(ctx context.Context, out *FileOutput) error
}
type RawTextOutput ¶ added in v0.26.0
type RawTextOutput struct {
Data string
}
func (*RawTextOutput) IsOutput ¶ added in v0.26.0
func (*RawTextOutput) IsOutput()
type Refreshable ¶ added in v0.26.0
type Resolver ¶ added in v0.26.0
func MustGetResolverFor ¶ added in v0.26.0
func MustGetResolverFor2 ¶ added in v0.26.0
func MustGetResolverFor3 ¶ added in v0.26.0
func NewMiddlewareResolver ¶ added in v0.26.0
func NewMiddlewareResolver(mw Middleware) Resolver
func NewNoopAsker ¶ added in v0.26.0
func NewNoopMethod ¶ added in v0.26.0
type Snake ¶ added in v0.13.0
type Snake interface {
ResolverNames() []string
Resolve(string) Resolver
Enums() []Enum
Resolvers() []Resolver
DependantsOf(string) []string
}
func NewSnake ¶ added in v0.13.0
func NewSnake[M NamedMethod](ctx context.Context, impl SnakeImplementation[M], res ...Resolver) (Snake, error)
func NewSnakeWithOpts ¶ added in v0.26.0
func NewSnakeWithOpts[M NamedMethod](ctx context.Context, impl SnakeImplementation[M], opts *NewSnakeOpts) (Snake, error)
type SnakeImplementation ¶ added in v0.26.0
type StringArrayInput ¶ added in v0.26.0
type StringArrayInput = simpleValueInput[[]string]
type StringEnumInput ¶ added in v0.26.0
type StringEnumInput = enumInput
type StringInput ¶ added in v0.26.0
type StringInput = simpleValueInput[string]
type TableOutput ¶ added in v0.26.0
type TableOutput struct {
ColumnNames []string
RowValueData [][]any
RowValueColors [][]string
RawData any
}
func (*TableOutput) IsOutput ¶ added in v0.26.0
func (*TableOutput) IsOutput()
type TypedResolver ¶ added in v0.26.0
type TypedResolver[M Method] interface { Resolver TypedRef() M WithMiddleware(...Middleware) TypedResolver[M] }
func MustGetTypedResolver ¶ added in v0.26.0
func MustGetTypedResolver[M Method](inter M) TypedResolver[M]
Source Files
¶
Click to show internal directories.
Click to hide internal directories.