Versions in this module Expand all Collapse all v3 v3.0.0 Oct 24, 2024 Changes in this version + const LogDebug + const LogError + const LogInfo + const LogNone + const LogWarn + const Spare + const StandBy + const Voter + var NewInmemNodeStore = protocol.NewInmemNodeStore + func DefaultDialFunc(ctx context.Context, address string) (net.Conn, error) + func DefaultLogFunc(l LogLevel, format string, a ...interface{}) + type Client struct + func FindLeader(ctx context.Context, store NodeStore, options ...Option) (*Client, error) + func New(ctx context.Context, address string, options ...Option) (*Client, error) + func (c *Client) Add(ctx context.Context, node NodeInfo) error + func (c *Client) Assign(ctx context.Context, id uint64, role NodeRole) error + func (c *Client) Close() error + func (c *Client) Cluster(ctx context.Context) ([]NodeInfo, error) + func (c *Client) Describe(ctx context.Context) (*NodeMetadata, error) + func (c *Client) Dump(ctx context.Context, dbname string) ([]File, error) + func (c *Client) Leader(ctx context.Context) (*NodeInfo, error) + func (c *Client) Remove(ctx context.Context, id uint64) error + func (c *Client) Transfer(ctx context.Context, id uint64) error + func (c *Client) Weight(ctx context.Context, weight uint64) error + type Connector protocol.Connector + func NewDirectConnector(id uint64, address string, options ...Option) *Connector + func NewLeaderConnector(store NodeStore, options ...Option) *Connector + func (connector *Connector) Connect(ctx context.Context) (*Client, error) + type DatabaseNodeStore struct + func NewNodeStore(db *sql.DB, schema, table, column string, options ...NodeStoreOption) *DatabaseNodeStore + func (d *DatabaseNodeStore) Get(ctx context.Context) ([]NodeInfo, error) + func (d *DatabaseNodeStore) Set(ctx context.Context, servers []NodeInfo) error + type DialFunc = protocol.DialFunc + func DialFuncWithTLS(dial DialFunc, config *tls.Config) DialFunc + type File struct + Data []byte + Name string + type InmemNodeStore = protocol.InmemNodeStore + type LogFunc = logging.Func + type LogLevel = logging.Level + type NodeInfo = protocol.NodeInfo + type NodeMetadata struct + FailureDomain uint64 + Weight uint64 + type NodeRole = protocol.NodeRole + type NodeStore = protocol.NodeStore + func DefaultNodeStore(filename string) (NodeStore, error) + type NodeStoreOption func(*nodeStoreOptions) + func WithNodeStoreWhereClause(where string) NodeStoreOption + type Option func(*options) + func WithConcurrentLeaderConns(maxConns int64) Option + func WithDialFunc(dial DialFunc) Option + func WithLogFunc(log LogFunc) Option + type YamlNodeStore struct + func NewYamlNodeStore(path string) (*YamlNodeStore, error) + func (s *YamlNodeStore) Get(ctx context.Context) ([]NodeInfo, error) + func (s *YamlNodeStore) Set(ctx context.Context, servers []NodeInfo) error Other modules containing this package github.com/canonical/go-dqlite github.com/canonical/go-dqlite/v2