Help us shape the future of Go! Take the 2026 Go Developer Survey

redshiftserverless

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 13 Imported by: 0

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

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 Endpoint

type Endpoint struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
}

Endpoint is where a workgroup listens.

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 New

func New(hub *core.Hub) *Service

New creates the Redshift Serverless service.

func (*Service) Close

func (s *Service) Close() error

Close removes the containers, except those persisted state resumes next run.

func (*Service) DB

func (s *Service) DB(account, region, id string) *redshift.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) Info

func (s *Service) Info() core.Info

func (*Service) Inspect

func (s *Service) Inspect(table, id string) any

Inspect returns a namespace with its admin password, or a workgroup with pogi's side: container, state and pogiNote.

func (*Service) Load

func (s *Service) Load(b []byte) error

Load restores state and reconnects to the containers by name (--persist leaves them behind on shutdown); containers of dropped workgroups go.

func (*Service) Reset

func (s *Service) Reset()

func (*Service) Resources

func (s *Service) Resources() []core.Table

Resources lists namespaces and workgroups for the console.

func (*Service) Save

func (s *Service) Save() ([]byte, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

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 Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Tag is a resource tag.

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.

Jump to

Keyboard shortcuts

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