Documentation
¶
Overview ¶
Package gs_arg provides a set of tools for working with function arguments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgList ¶
type ArgList struct {
// contains filtered or unexported fields
}
ArgList represents a list of arguments for a function.
type Callable ¶
type Callable struct {
// contains filtered or unexported fields
}
Callable wraps a function and its binding arguments.
func Bind ¶
func Bind(fn CallableFunc, args []gs.Arg) (*Callable, error)
Bind creates a Callable by binding arguments to a function.
func MustBind ¶
func MustBind(fn CallableFunc, args ...gs.Arg) *Callable
MustBind binds arguments to a function and panics if an error occurs.
func (*Callable) Call ¶
Call invokes the function with its bound arguments processed in the IoC container.
func (*Callable) GetArgValue ¶
type IndexArg ¶
IndexArg represents an argument that has an index.
func (IndexArg) GetArgValue ¶
GetArgValue is not implemented for IndexArg, it panics if called.
type OptionArg ¶
type OptionArg struct {
// contains filtered or unexported fields
}
OptionArg represents a binding for an option function argument.
func Option ¶
func Option(fn CallableFunc, args ...gs.Arg) *OptionArg
Option creates a binding for an option function argument.
func (*OptionArg) GetArgValue ¶
type TagArg ¶
type TagArg struct {
Tag string
}
TagArg represents an argument that has a tag for binding or autowiring.
func (TagArg) GetArgValue ¶
GetArgValue returns the value of the argument based on its type.
type ValueArg ¶
type ValueArg struct {
// contains filtered or unexported fields
}
ValueArg represents an argument with a fixed value.
func (ValueArg) GetArgValue ¶
GetArgValue returns the value of the fixed argument.