mpostgres

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination added in v1.3.0

type Pagination struct {
	Items any `json:"items"`
	Page  int `json:"page"`
	Limit int `json:"limit"`
}

Pagination is a struct designed to encapsulate pagination response payload data.

func (*Pagination) SetItems added in v1.3.0

func (p *Pagination) SetItems(items any)

SetItems set an array of any struct in items.

type PostgresConnection

type PostgresConnection struct {
	ConnectionStringPrimary string
	ConnectionStringReplica string
	PrimaryDBName           string
	ReplicaDBName           string
	ConnectionDB            *dbresolver.DB
	Connected               bool
	Component               string
}

PostgresConnection is a hub which deal with postgres connections.

func (*PostgresConnection) Connect

func (pc *PostgresConnection) Connect() error

Connect keeps a singleton connection with postgres.

func (*PostgresConnection) GetDB

func (pc *PostgresConnection) GetDB() (dbresolver.DB, error)

GetDB returns a pointer to the postgres connection, initializing it if necessary.

Jump to

Keyboard shortcuts

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