db

package
v0.0.0-...-04e9ec7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnectionFromDsn

func GetConnectionFromDsn(ctx context.Context, dsnString string) (driver.Conn, error)

func GetlaughingtaleDb

func GetlaughingtaleDb() *gorm.DB

func InitGormPool

func InitGormPool()

func WrapDB

func WrapDB(db *sql.DB) (*sqlx.DB, error)

Types

type Generator

type Generator interface {
	GetAuthToken(ctx context.Context) (string, error)
}

type IAM

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

func NewIAMClient

func NewIAMClient() *IAM

func (*IAM) GetIamRdsCredential

func (iamHandler *IAM) GetIamRdsCredential(ctx context.Context, host string) (string, error)

type IAMAuth

type IAMAuth struct {
	DatabaseUser       string
	DatabaseHost       string
	DatabasePort       string
	DatabaseName       string
	AmazonResourceName string
	AuthTokenGenerator Generator
	DatabaseSchema     string
}

func (IAMAuth) Connect

func (ia IAMAuth) Connect(ctx context.Context) (*sqlx.DB, error)

func (*IAMAuth) GetConnectionString

func (ia *IAMAuth) GetConnectionString(ctx context.Context, lookup LookupCNAME) (string, error)

type IAMAuthGenerator

type IAMAuthGenerator struct{}

type LocalAuth

type LocalAuth struct {
	DatabaseUser     string
	DatabaseHost     string
	DatabasePort     string
	DatabaseName     string
	DatabasePassword string
	DatabaseSchema   string
}

func (LocalAuth) Connect

func (la LocalAuth) Connect(ctx context.Context) (*sqlx.DB, error)

func (*LocalAuth) GetConnectionString

func (la *LocalAuth) GetConnectionString(ctx context.Context, lookup LookupCNAME) (string, error)

func (*LocalAuth) GetLocalReaderNodeConnectionString

func (la *LocalAuth) GetLocalReaderNodeConnectionString(ctx context.Context, lookup LookupCNAME) string

type LookupCNAME

type LookupCNAME func(string) (string, error)

Jump to

Keyboard shortcuts

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