Skip to content

michaelquigley/df

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

df - Dynamic Foundation

A Go framework for building dynamic, configuration-driven applications

The df (dynamic foundation) framework enables applications that can reconfigure their internal architecture based on runtime configuration. It provides the essential building blocks for creating flexible, manageable systems at any scale.

Framework Components

The df framework consists of three complementary packages:

dd - dynamic foundation for data

Convert between Go structs and maps with ease

Bidirectional data binding between Go structs and map[string]any. Since maps are foundational to all data systems, this enables seamless integration with any network protocol, database, object store, or file format.

// struct → map → JSON/YAML/database
user := User{Name: "John", Age: 30}
data, _ := dd.Unbind(user)

// map → struct (from config, API, etc.)
userData := map[string]any{"name": "Alice", "age": 25}
user, _ := dd.New[User](userData)

dl - dynamic foundation for logging

Intelligent channel-based logging built on Go's slog

Route different log categories to independent destinations with per-channel configuration. Database logs can go to files, HTTP logs to JSON format, errors to colored console output.

// Different channels route to different destinations
dl.ChannelLog("database").With("table", "users").Info("query executed")
dl.ChannelLog("http").With("status", 200).Info("request processed")
dl.ChannelLog("errors").With("code", 500).Error("internal error")

da - dynamic foundation for applications

Easily manage massive monoliths in code

Dependency injection and lifecycle management for complex applications. Factory pattern for configuration-driven object creation, automatic dependency resolution, and container introspection.

// Build applications with automatic dependency resolution
app := da.NewApplication(config)
da.WithFactory(app, &DatabaseFactory{})
da.WithFactory(app, &APIFactory{})

app.Initialize()  // build + link dependencies
app.Start()       // start all services

When to Use df

  • Configuration-driven applications that need to adapt behavior based on runtime config
  • Large monolithic applications that need organized dependency management
  • Systems integration where data flows between different formats and protocols
  • Plugin architectures with dynamic component loading and lifecycle management
  • Microservice orchestration with shared infrastructure and service discovery

Getting Started

Start with the documentation.

Each package works independently:

  • Start with dd for struct ↔ map conversion and configuration loading
  • Add dl for intelligent logging with channel routing
  • Use da for dependency injection and application lifecycle management

See examples in each package: dd/examples/, dl/examples/, da/examples/

License

See LICENSE file for details.

About

a dynamic foundation for golang applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages