Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PgSqlWireSet = wire.NewSet( GetConfig, NewDbConnection, )
Functions ¶
func NewDbConnection ¶
Types ¶
type AuditLog ¶
type AuditLog struct { CreatedOn time.Time `sql:"created_on,type:timestamptz"` CreatedBy int32 `sql:"created_by,type:integer"` UpdatedOn time.Time `sql:"updated_on,type:timestamptz"` UpdatedBy int32 `sql:"updated_by,type:integer"` }
func NewDefaultAuditLog ¶ added in v0.6.26
func (*AuditLog) CreateAuditLog ¶ added in v0.6.29
CreateAuditLog can be used by any repository to create AuditLog for insert operation
func (*AuditLog) UpdateAuditLog ¶ added in v0.6.29
UpdateAuditLog can be used by any repository to update AuditLog for update operation
type Config ¶
type Config struct { Addr string `env:"PG_ADDR" envDefault:"127.0.0.1"` Port string `env:"PG_PORT" envDefault:"5432"` User string `env:"PG_USER" envDefault:""` Password string `env:"PG_PASSWORD" envDefault:"" secretData:"-"` Database string `env:"PG_DATABASE" envDefault:"orchestrator"` CasbinDatabase string `env:"CASBIN_DATABASE" envDefault:"casbin"` ApplicationName string `env:"APP" envDefault:"orchestrator" envDescription:"Application name"` LogQuery bool `env:"PG_LOG_QUERY" envDefault:"true"` LogAllQuery bool `env:"PG_LOG_ALL_QUERY" envDefault:"false"` ExportPromMetrics bool `env:"PG_EXPORT_PROM_METRICS" envDefault:"false"` QueryDurationThreshold int64 `env:"PG_QUERY_DUR_THRESHOLD" envDefault:"5000"` ReadTimeout int64 `env:"PG_READ_TIMEOUT" envDefault:"30"` WriteTimeout int64 `env:"PG_WRITE_TIMEOUT" envDefault:"30"` }
type TransactionUtilImpl ¶ added in v0.6.19
type TransactionUtilImpl struct {
// contains filtered or unexported fields
}
func NewTransactionUtilImpl ¶ added in v0.6.19
func NewTransactionUtilImpl(db *pg.DB) *TransactionUtilImpl
func (*TransactionUtilImpl) CommitTx ¶ added in v0.6.19
func (impl *TransactionUtilImpl) CommitTx(tx *pg.Tx) error
func (*TransactionUtilImpl) RollbackTx ¶ added in v0.6.19
func (impl *TransactionUtilImpl) RollbackTx(tx *pg.Tx) error
Click to show internal directories.
Click to hide internal directories.