mpostgres

package
v1.29.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 11 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" example:"1"`
	Limit int `json:"limit" example:"10"`

} // @name Pagination

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

swagger:model Pagination @Description Pagination is the struct designed to store the pagination data of an entity list.

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
	Logger                  mlog.Logger
}

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