opt

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None              = Option(1)
	IgnoreCase        = Option(2)
	NoCache           = Option(4)
	IterateParameters = Option(8)
	RoundAwayFromZero = Option(16)
)

Variables

This section is empty.

Functions

func MatchArgument

func MatchArgument(name string, args ...*LogicalExpression) error

func MatchOneArgument

func MatchOneArgument(name string, args ...*LogicalExpression) error

func MatchTwoArgument

func MatchTwoArgument(name string, args ...*LogicalExpression) error

Types

type Argument

type Argument struct {
	Value interface{}
	Type  reflect.Kind
}

func NewArgument

func NewArgument(v interface{}) (*Argument, error)

func NewArgumentWithType

func NewArgumentWithType(v interface{}, t reflect.Kind) *Argument

func (*Argument) Equal

func (arg *Argument) Equal(other *Argument) bool

func (*Argument) Float64

func (arg *Argument) Float64() (float64, error)

func (*Argument) Int

func (arg *Argument) Int() (int, error)

func (*Argument) Int64

func (arg *Argument) Int64() (int64, error)

func (*Argument) IsInteger

func (arg *Argument) IsInteger() bool

func (*Argument) IsNan

func (arg *Argument) IsNan() bool

func (*Argument) IsNumber

func (arg *Argument) IsNumber() bool

func (*Argument) String

func (arg *Argument) String() string

type ArgumentFunc added in v1.0.1

type ArgumentFunc func() (interface{}, error)

type FormulaContext

type FormulaContext struct {
	Option     Option
	Parameters map[string]interface{}
	Result     bytes.Buffer
}

func NewFormulaContext

func NewFormulaContext(options ...Option) *FormulaContext

type Function

type Function interface {
	Name() string
	Evaluate(context *FormulaContext, args ...*LogicalExpression) (*Argument, error)
}

type LogicalExpression

type LogicalExpression interface {
	Evaluate(context *FormulaContext) (*Argument, error)
}

type Option

type Option int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL