queries

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryDecoder

type QueryDecoder func(data []byte, ptrTargetModel interface{}) error

QueryDecoder defines a function that decodes query bytes to query models

var DefaultQueryDecode QueryDecoder = json.Unmarshal

DefaultQueryDecode is the default function used to decode query bytes to query models

type QueryEncoder

type QueryEncoder func(queryModel interface{}) ([]byte, error)

QueryEncoder defines a function that encodes query models to bytes

var DefaultQueryEncode QueryEncoder = json.Marshal

DefaultQueryEncode is the default function used to marshal query models into bytes

type QueryHandler

type QueryHandler interface {
	// QueryPath defines the path of the query in the module to retrieve information
	QueryPath() string
	// Validate validates the correctness of the query formation in a stateless way
	Validate() error
}

QueryHandler abstracts the functionality of a query handler CONTRACT: must be a struct pointer

Jump to

Keyboard shortcuts

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