Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID int64 `gorm:"primaryKey" json:"id" deepcopier:"ID"` Name string `json:"name" deepcopier:"Name"` Type string `json:"type" deepcopier:"Type"` Description string `json:"description" deepcopier:"Description"` UserID int64 `json:"user_id" deepcopier:"UserID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty"` }
type GetAllAccountReq ¶
type GetAllAccountReq struct { UserID int64 `json:"user_id"` Page int `json:"page"` Limit int `json:"limit"` }
GetAllAccountReq ...
type Repository ¶
type Repository interface { // CreateAccount ... CreateAccount(ctx context.Context, account Account) (returnData Account, err error) // UpdateAccount ... UpdateAccount(ctx context.Context, account Account) (returnData Account, err error) // GetAccountByID ... GetAccountByID(ctx context.Context, id int64) (returnData Account, err error) // GetAllAccount ... GetAllAccount(ctx context.Context, req GetAllAccountReq) (returnData []Account, err error) // DeleteAccount ... DeleteAccount(ctx context.Context, id int64) (returnData Account, err error) // CountTotalAccount ... CountTotalAccount(ctx context.Context, userID int64) (total int64, err error) }
func NewDB ¶
func NewDB(d *driversql.Database) Repository
func NewRepo ¶
func NewRepo(db Repository) Repository
type Res ¶
type Res struct { ID int64 `json:"id" deepcopier:"ID"` Name string `json:"name" deepcopier:"Name"` Type string `json:"type" deepcopier:"Type"` Description string `json:"description" deepcopier:"Description"` UserID int64 `json:"user_id" deepcopier:"UserID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.