expr

package
v0.0.0-...-f7bad0d Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assigned

type Assigned struct {
	// contains filtered or unexported fields
}

Assigned associates a name with an expression.

func NewAssigned

func NewAssigned(name string, expr any) Assigned

NewAssigned creates a new named expression.

func (Assigned) Expression

func (n Assigned) Expression() any

Expr returns the expression.

func (Assigned) Name

func (n Assigned) Name() string

Name returns the name of the expression.

type Bound

type Bound[T any] struct {
	// contains filtered or unexported fields
}

Bound represents a bound. either exclusive or inclusive.

func NewBound

func NewBound[T any](value T, exclusive bool) *Bound[T]

NewBound creates a new bound.

func (*Bound[T]) Exclusive

func (b *Bound[T]) Exclusive() bool

Exclusive returns true if the bound is exclusive.

func (*Bound[T]) IsEmpty

func (b *Bound[T]) IsEmpty() bool

IsEmpty returns true if the bound is nil.

func (Bound[T]) Value

func (b Bound[T]) Value() T

Value returns the value of the bound.

type Exact

type Exact[T any] struct {
	// contains filtered or unexported fields
}

Exact represents an exact equality expression.

func NewExact

func NewExact[T any](value T) Exact[T]

NewExact creates a new equality expression.

func (Exact[T]) Value

func (e Exact[T]) Value() T

Value returns the value of the equality expression.

type Range

type Range[T any] struct {
	// contains filtered or unexported fields
}

Range represents a range of values of a sequential type.

func NewRange

func NewRange[T any](low, high *Bound[T]) Range[T]

NewRange creates a new range lookup expression.

func (Range[T]) High

func (r Range[T]) High() *Bound[T]

High returns the high bound of the range.

func (Range[T]) Low

func (r Range[T]) Low() *Bound[T]

Low returns the low bound of the range.

func (Range[T]) String

func (r Range[T]) String() string

String returns the string representation of the range.

type Set

type Set[T any] struct {
	// contains filtered or unexported fields
}

Set represents a set that the value must be in.

func NewSet

func NewSet[T any](values ...T) Set[T]

NewSet creates a new in expression.

func (Set[T]) Values

func (i Set[T]) Values() []T

Values returns the values of the in expression.

Jump to

Keyboard shortcuts

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