postgresql

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddonName      = "miren-postgresql"
	BaseImage      = "oci.miren.cloud/postgres"
	DefaultVersion = "18"
)
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

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
	SharedSuperuserPassword string
	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 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
	VariantConfig     map[string]string
}

type CreateSharedPoolOut

type CreateSharedPoolOut struct {
	PoolID entity.Id
}

type CreateSharedServerEntityIn

type CreateSharedServerEntityIn struct {
	SuperuserPassword string
	VariantConfig     map[string]string
}

type CreateSharedServerEntityOut

type CreateSharedServerEntityOut struct {
	ServerID 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 DeleteDedicatedServerEntityIn

type DeleteDedicatedServerEntityIn struct {
	DedicatedServerID   entity.Id
	DedicatedServerName string

	// PoolCleanedUp forces this action to run after DeleteDedicatedPool,
	// ensuring the server entity is deleted last.
	PoolCleanedUp saga.Edge `saga:"dedicated_pool_deleted"`
}

type DeleteDedicatedServerEntityOut

type DeleteDedicatedServerEntityOut struct {
	ServerDeleted 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
	VariantConfig map[string]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 LookupDedicatedServerIn

type LookupDedicatedServerIn struct {
	DedicatedServerID entity.Id
}

type LookupDedicatedServerOut

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

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 {
	dbsaga.BaseProvider
}

Provider implements the AddonProvider interface for PostgreSQL.

func NewProvider

func NewProvider(fw *addon.ProviderFramework) *Provider

NewProvider creates a new PostgreSQL addon provider.

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
	ServiceHost string
	VariantName string
	Password    string
}

type UpdateDedicatedServerOut

type UpdateDedicatedServerOut struct {
	Updated bool
}

Jump to

Keyboard shortcuts

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