client

package
v0.0.0-...-c030021 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDialFunc

func DefaultDialFunc(ctx context.Context, address string) (net.Conn, error)

DefaultDialFunc is the default dial function, which can handle plain TCP and Unix socket endpoints. You can customize it with WithDialFunc()

Types

type Client

type Client struct{}

func (*Client) Cluster

func (c *Client) Cluster(context.Context) ([]dqlite.NodeInfo, error)

func (*Client) Leader

func (c *Client) Leader(ctx context.Context) (*dqlite.NodeInfo, error)

Leader returns information about the current leader, if any.

type DialFunc

type DialFunc func(context.Context, string) (net.Conn, error)

func DialFuncWithTLS

func DialFuncWithTLS(dial DialFunc, config *tls.Config) DialFunc

DialFuncWithTLS returns a dial function that uses TLS encryption.

The given dial function will be used to establish the network connection, and the given TLS config will be used for encryption.

type LogFunc

type LogFunc = func(LogLevel, string, ...interface{})

LogFunc is a function that can be used for logging.

type LogLevel

type LogLevel int

LogLevel defines the logging level.

const (
	LogNone LogLevel = iota
	LogDebug
	LogInfo
	LogWarn
	LogError
)

Available logging levels.

func (LogLevel) String

func (l LogLevel) String() string

type NodeStore

type NodeStore interface {
	Get(context.Context) ([]dqlite.NodeInfo, error)
	Set(context.Context, []dqlite.NodeInfo) error
}

type YamlNodeStore

type YamlNodeStore struct{}

func NewYamlNodeStore

func NewYamlNodeStore(_ string) (*YamlNodeStore, error)

func (*YamlNodeStore) Get

func (*YamlNodeStore) Set

Jump to

Keyboard shortcuts

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