Documentation
¶
Overview ¶
Package client implements the rift tunnel client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMCPNotCompiled = errors.New("MCP support not compiled in; rebuild with -tags mcp")
ErrMCPNotCompiled is returned when the binary was built without the `mcp` build tag and the user requests Protocol=mcp at runtime. Rebuild with `go build -tags mcp` to enable the MCP wire protocol.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to a rift server and manages tunnel registration.
func New ¶
func New(cfg config.ClientConfig, ts store.TokenStore, log *zap.Logger) *Client
New creates a Client.
func (*Client) Close ¶ added in v0.1.0
Close cancels an in-flight Connect and waits for it to return. Idempotent; subsequent calls return nil without blocking. Safe to call before Connect.
func (*Client) Connect ¶
Connect dials the server and reconnects with exponential backoff until ctx is done. Returns a non-nil error only for permanent server errors (auth failure, rate limit, token expired) that retrying will not fix, or the parent ctx error (context.Canceled / context.DeadlineExceeded) when the parent ctx caused the exit. Returns nil only when Close was the cause of exit.
When the parent ctx expires while the most recent dial attempt failed (typically TLS verification or a refused connection), the returned error joins the parent ctx error with the last connection error so callers can inspect both via errors.Is.