config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAppName           = "hyperrr"
	DefaultAppEnv            = "local"
	DefaultLogLevel          = "info"
	DefaultLogFormat         = "text"
	DefaultServerPort        = 8080
	DefaultEventBusProvider  = "inmem"
	DefaultWorkflowStoreType = "mem"
	DefaultNatsStateBucket   = "hyperrr_state"
	DefaultNatsLocksBucket   = "hyperrr_locks"
	DefaultDBDriver          = "sqlite"
	DefaultDBDSN             = "hyperrr.db"
	DefaultStorageProvider   = "cloud"
	DefaultStorageBucketURL  = "mem://"
	DefaultNatsURL           = "nats://localhost:4222"
	DefaultCurrency          = "USD"
)

Default configuration constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName           string         `mapstructure:"APP_NAME"`
	AppEnv            string         `mapstructure:"APP_ENV"`
	LogLevel          string         `mapstructure:"LOG_LEVEL"`
	LogFormat         string         `mapstructure:"LOG_FORMAT"`
	ServerPort        int            `mapstructure:"SERVER_PORT"`
	EventBusProvider  string         `mapstructure:"EVENT_BUS_PROVIDER"`
	WorkflowStoreType string         `mapstructure:"WORKFLOW_STORE_TYPE"`
	NATSStateBucket   string         `mapstructure:"NATS_STATE_BUCKET"`
	NATSLocksBucket   string         `mapstructure:"NATS_LOCKS_BUCKET"`
	DBDriver          string         `mapstructure:"DB_DRIVER"`
	DBDSN             string         `mapstructure:"DB_DSN"`
	StorageProvider   string         `mapstructure:"STORAGE_PROVIDER"`
	StoragePath       string         `mapstructure:"STORAGE_PATH"`
	StorageBucketURL  string         `mapstructure:"STORAGE_BUCKET_URL"`
	NATSURL           string         `mapstructure:"NATS_URL"`
	Currency          string         `mapstructure:"CURRENCY"`
	MCPAuthProviders  []string       `mapstructure:"MCP_AUTH_PROVIDERS"`
	AuthProviders     []string       `mapstructure:"AUTH_PROVIDERS"`
	Modules           []ModuleConfig `mapstructure:"modules"`
}

Config represents the application configuration.

func Load

func Load() (*Config, error)

Load loads the configuration.

func LoadWithFile

func LoadWithFile(filename string) (*Config, error)

LoadWithFile loads the configuration from a specific file.

func (*Config) ResolveEnvOptions

func (cfg *Config) ResolveEnvOptions()

ResolveEnvOptions resolves any "env.XXX" references in module options using the OS environment.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks for configuration constraints and returns a formatted list of all errors.

type ModuleConfig

type ModuleConfig struct {
	Resolve string         `mapstructure:"resolve" json:"resolve" yaml:"resolve"`
	ID      string         `mapstructure:"id" json:"id" yaml:"id"`
	Options map[string]any `mapstructure:"options" json:"options" yaml:"options"`
}

ModuleConfig represents registration info for a dynamic module.

Jump to

Keyboard shortcuts

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