slice

package
v1.23.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

domain.go — `drift slice domain {add, verify, list, remove}`. Thin wrappers around the API gateway's /ops/slice/domain* endpoints.

Package lifecycle — browser handoff helpers for `drift slice resize`.

The configurable-slices feature originally replaced the old "pick a tier" CLI prompt with a browser form for both create and resize: the CLI mints a session against the configurator service, opens the user's browser at a single-use URL, and then polls a redeem endpoint until the session is finalized. The CLI never sees the SliceConfig the user typed in — it only sees the final Slice document the configurator forwarded to api/ops/slice/{create,resize}.

`drift slice create`'s default path no longer uses this — the configurator service was retired in favor of the `drift` dashboard (cmd/portal), which already has a full equivalent create-slice form; see cmd/slice/create.go's openPortalCreate. Resize hasn't moved yet, so this file (and the configurator handoff protocol it speaks) is still live for that one path.

Resize also supports a --headless-equivalent: --from <Driftfile> (see resize.go), which posts directly to the api gateway and is the only way to drive a resize from a non-interactive shell (CI, tests, scripts that pipe through ssh). It is intentionally less ergonomic than the browser flow — the user has to hand-author the Driftfile's target shape.

link.go — `drift slice link {add, list, remove}`.

Slice-to-slice linking: grant the ACTIVE slice permission to call another of your slices (e.g. an app slice → your own observability slice). Thin wrappers around the API gateway's /ops/slice/link endpoints; the operator records the link and unions the target's host into the active slice's egress allowlist.

Same-user only (the target must be a slice you own). This widens to "same Drift Team" when Teams land — the CLI surface won't change.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCmd

func GetCmd() *cobra.Command

GetCmd returns the "drift slice" command group for managing slices.

func TierLabel added in v1.6.0

func TierLabel(tier string) string

TierLabel renders a tier for display: hacker reads as "free", everything else as "configured". Shared by `slice list` and the portal.

Types

type SliceEntry added in v1.6.0

type SliceEntry struct {
	Name string `json:"name"`
	Tier string `json:"tier"`
}

SliceEntry is one slice in the caller's account, as returned by /ops/slice/list. Exported so the `drift portal` TUI can reuse the fetch.

func FetchSlices added in v1.6.0

func FetchSlices() ([]SliceEntry, error)

FetchSlices returns the caller's slices. Data-only (no printing) so both the `slice list` command and the portal dashboard can share it.

Jump to

Keyboard shortcuts

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