cli

package
v0.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, args []string, stdout, stderr io.Writer) (exitCode int)

func SetRegionVerifierFactoryForTest

func SetRegionVerifierFactoryForTest(factory RegionVerifierFactory) func()

SetRegionVerifierFactoryForTest swaps the default region verifier with a fake. Tests should call the returned restore func via t.Cleanup.

func WithAPICallerFactory

func WithAPICallerFactory(ctx context.Context, factory APICallerFactory) context.Context

func WithFullCommandSurface

func WithFullCommandSurface(ctx context.Context) context.Context

WithFullCommandSurface keeps spec-level tests able to exercise resources that are intentionally hidden from the public CLI surface.

func WithResourceCallerFactory

func WithResourceCallerFactory(ctx context.Context, factory ResourceCallerFactory) context.Context

Types

type APICallerFactory

type APICallerFactory func(profileName, configPath, product, region string, getenv func(string) string) (engine.Caller, error)

type RegionVerifier

type RegionVerifier interface {
	Verify(string, string) error
}

RegionVerifier is the surface exposed by aliyun.RegionVerifier and any test double swapped in via SetRegionVerifierFactoryForTest.

type RegionVerifierFactory

type RegionVerifierFactory func(profileName, configPath string, getenv func(string) string) (RegionVerifier, error)

RegionVerifierFactory builds a RegionVerifier for the active profile. The returned error indicates that verification cannot be performed (e.g. missing credentials) — the CLI translates that into a soft skip rather than a hard failure.

type ResourceCallerFactory

type ResourceCallerFactory func(profileName, configPath string, resource spec.ResourceSpec, region string, getenv func(string) string) (engine.Caller, error)

Jump to

Keyboard shortcuts

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