aws_postgres

package
v0.0.0-...-a444f70 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBLite

type DBLite interface {
	PublishEvent(context.Context, o5msg.Message) error
	RequestToClientToken(context.Context, *messaging_j5pb.RequestMetadata) (string, error)
	ClientTokenToRequest(context.Context, string) (*messaging_j5pb.RequestMetadata, error)
}

type DBMigrator

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

func NewDBMigrator

func NewDBMigrator(client SecretsManagerAPI, creds RDSAuthProvider) *DBMigrator

func (*DBMigrator) CleanupPostgresDatabase

func (d *DBMigrator) CleanupPostgresDatabase(ctx context.Context, migrationID string, msg *awsinfra_tpb.CleanupPostgresDatabaseMessage) error

func (*DBMigrator) DestroyPostgresDatabase

func (d *DBMigrator) DestroyPostgresDatabase(ctx context.Context, migrationID string, msg *awsinfra_tpb.DestroyPostgresDatabaseMessage) error

func (*DBMigrator) UpsertPostgresDatabase

func (d *DBMigrator) UpsertPostgresDatabase(ctx context.Context, migrationID string, msg *awsinfra_tpb.UpsertPostgresDatabaseMessage) error

type DBSecret

type DBSecret struct {
	Username string `json:"dbuser"`
	Password string `json:"dbpass"`
	Hostname string `json:"dbhost"`
	DBName   string `json:"dbname"`
	URL      string `json:"dburl"`
}

type DBSpec

type DBSpec interface {
	OpenRoot(context.Context) (*sql.DB, error)
	OpenDBAsRoot(ctx context.Context, dbName string) (*sql.DB, error)

	// NewAppSecret creates the APP side secret for either root connection type.
	NewAppSecret(dbName string) DBSecret
}

type IDBMigrator

type IDBMigrator interface {
	UpsertPostgresDatabase(ctx context.Context, migrationID string, msg *awsinfra_tpb.UpsertPostgresDatabaseMessage) error
	CleanupPostgresDatabase(ctx context.Context, migrationID string, msg *awsinfra_tpb.CleanupPostgresDatabaseMessage) error
	DestroyPostgresDatabase(ctx context.Context, migrationID string, msg *awsinfra_tpb.DestroyPostgresDatabaseMessage) error
}

type PostgresMigrateWorker

type PostgresMigrateWorker struct {
	awsinfra_tpb.UnimplementedPostgresRequestTopicServer
	// contains filtered or unexported fields
}

func NewPostgresMigrateWorker

func NewPostgresMigrateWorker(db DBLite, migrator IDBMigrator) *PostgresMigrateWorker

func (*PostgresMigrateWorker) CleanupPostgresDatabase

func (*PostgresMigrateWorker) DestroyPostgresDatabase

func (*PostgresMigrateWorker) UpsertPostgresDatabase

type RDSAuthProvider

type RDSAuthProvider interface {
	BuildAuthToken(ctx context.Context, dbEndpoint, dbUser string) (string, error)
}

Jump to

Keyboard shortcuts

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