Documentation ¶
Overview ¶
Package selector provides functionality for users to select an application, environment, or service name.
Package selector provides functionality for users to select an application, environment, or service name.
Index ¶
- Variables
- type AppEnvLister
- type ConfigLister
- type ConfigSelect
- type ConfigSvcLister
- type CredsSelect
- type DeploySelect
- type DeployStoreClient
- type DeployedService
- type EC2Select
- type GetDeployedServiceOpts
- type Names
- type Prompter
- type Select
- type SessionProvider
- type VPCSubnetLister
- type WorkspaceSelect
- type WsSvcLister
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVPCNotFound is returned when no existing VPCs are found. ErrVPCNotFound = errors.New("no existing VPCs found") // ErrSubnetsNotFound is returned when no existing subnets are found. ErrSubnetsNotFound = errors.New("no existing subnets found") )
Functions ¶
This section is empty.
Types ¶
type AppEnvLister ¶
type AppEnvLister interface { ListEnvironments(appName string) ([]*config.Environment, error) ListApplications() ([]*config.Application, error) }
AppEnvLister wraps methods to list apps and envs in config store.
type ConfigLister ¶
type ConfigLister interface { AppEnvLister ConfigSvcLister }
ConfigLister wraps config store listing methods.
type ConfigSelect ¶
type ConfigSelect struct { *Select // contains filtered or unexported fields }
ConfigSelect is an application and environment selector, but can also choose a service from the config store.
func NewConfigSelect ¶
func NewConfigSelect(prompt Prompter, store ConfigLister) *ConfigSelect
NewConfigSelect returns a new selector that chooses applications, environments, or services from the config store.
type ConfigSvcLister ¶
ConfigSvcLister wraps the method to list svcs in config store.
type CredsSelect ¶ added in v0.3.0
type CredsSelect struct { Prompt Prompter Profile Names Session SessionProvider }
CredsSelect prompts users for credentials.
type DeploySelect ¶
type DeploySelect struct { *Select // contains filtered or unexported fields }
DeploySelect is a service and environment selector from the deploy store.
func NewDeploySelect ¶
func NewDeploySelect(prompt Prompter, configStore AppEnvLister, deployStore DeployStoreClient) *DeploySelect
NewDeploySelect returns a new selector that chooses services and environments from the deploy store.
func (*DeploySelect) DeployedService ¶
func (s *DeploySelect) DeployedService(prompt, help string, app string, opts ...GetDeployedServiceOpts) (*DeployedService, error)
DeployedService has the user select a deployed service. Callers can provide either a particular environment, a particular service to filter on, or both.
type DeployStoreClient ¶
type DeployStoreClient interface { ListDeployedServices(appName string, envName string) ([]string, error) IsServiceDeployed(appName string, envName string, svcName string) (bool, error) }
DeployStoreClient wraps methods of deploy store.
type DeployedService ¶
DeployedService contains the service name and environment name of the deployed service.
func (*DeployedService) String ¶
func (s *DeployedService) String() string
type EC2Select ¶ added in v0.3.0
type EC2Select struct {
// contains filtered or unexported fields
}
EC2Select is a selector for Ec2 resources.
func NewEC2Select ¶ added in v0.3.0
func NewEC2Select(prompt Prompter, ec2Client VPCSubnetLister) *EC2Select
NewEC2Select returns a new selector that chooses Ec2 resources.
func (*EC2Select) PrivateSubnets ¶ added in v0.3.0
PrivateSubnets has the user multiselect private subnets given the VPC ID.
func (*EC2Select) PublicSubnets ¶ added in v0.3.0
PublicSubnets has the user multiselect public subnets given the VPC ID.
type GetDeployedServiceOpts ¶
type GetDeployedServiceOpts func(*DeploySelect)
GetDeployedServiceOpts sets up optional parameters for GetDeployedServiceOpts function.
func WithEnv ¶
func WithEnv(env string) GetDeployedServiceOpts
WithEnv sets up the env name for DeploySelect.
func WithSvc ¶
func WithSvc(svc string) GetDeployedServiceOpts
WithSvc sets up the svc name for DeploySelect.
type Names ¶ added in v0.3.0
type Names interface {
Names() []string
}
Names wraps the method that returns a list of names.
type Prompter ¶
type Prompter interface { Get(message, help string, validator prompt.ValidatorFunc, promptOpts ...prompt.Option) (string, error) SelectOne(message, help string, options []string, promptOpts ...prompt.Option) (string, error) MultiSelect(message, help string, options []string, promptOpts ...prompt.Option) ([]string, error) }
Prompter wraps the methods to ask for inputs from the terminal.
type Select ¶
type Select struct {
// contains filtered or unexported fields
}
Select prompts users to select the name of an application or environment.
func NewSelect ¶
func NewSelect(prompt Prompter, store AppEnvLister) *Select
NewSelect returns a selector that chooses applications or environments.
func (*Select) Application ¶
Application fetches all the apps in an account/region and prompts the user to select one.
type SessionProvider ¶ added in v0.3.0
type SessionProvider interface { Default() (*session.Session, error) FromProfile(name string) (*session.Session, error) FromStaticCreds(accessKeyID, secretAccessKey, sessionToken string) (*session.Session, error) }
SessionProvider wraps the methods to create AWS sessions.
type VPCSubnetLister ¶ added in v0.3.0
type VPCSubnetLister interface { ListVPC() ([]string, error) ListVPCSubnets(vpcID string, opts ...ec2.ListVPCSubnetsOpts) ([]string, error) }
VPCSubnetLister list VPCs and subnets.
type WorkspaceSelect ¶
type WorkspaceSelect struct { *Select // contains filtered or unexported fields }
WorkspaceSelect is an application and environment selector, but can also choose a service from the workspace.
func NewWorkspaceSelect ¶
func NewWorkspaceSelect(prompt Prompter, store AppEnvLister, ws WsSvcLister) *WorkspaceSelect
NewWorkspaceSelect returns a new selector that chooses applications and environments from the config store, but services from the local workspace.
type WsSvcLister ¶
WsSvcLister wraps the method to get svcs in current workspace.