shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Packages
Search packages... ⌘K
  • Data & Persistence
    • Databases 3
    • Object Storage 1
    • File Formats 2
    • Enumerations 2
    • Content 1
    • Codegen 2
  • System Integration
    • Secrets 1
    • CLI Tools 5
    • Media Processing 2
    • Adapters 2
  • UI & Components
    • Primitives 1
    • Blocks 1
    • Sections & Layouts 1
    • Entities 1
    • Media 1
    • Utilities 1
    • State & Presenter 1
    • Branding & Style 1
  • Game Engine
    • Framework 1
    • Engine 2
    • Presets 1
    • Vendor 1
Packages/ Data & Persistence/ File Formats/ Config
Go Package

config

YAML configuration reader — typed config loading with environment overlay

Go Ready MD
Config Loading with Environment Override go
1
2
3
4
5
6
7
8
9
10
11
12
type AppConfig struct {
    Server struct {
        Port int    `yaml:"port" required:"true"`
        Host string `yaml:"host" default:"0.0.0.0"`
    } `yaml:"server"`
    Database database.Config `yaml:"database"`
}

// Load base config, then overlay dev-specific values
cfg, err := config.Load[AppConfig]("config.yml")
cfg, err = config.Overlay(cfg, "config.dev.yml")
err = config.Validate(cfg)

About

Loads YAML configuration files into typed Go structs with environment variable overlay support. Validates required fields, applies defaults, and merges environment-specific overrides following a base-then-env cascade.

Public API

NameKindSignature
Loadfuncfunc Load[T any](path string, opts ...Option) (*T, error)
Configtypetype Config struct
Overlayfuncfunc Overlay[T any](base *T, envPath string) (*T, error)
Validatefuncfunc Validate[T any](cfg *T) error

Dependencies

Imported By (4)

database Go Ready

PostgreSQL adapter — connection pooling, schema isolation, health checks

postgresqlpgxpoolingschema-isolation
4 exports 5 deps
storage Go Ready

R2-compatible object storage — upload, download, presigned URLs

r2s3-compatibleobject-storagepresigned-urls
5 exports 3 deps
vault Go Ready

1Password vault adapter — credential retrieval, caching, op:// URI resolution

1passwordsecretscredentialsop-uri
5 exports 4 deps
adapter Go Ready

HTTP client adapter — standardized external API client with retry and auth

http-clientretryauthenticationexternal-api
5 exports 3 deps

Related Packages

vault Go Ready

1Password vault adapter — credential retrieval, caching, op:// URI resolution

1passwordsecretscredentialsop-uri
5 exports 4 deps
database Go Ready

PostgreSQL adapter — connection pooling, schema isolation, health checks

postgresqlpgxpoolingschema-isolation
4 exports 5 deps

Source

github.com/shredbx/sbx-core/pkg/config
yamlconfigurationenvironmenttyped-config
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |