pgha

package
v0.0.0-rc12 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgHA

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

func NewFromConnection

func NewFromConnection(managedConnection *connection.ConnectionPG) (*PgHA, error)

func NewFromDBAAS

func NewFromDBAAS(name, user, password, cluster string) (*PgHA, error)

func NewFromHASQL

func NewFromHASQL(cluster *hasql.Cluster, dbName, user, password string, port int, ssl bool) *PgHA

func NewFromHosts

func NewFromHosts(dbName, user, password string, hosts []string, port int, ssl bool) (*PgHA, error)

func (*PgHA) Close

func (pg *PgHA) Close() error

func (*PgHA) Conn

func (pg *PgHA) Conn(role dbaas.Role) (*pgx.Conn, error)

func (*PgHA) ConnConfig

func (pg *PgHA) ConnConfig(role dbaas.Role) (*pgx.ConnConfig, error)

func (*PgHA) ConnString

func (pg *PgHA) ConnString(role dbaas.Role) (string, error)

func (*PgHA) ConnStringByHost

func (pg *PgHA) ConnStringByHost(host string) string

func (*PgHA) MasterHost

func (pg *PgHA) MasterHost() (*string, error)

func (*PgHA) Pool

func (pg *PgHA) Pool(role dbaas.Role) (*pgxpool.Pool, error)

func (*PgHA) PoolExec

func (pg *PgHA) PoolExec(ctx context.Context, role dbaas.Role, f func(*pgxpool.Conn) error) error

func (*PgHA) PoolSize

func (pg *PgHA) PoolSize() int64

func (*PgHA) ReplicaHost

func (pg *PgHA) ReplicaHost() (*string, error)

func (*PgHA) Sqlx

func (pg *PgHA) Sqlx(role dbaas.Role) (*sqlx.DB, error)

Jump to

Keyboard shortcuts

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