session

package
v0.0.0-...-a56bf6c Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: PostgreSQL Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPQR_DISTRIBUTION            = "__spqr__distribution"
	SPQR_DEFAULT_ROUTE_BEHAVIOUR = "__spqr__default_route_behaviour"
	SPQR_AUTO_DISTRIBUTION       = "__spqr__auto_distribution"
	SPQR_DISTRIBUTION_KEY        = "__spqr__distribution_key"
	SPQR_ALLOW_MULTISHARD        = "__spqr__allow_multishard"
	SPQR_SHARDING_KEY            = "__spqr__sharding_key"
	SPQR_SCATTER_QUERY           = "__spqr__scatter_query"
	SPQR_REPLY_NOTICE            = "__spqr__reply_notice"
	SPQR_MAINTAIN_PARAMS         = "__spqr__maintain_params"
	SPQR_EXECUTE_ON              = "__spqr__execute_on"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DummySessionParamHandler

type DummySessionParamHandler struct {
	// contains filtered or unexported fields
}

func (*DummySessionParamHandler) AllowMultishard

func (t *DummySessionParamHandler) AllowMultishard() bool

AllowMultishard implements SessionParamsHolder.

func (*DummySessionParamHandler) AutoDistribution

func (t *DummySessionParamHandler) AutoDistribution() string

AutoDistribution implements SessionParamsHolder.

func (*DummySessionParamHandler) BindParamFormatCodes

func (t *DummySessionParamHandler) BindParamFormatCodes() []int16

BindParamFormatCodes implements SessionParamsHolder. BindParamFormatCodes returns the format codes for binding parameters.

func (*DummySessionParamHandler) BindParams

func (t *DummySessionParamHandler) BindParams() [][]byte

BindParams implements session.SessionParamsHolder. BindParams returns the byte slices stored in the DummySessionParamHandler.

func (*DummySessionParamHandler) DefaultRouteBehaviour

func (t *DummySessionParamHandler) DefaultRouteBehaviour() string

DefaultRouteBehaviour implements session.SessionParamsHolder. DefaultRouteBehaviour returns the default behavior for the route.

func (*DummySessionParamHandler) Distribution

func (t *DummySessionParamHandler) Distribution() string

Distribution implements session.SessionParamsHolder. Distribution returns the distribution value of the DummySessionParamHandler.

func (*DummySessionParamHandler) DistributionIsDefault

func (t *DummySessionParamHandler) DistributionIsDefault() bool

DistributionIsDefault implements session.SessionParamsHolder. DistributionIsDefault returns whether the distribution is set to default.

func (*DummySessionParamHandler) DistributionKey

func (t *DummySessionParamHandler) DistributionKey() string

DistributionKey implements SessionParamsHolder.

func (*DummySessionParamHandler) ExecuteOn

func (t *DummySessionParamHandler) ExecuteOn() string

ExecuteOn implements SessionParamsHolder.

func (*DummySessionParamHandler) MaintainParams

func (t *DummySessionParamHandler) MaintainParams() bool

MaintainParams implements SessionParamsHolder.

func (*DummySessionParamHandler) RouteHint

RouteHint implements session.SessionParamsHolder. RouteHint returns the route hint associated with the DummySessionParamHandler.

func (*DummySessionParamHandler) SetAllowMultishard

func (t *DummySessionParamHandler) SetAllowMultishard(v bool)

SetAllowMultishard implements SessionParamsHolder.

func (*DummySessionParamHandler) SetAutoDistribution

func (t *DummySessionParamHandler) SetAutoDistribution(string)

SetAutoDistribution implements SessionParamsHolder.

func (*DummySessionParamHandler) SetBindParams

func (t *DummySessionParamHandler) SetBindParams(b [][]byte)

SetBindParams implements session.SessionParamsHolder. SetBindParams sets the bind parameters for the DummySessionParamHandler. It takes a 2D byte slice as input and assigns it to the 'b' field of the struct.

func (*DummySessionParamHandler) SetDefaultRouteBehaviour

func (t *DummySessionParamHandler) SetDefaultRouteBehaviour(b string)

SetDefaultRouteBehaviour implements session.SessionParamsHolder. SetDefaultRouteBehaviour sets the default route behaviour for the DummySessionParamHandler. It takes a string parameter `b` representing the behaviour and assigns it to the `behaviour` field of the DummySessionParamHandler struct.

func (*DummySessionParamHandler) SetDistribution

func (t *DummySessionParamHandler) SetDistribution(d string)

SetDistribution implements session.SessionParamsHolder. SetDistribution sets the distribution for the DummySessionParamHandler.

func (*DummySessionParamHandler) SetDistributionKey

func (t *DummySessionParamHandler) SetDistributionKey(string)

SetDistributionKey implements SessionParamsHolder.

func (*DummySessionParamHandler) SetExecuteOn

func (t *DummySessionParamHandler) SetExecuteOn(v string)

SetExecuteOn implements SessionParamsHolder.

func (*DummySessionParamHandler) SetMaintainParams

func (t *DummySessionParamHandler) SetMaintainParams(bool)

SetMaintainParams implements SessionParamsHolder.

func (*DummySessionParamHandler) SetParamFormatCodes

func (t *DummySessionParamHandler) SetParamFormatCodes(f []int16)

SetParamFormatCodes implements SessionParamsHolder. SetParamFormatCodes sets the format codes for the DummySessionParamHandler. It takes a slice of int16 values as the input and assigns it to the 'f' field of the DummySessionParamHandler.

func (*DummySessionParamHandler) SetRouteHint

func (t *DummySessionParamHandler) SetRouteHint(rh routehint.RouteHint)

SetRouteHint implements session.SessionParamsHolder. SetRouteHint sets the route hint for the DummySessionParamHandler. It takes a route hint as a parameter and assigns it to the `rh` field of the DummySessionParamHandler.

func (*DummySessionParamHandler) SetShardingKey

func (t *DummySessionParamHandler) SetShardingKey(k string)

SetShardingKey implements session.SessionParamsHolder. SetShardingKey sets the sharding key for the DummySessionParamHandler. The sharding key is used to determine the partition or shard where the data will be stored.

func (*DummySessionParamHandler) SetShowNoticeMsg

func (t *DummySessionParamHandler) SetShowNoticeMsg(bool)

SetShowNoticeMsg implements SessionParamsHolder.

func (*DummySessionParamHandler) ShardingKey

func (t *DummySessionParamHandler) ShardingKey() string

ShardingKey implements session.SessionParamsHolder. ShardingKey returns the sharding key associated with the DummySessionParamHandler.

func (*DummySessionParamHandler) ShowNoticeMsg

func (t *DummySessionParamHandler) ShowNoticeMsg() bool

ShowNoticeMsg implements SessionParamsHolder.

type SessionParamsHolder

type SessionParamsHolder interface {

	// Get current session DRB
	DefaultRouteBehaviour() string
	SetDefaultRouteBehaviour(string)

	SetAutoDistribution(string)
	AutoDistribution() string

	SetDistributionKey(string)
	DistributionKey() string

	AllowMultishard() bool
	SetAllowMultishard(bool)

	// Get current session distribution
	Distribution() string
	SetDistribution(string)

	// ShardingKey
	ShardingKey() string
	SetShardingKey(string)

	BindParams() [][]byte
	SetBindParams([][]byte)

	BindParamFormatCodes() []int16
	SetParamFormatCodes([]int16)

	ShowNoticeMsg() bool
	SetShowNoticeMsg(bool)

	MaintainParams() bool
	SetMaintainParams(bool)

	ExecuteOn() string
	SetExecuteOn(string)

	RouteHint() routehint.RouteHint
	SetRouteHint(routehint.RouteHint)
}

func NewDummyHandler

func NewDummyHandler(distribution string) SessionParamsHolder

NewDummyHandler creates a new instance of DummySessionParamHandler with the specified distribution. It returns a SessionParamsHolder interface.

Jump to

Keyboard shortcuts

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