postgresql

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PoolModeTypeChoices

func PoolModeTypeChoices() []string

Types

type ExtensionOut

type ExtensionOut struct {
	Name     string   `json:"name"`
	Versions []string `json:"versions,omitempty"`
}

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"`
	Version    string         `json:"version"`
}

type PgserviceQueryStatisticsIn

type PgserviceQueryStatisticsIn struct {
	Limit   *int   `json:"limit,omitempty"`
	Offset  *int   `json:"offset,omitempty"`
	OrderBy string `json:"order_by,omitempty"`
}

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 (h *PostgreSQLHandler) PgAvailableExtensions(ctx context.Context, tenant string) ([]PgOut, error)

func (*PostgreSQLHandler) ServicePGBouncerCreate

func (h *PostgreSQLHandler) ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error

func (*PostgreSQLHandler) ServicePGBouncerDelete

func (h *PostgreSQLHandler) ServicePGBouncerDelete(ctx context.Context, project string, serviceName string, poolName string) error

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"`
	BlkWriteTime      *float64 `json:"blk_write_time,omitempty"`
	Calls             *float64 `json:"calls,omitempty"`
	DatabaseName      string   `json:"database_name,omitempty"`
	LocalBlksDirtied  *float64 `json:"local_blks_dirtied,omitempty"`
	LocalBlksHit      *float64 `json:"local_blks_hit,omitempty"`
	LocalBlksRead     *float64 `json:"local_blks_read,omitempty"`
	LocalBlksWritten  *float64 `json:"local_blks_written,omitempty"`
	MaxExecTime       *float64 `json:"max_exec_time,omitempty"`
	MaxPlanTime       *float64 `json:"max_plan_time,omitempty"`
	MaxTime           *float64 `json:"max_time,omitempty"`
	MeanExecTime      *float64 `json:"mean_exec_time,omitempty"`
	MeanPlanTime      *float64 `json:"mean_plan_time,omitempty"`
	MeanTime          *float64 `json:"mean_time,omitempty"`
	MinExecTime       *float64 `json:"min_exec_time,omitempty"`
	MinPlanTime       *float64 `json:"min_plan_time,omitempty"`
	MinTime           *float64 `json:"min_time,omitempty"`
	Query             string   `json:"query,omitempty"`
	Queryid           *float64 `json:"queryid,omitempty"`
	Rows              *float64 `json:"rows,omitempty"`
	SharedBlksDirtied *float64 `json:"shared_blks_dirtied,omitempty"`
	SharedBlksHit     *float64 `json:"shared_blks_hit,omitempty"`
	SharedBlksRead    *float64 `json:"shared_blks_read,omitempty"`
	SharedBlksWritten *float64 `json:"shared_blks_written,omitempty"`
	StddevExecTime    *float64 `json:"stddev_exec_time,omitempty"`
	StddevPlanTime    *float64 `json:"stddev_plan_time,omitempty"`
	StddevTime        *float64 `json:"stddev_time,omitempty"`
	TempBlksRead      *float64 `json:"temp_blks_read,omitempty"`
	TempBlksWritten   *float64 `json:"temp_blks_written,omitempty"`
	TotalExecTime     *float64 `json:"total_exec_time,omitempty"`
	TotalPlanTime     *float64 `json:"total_plan_time,omitempty"`
	TotalTime         *float64 `json:"total_time,omitempty"`
	UserName          string   `json:"user_name,omitempty"`
	WalBytes          string   `json:"wal_bytes,omitempty"`
	WalFpi            *float64 `json:"wal_fpi,omitempty"`
	WalRecords        *float64 `json:"wal_records,omitempty"`
}

type ServicePgbouncerCreateIn

type ServicePgbouncerCreateIn struct {
	Database string       `json:"database"`
	PoolMode PoolModeType `json:"pool_mode,omitempty"`
	PoolName string       `json:"pool_name"`
	PoolSize *int         `json:"pool_size,omitempty"`
	Username string       `json:"username,omitempty"`
}

type ServicePgbouncerUpdateIn

type ServicePgbouncerUpdateIn struct {
	Database string       `json:"database,omitempty"`
	PoolMode PoolModeType `json:"pool_mode,omitempty"`
	PoolSize *int         `json:"pool_size,omitempty"`
	Username string       `json:"username,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL