Documentation
¶
Overview ¶
Package redshiftserverless emulates Amazon Redshift Serverless over JSON 1.1. A namespace holds the admin login and the first database; its workgroup runs them in a PostgreSQL container on localhost, as a Redshift cluster does. Snapshots and usage limits are metadata.
Index ¶
- type ConfigParameter
- type Endpoint
- type Namespace
- type Service
- func (s *Service) Close() error
- func (s *Service) DB(account, region, id string) *redshift.DB
- func (s *Service) Info() core.Info
- func (s *Service) Inspect(table, id string) any
- func (s *Service) Load(b []byte) error
- func (s *Service) Reset()
- func (s *Service) Resources() []core.Table
- func (s *Service) Save() ([]byte, error)
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Snapshot
- type Tag
- type UsageLimit
- type Workgroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigParameter ¶
type ConfigParameter struct {
ParameterKey string `json:"parameterKey"`
ParameterValue string `json:"parameterValue"`
}
ConfigParameter is a database setting of a workgroup.
type Namespace ¶
type Namespace struct {
NamespaceArn string `json:"namespaceArn"`
NamespaceId string `json:"namespaceId"`
NamespaceName string `json:"namespaceName"`
AdminUsername string `json:"adminUsername"`
DbName string `json:"dbName"`
KmsKeyId string `json:"kmsKeyId"`
DefaultIamRoleArn string `json:"defaultIamRoleArn,omitempty"`
IamRoles []string `json:"iamRoles,omitempty"`
LogExports []string `json:"logExports,omitempty"`
Status string `json:"status"`
CreationDate time.Time `json:"creationDate"`
Password string `json:"pogiAdminPassword,omitempty"` // pogi's
}
Namespace is a namespace: the admin login and first database.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Redshift Serverless emulator.
func (*Service) Close ¶
Close removes the containers, except those persisted state resumes next run.
func (*Service) DB ¶
DB is where the database of a workgroup (by name or ARN) answers, for the Data API; nil when there is no such workgroup.
func (*Service) Inspect ¶
Inspect returns a namespace with its admin password, or a workgroup with pogi's side: container, state and pogiNote.
func (*Service) Load ¶
Load restores state and reconnects to the containers by name (--persist leaves them behind on shutdown); containers of dropped workgroups go.
type Snapshot ¶
type Snapshot struct {
SnapshotName string `json:"snapshotName"`
SnapshotArn string `json:"snapshotArn"`
NamespaceName string `json:"namespaceName"`
NamespaceArn string `json:"namespaceArn"`
AdminUsername string `json:"adminUsername"`
OwnerAccount string `json:"ownerAccount"`
KmsKeyId string `json:"kmsKeyId"`
SnapshotCreateTime time.Time `json:"snapshotCreateTime"`
SnapshotRetentionPeriod int `json:"snapshotRetentionPeriod"`
Status string `json:"status"`
}
Snapshot is a snapshot of a namespace. ponytail: metadata only, like Redshift's: restoring needs a dump of the container.
type UsageLimit ¶
type UsageLimit struct {
UsageLimitId string `json:"usageLimitId"`
UsageLimitArn string `json:"usageLimitArn"`
ResourceArn string `json:"resourceArn"`
UsageType string `json:"usageType"`
Amount int64 `json:"amount"`
Period string `json:"period"`
BreachAction string `json:"breachAction"`
}
UsageLimit is a usage limit of a workgroup; pogi never breaches it.
type Workgroup ¶
type Workgroup struct {
WorkgroupArn string `json:"workgroupArn"`
WorkgroupId string `json:"workgroupId"`
WorkgroupName string `json:"workgroupName"`
NamespaceName string `json:"namespaceName"`
BaseCapacity int `json:"baseCapacity"`
MaxCapacity int `json:"maxCapacity,omitempty"`
ConfigParameters []ConfigParameter `json:"configParameters,omitempty"`
EnhancedVpcRouting bool `json:"enhancedVpcRouting"`
PubliclyAccessible bool `json:"publiclyAccessible"`
SecurityGroupIds []string `json:"securityGroupIds,omitempty"`
SubnetIds []string `json:"subnetIds,omitempty"`
Port int `json:"port"`
Endpoint *Endpoint `json:"endpoint,omitempty"` // in views only
Status string `json:"status,omitempty"` // in views only, from Pogi
TrackName string `json:"trackName"`
CreationDate time.Time `json:"creationDate"`
Pogi *rds.Server `json:"pogi,omitempty"` // pogi's
}
Workgroup is a workgroup; it owns the container of its namespace's database.