ecs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddToECSCmd = &cobra.Command{
	Use:          "add",
	Short:        Cmd.Short,
	Long:         Cmd.Long,
	SilenceUsage: true,
	RunE:         addAgentToECS,
}

'postman-lc-agent ecs' should default to 'postman-lc-agent ecs add'

View Source
var Cmd = &cobra.Command{
	Use:   "ecs",
	Short: "Add the Postman Live Collections Agent to AWS ECS.",
	Long:  "The CLI will collect information from you and add the Postman Live Collections Agent container to an ECS Task.",

	SilenceUsage: true,
	RunE:         addAgentToECS,
}
View Source
var NoSuchClusterError = errors.New("No such cluster")
View Source
var NoSuchProfileError = errors.New("No such profile")

Error indicating profile is absent. TODO: stop mixing error.Is and error.As usage?

View Source
var RemoveFromECSCmd = &cobra.Command{
	Use:          "remove",
	Short:        "Remove the Postman Live Collections Agent from AWS ECS.",
	Long:         "Remove a previously installed Postman container from an ECS Task.",
	SilenceUsage: true,
	RunE:         removeAgentFromECS,

	Hidden: true,
}

Functions

func ListAWSObjectsByName added in v0.22.0

func ListAWSObjectsByName[
	ListOutput any,
	DescribeInput any,
	DescribeOutput any,
	NamedItem any,
](
	ctx context.Context,
	objectName string,
	paginator AWSPaginator[ListOutput],
	getArns func(ListOutput) []arn,
	inputFactory func([]arn) DescribeInput,
	describe func(context.Context, DescribeInput) (DescribeOutput, error),
	extract func(DescribeOutput) []NamedItem,
	convert func(NamedItem) (arn, string),
) (map[arn]string, error)

func NewUsageError

func NewUsageError(err error) error

func RunAddWorkflow

func RunAddWorkflow() error

Run the "add to ECS" workflow until we complete or get an error. Errors that are UsageErrors should be returned as-is; other errors should be wrapped to avoid showing usage. (This is reversed from the other command conventions, but there are relatively few usage errors here.)

func UsageErrorf

func UsageErrorf(f string, args ...interface{}) error

Types

type AWSPaginator added in v0.22.0

type AWSPaginator[ListOutput any] interface {
	HasMorePages() bool
	NextPage(context.Context, ...func(*ecs.Options)) (ListOutput, error)
}

Interface of the Paginator returned by the ECS package. TODO: should we make this take the Options type as an extra parameter, so it can be used with other packages?

type AddWorkflow

type AddWorkflow struct {
	// contains filtered or unexported fields
}

func (*AddWorkflow) GetDeploymentByID added in v0.22.0

func (wf *AddWorkflow) GetDeploymentByID(serviceARN arn, deploymentID string) (types.Deployment, error)

func (*AddWorkflow) GetDeploymentMatchingTask added in v0.22.0

func (wf *AddWorkflow) GetDeploymentMatchingTask(serviceARN arn) (string, types.Deployment, error)

Returns the deployment of the given service that matches the ECS task definition configured in the workflow. For convenience, the deployment ID is also returned as a string.

type AddWorkflowState

type AddWorkflowState func(*AddWorkflow) (next optionals.Optional[AddWorkflowState], err error)

A function which executes the next part of the workflow, and picks a next state (Some) or exits (None), or signals an eror.

type UnauthorizedOperationError

type UnauthorizedOperationError struct {
	ServiceID     string
	OperationName string
	ARN           arn
}

Error indicating the user was unauthorized.

func (UnauthorizedOperationError) Error

type UsageError

type UsageError struct {
	// contains filtered or unexported fields
}

func (UsageError) Error

func (ue UsageError) Error() string

Jump to

Keyboard shortcuts

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