connector

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package connector provides the `ana connector` verb tree: list, get, create, update, delete, test, tables, examples. It is pure dispatch glue around an injected Unary RPC call (see Deps) so tests pass a fake and the package never imports internal/transport or internal/config directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(deps Deps) *cli.Group

New returns the `connector` verb group. The returned *cli.Group is safe to register under any name in the root verb table.

Types

type Deps

type Deps struct {
	Unary    func(ctx context.Context, path string, req, resp any) error
	Endpoint func() string
}

Deps is the narrow injection boundary. Unary JSON-encodes req, POSTs it to path, and JSON-decodes the response into *resp. A concrete wiring layer adapts transport.Client to this function field; tests pass a recording fake.

Endpoint is a closure that returns the resolved API base URL (after --endpoint / profile / env precedence), used by OAuth leaves whose success notes direct users at the correct TextQL web app to complete the browser handshake. The closure form lets the wiring layer defer config-load until the OAuth verb actually runs (so non-OAuth verbs never trigger it). A nil closure or an empty return value falls back to defaultEndpoint.

Jump to

Keyboard shortcuts

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