Documentation ¶
Index ¶
- func If(b Interface, doIfFn func(criteria Interface)) bool
- func IfElse(b Interface, doIfFn func(criteria Interface), ...) bool
- func IfNot(b Interface, doIfNotFn func(criteria Interface)) bool
- type Interface
- type MockInterface
- func (_m *MockInterface) And(_a0 acal.TypedValue[bool]) Simple
- func (_m *MockInterface) Bool() bool
- func (_m *MockInterface) ExtractValues(cache acal.IValueCache) acal.IValueCache
- func (_m *MockInterface) GetAlias() string
- func (_m *MockInterface) GetName() string
- func (_m *MockInterface) GetTypedValue() bool
- func (_m *MockInterface) GetValue() interface{}
- func (_m *MockInterface) HasIdentity() bool
- func (_m *MockInterface) Identify() string
- func (_m *MockInterface) IsNil() bool
- func (_m *MockInterface) Not() Simple
- func (_m *MockInterface) Or(_a0 acal.TypedValue[bool]) Simple
- func (_m *MockInterface) SetAlias(_a0 string)
- func (_m *MockInterface) Stringify() string
- func (_m *MockInterface) ToSyntaxOperand(nextOp acal.Op) *acal.SyntaxOperand
- type MockValue
- func (_m *MockValue) Bool() bool
- func (_m *MockValue) ExtractValues(cache acal.IValueCache) acal.IValueCache
- func (_m *MockValue) GetAlias() string
- func (_m *MockValue) GetName() string
- func (_m *MockValue) GetTypedValue() bool
- func (_m *MockValue) GetValue() interface{}
- func (_m *MockValue) HasIdentity() bool
- func (_m *MockValue) Identify() string
- func (_m *MockValue) IsNil() bool
- func (_m *MockValue) SetAlias(_a0 string)
- func (_m *MockValue) Stringify() string
- func (_m *MockValue) ToSyntaxOperand(nextOp acal.Op) *acal.SyntaxOperand
- type Simple
- func MakeSimple(name string, value bool) Simple
- func MakeSimpleFrom(value acal.TypedValue[bool]) Simple
- func MakeSimpleWithFormula(value bool, formulaFn func() *acal.SyntaxNode) Simple
- func PerformBinaryLogicOp[T any](tv1 acal.TypedValue[T], tv2 acal.TypedValue[T], op acal.Op, opDesc string, ...) Simple
- func PerformUnaryLogicOp[T any](tv acal.TypedValue[T], fnName string, unaryOpFn func(v T) bool) Simple
- func (s Simple) Anchor(name string) Simple
- func (s Simple) And(s2 acal.TypedValue[bool]) Simple
- func (s Simple) Bool() bool
- func (s Simple) GetTypedValue() bool
- func (s Simple) Not() Simple
- func (s Simple) Or(s2 acal.TypedValue[bool]) Simple
- func (s Simple) Then() Simple
- func (s Simple) ToSyntaxOperand(nextOp acal.Op) *acal.SyntaxOperand
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func If ¶
If executes the provided doIfFn if the given Interface is true and return whether the function was executed.
Types ¶
type Interface ¶
type Interface interface { Value // And applies AND operation on the value of this Interface and the given acal.TypedValue. And(acal.TypedValue[bool]) Simple // Or applies OR operation on the value of this Interface and the given acal.TypedValue. Or(acal.TypedValue[bool]) Simple // Not returns the inverse value of this Interface. Not() Simple }
Interface governs the methods that Value should provide.
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func NewMockInterface ¶
func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface
NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInterface) And ¶
func (_m *MockInterface) And(_a0 acal.TypedValue[bool]) Simple
And provides a mock function with given fields: _a0
func (*MockInterface) Bool ¶
func (_m *MockInterface) Bool() bool
Bool provides a mock function with given fields:
func (*MockInterface) ExtractValues ¶
func (_m *MockInterface) ExtractValues(cache acal.IValueCache) acal.IValueCache
ExtractValues provides a mock function with given fields: cache
func (*MockInterface) GetAlias ¶
func (_m *MockInterface) GetAlias() string
GetAlias provides a mock function with given fields:
func (*MockInterface) GetName ¶
func (_m *MockInterface) GetName() string
GetName provides a mock function with given fields:
func (*MockInterface) GetTypedValue ¶
func (_m *MockInterface) GetTypedValue() bool
GetTypedValue provides a mock function with given fields:
func (*MockInterface) GetValue ¶
func (_m *MockInterface) GetValue() interface{}
GetValue provides a mock function with given fields:
func (*MockInterface) HasIdentity ¶
func (_m *MockInterface) HasIdentity() bool
HasIdentity provides a mock function with given fields:
func (*MockInterface) Identify ¶
func (_m *MockInterface) Identify() string
Identify provides a mock function with given fields:
func (*MockInterface) IsNil ¶
func (_m *MockInterface) IsNil() bool
IsNil provides a mock function with given fields:
func (*MockInterface) Not ¶
func (_m *MockInterface) Not() Simple
Not provides a mock function with given fields:
func (*MockInterface) Or ¶
func (_m *MockInterface) Or(_a0 acal.TypedValue[bool]) Simple
Or provides a mock function with given fields: _a0
func (*MockInterface) SetAlias ¶
func (_m *MockInterface) SetAlias(_a0 string)
SetAlias provides a mock function with given fields: _a0
func (*MockInterface) Stringify ¶
func (_m *MockInterface) Stringify() string
Stringify provides a mock function with given fields:
func (*MockInterface) ToSyntaxOperand ¶
func (_m *MockInterface) ToSyntaxOperand(nextOp acal.Op) *acal.SyntaxOperand
ToSyntaxOperand provides a mock function with given fields: nextOp
type MockValue ¶
MockValue is an autogenerated mock type for the Value type
func NewMockValue ¶
func NewMockValue(t mockConstructorTestingTNewMockValue) *MockValue
NewMockValue creates a new instance of MockValue. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockValue) ExtractValues ¶
func (_m *MockValue) ExtractValues(cache acal.IValueCache) acal.IValueCache
ExtractValues provides a mock function with given fields: cache
func (*MockValue) GetTypedValue ¶
GetTypedValue provides a mock function with given fields:
func (*MockValue) GetValue ¶
func (_m *MockValue) GetValue() interface{}
GetValue provides a mock function with given fields:
func (*MockValue) HasIdentity ¶
HasIdentity provides a mock function with given fields:
func (*MockValue) ToSyntaxOperand ¶
func (_m *MockValue) ToSyntaxOperand(nextOp acal.Op) *acal.SyntaxOperand
ToSyntaxOperand provides a mock function with given fields: nextOp
type Simple ¶
Simple ...
var NilBool Simple
func MakeSimpleFrom ¶
func MakeSimpleFrom(value acal.TypedValue[bool]) Simple
MakeSimpleFrom returns a new Simple using the given value as formula.
func MakeSimpleWithFormula ¶
func MakeSimpleWithFormula(value bool, formulaFn func() *acal.SyntaxNode) Simple
MakeSimpleWithFormula returns a new Simple with the given value and formula.
func PerformBinaryLogicOp ¶
func PerformBinaryLogicOp[T any]( tv1 acal.TypedValue[T], tv2 acal.TypedValue[T], op acal.Op, opDesc string, binaryOpFn func(a, b T) bool, ) Simple
PerformBinaryLogicOp returns a Simple to represent the result of performing binaryOpFn on the values of the provided acal.TypedValue.
func PerformUnaryLogicOp ¶
func PerformUnaryLogicOp[T any]( tv acal.TypedValue[T], fnName string, unaryOpFn func(v T) bool, ) Simple
PerformUnaryLogicOp returns a Simple to represent the result of performing unaryOpFn on the values of the provided acal.TypedValue.
func (Simple) And ¶
func (s Simple) And(s2 acal.TypedValue[bool]) Simple
And applies AND operation on the value of this Simple and the given acal.TypedValue.
func (Simple) Bool ¶
Bool returns the value of this Simple as a bool. If it's nil, false is returned.
func (Simple) GetTypedValue ¶
GetTypedValue returns the typed value this Simple contains.
func (Simple) Or ¶
func (s Simple) Or(s2 acal.TypedValue[bool]) Simple
Or applies OR operation on the value of this Simple and the given acal.TypedValue.
func (Simple) Then ¶
Then does nothing and returns this Simple as-is. It's meant for separating code into more readable chunk.
func (Simple) ToSyntaxOperand ¶
func (s Simple) ToSyntaxOperand(nextOp acal.Op) *acal.SyntaxOperand
ToSyntaxOperand returns the acal.SyntaxOperand representation of this Simple.