sty_shared

package
v2024.17.5 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sty_shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by <Replace with FULL_NAME> / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	CTXBackground = context.Background()
)

Functions

func GetPostgresConnection

func GetPostgresConnection(
	dbName, user, password, host, sslMode string,
	port, timeout, poolMaxConns int,
) (
	DBPoolPtr *pgxpool.Pool,
	errorInfo pi.ErrorInfo,
)

GetPostgresConnection will create a connection to a database. dbName Name of the Postgres database user Account that GetPostgresConnection will use to authenticate password Users password for authentication host Internet DNS or IP address of the server running the instance of Postgres sslMode Type of encryption used for the connection (https://www.postgresql.org/docs/12/libpq-ssl.html for version 12) port Interface the connection communicates with Postgres timeout Number of seconds a request must complete (3 seconds is normal setting)

Customer Messages: None
Errors: None
Verifications: None

func VerifyConnection

func VerifyConnection(
	dbPoolPtr *pgxpool.Pool,
	dbName string,
) (errorInfo pi.ErrorInfo)

Verify that the pointer to the database connection is active.

Types

type ConnValues

type ConnValues struct {
	DBName   string `json:"dbName"`
	User     string `json:"user"`
	Password string `json:"password"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Timeout  int    `json:"timeout"`
	SSLMode  string `json:"sslMode"`
}

type Row

type Row pgx.Row

type Rows

type Rows pgx.Rows

type Transaction

type Transaction pgx.Tx

Row and Rows are so pgx package doesn't need to be imported everywhere there are queries to the database.

Jump to

Keyboard shortcuts

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