cloud

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProviderNotFound = errors.New("provider not found")
)

Common errors

Functions

This section is empty.

Types

type ApprovalAction added in v0.1.5

type ApprovalAction struct {
	PipelineName string
	StageName    string
	ActionName   string
	Token        string
}

ApprovalAction represents a pending approval in a pipeline

type Category

type Category interface {
	// Name returns the category's name.
	Name() string

	// Description returns the category's description.
	Description() string

	// Operations returns all available operations for this category.
	Operations() []Operation

	// IsUIVisible returns whether this category should be visible in the UI.
	IsUIVisible() bool
}

Category represents a group of operations.

type CodePipelineManualApprovalOperation added in v0.1.5

type CodePipelineManualApprovalOperation interface {
	UIOperation

	// GetPendingApprovals returns all pending manual approval actions
	GetPendingApprovals(ctx context.Context) ([]ApprovalAction, error)

	// ApproveAction approves or rejects an approval action
	ApproveAction(ctx context.Context, action ApprovalAction, approved bool, comment string) error
}

CodePipelineManualApprovalOperation represents a manual approval operation for AWS CodePipeline

type FunctionStatus added in v0.1.5

type FunctionStatus struct {
	Name         string
	Runtime      string
	Memory       int32
	Timeout      int32
	LastUpdate   string
	Role         string
	Handler      string
	Description  string
	FunctionArn  string
	CodeSize     int64
	Version      string
	PackageType  string
	Architecture string
	LogGroup     string
}

FunctionStatus represents the status of a Lambda function

type FunctionStatusOperation added in v0.1.5

type FunctionStatusOperation interface {
	UIOperation

	// GetFunctionStatus returns the status of all Lambda functions
	GetFunctionStatus(ctx context.Context) ([]FunctionStatus, error)
}

FunctionStatusOperation represents an operation to view Lambda function status

type LambdaExecuteOperation added in v0.1.5

type LambdaExecuteOperation interface {
	UIOperation

	// ExecuteFunction executes a Lambda function with the given payload
	ExecuteFunction(ctx context.Context, functionName string, payload string) (*LambdaExecuteResult, error)
}

LambdaExecuteOperation represents an operation to execute a Lambda function

type LambdaExecuteResult added in v0.1.5

type LambdaExecuteResult struct {
	StatusCode      int
	ExecutedVersion string
	Payload         string
	LogResult       string
}

LambdaExecuteResult represents the result of a Lambda function execution

type Operation

type Operation interface {
	// Name returns the operation's name.
	Name() string

	// Description returns the operation's description.
	Description() string

	// Execute executes the operation with the given parameters.
	Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

	// IsUIVisible returns whether this operation should be visible in the UI.
	IsUIVisible() bool
}

Operation represents a cloud operation.

type PipelineStatus added in v0.1.5

type PipelineStatus struct {
	Name   string
	Stages []StageStatus
}

PipelineStatus represents the status of a pipeline and its stages

type PipelineStatusOperation added in v0.1.5

type PipelineStatusOperation interface {
	UIOperation

	// GetPipelineStatus returns the status of all pipelines
	GetPipelineStatus(ctx context.Context) ([]PipelineStatus, error)
}

PipelineStatusOperation represents an operation to view pipeline status

type Provider

type Provider interface {
	// Name returns the provider's name.
	Name() string

	// Description returns the provider's description.
	Description() string

	// Services returns all available services for this provider.
	Services() []Service

	// GetProfiles returns all available profiles for this provider.
	GetProfiles() ([]string, error)

	// LoadConfig loads the provider configuration with the given profile and region.
	LoadConfig(profile, region string) error

	// GetFunctionStatusOperation returns the function status operation
	GetFunctionStatusOperation() (FunctionStatusOperation, error)

	// GetLambdaExecuteOperation returns the Lambda execute operation
	GetLambdaExecuteOperation() (LambdaExecuteOperation, error)

	// GetCodePipelineManualApprovalOperation returns the CodePipeline manual approval operation
	GetCodePipelineManualApprovalOperation() (CodePipelineManualApprovalOperation, error)

	// GetPipelineStatusOperation returns the pipeline status operation
	GetPipelineStatusOperation() (PipelineStatusOperation, error)

	// GetStartPipelineOperation returns the start pipeline operation
	GetStartPipelineOperation() (StartPipelineOperation, error)

	// GetAuthenticationMethods returns available authentication methods
	GetAuthenticationMethods() []string

	// GetAuthConfigKeys returns configuration keys for the specified authentication method
	GetAuthConfigKeys(method string) []string

	// Authenticate authenticates using the provided method and configuration
	Authenticate(method string, authConfig map[string]string) error

	// IsAuthenticated checks if the provider is authenticated
	IsAuthenticated() bool

	// GetConfigKeys returns required configuration keys
	GetConfigKeys() []string

	// GetConfigOptions returns available options for a configuration key
	GetConfigOptions(key string) ([]string, error)

	// Configure configures the provider with the given configuration
	Configure(config map[string]string) error

	// GetApprovals returns pending approvals for the provider
	GetApprovals(ctx context.Context) ([]ApprovalAction, error)

	// ApproveAction approves or rejects an approval action
	ApproveAction(ctx context.Context, action ApprovalAction, approved bool, comment string) error

	// GetStatus returns the status of all pipelines
	GetStatus(ctx context.Context) ([]PipelineStatus, error)

	// StartPipeline starts a pipeline execution
	StartPipeline(ctx context.Context, pipelineName string, commitID string) error
}

Provider represents a cloud provider.

type ProviderRegistry added in v0.1.5

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

ProviderRegistry is a registry for cloud providers

func NewProviderRegistry added in v0.1.5

func NewProviderRegistry() *ProviderRegistry

NewProviderRegistry creates a new provider registry

func (*ProviderRegistry) Get added in v0.1.5

func (r *ProviderRegistry) Get(name string) (Provider, error)

Get returns a provider by name with an error if not found

func (*ProviderRegistry) GetProvider added in v0.1.5

func (r *ProviderRegistry) GetProvider(name string) (Provider, bool)

GetProvider returns a provider by name

func (*ProviderRegistry) GetProviderNames added in v0.1.5

func (r *ProviderRegistry) GetProviderNames() []string

GetProviderNames returns the names of all registered providers

func (*ProviderRegistry) List added in v0.1.5

func (r *ProviderRegistry) List() []Provider

List returns all registered providers

func (*ProviderRegistry) Providers added in v0.1.5

func (r *ProviderRegistry) Providers() []Provider

Providers returns all registered providers

func (*ProviderRegistry) Register added in v0.1.5

func (r *ProviderRegistry) Register(provider Provider)

Register registers a provider with the registry

type Service

type Service interface {
	// Name returns the service's name.
	Name() string

	// Description returns the service's description.
	Description() string

	// Categories returns all available categories for this service.
	Categories() []Category
}

Service represents a cloud service.

type StageStatus added in v0.1.5

type StageStatus struct {
	Name        string
	Status      string
	LastUpdated string
}

StageStatus represents the status of a pipeline stage

type StartPipelineOperation added in v0.1.5

type StartPipelineOperation interface {
	UIOperation

	// StartPipelineExecution starts a pipeline execution
	StartPipelineExecution(ctx context.Context, pipelineName string, commitID string) error
}

StartPipelineOperation represents an operation to start a pipeline execution

type UIOperation added in v0.1.5

type UIOperation interface {
	// Name returns the operation's name
	Name() string

	// Description returns the operation's description
	Description() string

	// IsUIVisible returns whether this operation should be visible in the UI
	IsUIVisible() bool
}

UIOperation represents a user-facing operation in the UI

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

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