command

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package command 根据操作登记构建普通 STX CLI 命令。 Package command builds regular STX CLI commands from the operation registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(specs []operation.OperationSpec, clientFactory ClientFactory) ([]*cobra.Command, error)

Build 构建登记项对应的 Cobra 顶级命令。 Build creates top-level Cobra commands for the supplied registry entries.

Types

type Client

type Client interface {
	Capabilities(ctx context.Context) (string, cliClient.CapabilityData, error)
	Request(ctx context.Context, method, path string, requestBody any, result any) (string, error)
	RequestWithHeaders(ctx context.Context, method, path string, requestBody any, headers map[string]string, result any) (string, error)
}

Client 是登记命令执行时使用的最小远端客户端接口。 Client is the minimal remote client contract used by generated commands.

type ClientFactory

type ClientFactory func(namespace string) (Client, error)

ClientFactory 根据本地命名空间创建远端客户端。 ClientFactory creates a remote client for one local namespace.

Jump to

Keyboard shortcuts

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