controller

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package controller contains the functions in pgbouncer instance manager that reacts to changes in the Pooler resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgBouncerInstanceInterface

type PgBouncerInstanceInterface interface {
	Paused() bool
	Pause() error
	Resume() error
	Reload() error
}

PgBouncerInstanceInterface the public interface for a PgBouncer instance, implementations should be thread safe

func NewPgBouncerInstance

func NewPgBouncerInstance() PgBouncerInstanceInterface

NewPgBouncerInstance initializes a new pgBouncerInstance

type PgBouncerReconciler

type PgBouncerReconciler struct {
	// contains filtered or unexported fields
}

PgBouncerReconciler reconciles the status of the Pooler resource with the one of this pgbouncer instance

func NewPgBouncerReconciler

func NewPgBouncerReconciler(poolerNamespacedName types.NamespacedName) (*PgBouncerReconciler, error)

NewPgBouncerReconciler creates a new pgbouncer reconciler

func (*PgBouncerReconciler) GetClient

func (r *PgBouncerReconciler) GetClient() ctrl.Client

GetClient returns the dynamic client that is being used for a certain reconciler

func (*PgBouncerReconciler) Init

Init ensures that all PgBouncer requirement are met.

In detail: 1. create the pgbouncer configuration and the required secrets 2. ensure that every needed folder is existent

func (*PgBouncerReconciler) Reconcile

func (r *PgBouncerReconciler) Reconcile(ctx context.Context, event *watch.Event) error

Reconcile is the main reconciliation loop for the pgbouncer instance

func (*PgBouncerReconciler) Run

func (r *PgBouncerReconciler) Run(ctx context.Context)

Run runs the reconciliation loop for this resource

func (*PgBouncerReconciler) Stop

func (r *PgBouncerReconciler) Stop()

Stop stops the controller

Jump to

Keyboard shortcuts

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