Documentation
¶
Overview ¶
Package postgresql contains business logic of working with Remote PostgreSQL instances.
Index ¶
- type Instance
- type Service
- func (svc *Service) Add(ctx context.Context, name, address string, port uint32, ...) (int32, error)
- func (svc *Service) ApplyPrometheusConfiguration(ctx context.Context, q *reform.Querier) error
- func (svc *Service) List(ctx context.Context) ([]Instance, error)
- func (svc *Service) Remove(ctx context.Context, id int32) error
- func (svc *Service) Restore(ctx context.Context, tx *reform.TX) error
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct { Node models.RemoteNode Service models.PostgreSQLService }
type Service ¶
type Service struct { *ServiceConfig // contains filtered or unexported fields }
Service is responsible for interactions with PostgreSQL.
func NewService ¶
func NewService(config *ServiceConfig) (*Service, error)
NewService creates a new service.
func (*Service) Add ¶
func (svc *Service) Add(ctx context.Context, name, address string, port uint32, username, password string) (int32, error)
Add new postgreSQL service and start postgres_exporter
func (*Service) ApplyPrometheusConfiguration ¶
ApplyPrometheusConfiguration Adds postgres to prometheus configuration and applies it
type ServiceConfig ¶
type ServiceConfig struct { PostgresExporterPath string Prometheus *prometheus.Service Supervisor services.Supervisor DB *reform.DB PortsRegistry *ports.Registry }
Click to show internal directories.
Click to hide internal directories.