repo

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound    error = fmt.Errorf("resource not found")
	ErrConflict    error = fmt.Errorf("conflict")
	ErrServerError error = fmt.Errorf("server error")
)

Error

Functions

This section is empty.

Types

type DBTx

type DBTx interface {
	GetTx() *gorm.DB

	Begin() (DBTx, error)
	Commit() error
	Rollback() error
}

DB transaction

func New

func New(c *config.Configs) (DBTx, *gorm.DB, *gorm.DB, error)

Init

type DBTxImp

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

func NewDBTxImp

func NewDBTxImp(d *gorm.DB) *DBTxImp

func (*DBTxImp) Begin

func (d *DBTxImp) Begin() (DBTx, error)

func (*DBTxImp) Commit

func (d *DBTxImp) Commit() error

func (*DBTxImp) GetTx

func (d *DBTxImp) GetTx() *gorm.DB

func (*DBTxImp) Rollback

func (d *DBTxImp) Rollback() error

type OutboxRepo

type OutboxRepo interface {
	WithTx(tx DBTx) OutboxRepo

	Create(ctx context.Context, userInfo *entity.Outbox) error
	Delete(ctx context.Context, userUUID uuid.EntityUUID) error
}

Outbox repo

type OutboxRepoImp

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

func NewOutboxRepoImp

func NewOutboxRepoImp(repoDB *gorm.DB) *OutboxRepoImp

func (*OutboxRepoImp) Create

func (u *OutboxRepoImp) Create(ctx context.Context, outbox *entity.Outbox) error

func (*OutboxRepoImp) Delete

func (u *OutboxRepoImp) Delete(ctx context.Context, userUUID uuid.EntityUUID) error

func (*OutboxRepoImp) WithTx

func (u *OutboxRepoImp) WithTx(tx DBTx) OutboxRepo

type UserInfoRepo

type UserInfoRepo interface {
	WithTx(tx DBTx) UserInfoRepo

	List(ctx context.Context, offset int, limit int) ([]entity.UserInfo, error)
	Create(ctx context.Context, userInfo *entity.UserInfo) error
	Get(ctx context.Context, userUUID uuid.EntityUUID) (*entity.UserInfo, error)
	GetByLoginID(ctx context.Context, userLoginID string) (*entity.UserInfo, error)
	Update(ctx context.Context, userInfo *entity.UserInfo) error
	Delete(ctx context.Context, userUUID uuid.EntityUUID) error
}

User info repo

type UserInfoRepoImp

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

func NewUserInfoRepoImp

func NewUserInfoRepoImp(repoDB *gorm.DB) *UserInfoRepoImp

func (*UserInfoRepoImp) Create

func (u *UserInfoRepoImp) Create(ctx context.Context, userInfo *entity.UserInfo) error

func (*UserInfoRepoImp) Delete

func (u *UserInfoRepoImp) Delete(ctx context.Context, userUUID uuid.EntityUUID) error

func (*UserInfoRepoImp) Get

func (u *UserInfoRepoImp) Get(ctx context.Context, userUUID uuid.EntityUUID) (*entity.UserInfo, error)

func (*UserInfoRepoImp) GetByLoginID

func (u *UserInfoRepoImp) GetByLoginID(ctx context.Context, userLoginID string) (*entity.UserInfo, error)

func (*UserInfoRepoImp) List

func (u *UserInfoRepoImp) List(ctx context.Context, offset int, limit int) ([]entity.UserInfo, error)

func (*UserInfoRepoImp) Update

func (u *UserInfoRepoImp) Update(ctx context.Context, userInfo *entity.UserInfo) error

func (*UserInfoRepoImp) WithTx

func (u *UserInfoRepoImp) WithTx(tx DBTx) UserInfoRepo

type UserSecretRepo

type UserSecretRepo interface {
	WithTx(tx DBTx) UserSecretRepo

	Create(ctx context.Context, userSecret *entity.UserSecret) error
	Get(ctx context.Context, userUUID uuid.EntityUUID) (*entity.UserSecret, error)
	Update(ctx context.Context, userSecret *entity.UserSecret) error
	Delete(ctx context.Context, userUUID uuid.EntityUUID) error
}

User secret repo

type UserSecretRepoImp

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

func NewUserSecretRepoImp

func NewUserSecretRepoImp(repoDB *gorm.DB) *UserSecretRepoImp

func (*UserSecretRepoImp) Create

func (u *UserSecretRepoImp) Create(ctx context.Context, userSecret *entity.UserSecret) error

func (*UserSecretRepoImp) Delete

func (u *UserSecretRepoImp) Delete(ctx context.Context, userUUID uuid.EntityUUID) error

func (*UserSecretRepoImp) Get

func (*UserSecretRepoImp) Update

func (u *UserSecretRepoImp) Update(ctx context.Context, userSecret *entity.UserSecret) error

func (*UserSecretRepoImp) WithTx

func (u *UserSecretRepoImp) WithTx(tx DBTx) UserSecretRepo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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