Documentation ¶
Index ¶
- type Chainable
- func (c *Chainable[T]) Divide(n T) IChainable[T]
- func (c Chainable[T]) Error() error
- func (c Chainable[T]) IsError() bool
- func (c Chainable[T]) LastErrorOperation() Operation
- func (c Chainable[T]) LastOperation() Operation
- func (c Chainable[T]) LastSuccessOperation() Operation
- func (c *Chainable[T]) Minus(n T) IChainable[T]
- func (c *Chainable[T]) Multiply(n T) IChainable[T]
- func (c *Chainable[T]) Plus(n T) IChainable[T]
- func (c Chainable[T]) Result() T
- func (c Chainable[T]) ResultAndError() (T, error)
- type IChainable
- type IChainableOperation
- type Number
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chainable ¶
type Chainable[T Number] struct { // contains filtered or unexported fields }
func (*Chainable[T]) Divide ¶
func (c *Chainable[T]) Divide(n T) IChainable[T]
Divide performs division operation.
func (Chainable[T]) LastErrorOperation ¶ added in v2.1.0
func (Chainable[T]) LastOperation ¶ added in v2.1.0
func (Chainable[T]) LastSuccessOperation ¶ added in v2.1.0
func (*Chainable[T]) Minus ¶ added in v2.2.0
func (c *Chainable[T]) Minus(n T) IChainable[T]
Minus performs substraction operation.
func (*Chainable[T]) Multiply ¶
func (c *Chainable[T]) Multiply(n T) IChainable[T]
Multiply performs multiplication operation.
func (*Chainable[T]) Plus ¶
func (c *Chainable[T]) Plus(n T) IChainable[T]
Plus performs addition operation.
func (Chainable[T]) ResultAndError ¶ added in v2.1.0
type IChainable ¶
type IChainable[T Number] interface { IChainableOperation[T] Result() T Error() error IsError() bool ResultAndError() (T, error) LastSuccessOperation() Operation LastErrorOperation() Operation LastOperation() Operation }
func New ¶
func New[T Number](value T) IChainable[T]
type IChainableOperation ¶
type IChainableOperation[T Number] interface { Plus(T) IChainable[T] Minus(T) IChainable[T] Multiply(T) IChainable[T] Divide(T) IChainable[T] }
type Number ¶ added in v2.2.0
type Number interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.