infra

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInfraNotFound is returned when infrastructure does not exist and auto provisioning is disabled
	ErrInfraNotFound = errors.New("required message queues do not exist. Either create them manually or set MQS_AUTO_PROVISION=true to enable auto-provisioning")
)

Functions

func Init added in v0.9.0

func Init(ctx context.Context, cfg Config, redisClient redis.Cmdable, logger *logging.Logger, mqType string) error

Init initializes and verifies infrastructure based on configuration. If AutoProvision is true (default), it will create infrastructure if needed. If AutoProvision is false, it will only verify infrastructure exists.

Types

type Config

type Config struct {
	DeliveryMQ    *mqinfra.MQInfraConfig
	LogMQ         *mqinfra.MQInfraConfig
	AutoProvision *bool
}

func (*Config) SetSensiblePolicyDefaults

func (cfg *Config) SetSensiblePolicyDefaults()

type Infra added in v0.4.0

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

func NewInfra added in v0.4.0

func NewInfra(cfg Config, redisClient redis.Cmdable, logger *logging.Logger, mqType string) Infra

func NewInfraWithProvider added in v0.4.0

func NewInfraWithProvider(lock redislock.Lock, provider InfraProvider, shouldManage bool, logger *logging.Logger) *Infra

NewInfraWithProvider creates an Infra instance with custom lock and provider (for testing)

func (*Infra) Declare added in v0.4.0

func (infra *Infra) Declare(ctx context.Context) error

func (*Infra) Teardown added in v0.4.0

func (infra *Infra) Teardown(ctx context.Context) error

func (*Infra) Verify added in v0.9.0

func (infra *Infra) Verify(ctx context.Context) error

Verify checks if infrastructure exists and returns an error if it doesn't.

type InfraProvider added in v0.4.0

type InfraProvider interface {
	Exist(ctx context.Context) (bool, error)
	Declare(ctx context.Context) error
	Teardown(ctx context.Context) error
}

InfraProvider handles the actual infrastructure operations

Jump to

Keyboard shortcuts

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