storage

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresClient

func NewPostgresClient(cfg config.PostgresConfigs) (*gorm.DB, error)

NewPostgresClient creates a new connection to postgres

Types

type Database

type Database struct {
	PG *gorm.DB
}

Database is a wrapper type for the gorm DB pointer

func NewDatabase

func NewDatabase(config config.Config) (*Database, error)

NewDatabase return a Database instance

func (*Database) Close

func (db *Database) Close()

type Logger

type Logger struct {
	SlowThreshold             time.Duration
	IgnoreRecordNotFoundError bool
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, data ...interface{})

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, msg string, data ...interface{})

func (*Logger) LogMode

func (l *Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface

func (*Logger) Trace

func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, msg string, data ...interface{})

Jump to

Keyboard shortcuts

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