adeptersinterfaces

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AivenConfig added in v0.2.3

type AivenConfig struct {
	APIToken                string        `mapstructure:"AIVEN_API_TOKEN" validate:"required"`
	ProjectName             string        `mapstructure:"AIVEN_PROJECT_NAME" validate:"required"`
	ServiceName             string        `mapstructure:"AIVEN_SERVICE_NAME" validate:"required"`
	MetricResolutionSeconds time.Duration `mapstructure:"metric_resolution_seconds" validate:"required"`
	// NOTE: If specified, we are able to use the
	// session refresh hack. Not documented.
	DatabaseName string `mapstructure:"database_name"`
}

type AivenHardwareState added in v0.2.3

type AivenHardwareState struct {
	TotalMemoryBytes int64
	NumCPUs          int
	LastChecked      time.Time
}

Aiven interfaces

type AivenPostgreSQLAdapter added in v0.2.3

type AivenPostgreSQLAdapter interface {
	PostgreSQLAdapter
	GetAivenClient() *aiven.Client
	GetAivenConfig() *AivenConfig
	GetAivenState() *AivenState
}

type AivenState added in v0.2.3

type AivenState struct {
	Hardware                       *AivenHardwareState
	InitialSharedBuffersPercentage float64
	InitialWorkMem                 int64
	LastAppliedConfig              time.Time
	// HACK: Used to trigger restarts on ALTER DATABASE statements
	LastKnownPGStatMonitorEnable bool
	// Guardrails
	LastGuardrailCheck            time.Time
	LastMemoryAvailableTime       time.Time
	LastMemoryAvailablePercentage float64
	LastHardwareInfoTime          time.Time
}

type AuroraHardwareState

type AuroraHardwareState struct {
	TotalMemoryBytes int64
	NumCPUs          int
	LastChecked      time.Time
}

type AuroraPerformanceInsightsState

type AuroraPerformanceInsightsState struct {
	Enabled     bool
	ResourceID  string
	LastChecked time.Time
}

type AuroraRDSAdapter

type AuroraRDSAdapter interface {
	PostgreSQLAdapter
	GetPIClient() *pi.Client
	GetEC2Client() *ec2.Client
	GetRDSClient() *rds.Client
	GetCWClient() *cloudwatch.Client
	GetAuroraRDSConfig() *AuroraRDSConfig
	GetEC2InstanceTypeInfo() (*ec2types.InstanceTypeInfo, error)
	GetAuroraState() *AuroraRDSState
}

type AuroraRDSConfig

type AuroraRDSConfig struct {
	AWSAccessKey          string `mapstructure:"AWS_ACCESS_KEY_ID"`
	AWSSecretAccessKey    string `mapstructure:"AWS_SECRET_ACCESS_KEY"`
	AWSRegion             string `mapstructure:"AWS_REGION" validate:"required"`
	RDSDatabaseIdentifier string `mapstructure:"RDS_DATABASE_IDENTIFIER" validate:"required"`
	RDSParameterGroupName string `mapstructure:"RDS_PARAMETER_GROUP_NAME" validate:"required"`
}

type AuroraRDSState

type AuroraRDSState struct {
	LastAppliedConfig   time.Time
	PerformanceInsights *AuroraPerformanceInsightsState
	Hardware            *AuroraHardwareState
	LastGuardrailCheck  time.Time
}

type DockerAdapter

type DockerAdapter interface {
	PostgreSQLAdapter
	GetContainerName() string
	GetDockerClient() *client.Client
}

type PostgreSQLAdapter

type PostgreSQLAdapter interface {
	Logger() *logrus.Logger
	PGDriver() *pgPool.Pool
	APIClient() *retryablehttp.Client
}

Common interface for all PostgreSQL adapters In the future if we support other databases, we can add a common interface for all database adapters and attach the driver and anything shared PostgreSQLAdapter is a struct that embeds the CommonAgent and adds a PGDriver. This is used by all the PostgreSQL adapters.

Jump to

Keyboard shortcuts

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