remote

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package remote is the client.Client over the HTTP contract: what an interface uses when the engine is another process, on this machine (a UNIX socket) or elsewhere (TCP, through whatever proxy the deployment runs). It speaks only the contract in openapi.yaml, so it is the one place in an interface's dependencies where an HTTP path appears. Subscribe answers ErrUnsupported until the events endpoint lands; live editing is the sync socket's, not this port's (docs/adr/0007).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Base string
	HTTP *http.Client
	// Headers are sent with every request: the proxy identity headers
	// when the client speaks for a person behind one, a bearer token
	// later.
	Headers http.Header
	// contains filtered or unexported fields
}

Client talks to Base ("http://host/api/v1").

func Dial

func Dial(addr string) (*Client, error)

Dial returns a client for an address: "http://..." or "https://..." over TCP, "unix:///path/to.sock" over a UNIX domain socket (the contract is then served at the socket's root, as `cartograph serve` does with CARTOGRAPH_ADDR=unix://...).

func New

func New(base string) *Client

New returns a client over an exact API base, for tests.

func (*Client) Actor

func (c *Client) Actor(ctx context.Context) (string, error)

func (*Client) Checks

func (c *Client) Checks(ctx context.Context, kind, id string) ([]client.Check, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Flow

func (c *Client) Flow(ctx context.Context, kind string) (client.Flow, bool, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, kind, id string) (client.Manifest, error)

func (*Client) Kinds

func (c *Client) Kinds(ctx context.Context) ([]string, error)

func (*Client) List

func (c *Client) List(ctx context.Context, kind, query string) ([]client.Summary, error)

func (*Client) SaveVersion

func (c *Client) SaveVersion(ctx context.Context, kind, id string, doc map[string]any, reason string) (client.Version, error)

func (*Client) SaveWorking

func (c *Client) SaveWorking(ctx context.Context, kind, id string, doc map[string]any) error

func (*Client) Schema

func (c *Client) Schema(ctx context.Context, kind string) ([]byte, error)

func (*Client) Settings

func (c *Client) Settings(ctx context.Context) (client.Settings, error)

func (*Client) SharedDocument

func (c *Client) SharedDocument(ctx context.Context, kind, id string) (string, error)

func (*Client) Subscribe

func (c *Client) Subscribe(context.Context, string, string) (<-chan client.Event, error)

func (*Client) Validate

func (c *Client) Validate(ctx context.Context, kind string, doc map[string]any) ([]client.Problem, error)

func (*Client) Working

func (c *Client) Working(ctx context.Context, kind, id string) (client.Manifest, error)

Jump to

Keyboard shortcuts

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