repository

package
v0.0.0-...-0bcc17c Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBRepository

type DBRepository interface {
	// Account-related
	CreateAccount(ctx context.Context, id string) (exists bool, err error)
	GetAccountDetail(ctx context.Context, id string) (res *model.AccountDetail, err error)
	UpdateAccountStatus(ctx context.Context, req *model.ActivationRequest) (err error)

	// Transaction-related
	GetAllTransactionHistory(ctx context.Context, accountID string) (res []*model.HistoryResultTransaction, err error)
	IsReferenceIDExists(ctx context.Context, accountID, referenceID string) (exists bool, err error)
	CreateTransaction(ctx context.Context, req *model.CreateTransactionRequest) (err error)
}

func NewDB

func NewDB(db *sqlx.DB, config *model.AppConfig) DBRepository

type RedisRepository

type RedisRepository interface {
	IsAccountEnabled(ctx context.Context, id string) (enabled bool, err error)
	SetAccountStatus(ctx context.Context, id string, enabled bool) error
}

func NewRedis

func NewRedis(client *redis.Client, config *model.AppConfig) RedisRepository

Jump to

Keyboard shortcuts

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