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