selector

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MPL-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvironmentSelector

type EnvironmentSelector interface {
	SelectEnvironment(projectID string) (zcontext.BasicInfo, *model.Environment, error)
}

type ProjectSelector

type ProjectSelector interface {
	SelectProject(opts ...SelectProjectOptionsApplyer) (zcontext.BasicInfo, *model.Project, error)
}

type SelectProjectOptions

type SelectProjectOptions struct {
	// CreatePreferred selects "Create New Project…" by default,
	// and not auto-select the only project.
	CreatePreferred bool
}

type SelectProjectOptionsApplyer

type SelectProjectOptionsApplyer func(*SelectProjectOptions)

func WithCreatePreferred

func WithCreatePreferred() SelectProjectOptionsApplyer

type SelectServiceOptions

type SelectServiceOptions struct {
	// ProjectID is the project id to select service from
	ProjectID string
	// Auto select the only service in the project
	Auto bool
	// CreateNew shows an option to create a new service
	CreateNew bool
	// FilterFunc filters the services
	FilterFunc func(service *model.Service) bool
}

type Selector

func New

func New(client api.Client, log *zap.SugaredLogger, prompter prompt.Prompter, ownerIDFn func() string) Selector

New returns a Selector. ownerIDFn resolves the current workspace owner ID at call time — it must be a closure (not a captured string) so a mid-run workspace switch and the --workspace flag override take effect on the very next selector call. Pass nil or a closure that returns "" for the personal workspace.

type ServiceSelector

type ServiceSelector interface {
	SelectService(opt SelectServiceOptions) (zcontext.BasicInfo, *model.Service, error)
}

Jump to

Keyboard shortcuts

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