read

package
v1.0.0-beta.97 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExprField

type ExprField struct {
	FieldAlias string
	Expr       expression.Expr
}

func NewExprField

func NewExprField(alias string, expr expression.Expr) *ExprField

func (*ExprField) Alias

func (e *ExprField) Alias() string

func (*ExprField) Apply

func (*ExprField) Apply(_ map[string]*JSONObject) ([]byte, error)

func (*ExprField) GetJSONAlias

func (e *ExprField) GetJSONAlias() []byte

func (*ExprField) Include

func (*ExprField) Include() bool

type Field

type Field interface {
	Include() bool
	Alias() string
	GetJSONAlias() []byte
	Apply(map[string]*JSONObject) ([]byte, error)
}

type FieldFactory

type FieldFactory struct {
	Exclude       map[string]Field
	Include       map[string]Field
	FetchedValues map[string]*JSONObject
}

func BuildFields

func BuildFields(reqFields jsoniter.RawMessage) (*FieldFactory, error)

func (*FieldFactory) AddField

func (factory *FieldFactory) AddField(f Field)

func (*FieldFactory) Apply

func (factory *FieldFactory) Apply(document []byte) ([]byte, error)

type JSONObject

type JSONObject struct {
	Key      []byte
	Value    []byte
	DataType jsonparser.ValueType
}

func (*JSONObject) GetKey

func (j *JSONObject) GetKey() []byte

func (*JSONObject) GetValue

func (j *JSONObject) GetValue() []byte

type SimpleField

type SimpleField struct {
	Name string
	Incl bool
}

func (*SimpleField) Alias

func (s *SimpleField) Alias() string

func (*SimpleField) Apply

func (s *SimpleField) Apply(data map[string]*JSONObject) ([]byte, error)

func (*SimpleField) GetJSONAlias

func (s *SimpleField) GetJSONAlias() []byte

func (*SimpleField) Include

func (s *SimpleField) Include() bool

Jump to

Keyboard shortcuts

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