infrastructure

package
v0.0.0-...-165d855 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

Log is the default log function

Types

type DbAdapter

type DbAdapter struct {
	*tgorm.GormClient
	Log func(ctx context.Context, logData *pb_logging.LogData) (*pb_logging.LoggingResult, error)
}

func NewDbAdapter

func NewDbAdapter(dbClient *tgorm.GormClient) DbAdapter

func (DbAdapter) DeleteDlr

func (a DbAdapter) DeleteDlr(ctx context.Context, dlr me.Dlr) (me.Dlr, error)

DeleteDlr soft-deletes the given dlr in the database.

func (DbAdapter) GetDlrsByFilter

func (a DbAdapter) GetDlrsByFilter(ctx context.Context, dlrFilter me.DlrFilter) (me.Dlrs, error)

GetDlrsByFilter returns the dlrs that match the given filter.

func (DbAdapter) SaveDlr

func (a DbAdapter) SaveDlr(ctx context.Context, dlr me.Dlr) (me.Dlr, error)

SaveDlr insert a new dlr or update the existing one in the database.

func (*DbAdapter) SetLogger

func (a *DbAdapter) SetLogger(LoggerFunc func(ctx context.Context, logData *pb_logging.LogData) (*pb_logging.LoggingResult, error))

SetLogger sets logging call-back function

type RedisAdapter

type RedisAdapter struct {
	*tredis.RedisClient
	Log func(ctx context.Context, logData *pb_logging.LogData) (*pb_logging.LoggingResult, error)
}

func NewRedisAdapter

func NewRedisAdapter(redisClient *tredis.RedisClient) RedisAdapter

func (*RedisAdapter) SetLogger

func (a *RedisAdapter) SetLogger(LoggerFunc func(ctx context.Context, logData *pb_logging.LogData) (*pb_logging.LoggingResult, error))

SetLogger sets logging call-back function

Jump to

Keyboard shortcuts

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