Versions in this module Expand all Collapse all v0 v0.1.1 Apr 12, 2024 v0.1.0 Apr 12, 2024 Changes in this version + type IPostgresDatabaseObject interface + GetCreatedAt func() time.Time + GetIsActive func() bool + GetUpdatedAt func() time.Time + SetCreatedAt func(time time.Time) + SetIsActive func(isActive bool) + SetUpdatedAt func(time time.Time) + type IPostgresRepository interface + Count func(whereStatement interface{}, table string) (int64, error) + Create func(entity T, table string) (*T, error) + Get func(whereStatement interface{}, table string) (*T, error) + GetList func(whereStatement interface{}, table string) ([]T, error) + Remove func(whereStatement interface{}, table string) error + Update func(entity T, whereStatement interface{}, table string) (*T, error) + type PostgresDatabaseObject struct + CreatedAt time.Time + IsActive bool + Section primitive.ObjectID + UpdatedAt time.Time + func (do *PostgresDatabaseObject) GetCreatedAt() time.Time + func (do *PostgresDatabaseObject) GetIsActive() bool + func (do *PostgresDatabaseObject) GetUpdatedAt() time.Time + func (do *PostgresDatabaseObject) SetCreatedAt(time time.Time) + func (do *PostgresDatabaseObject) SetIsActive(isActive bool) + func (do *PostgresDatabaseObject) SetUpdatedAt(time time.Time) + type PostgresRepository struct + func NewPostgresRepository[T IPostgresDatabaseObject](db *gorm.DB) *PostgresRepository[T] + func (r *PostgresRepository[T]) Count(whereStatement interface{}, table string) (int64, error) + func (r *PostgresRepository[T]) Create(entity *T, table string) (*T, error) + func (r *PostgresRepository[T]) Get(whereStatement interface{}, table string) (*T, error) + func (r *PostgresRepository[T]) GetList(whereStatement interface{}, table string) ([]T, error) + func (r *PostgresRepository[T]) Remove(whereStatement interface{}, table string) error + func (r *PostgresRepository[T]) Update(entity T, whereStatement interface{}, table string) (*T, error)