database

package
v0.0.0-...-a121bc4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: EUPL-1.2 Imports: 7 Imported by: 0

Documentation

Overview

Package database holds the database connection and functions for the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB wraps the database connection and stores the access counter.

func Open

func Open(logger *zap.Logger, dsn string) (*DB, error)

Open opens a database connection and returns a DB instance.

func (*DB) Close

func (d *DB) Close() error

Close closes the database connection.

func (*DB) Count

func (d *DB) Count() uint64

Count returns the current access counter.

func (*DB) Increment

func (d *DB) Increment() (uint64, error)

Increment increments the access counter and stores the access in the database.

func (*DB) Ping

func (d *DB) Ping() error

Ping checks if the PostgreSQL database is accessible by executing a simple query.

Jump to

Keyboard shortcuts

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