cli

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cli holds the marketplace's user-facing commands: browsing the catalog, and enabling an offering in a workspace.

Enabling is a plain kcp APIBinding the caller creates with their own credential, so these commands are sugar over surfaces that already exist — there is no marketplace API to call and nothing privileged in the path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEnableCommand

func NewEnableCommand(defaults ServerDefaults, resolve WorkspaceResolver) *cobra.Command

NewEnableCommand enables an offering in a workspace by creating the APIBinding, as the caller.

func NewOffersCommand

func NewOffersCommand(defaults ServerDefaults) *cobra.Command

NewOffersCommand lists the catalog.

Types

type ServerDefaults

type ServerDefaults struct {
	// URL is the marketplace virtual workspace's base URL.
	URL string
	// CertificateAuthority verifies its serving certificate; Insecure
	// skips that, for local testing.
	CertificateAuthority string
	Insecure             bool
	// Token is the bearer token the composer's login obtained, used when
	// no credential is given explicitly.
	Token string
}

ServerDefaults is what a composing binary already knows about where the platform is — learned by its own login, remembered in its own way — and hands over so the catalog commands need no address on every call. This package does not read it from anywhere itself: what counts as "the stored server" is the composer's business, not the marketplace's.

The zero value means "nothing known", and the flags are then required.

type WorkspaceResolver

type WorkspaceResolver func() (url string, describe string, err error)

WorkspaceResolver reports the workspace URL a command should act on when no flag names one.

It is a function rather than an import because the marketplace does not know what a tenant is: whoever assembles the CLI decides where "here" is — under the repo-wide CLI that is whatever `use` selected, and the two components still never name each other.

Jump to

Keyboard shortcuts

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