Documentation
¶
Overview ¶
Package koutendb provides a native Go TCP client for KoutenDB wire v1. It does not require cgo or libkoutendb. Clients serialize operations and may be shared by goroutines. Use separate clients for parallel requests.
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) Get(ctx context.Context, id ID) (*Payload, error)
- func (c *Client) GetJSON(ctx context.Context, id ID, dst any) (bool, error)
- func (c *Client) GoString() string
- func (c *Client) Health(ctx context.Context) (string, error)
- func (c *Client) Put(ctx context.Context, ring string, data []byte) (ID, error)
- func (c *Client) PutCodec(ctx context.Context, ring string, data []byte, codec Codec) (ID, error)
- func (c *Client) PutJSON(ctx context.Context, ring string, value any) (ID, error)
- func (c *Client) Query(ctx context.Context, id ID, selection string) (*Payload, error)
- func (c *Client) QueryJSON(ctx context.Context, id ID, selection string, dst any) (bool, error)
- func (c *Client) String() string
- type Codec
- type Credentials
- type Error
- type ID
- type Options
- type Payload
- type TLSOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnection = &Error{kind: "connection", message: "koutendb: connection failed"} ErrTimeout = &Error{kind: "timeout", message: "koutendb: operation timed out"} ErrAuthentication = &Error{kind: "authentication", message: "koutendb: authentication rejected"} ErrProtocol = &Error{kind: "protocol", message: "koutendb: invalid wire response"} ErrVersionMismatch = &Error{kind: "version", message: "koutendb: unsupported wire version"} ErrServer = &Error{kind: "server", message: "koutendb: server rejected request"} ErrIndeterminateWrite = &Error{kind: "indeterminate", message: "koutendb: write outcome unknown; do not automatically retry"} ErrInvalidInput = &Error{kind: "input", message: "koutendb: invalid option or request"} ErrClosed = &Error{kind: "closed", message: "koutendb: client closed"} )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is concurrency-safe. Do not copy a Client after Dial.
func (*Client) Close ¶
Close waits for the current bounded operation, closes all peers, and is idempotent.
type Credentials ¶
type Credentials struct{ Username, Password, AuthToken, SecretKey string }
func (Credentials) GoString ¶
func (c Credentials) GoString() string
func (Credentials) MarshalJSON ¶
func (Credentials) MarshalJSON() ([]byte, error)
func (Credentials) String ¶
func (Credentials) String() string
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error identifies a failure without exposing server messages or credentials.
type ID ¶
ID preserves all six server-supplied fields. Never calculate placement locally.
func (ID) MarshalText ¶
func (*ID) UnmarshalText ¶
type Options ¶
type Options struct {
ConnectTimeout, ReadTimeout, WriteTimeout time.Duration
MaxFrameBytes int
MaxRedirects int
DisableReadRetry bool
Credentials Credentials
Galaxy string
TLS *TLSOptions
}
Options is copied at Dial. Zero durations/limits select defaults.
func (Options) MarshalJSON ¶
type TLSOptions ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
conformance
command
Command conformance adapts JSONL requests to the shared core test harness.
|
Command conformance adapts JSONL requests to the shared core test harness. |
|
Package embedded provides the optional KoutenDB C ABI wrapper.
|
Package embedded provides the optional KoutenDB C ABI wrapper. |
|
examples
|
|
|
tcp
command
|
Click to show internal directories.
Click to hide internal directories.