cloudcontrol

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResourceTypeToService = map[string]string{
	"AWS::S3::Bucket":      "s3",
	"AWS::DynamoDB::Table": "dynamodb",
	"AWS::SQS::Queue":      "sqs",
	"AWS::SNS::Topic":      "sns",
}

ResourceTypeToService maps Cloud Control resource type names to cloudmock service names.

Functions

This section is empty.

Types

type CloudControlService

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

CloudControlService is the cloudmock implementation of the AWS Cloud Control API.

func New

func New(accountID, region string) *CloudControlService

New returns a new CloudControlService for the given AWS account ID and region.

func (*CloudControlService) Actions

func (s *CloudControlService) Actions() []service.Action

Actions returns the list of Cloud Control API actions supported by this service.

func (*CloudControlService) HandleRequest

func (s *CloudControlService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming Cloud Control request to the appropriate handler.

func (*CloudControlService) HealthCheck

func (s *CloudControlService) HealthCheck() error

HealthCheck always returns nil.

func (*CloudControlService) Name

func (s *CloudControlService) Name() string

Name returns the AWS service name used for routing.

func (*CloudControlService) SetLocator

func (s *CloudControlService) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service resource type mapping.

type Resource

type Resource struct {
	TypeName   string
	Identifier string
	Properties string // JSON string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Resource represents a Cloud Control API resource.

type ResourceRequest

type ResourceRequest struct {
	RequestToken  string
	OperationType string // CREATE, UPDATE, DELETE
	TypeName      string
	Identifier    string
	StatusCode    string // PENDING, IN_PROGRESS, SUCCESS, FAILED
	StatusMessage string
	EventTime     time.Time
	// contains filtered or unexported fields
}

ResourceRequest represents a Cloud Control API resource request.

type ServiceLocator

type ServiceLocator interface {
	Lookup(name string) (service.Service, error)
}

ServiceLocator provides access to other services for cross-service communication.

type Store

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

Store manages Cloud Control resources in memory.

func NewStore

func NewStore(accountID, region string) *Store

NewStore returns a new empty Cloud Control Store.

func (*Store) CreateResource

func (s *Store) CreateResource(typeName, identifier, properties string) (*ResourceRequest, *Resource, error)

CreateResource creates a new resource and returns the request tracking it.

func (*Store) DeleteResource

func (s *Store) DeleteResource(typeName, identifier string) (*ResourceRequest, error)

DeleteResource deletes a resource.

func (*Store) GetResource

func (s *Store) GetResource(typeName, identifier string) (*Resource, bool)

GetResource retrieves a resource.

func (*Store) GetResourceRequestStatus

func (s *Store) GetResourceRequestStatus(token string) (*ResourceRequest, bool)

GetResourceRequestStatus retrieves a request by token.

func (*Store) ListResourceRequests

func (s *Store) ListResourceRequests() []*ResourceRequest

ListResourceRequests returns all requests.

func (*Store) ListResources

func (s *Store) ListResources(typeName string) []*Resource

ListResources returns all resources of a given type.

func (*Store) UpdateResource

func (s *Store) UpdateResource(typeName, identifier, patchDocument string) (*ResourceRequest, error)

UpdateResource updates a resource's properties.

Jump to

Keyboard shortcuts

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