Documentation
¶
Index ¶
- Variables
- func RegisterBinary(token string, registrator ...registrators.Binary) error
- func RegisterConst(token string, registrator ...registrators.Const) error
- func RegisterFunc(token string, registrator ...registrators.Func) error
- func RegisterUnary(token string, registrator ...registrators.Unary) error
- func RegisterVarSource(registrator ...registrators.VarSourse)
- func RegisterVarType(registrator ...registrators.VariableType)
- type Enviroment
- func (env *Enviroment) RegisterBinary(token string, registrator ...registrators.Binary) error
- func (env *Enviroment) RegisterBinaryNoErr(token string, registrator ...registrators.Binary)
- func (env *Enviroment) RegisterConst(token string, registrator ...registrators.Const) error
- func (env *Enviroment) RegisterConstNoErr(token string, registrator ...registrators.Const)
- func (env *Enviroment) RegisterFunc(token string, registrator ...registrators.Func) error
- func (env *Enviroment) RegisterFuncNoErr(token string, registrator ...registrators.Func)
- func (env *Enviroment) RegisterUnary(token string, registrator ...registrators.Unary) error
- func (env *Enviroment) RegisterUnaryNoErr(token string, registrator ...registrators.Unary)
- func (env *Enviroment) RegisterVarSource(registrator ...registrators.VarSourse)
- func (env *Enviroment) RegisterVarType(registrator ...registrators.VariableType)
Constants ¶
This section is empty.
Variables ¶
var DefaultEnv = New()
Functions ¶
func RegisterBinary ¶
func RegisterBinary(token string, registrator ...registrators.Binary) error
RegisterBinary registers a set of builders for a given binary operator globally using the default environment instance. This function delegates the actual work to the RegisterBinary method of the global DefaultEnv object.
func RegisterConst ¶
func RegisterConst(token string, registrator ...registrators.Const) error
RegisterConst registers a set of builders for a given constant globally using the default environment instance. This function delegates the actual work to the RegisterConst method of the global DefaultEnv object.
func RegisterFunc ¶
func RegisterFunc(token string, registrator ...registrators.Func) error
RegisterFunc registers a set of builders for a given function globally using the default environment instance. This function delegates the actual work to the RegisterFunc method of the global DefaultEnv object.
func RegisterUnary ¶
func RegisterUnary(token string, registrator ...registrators.Unary) error
RegisterUnary registers a set of builders for a given unary operator globally using the default environment instance. This function delegates the actual work to the RegisterUnary method of the global DefaultEnv object.
func RegisterVarSource ¶
func RegisterVarSource(registrator ...registrators.VarSourse)
RegisterVarTypes registers a variable source type globally using the default environment instance. This function delegates the actual work to the RegisterVarSourse method of the global DefaultEnv object.
func RegisterVarType ¶
func RegisterVarType(registrator ...registrators.VariableType)
RegisterVarType registers variable types globally using the default environment instance. This function delegates the actual work to the RegisterVarType method of the global DefaultEnv object.
Types ¶
type Enviroment ¶
type Enviroment struct {
Unary map[string]map[hashsum.Inputs]base.Builder
Binary map[string]map[hashsum.Inputs]base.Builder
Func map[string]map[hashsum.Inputs]base.Builder
Const map[string]registrators.Const
VariableMakers map[reflect.Type]registrators.VariableType
Variables map[reflect.Type]map[string]base.Builder
}
func New ¶
func New() *Enviroment
func (*Enviroment) RegisterBinary ¶
func (env *Enviroment) RegisterBinary(token string, registrator ...registrators.Binary) error
RegisterBinary adds a set of builders for a given binary operator into the environment's registry. This method allows associating different implementations of a binary operation based on input types. If the provided token does not correspond to any known binary operator, returns an error.
func (*Enviroment) RegisterBinaryNoErr ¶
func (env *Enviroment) RegisterBinaryNoErr(token string, registrator ...registrators.Binary)
RegisterBinaryNoErr calls RegisterBinary and panics on error.
func (*Enviroment) RegisterConst ¶
func (env *Enviroment) RegisterConst(token string, registrator ...registrators.Const) error
RegisterConst adds a set of collectors for the given constant to the environment registry. If the provided token matches any operator, an error is returned.
func (*Enviroment) RegisterConstNoErr ¶
func (env *Enviroment) RegisterConstNoErr(token string, registrator ...registrators.Const)
RegisterConstNoErr calls RegisterConst and panics on error.
func (*Enviroment) RegisterFunc ¶
func (env *Enviroment) RegisterFunc(token string, registrator ...registrators.Func) error
RegisterFunc adds a set of collectors for the given function to the environment registry. This method allows you to chain together different implementations of a function based on input types. If the provided token matches any operator, an error is returned.
func (*Enviroment) RegisterFuncNoErr ¶
func (env *Enviroment) RegisterFuncNoErr(token string, registrator ...registrators.Func)
RegisterFuncNoErr calls RegisterFunc and panics on error.
func (*Enviroment) RegisterUnary ¶
func (env *Enviroment) RegisterUnary(token string, registrator ...registrators.Unary) error
RegisterUnary adds a set of builders for a given unary operator into the environment's registry. This method allows associating different implementations of a unary operation based on input types. If the provided token does not correspond to any known unary operator, returns an error.
func (*Enviroment) RegisterUnaryNoErr ¶
func (env *Enviroment) RegisterUnaryNoErr(token string, registrator ...registrators.Unary)
RegisterUnaryNoErr calls RegisterUnary and panics on error.
func (*Enviroment) RegisterVarSource ¶
func (env *Enviroment) RegisterVarSource(registrator ...registrators.VarSourse)
RegisterVarSource adds the variable source type to the environment registry. If the provided token matches any operator, an error is returned.
func (*Enviroment) RegisterVarType ¶
func (env *Enviroment) RegisterVarType(registrator ...registrators.VariableType)
RegisterVarType adds variable types to the environment registry. If the provided token matches any operator, an error is returned.