Documentation
¶
Index ¶
- Variables
- type Certificate
- type CreateDBClusterOptions
- type CreateDBInstanceOptions
- type DBCluster
- type DBClusterMemberEntry
- type DBClusterParameter
- type DBClusterParameterGroup
- type DBClusterSnapshot
- type DBClusterSnapshotAttribute
- type DBClusterSnapshotAttributesResult
- type DBEngineVersion
- type DBInstance
- type DBSubnetGroup
- type DeleteDBClusterOptions
- type EventCategoryMap
- type EventSubscription
- type GlobalCluster
- 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) AddDBClusterInternal(cluster *DBCluster)
- func (b *InMemoryBackend) AddDBClusterParameterGroupInternal(pg *DBClusterParameterGroup)
- func (b *InMemoryBackend) AddDBClusterSnapshotInternal(snap *DBClusterSnapshot)
- func (b *InMemoryBackend) AddDBInstanceInternal(inst *DBInstance)
- func (b *InMemoryBackend) AddDBSubnetGroupInternal(sg *DBSubnetGroup)
- func (b *InMemoryBackend) AddEventSubscriptionInternal(sub *EventSubscription)
- func (b *InMemoryBackend) AddGlobalClusterInternal(gc *GlobalCluster)
- func (b *InMemoryBackend) AddSourceIdentifierToSubscription(ctx context.Context, subscriptionName, sourceID string) (*EventSubscription, error)
- func (b *InMemoryBackend) AddTagsToResource(ctx context.Context, arnStr string, tags []Tag) error
- func (b *InMemoryBackend) ApplyPendingMaintenanceAction(_ context.Context, resourceARN, action, optInType string) error
- func (b *InMemoryBackend) CopyDBClusterParameterGroup(ctx context.Context, sourceGroupName, targetName, targetDescription string) (*DBClusterParameterGroup, error)
- func (b *InMemoryBackend) CopyDBClusterSnapshot(ctx context.Context, sourceSnapshotID, targetSnapshotID string) (*DBClusterSnapshot, error)
- func (b *InMemoryBackend) CreateDBCluster(ctx context.Context, ...) (*DBCluster, error)
- func (b *InMemoryBackend) CreateDBClusterParameterGroup(ctx context.Context, name, family, description string, tags map[string]string) (*DBClusterParameterGroup, error)
- func (b *InMemoryBackend) CreateDBClusterSnapshot(ctx context.Context, snapshotID, clusterID string, tags map[string]string) (*DBClusterSnapshot, error)
- func (b *InMemoryBackend) CreateDBInstance(ctx context.Context, id, clusterID, instanceClass, engine string, ...) (*DBInstance, error)
- func (b *InMemoryBackend) CreateDBSubnetGroup(ctx context.Context, name, description, vpcID string, subnetIDs []string, ...) (*DBSubnetGroup, error)
- func (b *InMemoryBackend) CreateEventSubscription(ctx context.Context, name, snsTopicARN, sourceType string, ...) (*EventSubscription, error)
- func (b *InMemoryBackend) CreateGlobalCluster(_ context.Context, id, sourceDBClusterID, engine, engineVersion string) (*GlobalCluster, error)
- func (b *InMemoryBackend) DeleteDBCluster(ctx context.Context, id string, opts *DeleteDBClusterOptions) (*DBCluster, error)
- func (b *InMemoryBackend) DeleteDBClusterParameterGroup(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteDBClusterSnapshot(ctx context.Context, snapshotID string) (*DBClusterSnapshot, error)
- func (b *InMemoryBackend) DeleteDBInstance(ctx context.Context, id string) (*DBInstance, error)
- func (b *InMemoryBackend) DeleteDBSubnetGroup(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteEventSubscription(ctx context.Context, name string) (*EventSubscription, error)
- func (b *InMemoryBackend) DeleteGlobalCluster(_ context.Context, id string) (*GlobalCluster, error)
- func (b *InMemoryBackend) DescribeCertificates(_ context.Context, certificateID string) []Certificate
- func (b *InMemoryBackend) DescribeDBClusterParameterGroups(ctx context.Context, name string) ([]DBClusterParameterGroup, error)
- func (b *InMemoryBackend) DescribeDBClusterParameters(ctx context.Context, groupName string) ([]DBClusterParameter, error)
- func (b *InMemoryBackend) DescribeDBClusterSnapshotAttributes(ctx context.Context, snapshotID string) (*DBClusterSnapshotAttributesResult, error)
- func (b *InMemoryBackend) DescribeDBClusterSnapshots(ctx context.Context, snapshotID, clusterID, snapshotType string) ([]DBClusterSnapshot, error)
- func (b *InMemoryBackend) DescribeDBClusters(ctx context.Context, id string) ([]DBCluster, error)
- func (b *InMemoryBackend) DescribeDBEngineVersions(_ context.Context, engine, engineVersion string) []DBEngineVersion
- func (b *InMemoryBackend) DescribeDBInstances(ctx context.Context, id, clusterID string) ([]DBInstance, error)
- func (b *InMemoryBackend) DescribeDBSubnetGroups(ctx context.Context, name string) ([]DBSubnetGroup, error)
- func (b *InMemoryBackend) DescribeEngineDefaultClusterParameters(_ context.Context, _ string) []DBClusterParameter
- func (b *InMemoryBackend) DescribeEventCategories(_ context.Context, sourceType string) []EventCategoryMap
- func (b *InMemoryBackend) DescribeEventSubscriptions(ctx context.Context, name string) []EventSubscription
- func (b *InMemoryBackend) DescribeGlobalClusters(_ context.Context, id string) []GlobalCluster
- func (b *InMemoryBackend) DescribePendingMaintenanceActions(_ context.Context, _ string) []ResourcePendingMaintenanceActions
- func (b *InMemoryBackend) FailoverDBCluster(ctx context.Context, id string) (*DBCluster, error)
- func (b *InMemoryBackend) FailoverGlobalCluster(_ context.Context, id, _ string) (*GlobalCluster, error)
- func (b *InMemoryBackend) GetClusterMembers(ctx context.Context, clusterID string) []DBClusterMemberEntry
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, arnStr string) []Tag
- func (b *InMemoryBackend) ModifyDBCluster(ctx context.Context, id, paramGroupName string, deletionProtection *bool, ...) (*DBCluster, error)
- func (b *InMemoryBackend) ModifyDBClusterParameterGroup(ctx context.Context, name string, parameters map[string]string) (*DBClusterParameterGroup, error)
- func (b *InMemoryBackend) ModifyDBClusterSnapshotAttribute(ctx context.Context, snapshotID, attributeName string, ...) (*DBClusterSnapshotAttributesResult, error)
- func (b *InMemoryBackend) ModifyDBInstance(ctx context.Context, id, instanceClass string, autoMinorVersionUpgrade *bool, ...) (*DBInstance, error)
- func (b *InMemoryBackend) ModifyDBSubnetGroup(ctx context.Context, name, description string, subnetIDs []string) (*DBSubnetGroup, error)
- func (b *InMemoryBackend) ModifyEventSubscription(ctx context.Context, name, snsTopicARN, sourceType string, ...) (*EventSubscription, error)
- func (b *InMemoryBackend) ModifyGlobalCluster(_ context.Context, id, newID string, deletionProtection *bool) (*GlobalCluster, error)
- func (b *InMemoryBackend) RebootDBInstance(ctx context.Context, id string) (*DBInstance, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RemoveFromGlobalCluster(_ context.Context, globalClusterID, _ string) (*GlobalCluster, error)
- func (b *InMemoryBackend) RemoveSourceIdentifierFromSubscription(ctx context.Context, subscriptionName, sourceID string) (*EventSubscription, error)
- func (b *InMemoryBackend) RemoveTagsFromResource(ctx context.Context, arnStr string, keys []string)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResetDBClusterParameterGroup(ctx context.Context, name string) (*DBClusterParameterGroup, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RestoreDBClusterFromSnapshot(ctx context.Context, snapshotID, clusterID, engine string) (*DBCluster, error)
- func (b *InMemoryBackend) RestoreDBClusterToPointInTime(ctx context.Context, sourceClusterID, targetClusterID string) (*DBCluster, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartDBCluster(ctx context.Context, id string) (*DBCluster, error)
- func (b *InMemoryBackend) StopDBCluster(ctx context.Context, id string) (*DBCluster, error)
- func (b *InMemoryBackend) SwitchoverGlobalCluster(_ context.Context, id, _ string) (*GlobalCluster, error)
- type ModifyDBClusterOptions
- type ModifyDBInstanceOptions
- type PendingMaintenanceAction
- type Provider
- type ResourcePendingMaintenanceActions
- type Tag
Constants ¶
This section is empty.
Variables ¶
var ( ErrClusterNotFound = awserr.New("DBClusterNotFoundFault", awserr.ErrNotFound) ErrClusterAlreadyExists = awserr.New("DBClusterAlreadyExistsFault", awserr.ErrAlreadyExists) ErrInstanceNotFound = awserr.New("DBInstanceNotFound", awserr.ErrNotFound) ErrInstanceAlreadyExists = awserr.New("DBInstanceAlreadyExists", awserr.ErrAlreadyExists) ErrSubnetGroupNotFound = awserr.New("DBSubnetGroupNotFoundFault", awserr.ErrNotFound) ErrSubnetGroupAlreadyExists = awserr.New("DBSubnetGroupAlreadyExists", awserr.ErrAlreadyExists) ErrSubnetGroupInUse = awserr.New("InvalidDBSubnetGroupStateFault", awserr.ErrInvalidParameter) ErrClusterParameterGroupNotFound = awserr.New("DBParameterGroupNotFound", awserr.ErrNotFound) ErrClusterParameterGroupAlreadyExists = awserr.New( "DBParameterGroupAlreadyExists", awserr.ErrAlreadyExists, ) ErrParameterGroupInUse = awserr.New("InvalidDBParameterGroupState", awserr.ErrInvalidParameter) ErrClusterSnapshotNotFound = awserr.New("DBClusterSnapshotNotFoundFault", awserr.ErrNotFound) ErrClusterSnapshotAlreadyExists = awserr.New("DBClusterSnapshotAlreadyExistsFault", awserr.ErrAlreadyExists) ErrEventSubscriptionNotFound = awserr.New("SubscriptionNotFound", awserr.ErrNotFound) ErrEventSubscriptionAlreadyExists = awserr.New("SubscriptionAlreadyExist", awserr.ErrAlreadyExists) ErrGlobalClusterNotFound = awserr.New("GlobalClusterNotFoundFault", awserr.ErrNotFound) ErrGlobalClusterAlreadyExists = awserr.New("GlobalClusterAlreadyExistsFault", awserr.ErrAlreadyExists) ErrInvalidParameter = awserr.New("InvalidParameterValue", awserr.ErrInvalidParameter) ErrUnknownAction = awserr.New("InvalidAction", awserr.ErrInvalidParameter) ErrInvalidClusterState = awserr.New("InvalidDBClusterStateFault", awserr.ErrInvalidParameter) )
Error code strings below are the literal wire values the real aws-sdk-go-v2/service/docdb query-protocol error deserializers switch on (see deserializers.go's awsAwsquery_deserializeOpError* functions for each operation), NOT the Go SDK type names (which all end in "...Fault"). AWS's DocDB API is inconsistent here: some resources put "Fault" on the wire code (DBCluster, DBClusterSnapshot, GlobalCluster, InvalidDBClusterStateFault, InvalidDBSubnetGroupStateFault), while others strip it (DBInstance, DBSubnetGroup-already-exists) or additionally drop "Cluster" and reuse the plain RDS DBParameterGroup codes for DBClusterParameterGroup operations (CreateDBClusterParameterGroup, ModifyDBClusterParameterGroup, etc. all switch on "DBParameterGroupNotFound"/"DBParameterGroupAlreadyExists"/ "InvalidDBParameterGroupState", never "DBClusterParameterGroup...Fault"). A wire code that doesn't match the SDK's switch falls through to smithy.GenericAPIError, so real callers doing errors.As against the typed fault (e.g. *types.DBInstanceNotFoundFault) silently stop matching.
var ErrNilAppContext = errors.New("AppContext is required")
ErrNilAppContext is returned when Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type CreateDBClusterOptions ¶
type CreateDBClusterOptions struct {
KmsKeyID string
VpcSecurityGroupIDs []string
EnabledCloudwatchLogsExports []string
IAMDatabaseAuthenticationEnabled bool
}
CreateDBClusterOptions holds optional parameters for CreateDBCluster.
type CreateDBInstanceOptions ¶
CreateDBInstanceOptions holds optional parameters for CreateDBInstance.
type DBCluster ¶
type DBCluster struct {
Tags map[string]string `json:"tags"`
DBClusterArn string `json:"dbClusterArn"`
EngineVersion string `json:"engineVersion"`
Engine string `json:"engine"`
PreferredMaintenanceWindow string `json:"preferredMaintenanceWindow"`
MasterUsername string `json:"masterUsername"`
DatabaseName string `json:"databaseName"`
DBClusterParameterGroupName string `json:"dbClusterParameterGroupName"`
Endpoint string `json:"endpoint"`
DBClusterIdentifier string `json:"dbClusterIdentifier"`
ReaderEndpoint string `json:"readerEndpoint"`
Status string `json:"status"`
DBSubnetGroupName string `json:"dbSubnetGroupName"`
PreferredBackupWindow string `json:"preferredBackupWindow"`
ClusterCreateTime string `json:"clusterCreateTime"`
HostedZoneID string `json:"hostedZoneId"`
KmsKeyID string `json:"kmsKeyId"`
ReplicationSourceIdentifier string `json:"replicationSourceIdentifier"`
AvailabilityZones []string `json:"availabilityZones"`
VpcSecurityGroupIDs []string `json:"vpcSecurityGroupIds"`
EnabledCloudwatchLogsExports []string `json:"enabledCloudwatchLogsExports"`
ReadReplicaIdentifiers []string `json:"readReplicaIdentifiers"`
Port int `json:"port"`
BackupRetentionPeriod int `json:"backupRetentionPeriod"`
StorageEncrypted bool `json:"storageEncrypted"`
MultiAZ bool `json:"multiAZ"`
DeletionProtection bool `json:"deletionProtection"`
IAMDatabaseAuthenticationEnabled bool `json:"iamDatabaseAuthenticationEnabled"`
// contains filtered or unexported fields
}
type DBClusterMemberEntry ¶
type DBClusterMemberEntry struct {
DBInstanceIdentifier string
PromotionTier int
IsClusterWriter bool
}
DBClusterMemberEntry represents an instance that is a member of a DB cluster.
type DBClusterParameter ¶
type DBClusterParameterGroup ¶
type DBClusterParameterGroup struct {
Tags map[string]string `json:"tags"`
Parameters map[string]string `json:"parameters"`
DBClusterParameterGroupName string `json:"dbClusterParameterGroupName"`
DBParameterGroupFamily string `json:"dbParameterGroupFamily"`
Description string `json:"description"`
DBClusterParameterGroupArn string `json:"dbClusterParameterGroupArn"`
// contains filtered or unexported fields
}
type DBClusterSnapshot ¶
type DBClusterSnapshot struct {
Tags map[string]string `json:"tags"`
DBClusterSnapshotIdentifier string `json:"dbClusterSnapshotIdentifier"`
DBClusterIdentifier string `json:"dbClusterIdentifier"`
DBClusterArn string `json:"dbClusterArn"`
Engine string `json:"engine"`
Status string `json:"status"`
EngineVersion string `json:"engineVersion"`
SnapshotType string `json:"snapshotType"`
SnapshotCreateTime string `json:"snapshotCreateTime"`
PercentProgress int `json:"percentProgress"`
StorageEncrypted bool `json:"storageEncrypted"`
// contains filtered or unexported fields
}
type DBClusterSnapshotAttribute ¶
type DBClusterSnapshotAttribute struct {
AttributeName string `json:"attributeName"`
AttributeValues []string `json:"attributeValues"`
}
DBClusterSnapshotAttribute represents a single attribute of a cluster snapshot.
type DBClusterSnapshotAttributesResult ¶
type DBClusterSnapshotAttributesResult struct {
DBClusterSnapshotIdentifier string `json:"dbClusterSnapshotIdentifier"`
Attributes []DBClusterSnapshotAttribute `json:"attributes"`
// contains filtered or unexported fields
}
DBClusterSnapshotAttributesResult holds the attributes for a cluster snapshot.
type DBEngineVersion ¶
DBEngineVersion represents a supported DocDB engine version.
type DBInstance ¶
type DBInstance struct {
Tags map[string]string `json:"tags"`
DBInstanceIdentifier string `json:"dbInstanceIdentifier"`
DBClusterIdentifier string `json:"dbClusterIdentifier"`
DBInstanceClass string `json:"dbInstanceClass"`
Engine string `json:"engine"`
DBInstanceStatus string `json:"dbInstanceStatus"`
Endpoint string `json:"endpoint"`
DBInstanceArn string `json:"dbInstanceArn"`
EngineVersion string `json:"engineVersion"`
AvailabilityZone string `json:"availabilityZone"`
DBSubnetGroupName string `json:"dbSubnetGroupName"`
PreferredMaintenanceWindow string `json:"preferredMaintenanceWindow"`
CACertificateIdentifier string `json:"caCertificateIdentifier"`
EnabledCloudwatchLogsExports []string `json:"enabledCloudwatchLogsExports"`
Port int `json:"port"`
PromotionTier int `json:"promotionTier"`
StorageEncrypted bool `json:"storageEncrypted"`
AutoMinorVersionUpgrade bool `json:"autoMinorVersionUpgrade"`
PubliclyAccessible bool `json:"publiclyAccessible"`
CopyTagsToSnapshot bool `json:"copyTagsToSnapshot"`
// contains filtered or unexported fields
}
type DBSubnetGroup ¶
type DBSubnetGroup struct {
Tags map[string]string `json:"tags"`
DBSubnetGroupName string `json:"dbSubnetGroupName"`
DBSubnetGroupDescription string `json:"dbSubnetGroupDescription"`
VpcID string `json:"vpcID"`
Status string `json:"status"`
DBSubnetGroupArn string `json:"dbSubnetGroupArn"`
SubnetIDs []string `json:"subnetIDs"`
// contains filtered or unexported fields
}
type DeleteDBClusterOptions ¶
type DeleteDBClusterOptions struct {
FinalDBClusterSnapshotIdentifier string
SkipFinalSnapshot bool
}
DeleteDBClusterOptions holds optional parameters for DeleteDBCluster.
type EventCategoryMap ¶
EventCategoryMap maps a source type to a list of event categories.
type EventSubscription ¶
type EventSubscription struct {
SubscriptionName string `json:"subscriptionName"`
SnsTopicARN string `json:"snsTopicARN"`
Status string `json:"status"`
SourceType string `json:"sourceType"`
SourceIDs []string `json:"sourceIDs"`
EventCategories []string `json:"eventCategories"`
// contains filtered or unexported fields
}
type GlobalCluster ¶
type GlobalCluster struct {
GlobalClusterIdentifier string `json:"globalClusterIdentifier"`
SourceDBClusterID string `json:"sourceDBClusterID"`
Status string `json:"status"`
Engine string `json:"engine"`
EngineVersion string `json:"engineVersion"`
GlobalClusterArn string `json:"globalClusterArn"`
StorageEncrypted bool `json:"storageEncrypted"`
DeletionProtection bool `json:"deletionProtection"`
}
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
}
Handler is the Echo HTTP handler for DocDB operations.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new DocDB handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this DocDB instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the DocDB action from the request.
func (*Handler) ExtractResource ¶
ExtractResource returns the DB cluster identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns supported DocDB operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority for DocDB (higher than RDS to intercept DocDB requests first).
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches DocDB requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory store for DocDB resources.
Seven resource collections that were previously nested by region (outer key = region, e.g. map[string]map[string]*DBCluster) are now each a single flat *store.Table keyed by the composite "region|id" string (see regionKey below), with a companion *store.Index grouping entries by region for per-region scans -- see store_setup.go for the full rationale. Six of the seven also have a byRegion index; snapshotAttributes does not (it is only ever looked up/written by its exact composite key, never listed by region). GlobalClusters are partition-scoped and remain a plain (non-composite-key) *store.Table. tags remains a raw nested map: its value (a bare []Tag) carries no identity of its own to key a store.Table by (see store_setup.go's doc comment for the full rationale).
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
func (*InMemoryBackend) AddDBClusterInternal ¶
func (b *InMemoryBackend) AddDBClusterInternal(cluster *DBCluster)
AddDBClusterInternal seeds a cluster directly for testing.
func (*InMemoryBackend) AddDBClusterParameterGroupInternal ¶
func (b *InMemoryBackend) AddDBClusterParameterGroupInternal(pg *DBClusterParameterGroup)
AddDBClusterParameterGroupInternal seeds a parameter group directly for testing.
func (*InMemoryBackend) AddDBClusterSnapshotInternal ¶
func (b *InMemoryBackend) AddDBClusterSnapshotInternal(snap *DBClusterSnapshot)
AddDBClusterSnapshotInternal seeds a snapshot directly for testing.
func (*InMemoryBackend) AddDBInstanceInternal ¶
func (b *InMemoryBackend) AddDBInstanceInternal(inst *DBInstance)
AddDBInstanceInternal seeds an instance directly for testing.
func (*InMemoryBackend) AddDBSubnetGroupInternal ¶
func (b *InMemoryBackend) AddDBSubnetGroupInternal(sg *DBSubnetGroup)
AddDBSubnetGroupInternal seeds a subnet group directly for testing.
func (*InMemoryBackend) AddEventSubscriptionInternal ¶
func (b *InMemoryBackend) AddEventSubscriptionInternal(sub *EventSubscription)
AddEventSubscriptionInternal seeds an event subscription directly for testing.
func (*InMemoryBackend) AddGlobalClusterInternal ¶
func (b *InMemoryBackend) AddGlobalClusterInternal(gc *GlobalCluster)
AddGlobalClusterInternal seeds a global cluster directly for testing.
func (*InMemoryBackend) AddSourceIdentifierToSubscription ¶
func (b *InMemoryBackend) AddSourceIdentifierToSubscription( ctx context.Context, subscriptionName, sourceID string, ) (*EventSubscription, error)
AddSourceIdentifierToSubscription adds a source identifier to an event subscription.
func (*InMemoryBackend) AddTagsToResource ¶
func (*InMemoryBackend) ApplyPendingMaintenanceAction ¶
func (b *InMemoryBackend) ApplyPendingMaintenanceAction( _ context.Context, resourceARN, action, optInType string, ) error
ApplyPendingMaintenanceAction applies a pending maintenance action to a resource.
func (*InMemoryBackend) CopyDBClusterParameterGroup ¶
func (b *InMemoryBackend) CopyDBClusterParameterGroup( ctx context.Context, sourceGroupName, targetName, targetDescription string, ) (*DBClusterParameterGroup, error)
CopyDBClusterParameterGroup copies a DB cluster parameter group.
func (*InMemoryBackend) CopyDBClusterSnapshot ¶
func (b *InMemoryBackend) CopyDBClusterSnapshot( ctx context.Context, sourceSnapshotID, targetSnapshotID string, ) (*DBClusterSnapshot, error)
CopyDBClusterSnapshot copies a DB cluster snapshot.
func (*InMemoryBackend) CreateDBCluster ¶
func (b *InMemoryBackend) CreateDBCluster( ctx context.Context, id, engine, engineVersion, masterUser, masterUserPassword, dbName, paramGroupName, subnetGroupName string, port int, storageEncrypted, deletionProtection bool, backupRetentionPeriod int, preferredBackupWindow, preferredMaintenanceWindow string, availabilityZones []string, tags map[string]string, opts *CreateDBClusterOptions, ) (*DBCluster, error)
func (*InMemoryBackend) CreateDBClusterParameterGroup ¶
func (b *InMemoryBackend) CreateDBClusterParameterGroup( ctx context.Context, name, family, description string, tags map[string]string, ) (*DBClusterParameterGroup, error)
func (*InMemoryBackend) CreateDBClusterSnapshot ¶
func (b *InMemoryBackend) CreateDBClusterSnapshot( ctx context.Context, snapshotID, clusterID string, tags map[string]string, ) (*DBClusterSnapshot, error)
func (*InMemoryBackend) CreateDBInstance ¶
func (b *InMemoryBackend) CreateDBInstance( ctx context.Context, id, clusterID, instanceClass, engine string, promotionTier int, tags map[string]string, opts *CreateDBInstanceOptions, ) (*DBInstance, error)
func (*InMemoryBackend) CreateDBSubnetGroup ¶
func (b *InMemoryBackend) CreateDBSubnetGroup( ctx context.Context, name, description, vpcID string, subnetIDs []string, tags map[string]string, ) (*DBSubnetGroup, error)
func (*InMemoryBackend) CreateEventSubscription ¶
func (b *InMemoryBackend) CreateEventSubscription( ctx context.Context, name, snsTopicARN, sourceType string, eventCategories, sourceIDs []string, ) (*EventSubscription, error)
CreateEventSubscription creates an event subscription.
func (*InMemoryBackend) CreateGlobalCluster ¶
func (b *InMemoryBackend) CreateGlobalCluster( _ context.Context, id, sourceDBClusterID, engine, engineVersion string, ) (*GlobalCluster, error)
CreateGlobalCluster creates a global cluster.
func (*InMemoryBackend) DeleteDBCluster ¶
func (b *InMemoryBackend) DeleteDBCluster( ctx context.Context, id string, opts *DeleteDBClusterOptions, ) (*DBCluster, error)
func (*InMemoryBackend) DeleteDBClusterParameterGroup ¶
func (b *InMemoryBackend) DeleteDBClusterParameterGroup(ctx context.Context, name string) error
func (*InMemoryBackend) DeleteDBClusterSnapshot ¶
func (b *InMemoryBackend) DeleteDBClusterSnapshot(ctx context.Context, snapshotID string) (*DBClusterSnapshot, error)
func (*InMemoryBackend) DeleteDBInstance ¶
func (b *InMemoryBackend) DeleteDBInstance(ctx context.Context, id string) (*DBInstance, error)
func (*InMemoryBackend) DeleteDBSubnetGroup ¶
func (b *InMemoryBackend) DeleteDBSubnetGroup(ctx context.Context, name string) error
func (*InMemoryBackend) DeleteEventSubscription ¶
func (b *InMemoryBackend) DeleteEventSubscription(ctx context.Context, name string) (*EventSubscription, error)
DeleteEventSubscription deletes an event subscription.
func (*InMemoryBackend) DeleteGlobalCluster ¶
func (b *InMemoryBackend) DeleteGlobalCluster(_ context.Context, id string) (*GlobalCluster, error)
DeleteGlobalCluster deletes a global cluster.
func (*InMemoryBackend) DescribeCertificates ¶
func (b *InMemoryBackend) DescribeCertificates(_ context.Context, certificateID string) []Certificate
DescribeCertificates returns certificate information.
func (*InMemoryBackend) DescribeDBClusterParameterGroups ¶
func (b *InMemoryBackend) DescribeDBClusterParameterGroups( ctx context.Context, name string, ) ([]DBClusterParameterGroup, error)
func (*InMemoryBackend) DescribeDBClusterParameters ¶
func (b *InMemoryBackend) DescribeDBClusterParameters( ctx context.Context, groupName string, ) ([]DBClusterParameter, error)
DescribeDBClusterParameters returns the parameters for a DB cluster parameter group.
func (*InMemoryBackend) DescribeDBClusterSnapshotAttributes ¶
func (b *InMemoryBackend) DescribeDBClusterSnapshotAttributes( ctx context.Context, snapshotID string, ) (*DBClusterSnapshotAttributesResult, error)
DescribeDBClusterSnapshotAttributes returns attributes for a cluster snapshot.
func (*InMemoryBackend) DescribeDBClusterSnapshots ¶
func (b *InMemoryBackend) DescribeDBClusterSnapshots( ctx context.Context, snapshotID, clusterID, snapshotType string, ) ([]DBClusterSnapshot, error)
func (*InMemoryBackend) DescribeDBClusters ¶
func (*InMemoryBackend) DescribeDBEngineVersions ¶
func (b *InMemoryBackend) DescribeDBEngineVersions(_ context.Context, engine, engineVersion string) []DBEngineVersion
DescribeDBEngineVersions returns available engine versions, optionally filtered.
func (*InMemoryBackend) DescribeDBInstances ¶
func (b *InMemoryBackend) DescribeDBInstances(ctx context.Context, id, clusterID string) ([]DBInstance, error)
func (*InMemoryBackend) DescribeDBSubnetGroups ¶
func (b *InMemoryBackend) DescribeDBSubnetGroups(ctx context.Context, name string) ([]DBSubnetGroup, error)
func (*InMemoryBackend) DescribeEngineDefaultClusterParameters ¶
func (b *InMemoryBackend) DescribeEngineDefaultClusterParameters( _ context.Context, _ string, ) []DBClusterParameter
DescribeEngineDefaultClusterParameters returns the default parameters for an engine family.
func (*InMemoryBackend) DescribeEventCategories ¶
func (b *InMemoryBackend) DescribeEventCategories(_ context.Context, sourceType string) []EventCategoryMap
DescribeEventCategories returns the event categories for DocDB.
func (*InMemoryBackend) DescribeEventSubscriptions ¶
func (b *InMemoryBackend) DescribeEventSubscriptions(ctx context.Context, name string) []EventSubscription
DescribeEventSubscriptions returns event subscriptions, optionally filtered by name.
func (*InMemoryBackend) DescribeGlobalClusters ¶
func (b *InMemoryBackend) DescribeGlobalClusters(_ context.Context, id string) []GlobalCluster
DescribeGlobalClusters returns global clusters, optionally filtered by ID, sorted by identifier.
func (*InMemoryBackend) DescribePendingMaintenanceActions ¶
func (b *InMemoryBackend) DescribePendingMaintenanceActions( _ context.Context, _ string, ) []ResourcePendingMaintenanceActions
DescribePendingMaintenanceActions returns pending maintenance actions for resources. This implementation returns an empty list (in-memory emulation has no real pending actions).
func (*InMemoryBackend) FailoverDBCluster ¶
func (*InMemoryBackend) FailoverGlobalCluster ¶
func (b *InMemoryBackend) FailoverGlobalCluster(_ context.Context, id, _ string) (*GlobalCluster, error)
FailoverGlobalCluster initiates a failover for a global cluster.
func (*InMemoryBackend) GetClusterMembers ¶
func (b *InMemoryBackend) GetClusterMembers(ctx context.Context, clusterID string) []DBClusterMemberEntry
GetClusterMembers returns the instances that belong to a given cluster, ordered by identifier.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, arnStr string) []Tag
func (*InMemoryBackend) ModifyDBCluster ¶
func (b *InMemoryBackend) ModifyDBCluster( ctx context.Context, id, paramGroupName string, deletionProtection *bool, backupRetentionPeriod int, preferredBackupWindow, preferredMaintenanceWindow string, opts *ModifyDBClusterOptions, ) (*DBCluster, error)
func (*InMemoryBackend) ModifyDBClusterParameterGroup ¶
func (b *InMemoryBackend) ModifyDBClusterParameterGroup( ctx context.Context, name string, parameters map[string]string, ) (*DBClusterParameterGroup, error)
func (*InMemoryBackend) ModifyDBClusterSnapshotAttribute ¶
func (b *InMemoryBackend) ModifyDBClusterSnapshotAttribute( ctx context.Context, snapshotID, attributeName string, valuesToAdd, valuesToRemove []string, ) (*DBClusterSnapshotAttributesResult, error)
func (*InMemoryBackend) ModifyDBInstance ¶
func (b *InMemoryBackend) ModifyDBInstance( ctx context.Context, id, instanceClass string, autoMinorVersionUpgrade *bool, preferredMaintenanceWindow string, opts *ModifyDBInstanceOptions, ) (*DBInstance, error)
func (*InMemoryBackend) ModifyDBSubnetGroup ¶
func (b *InMemoryBackend) ModifyDBSubnetGroup( ctx context.Context, name, description string, subnetIDs []string, ) (*DBSubnetGroup, error)
ModifyDBSubnetGroup modifies a DB subnet group.
func (*InMemoryBackend) ModifyEventSubscription ¶
func (b *InMemoryBackend) ModifyEventSubscription( ctx context.Context, name, snsTopicARN, sourceType string, eventCategories []string, ) (*EventSubscription, error)
ModifyEventSubscription modifies an event subscription.
func (*InMemoryBackend) ModifyGlobalCluster ¶
func (b *InMemoryBackend) ModifyGlobalCluster( _ context.Context, id, newID string, deletionProtection *bool, ) (*GlobalCluster, error)
ModifyGlobalCluster modifies a global cluster.
func (*InMemoryBackend) RebootDBInstance ¶
func (b *InMemoryBackend) RebootDBInstance(ctx context.Context, id string) (*DBInstance, error)
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the backend's configured default AWS region.
func (*InMemoryBackend) RemoveFromGlobalCluster ¶
func (b *InMemoryBackend) RemoveFromGlobalCluster( _ context.Context, globalClusterID, _ string, ) (*GlobalCluster, error)
RemoveFromGlobalCluster removes a DB cluster from a global cluster.
func (*InMemoryBackend) RemoveSourceIdentifierFromSubscription ¶
func (b *InMemoryBackend) RemoveSourceIdentifierFromSubscription( ctx context.Context, subscriptionName, sourceID string, ) (*EventSubscription, error)
RemoveSourceIdentifierFromSubscription removes a source identifier from an event subscription.
func (*InMemoryBackend) RemoveTagsFromResource ¶
func (b *InMemoryBackend) RemoveTagsFromResource(ctx context.Context, arnStr string, keys []string)
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all stored state, returning the backend to an empty state.
It calls b.registry.ResetAll() rather than re-registering tables: registerAllTables must run exactly once, at construction (store.Register panics on a duplicate name) -- see the doc comment on registerAllTables in store_setup.go.
func (*InMemoryBackend) ResetDBClusterParameterGroup ¶
func (b *InMemoryBackend) ResetDBClusterParameterGroup( ctx context.Context, name string, ) (*DBClusterParameterGroup, error)
ResetDBClusterParameterGroup resets a parameter group to its default values.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) RestoreDBClusterFromSnapshot ¶
func (b *InMemoryBackend) RestoreDBClusterFromSnapshot( ctx context.Context, snapshotID, clusterID, engine string, ) (*DBCluster, error)
RestoreDBClusterFromSnapshot restores a new cluster from a snapshot.
func (*InMemoryBackend) RestoreDBClusterToPointInTime ¶
func (b *InMemoryBackend) RestoreDBClusterToPointInTime( ctx context.Context, sourceClusterID, targetClusterID string, ) (*DBCluster, error)
RestoreDBClusterToPointInTime restores a new cluster to a point in time from a source cluster.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) StartDBCluster ¶
func (*InMemoryBackend) StopDBCluster ¶
func (*InMemoryBackend) SwitchoverGlobalCluster ¶
func (b *InMemoryBackend) SwitchoverGlobalCluster(_ context.Context, id, _ string) (*GlobalCluster, error)
SwitchoverGlobalCluster initiates a switchover for a global cluster.
type ModifyDBClusterOptions ¶
type ModifyDBClusterOptions struct {
EngineVersion string
MasterUserPassword string
NewDBClusterIdentifier string
VpcSecurityGroupIDs []string
EnableLogsTypes []string
DisableLogsTypes []string
Port int
}
ModifyDBClusterOptions holds optional extra parameters for ModifyDBCluster.
type ModifyDBInstanceOptions ¶
type ModifyDBInstanceOptions struct {
CopyTagsToSnapshot *bool
PromotionTier *int
CACertificateIdentifier string
}
ModifyDBInstanceOptions holds optional extra parameters for ModifyDBInstance.
type PendingMaintenanceAction ¶
PendingMaintenanceAction describes a pending maintenance action.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for DocDB.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the DocDB service backend and handler.
type ResourcePendingMaintenanceActions ¶
type ResourcePendingMaintenanceActions struct {
ResourceIdentifier string
Actions []PendingMaintenanceAction
}
ResourcePendingMaintenanceActions holds pending maintenance actions for a resource.
Source Files
¶
- certificates.go
- db_cluster_parameter_groups.go
- db_cluster_snapshots.go
- db_clusters.go
- db_instances.go
- db_subnet_groups.go
- engine_versions.go
- errors.go
- events.go
- global_clusters.go
- handler.go
- handler_certificates.go
- handler_db_cluster_parameter_groups.go
- handler_db_cluster_snapshots.go
- handler_db_clusters.go
- handler_db_instances.go
- handler_db_subnet_groups.go
- handler_engine_versions.go
- handler_events.go
- handler_global_clusters.go
- handler_pending_maintenance.go
- handler_tags.go
- models.go
- pending_maintenance.go
- persistence.go
- provider.go
- store.go
- store_setup.go
- tags.go