infrastructure

package
v0.0.0-...-436674b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 9 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) GetUserPasswordByUserId

func (a DbAdapter) GetUserPasswordByUserId(ctx context.Context, userId uuid.UUID) (me.UserPassword, error)

GetUserPasswordByUserId returns active password of the given user.

func (DbAdapter) GetUsersByFilter

func (a DbAdapter) GetUsersByFilter(ctx context.Context, userFilter me.UserFilter) (me.Users, error)

GetUsersByFilter returns the users that match the given filter.

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) ChangePassword

func (a RedisAdapter) ChangePassword(ctx context.Context, userPassword me.UserPassword) error

ChangePassword changes the given user password in the redis.

func (RedisAdapter) DeleteUserPasswordByUserId

func (a RedisAdapter) DeleteUserPasswordByUserId(ctx context.Context, userId uuid.UUID) error

DeleteUserPasswordByUserId hard-deletes the given user id in the redis.

func (RedisAdapter) GetUserPasswordByUserId

func (a RedisAdapter) GetUserPasswordByUserId(ctx context.Context, userId uuid.UUID) (me.UserPassword, error)

GetUserPasswordByUserId returns active password of the given user.

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