repository

package
v0.0.0-...-454e616 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(conf *viper.Viper, l *log.Logger) *gorm.DB

func NewRedis

func NewRedis(conf *viper.Viper) *redis.Client

Types

type Repository

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

func NewRepository

func NewRepository(db *gorm.DB, rdb *redis.Client, logger *log.Logger) *Repository

func (*Repository) DB

func (r *Repository) DB(ctx context.Context) *gorm.DB

func (*Repository) Transaction

func (r *Repository) Transaction(ctx context.Context, fn func(ctx context.Context) error) error

type Transaction

type Transaction interface {
	Transaction(ctx context.Context, fn func(ctx context.Context) error) error
}

func NewTransaction

func NewTransaction(r *Repository) Transaction

Jump to

Keyboard shortcuts

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