pgclient

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnectorSet

func NewConnectorSet(awsProvider AWSProvider, configs ConfigProvider) *pgConnSet

Types

type AWSProvider

type AWSProvider interface {
	Credentials() aws.CredentialsProvider
	Region() string
}

type AuroraConfig

type AuroraConfig struct {
	Endpoint string `json:"endpoint"` // Address and Port
	Port     int    `json:"port"`
	DBName   string `json:"dbName"`
	DBUser   string `json:"dbUser"`
}

type AuthClient

type AuthClient interface {
	ConnectionString(ctx context.Context, lookupName string) (string, error)
}

type ConfigProvider

type ConfigProvider interface {
	GetConfig(name string) (string, bool)
}

type ConfigSet

type ConfigSet interface {
	GetConnector(raw string) (PGConnector, error)
}

type CredBuilder

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

func NewCredBuilder

func NewCredBuilder(creds aws.CredentialsProvider, region string) *CredBuilder

func (*CredBuilder) AddConfig

func (cb *CredBuilder) AddConfig(name string, config *AuroraConfig) error

func (*CredBuilder) ConnectionString

func (cb *CredBuilder) ConnectionString(ctx context.Context, lookupName string) (string, error)

func (*CredBuilder) NewToken

func (cb *CredBuilder) NewToken(ctx context.Context, lookupName string) (string, error)

type EnvProvider

type EnvProvider struct{}

func (EnvProvider) GetConfig

func (EnvProvider) GetConfig(name string) (string, bool)

type PGConnector

type PGConnector interface {
	Name() string
	DSN(context.Context) (string, error)
}

func NewAuroraConnector

func NewAuroraConnector(name string, creds AuthClient) (PGConnector, error)

func NewDirectConnector

func NewDirectConnector(name, dsn string) PGConnector

Jump to

Keyboard shortcuts

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