builder

package
v1.6.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Eq    token = "="
	NotEq token = "!="
	Gt    token = ">"
	Gte   token = ">="
	Lt    token = "<"
	Lte   token = "<="
	In    token = "in"
)
View Source
const (
	Epoch     field = "epoch"
	Smesher   field = "pubkey"
	Coinbase  field = "coinbase"
	Id        field = "id"
	Layer     field = "layer"
	Address   field = "address"
	Principal field = "principal"
)
View Source
const (
	Offset  modifier = "offset"
	Limit   modifier = "limit"
	OrderBy modifier = "order by"
	GroupBy modifier = "group by"
)

Variables

This section is empty.

Functions

func BindingsFrom

func BindingsFrom(operations Operations) sql.Encoder

func FilterFrom

func FilterFrom(operations Operations) string

Types

type Modifier

type Modifier struct {
	Key modifier
	// Value will be type casted to one the expected types.
	// Modifier will panic if it doesn't match any of expected.
	Value any
}

type Op

type Op struct {
	// Prefix will be added before field name
	Prefix string
	Field  field
	Token  token
	// Value will be type casted to one the expected types.
	// Operation will panic if it doesn't match any of expected.
	Value any
}

type Operations

type Operations struct {
	Filter    []Op
	Modifiers []Modifier
	StartWith string
}

func FilterEpochOnly added in v1.6.0

func FilterEpochOnly(publish types.EpochID) Operations

Jump to

Keyboard shortcuts

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