extent

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFunc

func CompareFunc(o order.Which) expr.ValueCompareFn

CompareFunc returns a generic comparator suitable for use in a Range based on the order of values in the range, i.e., when order is desc then the first value is larger than the last value and Before is true for larger values while After is true for smaller values, etc.

func Format

func Format(s Span) string

func Overlaps

func Overlaps(a, b Span) bool

Types

type Generic

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

func NewGeneric

func NewGeneric(lower, upper zed.Value, cmp expr.ValueCompareFn) *Generic

Create a new Range from generic range of zed.Values according to lower and upper. The range is not sensitive to the absolute order of lower and upper.

func NewGenericFromOrder

func NewGenericFromOrder(first, last zed.Value, o order.Which) *Generic

func (*Generic) After

func (g *Generic) After(zv zed.Value) bool

func (*Generic) Before

func (g *Generic) Before(zv zed.Value) bool

func (*Generic) Crop

func (g *Generic) Crop(s Span) bool

func (*Generic) Extend

func (g *Generic) Extend(zv zed.Value)

func (*Generic) First

func (g *Generic) First() zed.Value

func (*Generic) In

func (g *Generic) In(zv zed.Value) bool

func (*Generic) Last

func (g *Generic) Last() zed.Value

func (*Generic) Overlaps

func (g *Generic) Overlaps(first, last zed.Value) bool

func (*Generic) String

func (g *Generic) String() string

type Span

type Span interface {
	First() zed.Value
	Last() zed.Value
	Before(zed.Value) bool
	After(zed.Value) bool
	In(zed.Value) bool
	Overlaps(zed.Value, zed.Value) bool
	Crop(Span) bool
	Extend(zed.Value)
	String() string
}

Span represents the closed interval [first, last] where first is "less than" last with respect to the Span's order.Which.

Jump to

Keyboard shortcuts

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