redshift

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Identifier         string
	ARN                string
	NodeType           string
	NumberOfNodes      int
	MasterUsername     string
	DBName             string
	Status             string
	Endpoint           ClusterEndpoint
	VpcId              string
	ClusterSubnetGroup string
	ParameterGroupName string
	CreatedTime        time.Time
	Tags               map[string]string
	Lifecycle          *lifecycle.Machine
	Schema             *ClusterSchema
}

Cluster represents a Redshift cluster.

type ClusterEndpoint

type ClusterEndpoint struct {
	Address string
	Port    int
}

ClusterEndpoint holds address and port.

type ClusterParameterGroup

type ClusterParameterGroup struct {
	Name        string
	ARN         string
	Family      string
	Description string
	Tags        map[string]string
}

ClusterParameterGroup represents a Redshift parameter group.

type ClusterSchema

type ClusterSchema struct {
	Databases map[string]*SchemaDatabase
}

ClusterSchema tracks databases → schemas → tables → columns for a cluster.

type ClusterSnapshot

type ClusterSnapshot struct {
	Identifier         string
	ARN                string
	ClusterIdentifier  string
	Status             string
	NodeType           string
	NumberOfNodes      int
	DBName             string
	MasterUsername     string
	SnapshotCreateTime time.Time
	Tags               map[string]string
}

ClusterSnapshot represents a manual or automated snapshot.

type ClusterSubnetGroup

type ClusterSubnetGroup struct {
	Name        string
	ARN         string
	Description string
	SubnetIds   []string
	VpcId       string
	Status      string
	Tags        map[string]string
}

ClusterSubnetGroup represents a Redshift subnet group.

type RedshiftService

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

RedshiftService is the cloudmock implementation of the AWS Redshift API.

func New

func New(accountID, region string) *RedshiftService

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

func (*RedshiftService) Actions

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

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

func (*RedshiftService) HandleRequest

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

HandleRequest routes an incoming Redshift request to the appropriate handler.

func (*RedshiftService) HealthCheck

func (s *RedshiftService) HealthCheck() error

HealthCheck always returns nil.

func (*RedshiftService) Name

func (s *RedshiftService) Name() string

Name returns the AWS service name used for routing.

func (*RedshiftService) ResourceSchemas

func (s *RedshiftService) ResourceSchemas() []schema.ResourceSchema

ResourceSchemas returns the schema for Redshift resource types.

type SchemaColumn

type SchemaColumn struct {
	Name     string
	DataType string
}

SchemaColumn represents a column in a Redshift table.

type SchemaDatabase

type SchemaDatabase struct {
	Schemas map[string]*SchemaSchema
}

SchemaDatabase holds schemas within a database.

type SchemaSchema

type SchemaSchema struct {
	Tables map[string]*SchemaTable
}

SchemaSchema holds tables within a schema.

type SchemaTable

type SchemaTable struct {
	Columns []SchemaColumn
}

SchemaTable holds columns for a table.

type StatementExecution

type StatementExecution struct {
	ID            string
	ClusterID     string
	Database      string
	SQL           string
	Status        string // SUBMITTED, PICKED, STARTED, FINISHED, FAILED, ABORTED
	ResultRows    int64
	ResultSize    int64
	CreatedAt     time.Time
	UpdatedAt     time.Time
	Error         string
	ResultColumns []SchemaColumn
	ResultData    [][]string
}

StatementExecution represents a Redshift Data API statement.

type Store

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

Store manages all Redshift resources in memory.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates a new Redshift Store.

func (*Store) AddTags

func (s *Store) AddTags(arn string, tags map[string]string) bool

func (*Store) AddTagsToResource

func (s *Store) AddTagsToResource(arn string, tags map[string]string) bool

func (*Store) CreateCluster

func (s *Store) CreateCluster(id, nodeType string, numNodes int, masterUser, dbName, subnetGroup, paramGroup string, tags map[string]string) (*Cluster, bool)

func (*Store) CreateClusterParameterGroup

func (s *Store) CreateClusterParameterGroup(name, family, description string, tags map[string]string) (*ClusterParameterGroup, bool)

func (*Store) CreateClusterSnapshot

func (s *Store) CreateClusterSnapshot(snapshotID, clusterID string, tags map[string]string) (*ClusterSnapshot, bool)

func (*Store) CreateClusterSubnetGroup

func (s *Store) CreateClusterSubnetGroup(name, description string, subnetIDs []string, tags map[string]string) (*ClusterSubnetGroup, bool)

func (*Store) DeleteCluster

func (s *Store) DeleteCluster(id string) (*Cluster, bool)

func (*Store) DeleteClusterParameterGroup

func (s *Store) DeleteClusterParameterGroup(name string) bool

func (*Store) DeleteClusterSnapshot

func (s *Store) DeleteClusterSnapshot(id string) bool

func (*Store) DeleteClusterSubnetGroup

func (s *Store) DeleteClusterSubnetGroup(name string) bool

func (*Store) ExecuteStatement

func (s *Store) ExecuteStatement(clusterID, database, sql string) (*StatementExecution, error)

func (*Store) GetCluster

func (s *Store) GetCluster(id string) (*Cluster, bool)

func (*Store) GetStatement

func (s *Store) GetStatement(id string) (*StatementExecution, bool)

func (*Store) ListClusterParameterGroups

func (s *Store) ListClusterParameterGroups(filterName string) []*ClusterParameterGroup

func (*Store) ListClusterSnapshots

func (s *Store) ListClusterSnapshots(clusterID, snapshotID string) []*ClusterSnapshot

func (*Store) ListClusterSubnetGroups

func (s *Store) ListClusterSubnetGroups(filterName string) []*ClusterSubnetGroup

func (*Store) ListClusters

func (s *Store) ListClusters(filterID string) []*Cluster

func (*Store) ListTags

func (s *Store) ListTags(arn string) (map[string]string, bool)

func (*Store) ModifyCluster

func (s *Store) ModifyCluster(id, nodeType string, numNodes int) (*Cluster, bool)

func (*Store) PauseCluster

func (s *Store) PauseCluster(id string) (*Cluster, bool)

func (*Store) RebootCluster

func (s *Store) RebootCluster(id string) (*Cluster, bool)

func (*Store) RemoveTags

func (s *Store) RemoveTags(arn string, keys []string) bool

func (*Store) RemoveTagsFromResource

func (s *Store) RemoveTagsFromResource(arn string, keys []string) bool

func (*Store) RestoreFromClusterSnapshot

func (s *Store) RestoreFromClusterSnapshot(newClusterID, snapshotID string) (*Cluster, bool)

func (*Store) ResumeCluster

func (s *Store) ResumeCluster(id string) (*Cluster, bool)

Jump to

Keyboard shortcuts

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