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 ¶
- type Client
- func (c *Client) Actor(ctx context.Context) (string, error)
- func (c *Client) Checks(ctx context.Context, kind, id string) ([]client.Check, error)
- func (c *Client) Close() error
- func (c *Client) Flow(ctx context.Context, kind string) (client.Flow, bool, error)
- func (c *Client) Get(ctx context.Context, kind, id string) (client.Manifest, error)
- func (c *Client) Kinds(ctx context.Context) ([]string, error)
- func (c *Client) List(ctx context.Context, kind, query string) ([]client.Summary, error)
- func (c *Client) SaveVersion(ctx context.Context, kind, id string, doc map[string]any, reason string) (client.Version, error)
- func (c *Client) SaveWorking(ctx context.Context, kind, id string, doc map[string]any) error
- func (c *Client) Schema(ctx context.Context, kind string) ([]byte, error)
- func (c *Client) Settings(ctx context.Context) (client.Settings, error)
- func (c *Client) SharedDocument(ctx context.Context, kind, id string) (string, error)
- func (c *Client) Subscribe(context.Context, string, string) (<-chan client.Event, error)
- func (c *Client) Validate(ctx context.Context, kind string, doc map[string]any) ([]client.Problem, error)
- func (c *Client) Working(ctx context.Context, kind, id string) (client.Manifest, error)
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 ¶
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://...).