Documentation
¶
Index ¶
- func PoolModeTypeChoices() []string
- type ExtensionOut
- type Handler
- type PgOut
- type PgserviceQueryStatisticsIn
- type PoolModeType
- type PostgreSQLHandler
- func (h *PostgreSQLHandler) PGServiceAvailableExtensions(ctx context.Context, project string, serviceName string) ([]ExtensionOut, error)
- func (h *PostgreSQLHandler) PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, ...) ([]QueryOut, error)
- func (h *PostgreSQLHandler) PgAvailableExtensions(ctx context.Context, tenant string) ([]PgOut, error)
- func (h *PostgreSQLHandler) ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, ...) error
- func (h *PostgreSQLHandler) ServicePGBouncerDelete(ctx context.Context, project string, serviceName string, poolName string) error
- func (h *PostgreSQLHandler) ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, ...) error
- type QueryOut
- type ServicePgbouncerCreateIn
- type ServicePgbouncerUpdateIn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PoolModeTypeChoices ¶
func PoolModeTypeChoices() []string
Types ¶
type ExtensionOut ¶
type Handler ¶
type Handler interface {
// PGServiceAvailableExtensions list PostgreSQL extensions that can be loaded with CREATE EXTENSION in this service
// GET /v1/project/{project}/service/{service_name}/pg/available-extensions
// https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/PGServiceAvailableExtensions
PGServiceAvailableExtensions(ctx context.Context, project string, serviceName string) ([]ExtensionOut, error)
// PGServiceQueryStatistics fetch PostgreSQL service query statistics
// POST /v1/project/{project}/service/{service_name}/pg/query/stats
// https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/PGServiceQueryStatistics
PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgserviceQueryStatisticsIn) ([]QueryOut, error)
// PgAvailableExtensions list PostgreSQL extensions available for this tenant grouped by PG version
// GET /v1/tenants/{tenant}/pg-available-extensions
// https://api.aiven.io/doc/#tag/Service/operation/PgAvailableExtensions
PgAvailableExtensions(ctx context.Context, tenant string) ([]PgOut, error)
// ServicePGBouncerCreate create a new connection pool for service
// POST /v1/project/{project}/service/{service_name}/connection_pool
// https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerCreate
ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error
// ServicePGBouncerDelete delete a connection pool
// DELETE /v1/project/{project}/service/{service_name}/connection_pool/{pool_name}
// https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerDelete
ServicePGBouncerDelete(ctx context.Context, project string, serviceName string, poolName string) error
// ServicePGBouncerUpdate update a connection pool
// PUT /v1/project/{project}/service/{service_name}/connection_pool/{pool_name}
// https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerUpdate
ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgbouncerUpdateIn) error
}
type PgOut ¶
type PgOut struct {
Extensions []ExtensionOut `json:"extensions"` // Extensions available for loading with CREATE EXTENSION in this service
Version string `json:"version"` // PostgreSQL version
}
type PgserviceQueryStatisticsIn ¶
type PgserviceQueryStatisticsIn struct {
Limit *int `json:"limit,omitempty"` // Limit for number of results
Offset *int `json:"offset,omitempty"` // Offset for retrieved results based on sort order
OrderBy *string `json:"order_by,omitempty"` // Sort order can be either asc or desc and multiple comma separated columns with their own order can be specified: :asc,:desc. Accepted sort columns are: blk_read_time, blk_write_time, calls, database_name, local_blks_dirtied, local_blks_hit, local_blks_read, local_blks_written, max_plan_time, max_time, mean_plan_time, mean_time, min_plan_time, min_time, query, queryid, rows, shared_blks_dirtied, shared_blks_hit, shared_blks_read, shared_blks_written, stddev_plan_time, stddev_time, temp_blks_read, temp_blks_written, total_plan_time, total_time, user_name, wal_bytes, wal_fpi, wal_records
}
PgserviceQueryStatisticsIn PGServiceQueryStatisticsRequestBody
type PoolModeType ¶
type PoolModeType string
const ( PoolModeTypeSession PoolModeType = "session" PoolModeTypeTransaction PoolModeType = "transaction" PoolModeTypeStatement PoolModeType = "statement" )
type PostgreSQLHandler ¶
type PostgreSQLHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(doer doer) PostgreSQLHandler
func (*PostgreSQLHandler) PGServiceAvailableExtensions ¶
func (h *PostgreSQLHandler) PGServiceAvailableExtensions(ctx context.Context, project string, serviceName string) ([]ExtensionOut, error)
func (*PostgreSQLHandler) PGServiceQueryStatistics ¶
func (h *PostgreSQLHandler) PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgserviceQueryStatisticsIn) ([]QueryOut, error)
func (*PostgreSQLHandler) PgAvailableExtensions ¶
func (*PostgreSQLHandler) ServicePGBouncerCreate ¶
func (h *PostgreSQLHandler) ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error
func (*PostgreSQLHandler) ServicePGBouncerDelete ¶
func (*PostgreSQLHandler) ServicePGBouncerUpdate ¶
func (h *PostgreSQLHandler) ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgbouncerUpdateIn) error
type QueryOut ¶
type QueryOut struct {
BlkReadTime *float64 `json:"blk_read_time,omitempty"` // Query statistic
BlkWriteTime *float64 `json:"blk_write_time,omitempty"` // Query statistic
Calls *float64 `json:"calls,omitempty"` // Query statistic
DatabaseName *string `json:"database_name,omitempty"` // Query statistic
LocalBlksDirtied *float64 `json:"local_blks_dirtied,omitempty"` // Query statistic
LocalBlksHit *float64 `json:"local_blks_hit,omitempty"` // Query statistic
LocalBlksRead *float64 `json:"local_blks_read,omitempty"` // Query statistic
LocalBlksWritten *float64 `json:"local_blks_written,omitempty"` // Query statistic
MaxPlanTime *float64 `json:"max_plan_time,omitempty"` // Query statistic
MaxTime *float64 `json:"max_time,omitempty"` // Query statistic
MeanPlanTime *float64 `json:"mean_plan_time,omitempty"` // Query statistic
MeanTime *float64 `json:"mean_time,omitempty"` // Query statistic
MinPlanTime *float64 `json:"min_plan_time,omitempty"` // Query statistic
MinTime *float64 `json:"min_time,omitempty"` // Query statistic
Query *string `json:"query,omitempty"` // Query statistic
Queryid *float64 `json:"queryid,omitempty"` // Query statistic
Rows *float64 `json:"rows,omitempty"` // Query statistic
StddevPlanTime *float64 `json:"stddev_plan_time,omitempty"` // Query statistic
StddevTime *float64 `json:"stddev_time,omitempty"` // Query statistic
TempBlksRead *float64 `json:"temp_blks_read,omitempty"` // Query statistic
TempBlksWritten *float64 `json:"temp_blks_written,omitempty"` // Query statistic
TotalPlanTime *float64 `json:"total_plan_time,omitempty"` // Query statistic
TotalTime *float64 `json:"total_time,omitempty"` // Query statistic
UserName *string `json:"user_name,omitempty"` // Query statistic
WalBytes *string `json:"wal_bytes,omitempty"` // Query statistic
WalFpi *float64 `json:"wal_fpi,omitempty"` // Query statistic
WalRecords *float64 `json:"wal_records,omitempty"` // Query statistic
}
type ServicePgbouncerCreateIn ¶
type ServicePgbouncerCreateIn struct {
Database string `json:"database"` // Service database name
PoolMode PoolModeType `json:"pool_mode,omitempty"` // PGBouncer pool mode
PoolName string `json:"pool_name"` // Connection pool name
PoolSize *int `json:"pool_size,omitempty"` // Size of PGBouncer's PostgreSQL side connection pool
Username *string `json:"username,omitempty"` // Service username
}
ServicePgbouncerCreateIn ServicePGBouncerCreateRequestBody
type ServicePgbouncerUpdateIn ¶
type ServicePgbouncerUpdateIn struct {
Database *string `json:"database,omitempty"` // Service database name
PoolMode PoolModeType `json:"pool_mode,omitempty"` // PGBouncer pool mode
PoolSize *int `json:"pool_size,omitempty"` // Size of PGBouncer's PostgreSQL side connection pool
Username *string `json:"username,omitempty"` // Service username
}
ServicePgbouncerUpdateIn ServicePGBouncerUpdateRequestBody
Click to show internal directories.
Click to hide internal directories.