Documentation ¶
Index ¶
- type IScenarioHelper
- type Movie
- type RedshiftBasicsScenario
- func (runner *RedshiftBasicsScenario) PopulateMoviesTable(ctx context.Context, clusterId string, databaseName string, tableName string, ...)
- func (runner *RedshiftBasicsScenario) QueryMoviesByYear(ctx context.Context, clusterId string, databaseName string, tableName string, ...)
- func (runner *RedshiftBasicsScenario) Run(ctx context.Context)
- type ScenarioHelper
- type SecretsManager
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IScenarioHelper ¶
type IScenarioHelper interface {
GetName() string
}
IScenarioHelper abstracts input and wait functions from a scenario so that they can be mocked for unit testing.
type RedshiftBasicsScenario ¶
type RedshiftBasicsScenario struct {
// contains filtered or unexported fields
}
RedshiftBasicsScenario separates the steps of this scenario into individual functions so that they are simpler to read and understand.
func RedshiftBasics ¶
func RedshiftBasics(sdkConfig aws.Config, questioner demotools.IQuestioner, pauser demotools.IPausable, filesystem demotools.IFileSystem, helper IScenarioHelper) RedshiftBasicsScenario
RedshiftBasics constructs a new Redshift Basics runner.
func (*RedshiftBasicsScenario) PopulateMoviesTable ¶
func (runner *RedshiftBasicsScenario) PopulateMoviesTable(ctx context.Context, clusterId string, databaseName string, tableName string, userName string, fileName string)
PopulateMoviesTable reads data from the <fileName> file and inserts records into the "Movies" table.
func (*RedshiftBasicsScenario) QueryMoviesByYear ¶
func (runner *RedshiftBasicsScenario) QueryMoviesByYear(ctx context.Context, clusterId string, databaseName string, tableName string, userName string, year int)
QueryMoviesByYear retrieves only movies from the "Movies" table which match the given year.
func (*RedshiftBasicsScenario) Run ¶
func (runner *RedshiftBasicsScenario) Run(ctx context.Context)
Run runs the RedshiftBasics interactive example that shows you how to use Amazon Redshift and how to interact with its common endpoints.
0. Retrieve username and password information to access Redshift. 1. Create a cluster. 2. Wait for the cluster to become available. 3. List the available databases in the region. 4. Create a table named "Movies" in the "dev" database. 5. Populate the movies table from the "movies.json" file. 6. Query the movies table by year. 7. Modify the cluster's maintenance window. 8. Optionally clean up all resources created during this demo.
This example creates an Amazon Redshift service client from the specified sdkConfig so that you can replace it with a mocked or stubbed config for unit testing.
It uses a questioner from the `demotools` package to get input during the example. This package can be found in the ..\..\demotools folder of this repo.
type ScenarioHelper ¶
func (ScenarioHelper) GetName ¶
func (helper ScenarioHelper) GetName() string
GetName returns a unique name formed of a prefix and a random number.
type SecretsManager ¶
type SecretsManager struct {
SecretsManagerClient *secretsmanager.Client
}
SecretsManager is used to retrieve username and password information from a secure service.