Versions in this module Expand all Collapse all v3 v3.0.0 Oct 24, 2024 Changes in this version + const Blob + const Boolean + const ClusterFormatV0 + const ClusterFormatV1 + const Float + const ISO8601 + const Integer + const MaxConcurrentLeaderConns + const Null + const RequestAdd + const RequestAssign + const RequestClient + const RequestCluster + const RequestDescribe + const RequestDescribeFormatV0 + const RequestDump + const RequestExec + const RequestExecSQL + const RequestFinalize + const RequestHeartbeat + const RequestInterrupt + const RequestLeader + const RequestOpen + const RequestPrepare + const RequestQuery + const RequestQuerySQL + const RequestRemove + const RequestTransfer + const RequestWeight + const ResponseDb + const ResponseEmpty + const ResponseFailure + const ResponseFiles + const ResponseMetadata + const ResponseNode + const ResponseNodeLegacy + const ResponseNodes + const ResponseResult + const ResponseRows + const ResponseStmt + const ResponseWelcome + const Spare + const StandBy + const Text + const UnixTime + const VersionLegacy + const VersionOne + const Voter + var ErrNoAvailableLeader = fmt.Errorf("no available dqlite leader server found") + var ErrRowsPart = fmt.Errorf("not all rows were returned in this response") + func DecodeDb(response *Message) (id uint32, err error) + func DecodeEmpty(response *Message) (err error) + func DecodeFailure(response *Message) (code uint64, message string, err error) + func DecodeMetadata(response *Message) (failureDomain uint64, weight uint64, err error) + func DecodeNode(response *Message) (id uint64, address string, err error) + func DecodeNodeCompat(protocol *Protocol, response *Message) (uint64, string, error) + func DecodeNodeLegacy(response *Message) (address string, err error) + func DecodeStmt(response *Message) (db uint32, id uint32, params uint64, err error) + func DecodeWelcome(response *Message) (heartbeatTimeout uint64, err error) + func Dial(ctx context.Context, address string) (net.Conn, error) + func EncodeAdd(request *Message, id uint64, address string) + func EncodeAssign(request *Message, id uint64, role uint64) + func EncodeClient(request *Message, id uint64) + func EncodeCluster(request *Message, format uint64) + func EncodeDescribe(request *Message, format uint64) + func EncodeDump(request *Message, name string) + func EncodeExecSQLV0(request *Message, db uint64, sql string, values NamedValues) + func EncodeExecSQLV1(request *Message, db uint64, sql string, values NamedValues32) + func EncodeExecV0(request *Message, db uint32, stmt uint32, values NamedValues) + func EncodeExecV1(request *Message, db uint32, stmt uint32, values NamedValues32) + func EncodeFinalize(request *Message, db uint32, stmt uint32) + func EncodeHeartbeat(request *Message, timestamp uint64) + func EncodeInterrupt(request *Message, db uint64) + func EncodeLeader(request *Message) + func EncodeOpen(request *Message, name string, flags uint64, vfs string) + func EncodePrepare(request *Message, db uint64, sql string) + func EncodeQuerySQLV0(request *Message, db uint64, sql string, values NamedValues) + func EncodeQuerySQLV1(request *Message, db uint64, sql string, values NamedValues32) + func EncodeQueryV0(request *Message, db uint32, stmt uint32, values NamedValues) + func EncodeQueryV1(request *Message, db uint32, stmt uint32, values NamedValues32) + func EncodeRemove(request *Message, id uint64) + func EncodeTransfer(request *Message, id uint64) + func EncodeWeight(request *Message, weight uint64) + type Config struct + AttemptTimeout time.Duration + BackoffCap time.Duration + BackoffFactor time.Duration + ConcurrentLeaderConns int64 + Dial DialFunc + DialTimeout time.Duration + PermitShared bool + RetryLimit uint + func (config Config) RetryStrategies() (strategies []strategy.Strategy) + type Connector struct + func NewDirectConnector(id uint64, address string, config Config, log logging.Func) *Connector + func NewLeaderConnector(store NodeStore, config Config, log logging.Func) *Connector + func (c *Connector) Connect(ctx context.Context) (*Protocol, error) + type DialFunc func(context.Context, string) (net.Conn, error) + type ErrRequest struct + Code uint64 + Description string + func (e ErrRequest) Error() string + type Error struct + Code int + Message string + func (e Error) Error() string + type Files struct + func DecodeFiles(response *Message) (files Files, err error) + func (f *Files) Close() + func (f *Files) Next() (string, []byte) + type InmemNodeStore struct + func NewInmemNodeStore() *InmemNodeStore + func (i *InmemNodeStore) Get(ctx context.Context) ([]NodeInfo, error) + func (i *InmemNodeStore) Set(ctx context.Context, servers []NodeInfo) error + type LeaderTracker struct + func (lt *LeaderTracker) DonateSharedProtocol(proto *Protocol) (accepted bool) + func (lt *LeaderTracker) GetLeaderAddr() string + func (lt *LeaderTracker) SetLeaderAddr(address string) + func (lt *LeaderTracker) TakeSharedProtocol() (proto *Protocol) + func (lt *LeaderTracker) UnsetLeaderAddr() + type Message struct + func (m *Message) Init(initialBufferSize int) + type NamedValues = []driver.NamedValue + type NamedValues32 = []driver.NamedValue + type NodeInfo struct + Address string + ID uint64 + Role NodeRole + type NodeRole int + func (r NodeRole) String() string + type NodeStore interface + Get func(context.Context) ([]NodeInfo, error) + Set func(context.Context, []NodeInfo) error + type Nodes []NodeInfo + func DecodeNodes(response *Message) (servers Nodes, err error) + type Protocol struct + func Handshake(ctx context.Context, conn net.Conn, version uint64, addr string) (*Protocol, error) + func (p *Protocol) Bad() + func (p *Protocol) Call(ctx context.Context, request, response *Message) (err error) + func (p *Protocol) Close() error + func (p *Protocol) Interrupt(ctx context.Context, request *Message, response *Message) (err error) + func (p *Protocol) More(ctx context.Context, response *Message) (err error) + type Result struct + LastInsertID uint64 + RowsAffected uint64 + func DecodeResult(response *Message) (result Result, err error) + type Rows struct + Columns []string + func DecodeRows(response *Message) (rows Rows, err error) + func (r *Rows) Close() error + func (r *Rows) ColumnTypes() ([]string, error) + func (r *Rows) Next(dest []driver.Value) error Other modules containing this package github.com/canonical/go-dqlite github.com/canonical/go-dqlite/v2