xcontext

package
Version: v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.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 QueryTuple

type QueryTuple struct {
	// Query string.
	Query string

	// Backend name.
	Backend string

	// Range info.
	Range string
}

QueryTuple tuple.

type QueryTuples

type QueryTuples []QueryTuple

QueryTuples represents the query tuple slice.

func (QueryTuples) Len

func (q QueryTuples) Len() int

Len impl.

func (QueryTuples) Less

func (q QueryTuples) Less(i, j int) bool

Less impl.

func (QueryTuples) Swap

func (q QueryTuples) Swap(i, j int)

Swap impl.

type RequestContext

type RequestContext struct {
	RawQuery string
	Mode     RequestMode
	TxnMode  TxnMode
	Querys   []QueryTuple
}

RequestContext tuple.

func NewRequestContext

func NewRequestContext() *RequestContext

NewRequestContext creates RequestContext The default Mode is ReqNormal

type RequestMode

type RequestMode int

RequestMode type.

const (
	// ReqNormal mode will send the query to the backend which computed by the planner.
	// This is the default mode.
	ReqNormal RequestMode = iota

	// ReqScatter mode will send the RawQuery to all backends.
	ReqScatter

	// ReqSingle mode will send the RawQuery to the first normal backend which computed by the scatter,
	// it is random sometimes.
	ReqSingle
)

type ResultContext

type ResultContext struct {
	Results *sqltypes.Result
}

ResultContext tuple.

func NewResultContext

func NewResultContext() *ResultContext

NewResultContext returns the result context.

type TxnMode

type TxnMode int

TxnMode type.

const (
	// TxnNone enum.
	TxnNone TxnMode = iota
	// TxnRead enum.
	TxnRead
	// TxnWrite enum.
	TxnWrite
)

Source Files

Jump to

Keyboard shortcuts

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