postgresql

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddonName    = "miren-postgresql"
	DefaultImage = "docker.io/library/postgres:17"
)
View Source
const (
	ConfigStorage = "storage"
	ConfigShared  = "shared"
)

Variant configuration keys

Variables

This section is empty.

Functions

func Definition

func Definition() addon.AddonDefinition

Definition returns the addon definition for PostgreSQL.

func IsSharedVariant

func IsSharedVariant(variantName string) bool

IsSharedVariant returns true if the variant is a shared-server variant.

func RegisterDedicatedSaga

func RegisterDedicatedSaga(registry *saga.Registry, fw *addon.ProviderFramework, rc *resultCapture) error

RegisterDedicatedSaga registers the dedicated PostgreSQL provisioning saga.

func RegisterDeprovisionDedicatedSaga

func RegisterDeprovisionDedicatedSaga(registry *saga.Registry, fw *addon.ProviderFramework) error

RegisterDeprovisionDedicatedSaga registers the dedicated deprovisioning saga.

func RegisterDeprovisionSharedSaga

func RegisterDeprovisionSharedSaga(registry *saga.Registry, fw *addon.ProviderFramework) error

RegisterDeprovisionSharedSaga registers the shared deprovisioning saga.

func RegisterEnsureSharedServerSaga

func RegisterEnsureSharedServerSaga(registry *saga.Registry, fw *addon.ProviderFramework) error

RegisterEnsureSharedServerSaga registers the saga that creates the shared PostgreSQL server infrastructure (entity, pool, service).

func RegisterSharedSaga

func RegisterSharedSaga(registry *saga.Registry, fw *addon.ProviderFramework, rc *resultCapture) error

RegisterSharedSaga registers the shared PostgreSQL provisioning saga. This also registers the nested ensure-shared-server saga in the same registry.

func UndoBuildSharedResult

func UndoBuildSharedResult(ctx context.Context, in BuildSharedResultIn, out BuildSharedResultOut) error

func UndoCreateSharedPool

func UndoCreateSharedPool(ctx context.Context, in CreateSharedPoolIn, out CreateSharedPoolOut) error

func UndoCreateSharedUser

func UndoCreateSharedUser(ctx context.Context, in CreateSharedUserIn, out CreateSharedUserOut) error

func UndoDecodeSharedAttrs

func UndoDecodeSharedAttrs(ctx context.Context, in DecodeSharedAttrsIn, out DecodeSharedAttrsOut) error

func UndoDropSharedUser

func UndoDropSharedUser(ctx context.Context, in DropSharedUserIn, out DropSharedUserOut) error

func UndoWaitForSharedPool

func UndoWaitForSharedPool(ctx context.Context, in WaitForSharedPoolIn, out WaitForSharedPoolOut) error

Types

type ActivateSharedServerIn

type ActivateSharedServerIn struct {
	ServerID          entity.Id
	PoolID            entity.Id
	ServiceID         entity.Id
	SuperuserPassword string
	ServiceHost       string
}

type ActivateSharedServerOut

type ActivateSharedServerOut struct {
	Activated bool
}

type BuildDedicatedResultIn

type BuildDedicatedResultIn struct {
	ServiceHost  string
	Username     string
	Password     string
	DatabaseName string
	ServerID     entity.Id
}

type BuildDedicatedResultOut

type BuildDedicatedResultOut struct {
	Done bool
}

type BuildSharedResultIn

type BuildSharedResultIn struct {
	ServerID           entity.Id
	ServiceHost        string
	SharedDatabaseName string
	SharedUsername     string
	SharedPassword     string
}

type BuildSharedResultOut

type BuildSharedResultOut struct {
	Done bool
}

type CleanupSharedServerIn

type CleanupSharedServerIn struct {
	SharedServerRef  entity.Id
	SharedServiceRef entity.Id
	SharedPoolRef    entity.Id
	RemainingCount   int64
}

type CleanupSharedServerOut

type CleanupSharedServerOut struct {
	CleanedUp bool
}

type CreateDedicatedPoolIn

type CreateDedicatedPoolIn struct {
	ServerName    string
	AppName       string
	DatabaseName  string
	Username      string
	Password      string
	VariantConfig map[string]string
}

type CreateDedicatedPoolOut

type CreateDedicatedPoolOut struct {
	PoolID entity.Id
}

type CreateDedicatedServiceIn

type CreateDedicatedServiceIn struct {
	ServiceName string
	AppName     string
	ServerName  string
}

type CreateDedicatedServiceOut

type CreateDedicatedServiceOut struct {
	ServiceID entity.Id
}

type CreatePostgresServerIn

type CreatePostgresServerIn struct {
	ServerName  string
	VariantName string
	Password    string
}

type CreatePostgresServerOut

type CreatePostgresServerOut struct {
	ServerID entity.Id
}

type CreateSharedDatabaseIn

type CreateSharedDatabaseIn struct {
	ServiceHost        string
	SuperuserPassword  string
	SharedDatabaseName string
	SharedUsername     string
}

type CreateSharedDatabaseOut

type CreateSharedDatabaseOut struct {
	DatabaseCreated bool
}

type CreateSharedPoolIn

type CreateSharedPoolIn struct {
	SuperuserPassword string
}

type CreateSharedPoolOut

type CreateSharedPoolOut struct {
	PoolID entity.Id
}

type CreateSharedServerEntityIn

type CreateSharedServerEntityIn struct {
	SuperuserPassword string
}

type CreateSharedServerEntityOut

type CreateSharedServerEntityOut struct {
	ServerID entity.Id
}

type CreateSharedServiceIn

type CreateSharedServiceIn struct{}

type CreateSharedServiceOut

type CreateSharedServiceOut struct {
	ServiceID entity.Id
}

type CreateSharedUserIn

type CreateSharedUserIn struct {
	ServiceHost             string
	SuperuserPassword       string
	GeneratedSharedUsername string
	SharedPassword          string
}

type CreateSharedUserOut

type CreateSharedUserOut struct {
	SharedUsername string
}

type DecodeDedicatedAttrsIn

type DecodeDedicatedAttrsIn struct {
	AssocEntity *entity.Entity `saga:"assocentity"`
}

type DecodeDedicatedAttrsOut

type DecodeDedicatedAttrsOut struct {
	DedicatedServerID entity.Id
}

type DecodeSharedAttrsIn

type DecodeSharedAttrsIn struct {
	AssocEntity *entity.Entity `saga:"assocentity"`
}

type DecodeSharedAttrsOut

type DecodeSharedAttrsOut struct {
	SharedServerRef entity.Id
	SharedDbName    string
	SharedUserName  string
}

type DecrementAssociationCountIn

type DecrementAssociationCountIn struct {
	SharedServerRef entity.Id
	DatabaseDropped bool
	UserDropped     bool
}

type DecrementAssociationCountOut

type DecrementAssociationCountOut struct {
	RemainingCount int64
}

type DeleteDedicatedPoolIn

type DeleteDedicatedPoolIn struct {
	DedicatedPoolID entity.Id
}

type DeleteDedicatedPoolOut

type DeleteDedicatedPoolOut struct {
	PoolDeleted bool
}

type DeleteDedicatedServerEntityIn

type DeleteDedicatedServerEntityIn struct {
	DedicatedServerID entity.Id
}

type DeleteDedicatedServerEntityOut

type DeleteDedicatedServerEntityOut struct {
	ServerDeleted bool
}

type DeleteDedicatedServiceIn

type DeleteDedicatedServiceIn struct {
	DedicatedServiceID entity.Id
}

type DeleteDedicatedServiceOut

type DeleteDedicatedServiceOut struct {
	ServiceDeleted bool
}

type DropSharedDatabaseIn

type DropSharedDatabaseIn struct {
	SharedServiceHost       string
	SharedSuperuserPassword string
	SharedDbName            string
	ConnectionsTerminated   bool
}

type DropSharedDatabaseOut

type DropSharedDatabaseOut struct {
	DatabaseDropped bool
}

type DropSharedUserIn

type DropSharedUserIn struct {
	SharedServiceHost       string
	SharedSuperuserPassword string
	SharedUserName          string
	ConnectionsTerminated   bool
}

type DropSharedUserOut

type DropSharedUserOut struct {
	UserDropped bool
}

type FindOrCreateSharedServerIn

type FindOrCreateSharedServerIn struct {
	AppName string
}

type FindOrCreateSharedServerOut

type FindOrCreateSharedServerOut struct {
	ServerID          entity.Id
	SuperuserPassword string
	ServiceHost       string
}

type GenerateCredentialsIn

type GenerateCredentialsIn struct {
	AppName string
}

type GenerateCredentialsOut

type GenerateCredentialsOut struct {
	Password     string
	DatabaseName string
	Username     string
	ServiceName  string
	ServerName   string
}

type GenerateSharedCredentialsIn

type GenerateSharedCredentialsIn struct {
	AppName string
}

type GenerateSharedCredentialsOut

type GenerateSharedCredentialsOut struct {
	SharedPassword          string
	SharedDatabaseName      string
	GeneratedSharedUsername string
}

type IncrementAssociationCountIn

type IncrementAssociationCountIn struct {
	ServerID entity.Id
}

type IncrementAssociationCountOut

type IncrementAssociationCountOut struct {
	Incremented bool
}

type LookupDedicatedServerIn

type LookupDedicatedServerIn struct {
	DedicatedServerID entity.Id
}

type LookupDedicatedServerOut

type LookupDedicatedServerOut struct {
	DedicatedServiceID entity.Id
	DedicatedPoolID    entity.Id
}

type LookupSharedServerIn

type LookupSharedServerIn struct {
	SharedServerRef entity.Id
}

type LookupSharedServerOut

type LookupSharedServerOut struct {
	SharedSuperuserPassword string
	SharedServiceRef        entity.Id
	SharedPoolRef           entity.Id
	SharedAssocCount        int64
	SharedServiceHost       string
}

type Provider

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

Provider implements the AddonProvider interface for PostgreSQL.

func NewProvider

func NewProvider(fw *addon.ProviderFramework) *Provider

NewProvider creates a new PostgreSQL addon provider.

func (*Provider) AdjustEnvVars

func (p *Provider) AdjustEnvVars(ctx context.Context, result *addon.ProvisionResult, assoc addon.AddonAssociation, collisions []string) ([]addon.Variable, error)

func (*Provider) Deprovision

func (p *Provider) Deprovision(ctx context.Context, assoc addon.AddonAssociation) error

func (*Provider) Provision

func (p *Provider) Provision(ctx context.Context, app addon.App, variant addon.Variant) (*addon.ProvisionResult, error)

type TerminateConnectionsIn

type TerminateConnectionsIn struct {
	SharedServiceHost       string
	SharedSuperuserPassword string
	SharedDbName            string
}

type TerminateConnectionsOut

type TerminateConnectionsOut struct {
	ConnectionsTerminated bool
}

type UpdateDedicatedServerIn

type UpdateDedicatedServerIn struct {
	ServerID    entity.Id
	PoolID      entity.Id
	ServiceID   entity.Id
	VariantName string
	Password    string
}

type UpdateDedicatedServerOut

type UpdateDedicatedServerOut struct {
	Updated bool
}

type WaitForDedicatedPoolIn

type WaitForDedicatedPoolIn struct {
	PoolID entity.Id
}

type WaitForDedicatedPoolOut

type WaitForDedicatedPoolOut struct {
	Ready bool
}

type WaitForDedicatedServiceIn

type WaitForDedicatedServiceIn struct {
	ServiceID entity.Id
}

type WaitForDedicatedServiceOut

type WaitForDedicatedServiceOut struct {
	ServiceHost string
}

type WaitForSharedPoolIn

type WaitForSharedPoolIn struct {
	PoolID entity.Id
}

type WaitForSharedPoolOut

type WaitForSharedPoolOut struct {
	PoolReady bool
}

type WaitForSharedServiceIn

type WaitForSharedServiceIn struct {
	ServiceID entity.Id
}

type WaitForSharedServiceOut

type WaitForSharedServiceOut struct {
	ServiceHost string
}

Jump to

Keyboard shortcuts

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