Documentation
¶
Index ¶
- type ConnOptions
- type Credentials
- type Metric
- type PgConnections
- type Request
- type SecretKey
- type TxManager
- func (mgr *TxManager) BatchResultClose(ctx context.Context, br pgx.BatchResults) error
- func (mgr *TxManager) BeginRo(ctx context.Context) (pgx.Tx, error)
- func (mgr *TxManager) Close()
- func (mgr *TxManager) Commit(ctx context.Context, tx pgx.Tx) error
- func (mgr *TxManager) GetValues(ctx context.Context, rows pgx.Rows, br pgx.BatchResults) ([]interface{}, error)
- func (mgr *TxManager) Query(ctx context.Context, br pgx.BatchResults, sql string) (pgx.Rows, error)
- func (mgr *TxManager) Rollback(ctx context.Context, tx pgx.Tx) error
- func (mgr *TxManager) SendBatch(ctx context.Context, tx pgx.Tx, batch *pgx.Batch) pgx.BatchResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnOptions ¶
type ConnOptions struct {
Host string `yaml:"host" validate:"required,hostname|ip"`
Port int `yaml:"port" validate:"required,min=1024,max=65535"`
Credentials Credentials `yaml:"credentials" validate:"required"`
DbName string `yaml:"db" validate:"required"`
Timeout model.Duration `yaml:"timeout" validate:"required"`
Requests []Request `yaml:"requests" validate:"required,gt=0,unique=Sql,dive,required"`
}
ConnOptions postgres://username:password@host:port/db?sslmode=disable
type Credentials ¶
type Credentials struct {
ClientSet kubernetes.Interface
Namespace string
User SecretKey `yaml:"username" validate:"required"`
Password SecretKey `yaml:"password" validate:"required"`
}
type PgConnections ¶
type PgConnections struct {
Connections []ConnOptions `yaml:"connections" validate:"min=1,unique=Host"`
}
type Request ¶
type Request struct {
Sql string `yaml:"sql" validate:"required"`
MetricName string `yaml:"metricName" validate:"required,prometheus_metric_name"`
Metrics []Metric `yaml:"metrics" validate:"required,gt=0,unique=FieldName,unique_labels,dive,required"`
Description string `yaml:"description,omitempty" validate:"omitempty,lte=100"`
}
type TxManager ¶
type TxManager struct {
// contains filtered or unexported fields
}
func NewTxManager ¶
func NewTxManager(pool pgxpoolmock.PgxPool) *TxManager
func (*TxManager) BatchResultClose ¶
Click to show internal directories.
Click to hide internal directories.