biz

package
v0.0.0-...-71f3af2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 4 Imported by: 0

README

Biz

Documentation

Index

Constants

View Source
const UserTableName = "users"

Variables

View Source
var ProviderSet = wire.NewSet(NewUserUsecase)

Functions

This section is empty.

Types

type User

type User struct {
	UserID    string `gorm:"primaryKey;column:userid" json:"userid"`
	Password  string `gorm:"column:password" json:"password"`
	CreatedAt time.Time
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) (err error)

func (*User) TableName

func (u *User) TableName() string

type UserRepo

type UserRepo interface {
	Save(ctx context.Context, user *User) error
	GetByUserID(ctx context.Context, userID string) (*User, error)
}

type UserUsecase

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

func NewUserUsecase

func NewUserUsecase(repo UserRepo) *UserUsecase

func (*UserUsecase) GetUserByIDFromDB

func (uc *UserUsecase) GetUserByIDFromDB(ctx context.Context, userID string) (*User, error)

func (*UserUsecase) SaveUser

func (uc *UserUsecase) SaveUser(ctx context.Context, user *User) error

Jump to

Keyboard shortcuts

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