Documentation
¶
Index ¶
Constants ¶
View Source
const ( Eq token = "=" NotEq token = "!=" Gt token = ">" Gte token = ">=" Lt token = "<" Lte token = "<=" In token = "in" IsNotNull token = "is not null" )
View Source
const ( And operator = "and" Or operator = "or" )
View Source
const ( Epoch field = "epoch" Smesher field = "pubkey" Coinbase field = "coinbase" Id field = "id" Layer field = "layer" Address field = "address" Principal field = "principal" Proof field = "proof" )
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
Group []Op
GroupOperator operator
// CustomQuery is used to add custom query. If this is set, Field and Token will be ignored.
// This is useful for complex queries that can't be expressed with Field and Token.
// Value will be used for custom query if it's not nil.
// Remember about setting correct bind index for Value.
CustomQuery string
}
type Operations ¶
func FilterEpochOnly ¶ added in v1.6.0
func FilterEpochOnly(publish types.EpochID) Operations
Click to show internal directories.
Click to hide internal directories.