Documentation ¶
Index ¶
- type IMysqlDatabaseObject
- type IMysqlRepository
- type MysqlDatabaseObject
- func (do *MysqlDatabaseObject) GetCreatedAt() time.Time
- func (do *MysqlDatabaseObject) GetIsActive() bool
- func (do *MysqlDatabaseObject) GetUpdatedAt() time.Time
- func (do *MysqlDatabaseObject) SetCreatedAt(time time.Time)
- func (do *MysqlDatabaseObject) SetIsActive(isActive bool)
- func (do *MysqlDatabaseObject) SetUpdatedAt(time time.Time)
- type MysqlRepository
- func (r *MysqlRepository[T]) Count(whereStatement interface{}, table string) (int64, error)
- func (r *MysqlRepository[T]) Create(entity *T, table string) (*T, error)
- func (r *MysqlRepository[T]) Get(whereStatement interface{}, table string) (*T, error)
- func (r *MysqlRepository[T]) GetList(whereStatement interface{}, table string) ([]T, error)
- func (r *MysqlRepository[T]) Remove(whereStatement interface{}, table string) error
- func (r *MysqlRepository[T]) Update(entity T, whereStatement interface{}, table string) (*T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMysqlDatabaseObject ¶
type IMysqlRepository ¶
type IMysqlRepository[T IMysqlDatabaseObject] interface { Create(entity T, table string) (*T, error) Count(whereStatement interface{}, table string) (int64, error) Get(whereStatement interface{}, table string) (*T, error) GetList(whereStatement interface{}, table string) ([]T, error) Update(entity T, whereStatement interface{}, table string) (*T, error) Remove(whereStatement interface{}, table string) error }
type MysqlDatabaseObject ¶
type MysqlDatabaseObject struct { Section primitive.ObjectID UpdatedAt time.Time CreatedAt time.Time IsActive bool }
func (*MysqlDatabaseObject) GetCreatedAt ¶
func (do *MysqlDatabaseObject) GetCreatedAt() time.Time
func (*MysqlDatabaseObject) GetIsActive ¶
func (do *MysqlDatabaseObject) GetIsActive() bool
func (*MysqlDatabaseObject) GetUpdatedAt ¶
func (do *MysqlDatabaseObject) GetUpdatedAt() time.Time
func (*MysqlDatabaseObject) SetCreatedAt ¶
func (do *MysqlDatabaseObject) SetCreatedAt(time time.Time)
func (*MysqlDatabaseObject) SetIsActive ¶
func (do *MysqlDatabaseObject) SetIsActive(isActive bool)
func (*MysqlDatabaseObject) SetUpdatedAt ¶
func (do *MysqlDatabaseObject) SetUpdatedAt(time time.Time)
type MysqlRepository ¶
type MysqlRepository[T IMysqlDatabaseObject] struct { // contains filtered or unexported fields }
func NewMysqlRepository ¶
func NewMysqlRepository[T IMysqlDatabaseObject](db *gorm.DB) *MysqlRepository[T]
func (*MysqlRepository[T]) Count ¶
func (r *MysqlRepository[T]) Count(whereStatement interface{}, table string) (int64, error)
func (*MysqlRepository[T]) Create ¶
func (r *MysqlRepository[T]) Create(entity *T, table string) (*T, error)
func (*MysqlRepository[T]) Get ¶
func (r *MysqlRepository[T]) Get(whereStatement interface{}, table string) (*T, error)
func (*MysqlRepository[T]) GetList ¶
func (r *MysqlRepository[T]) GetList(whereStatement interface{}, table string) ([]T, error)
func (*MysqlRepository[T]) Remove ¶
func (r *MysqlRepository[T]) Remove(whereStatement interface{}, table string) error
func (*MysqlRepository[T]) Update ¶
func (r *MysqlRepository[T]) Update(entity T, whereStatement interface{}, table string) (*T, error)
Click to show internal directories.
Click to hide internal directories.