selector

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

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) Selector

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