postgres

package
v1.6.5-rc16 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

  1. clean workspace
make clean
  1. start postgres
make start_postgres
  1. init database
make init_db
  1. test
make build
make run

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SwitchSlave

func SwitchSlave(db sqlx.DBExecutor) sqlx.DBExecutor

Types

type CanSlave

type CanSlave interface {
	UseSlave() sqlx.DBExecutor
}

type Endpoint

type Endpoint struct {
	Master   types.Endpoint
	Slave    types.Endpoint
	Database *sqlx.Database `env:"-"`
	Retry    *retry.Retry

	Extensions      []string
	PoolSize        int
	ConnMaxLifetime types.Duration

	*sqlx.DB `env:"-"`
	// contains filtered or unexported fields
}

func (*Endpoint) Init

func (e *Endpoint) Init() error

func (Endpoint) LivenessCheck

func (e Endpoint) LivenessCheck() map[string]string

func (Endpoint) Name

func (e Endpoint) Name() string

func (*Endpoint) SetDefault

func (e *Endpoint) SetDefault()

func (Endpoint) UseSlave

func (e Endpoint) UseSlave() sqlx.DBExecutor

Jump to

Keyboard shortcuts

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