apiclient

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package apiclient is the public Go client for the Zattera API. The CLI is built on it; third parties may use it directly. It wraps a single gRPC connection with bearer-token auth and typed service accessors.

Leader forwarding: any control node accepts unary mutating calls and transparently forwards them to the current raft leader (T-08), so a client may target any node for these. Streaming RPCs are NOT forwarded — they are served from the contacted node's local (eventually-consistent) state, or, for leader-only streams, fail with codes.FailedPrecondition carrying the leader address so the caller can redial it. Point streaming calls at the leader when strong consistency matters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

Client is a connected API client.

func New

func New(cfg Config) (*Client, error)

New dials the API. The connection is lazy; the first RPC connects.

func (*Client) Close

func (c *Client) Close() error

Close tears down the connection.

type Config

type Config struct {
	// Address like "paas.example.com:8443" (scheme optional, https implied).
	Address string
	Token   string
	// CACertPEM pins the cluster CA. Empty = system roots.
	CACertPEM []byte
	// InsecureSkipVerify is for `--dev` servers with self-signed certs whose
	// CA the CLI has not stored (discouraged; prefer CACertPEM).
	InsecureSkipVerify bool
}

Config for a client connection.

Jump to

Keyboard shortcuts

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