api

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package api provides the `ana api` verb — an authenticated raw-JSON passthrough over the shared transport client. Dispatches to a single leaf. Two path forms:

  • Leading slash → sent verbatim (REST e.g. `/v1/...`, or a pre-resolved RPC path e.g. `/rpc/public/<service>/<Method>`).
  • No leading slash → treated as a fully-qualified Connect-RPC short form (e.g. `textql.rpc.public.auth.PublicAuthService/GetOrganization`) and prefixed with `/rpc/public/`.

Like every other verb package, api never imports internal/transport — the caller adapts its transport client to the narrow Deps.DoRaw field.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(deps Deps) cli.Command

New returns the `api` verb as a single leaf command. Unlike other verb packages this is not a *cli.Group — there are no subcommands, just a path positional.

Types

type Deps

type Deps struct {
	DoRaw func(ctx context.Context, method, path string, body []byte) (int, []byte, error)
}

Deps is the injection boundary. A real wiring layer adapts transport.Client.DoRaw; tests pass fakes that record (method, path, body) so assertions can inspect the outbound request and the returned response.

Jump to

Keyboard shortcuts

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