rabbitmq

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddonName      = "miren-rabbitmq"
	BaseImage      = "oci.miren.cloud/rabbitmq"
	DefaultVersion = "4"
)
View Source
const (
	ConfigStorage = "storage"
)

Variables

This section is empty.

Functions

func Definition

func Definition() addon.AddonDefinition

func RegisterDedicatedSaga

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

func RegisterDeprovisionDedicatedSaga

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

func RegisterRotateDedicatedSaga added in v0.12.1

func RegisterRotateDedicatedSaga(registry *saga.Registry, fw *addon.ProviderFramework, rc *rotateCapture) error

RegisterRotateDedicatedSaga registers the dedicated RabbitMQ rotation saga.

func UndoBuildRotationResult added in v0.12.1

func UndoBuildRotationResult(ctx context.Context, in BuildRotationResultIn, out BuildRotationResultOut) error

func UndoChangePassword added in v0.12.1

func UndoChangePassword(ctx context.Context, in ChangePasswordIn, out ChangePasswordOut) error

func UndoLoadRotationState added in v0.12.1

func UndoLoadRotationState(ctx context.Context, in LoadRotationStateIn, out LoadRotationStateOut) error

func UndoUpdateServerPassword added in v0.12.1

func UndoUpdateServerPassword(ctx context.Context, in UpdateServerPasswordIn, out UpdateServerPasswordOut) error

Types

type BuildDedicatedResultIn

type BuildDedicatedResultIn struct {
	ServiceHost string    `saga:"servicehost"`
	ServerID    entity.Id `saga:"serverid"`
	Username    string    `saga:"username"`
	Password    string    `saga:"password"`
	Vhost       string    `saga:"vhost"`
}

type BuildDedicatedResultOut

type BuildDedicatedResultOut struct {
	Done bool
}

type BuildRotationResultIn added in v0.12.1

type BuildRotationResultIn struct {
	RotateServiceHost string `saga:"rotateservicehost"`
	RotateNewPassword string `saga:"rotatenewpassword"`
}

type BuildRotationResultOut added in v0.12.1

type BuildRotationResultOut struct {
	Done bool
}

func BuildRotationResult added in v0.12.1

func BuildRotationResult(ctx context.Context, in BuildRotationResultIn) (BuildRotationResultOut, error)

type ChangePasswordIn added in v0.12.1

type ChangePasswordIn struct {
	RotatePoolID      entity.Id `saga:"rotatepoolid"`
	RotateNewPassword string    `saga:"rotatenewpassword"`
	RotateOldPassword string    `saga:"rotateoldpassword"`
}

type ChangePasswordOut added in v0.12.1

type ChangePasswordOut struct {
	// Gates the entity update on the engine actually changing; passed as data
	// (not a bare edge) so the consumer could verify it if it wanted to.
	PasswordChanged bool `saga:"rmq_password_changed"`
}

func ChangePassword added in v0.12.1

func ChangePassword(ctx context.Context, in ChangePasswordIn) (ChangePasswordOut, error)

type CreateDedicatedPoolIn

type CreateDedicatedPoolIn struct {
	ServerName    string            `saga:"servername"`
	AppName       string            `saga:"appname"`
	Password      string            `saga:"password"`
	Username      string            `saga:"username"`
	Vhost         string            `saga:"vhost"`
	VariantConfig map[string]string `saga:"variantconfig"`
}

type CreateDedicatedPoolOut

type CreateDedicatedPoolOut struct {
	PoolID entity.Id `saga:"poolid"`
}

type CreateRabbitmqServerIn

type CreateRabbitmqServerIn struct {
	ServerName  string `saga:"servername"`
	VariantName string `saga:"variantname"`
	Password    string `saga:"password"`
}

type CreateRabbitmqServerOut

type CreateRabbitmqServerOut struct {
	ServerID entity.Id `saga:"serverid"`
}

type DecodeDedicatedAttrsIn

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

type DecodeDedicatedAttrsOut

type DecodeDedicatedAttrsOut struct {
	DedicatedServerID entity.Id `saga:"dedicatedserverid"`
}

type DeleteDedicatedServerEntityIn

type DeleteDedicatedServerEntityIn struct {
	DedicatedServerID   entity.Id `saga:"dedicatedserverid"`
	DedicatedServerName string    `saga:"dedicatedservername"`

	ServiceCleanedUp saga.Edge `saga:"dedicated_service_deleted"`
	PoolCleanedUp    saga.Edge `saga:"dedicated_pool_deleted"`
}

type DeleteDedicatedServerEntityOut

type DeleteDedicatedServerEntityOut struct {
	ServerDeleted bool
}

type GenerateCredentialsIn

type GenerateCredentialsIn struct {
	AppName string
}

type GenerateCredentialsOut

type GenerateCredentialsOut struct {
	Password    string `saga:"password"`
	Username    string `saga:"username"`
	Vhost       string `saga:"vhost"`
	ServiceName string `saga:"servicename"`
	ServerName  string `saga:"servername"`
}

type LoadRotationStateIn added in v0.12.1

type LoadRotationStateIn struct {
	DedicatedServerID entity.Id `saga:"dedicatedserverid"`
}

type LoadRotationStateOut added in v0.12.1

type LoadRotationStateOut struct {
	RotatePoolID      entity.Id `saga:"rotatepoolid"`
	RotateOldPassword string    `saga:"rotateoldpassword"`
	RotateServiceHost string    `saga:"rotateservicehost"`
}

func LoadRotationState added in v0.12.1

func LoadRotationState(ctx context.Context, in LoadRotationStateIn) (LoadRotationStateOut, error)

type LookupDedicatedServerIn

type LookupDedicatedServerIn struct {
	DedicatedServerID entity.Id `saga:"dedicatedserverid"`
}

type LookupDedicatedServerOut

type LookupDedicatedServerOut struct {
	DedicatedServiceID  entity.Id `saga:"dedicatedserviceid"`
	DedicatedPoolID     entity.Id `saga:"dedicatedpoolid"`
	DedicatedServerName string    `saga:"dedicatedservername"`
}

type Provider

type Provider struct {
	dbsaga.BaseProvider
}

func NewProvider

func NewProvider(fw *addon.ProviderFramework) *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)

func (*Provider) RotateCredential added in v0.12.1

func (p *Provider) RotateCredential(ctx context.Context, assoc addon.AddonAssociation, credential, newSecret string) (*addon.RotationResult, error)

RotateCredential implements addon.CredentialRotator for RabbitMQ. A dedicated server has a single credential: the `miren` user's password, which the app connects with.

RabbitMQ is the outlier. Its password lives inside the node's mnesia database (seeded once at first boot from RABBITMQ_DEFAULT_PASS), AMQP has no password-change operation, and only the AMQP port is exposed, so there is no way to rotate it over the network like the SQL engines. Instead we run `rabbitmqctl change_password` inside the running container, record the new value on the server entity, and hand the app fresh connection vars to redeploy on. rabbitmqctl authenticates to the node via the Erlang cookie, not the user password, so a crashed retry converges no matter which password the node currently holds (no try-both dance needed).

type UpdateDedicatedServerIn

type UpdateDedicatedServerIn struct {
	ServerID    entity.Id `saga:"serverid"`
	PoolID      entity.Id `saga:"poolid"`
	ServiceID   entity.Id `saga:"serviceid"`
	ServiceHost string    `saga:"servicehost"`
	VariantName string    `saga:"variantname"`
	Password    string    `saga:"password"`
}

type UpdateDedicatedServerOut

type UpdateDedicatedServerOut struct {
	Updated bool
}

type UpdateServerPasswordIn added in v0.12.1

type UpdateServerPasswordIn struct {
	DedicatedServerID entity.Id `saga:"dedicatedserverid"`
	RotateNewPassword string    `saga:"rotatenewpassword"`
	RotateOldPassword string    `saga:"rotateoldpassword"`

	PasswordChanged bool `saga:"rmq_password_changed"`
}

type UpdateServerPasswordOut added in v0.12.1

type UpdateServerPasswordOut struct {
	Recorded bool
}

func UpdateServerPassword added in v0.12.1

func UpdateServerPassword(ctx context.Context, in UpdateServerPasswordIn) (UpdateServerPasswordOut, error)

Jump to

Keyboard shortcuts

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