Documentation
¶
Index ¶
- type Cluster
- type ClusterEndpoint
- type ClusterParameterGroup
- type ClusterSchema
- type ClusterSnapshot
- type ClusterSubnetGroup
- type RedshiftService
- func (s *RedshiftService) Actions() []service.Action
- func (s *RedshiftService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
- func (s *RedshiftService) HealthCheck() error
- func (s *RedshiftService) Name() string
- func (s *RedshiftService) ResourceSchemas() []schema.ResourceSchema
- type SchemaColumn
- type SchemaDatabase
- type SchemaSchema
- type SchemaTable
- type StatementExecution
- type Store
- func (s *Store) AddTags(arn string, tags map[string]string) bool
- func (s *Store) AddTagsToResource(arn string, tags map[string]string) bool
- func (s *Store) CreateCluster(id, nodeType string, numNodes int, ...) (*Cluster, bool)
- func (s *Store) CreateClusterParameterGroup(name, family, description string, tags map[string]string) (*ClusterParameterGroup, bool)
- func (s *Store) CreateClusterSnapshot(snapshotID, clusterID string, tags map[string]string) (*ClusterSnapshot, bool)
- func (s *Store) CreateClusterSubnetGroup(name, description string, subnetIDs []string, tags map[string]string) (*ClusterSubnetGroup, bool)
- func (s *Store) DeleteCluster(id string) (*Cluster, bool)
- func (s *Store) DeleteClusterParameterGroup(name string) bool
- func (s *Store) DeleteClusterSnapshot(id string) bool
- func (s *Store) DeleteClusterSubnetGroup(name string) bool
- func (s *Store) ExecuteStatement(clusterID, database, sql string) (*StatementExecution, error)
- func (s *Store) GetCluster(id string) (*Cluster, bool)
- func (s *Store) GetStatement(id string) (*StatementExecution, bool)
- func (s *Store) ListClusterParameterGroups(filterName string) []*ClusterParameterGroup
- func (s *Store) ListClusterSnapshots(clusterID, snapshotID string) []*ClusterSnapshot
- func (s *Store) ListClusterSubnetGroups(filterName string) []*ClusterSubnetGroup
- func (s *Store) ListClusters(filterID string) []*Cluster
- func (s *Store) ListTags(arn string) (map[string]string, bool)
- func (s *Store) ModifyCluster(id, nodeType string, numNodes int) (*Cluster, bool)
- func (s *Store) PauseCluster(id string) (*Cluster, bool)
- func (s *Store) RebootCluster(id string) (*Cluster, bool)
- func (s *Store) RemoveTags(arn string, keys []string) bool
- func (s *Store) RemoveTagsFromResource(arn string, keys []string) bool
- func (s *Store) RestoreFromClusterSnapshot(newClusterID, snapshotID string) (*Cluster, bool)
- func (s *Store) ResumeCluster(id string) (*Cluster, bool)
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 ¶
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 ¶
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 (*Store) AddTagsToResource ¶
func (*Store) CreateCluster ¶
func (*Store) CreateClusterParameterGroup ¶
func (*Store) CreateClusterSnapshot ¶
func (*Store) CreateClusterSubnetGroup ¶
func (*Store) DeleteClusterParameterGroup ¶
func (*Store) DeleteClusterSnapshot ¶
func (*Store) DeleteClusterSubnetGroup ¶
func (*Store) ExecuteStatement ¶
func (s *Store) ExecuteStatement(clusterID, database, sql string) (*StatementExecution, error)
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