Documentation
¶
Overview ¶
Package bedrockagentcorecontrol emulates the Amazon Bedrock AgentCore control plane.
Index ¶
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
- func (b *InMemoryBackend) SetReferences(r References)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- type Provider
- type References
- type Resource
- type ResourcePolicy
- type TokenVault
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
DefaultRegion string
// contains filtered or unexported fields
}
Handler serves the AgentCore control-plane REST-JSON API.
func (*Handler) ChaosOperations ¶
ChaosOperations lists the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions lists the regions this handler serves.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name.
func (*Handler) ExtractResource ¶
ExtractResource returns the resource ARN or identifier the request addresses.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists every implemented operation.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches by SigV4 signing name (or SDK user agent) plus a known path shape.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the AgentCore control-plane state; one coarse lock guards every table.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the default account.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default Region.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot; an incompatible version is discarded.
func (*InMemoryBackend) SetLifecycleDelay ¶
func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
SetLifecycleDelay keeps resources in CREATING, UPDATING and DELETING for d; zero settles immediately.
func (*InMemoryBackend) SetReferences ¶
func (b *InMemoryBackend) SetReferences(r References)
SetReferences wires lookups of resources owned by other services.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Bedrock AgentCore control plane.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init builds the backend and handler.
type References ¶
type References interface {
ECRRepositoryExists(account, region, repository string) bool
LambdaFunctionExists(arn string) bool
SecretExists(arn string) bool
ReadObject(bucket, key string) ([]byte, bool)
}
References resolves resources owned by other emulated services; nil members skip the check.
type Resource ¶
type Resource struct {
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
SettleAt time.Time `json:"settleAt"`
Doc map[string]any `json:"doc"`
Tags map[string]string `json:"tags,omitempty"`
Aux map[string]any `json:"aux,omitempty"`
Account string `json:"account"`
Region string `json:"region"`
Kind string `json:"kind"`
Parent string `json:"parent,omitempty"`
ParentARN string `json:"parentArn,omitempty"`
ID string `json:"id"`
ARN string `json:"arn,omitempty"`
Status string `json:"status,omitempty"`
Transition string `json:"transition,omitempty"`
Versions []Version `json:"versions,omitempty"`
Deleting bool `json:"deleting,omitempty"`
System bool `json:"system,omitempty"`
}
Resource is one AgentCore control-plane resource. Doc holds the caller-supplied members verbatim (JSON-decoded); server-assigned identity, status, timestamps and tags live in typed fields.
type ResourcePolicy ¶
ResourcePolicy is the resource-based policy attached to a runtime, endpoint or gateway ARN.
type TokenVault ¶
type TokenVault struct {
Modified time.Time `json:"modified"`
KMS map[string]any `json:"kms"`
Key string `json:"key"`
}
TokenVault is the per-account token vault configuration.
type Version ¶
type Version struct {
Created time.Time `json:"created"`
Doc map[string]any `json:"doc"`
ID string `json:"id"`
Branch string `json:"branch,omitempty"`
Parents []string `json:"parents,omitempty"`
}
Version is an immutable snapshot taken on create and on every update of a versioned resource.