gentypes

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValueAndPrefix

func ValueAndPrefix(val interface{}) (interface{}, string)

For Fields declared as map[string]type (type = int, string, time, bool, value) in lql, we need to determine which nested key/value combo to search for

Types

type FieldType

type FieldType struct {
	Field    string // Field Name
	Prefix   string // .f, .b, .i, .v for nested object types
	Path     string // mapstr_fieldname ,etc, prefixed
	Type     value.ValueType
	TypeName string
}

FieldType Describes a field's usage within Elasticsearch - is it nested? which changes query semantics - prefix for nested object values

func (*FieldType) Nested

func (f *FieldType) Nested() bool

func (*FieldType) Numeric

func (f *FieldType) Numeric() bool

Numeric returns true if field type has numeric values.

func (*FieldType) PathAndPrefix

func (f *FieldType) PathAndPrefix(val string) string

func (*FieldType) PrefixAndValue

func (f *FieldType) PrefixAndValue(val interface{}) (string, interface{})

func (*FieldType) String

func (f *FieldType) String() string

type FilterValidate

type FilterValidate func(fs *rel.FilterStatement) error

FilterValidate interface Will walk a filter statement validating columns, types against underlying Schema.

type MissingFieldError

type MissingFieldError struct {
	Field string
}

MissingFieldErrors are returned when a segment can't be evaluated due to a referenced field missing from a schema.

func MissingField

func MissingField(field string) *MissingFieldError

MissingField creates a new MissingFieldError for the given field.

func (*MissingFieldError) Error

func (m *MissingFieldError) Error() string

func (*MissingFieldError) Reason

func (m *MissingFieldError) Reason() string

func (*MissingFieldError) Status

func (m *MissingFieldError) Status() int

type Payload

type Payload struct {
	Size   *int                   `json:"size,omitempty"`
	Filter interface{}            `json:"filter,omitempty"`
	Fields []string               `json:"fields,omitempty"`
	Sort   []map[string]SortOrder `json:"sort,omitempty"`
}

Payload is the top Level Request to Elasticsearch

func (*Payload) SortAsc

func (p *Payload) SortAsc(field string)

func (*Payload) SortDesc

func (p *Payload) SortDesc(field string)

type SchemaColumns

type SchemaColumns interface {
	// Underlying data type of column
	Column(col string) (value.ValueType, bool)
	// ColumnInfo of a FilterStatement column explains this column
	// and how to map to Elasticsearch field or false if the field
	// doesn't exist.
	ColumnInfo(col string) (*FieldType, bool)
}

SchemaColumns provides info on fields/columns to help the generator understand how to map Columns to Underlying es fields

type SortOrder

type SortOrder struct {
	Order string `json:"order"`
}

SortOder of the es query request

Jump to

Keyboard shortcuts

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