Go to file
Mike Bierlee eda86dc975 Rename package name to somewhat fix DUB builds
DUB builds were failing because of long path names, due to the long project name
2022-11-28 20:02:52 +03:00
.vscode Add function to register value injectors 2022-10-31 22:02:49 +03:00
examples Add quickstart example 2022-11-27 18:47:33 +03:00
source/poodinis/valueinjector Add quickstart example 2022-11-27 18:47:33 +03:00
testfiles Add load functions for individual file formats 2022-11-27 17:59:46 +03:00
.gitignore Add quickstart example 2022-11-27 18:47:33 +03:00
CHANGES.md Rename package name to somewhat fix DUB builds 2022-11-28 20:02:52 +03:00
dub.json Rename package name to somewhat fix DUB builds 2022-11-28 20:02:52 +03:00
dub.selections.json Add project skeleton 2022-10-31 21:46:04 +03:00
LICENSE.txt Add project skeleton 2022-10-31 21:46:04 +03:00
makefile Add quickstart example 2022-11-27 18:47:33 +03:00
README.md Rename package name to somewhat fix DUB builds 2022-11-28 20:02:52 +03:00
testmain.d Add quickstart example 2022-11-27 18:47:33 +03:00

Mirage Config injector for Poodinis

Version 1.0.2
Copyright 2022 Mike Bierlee
Licensed under the terms of the MIT license - See LICENSE.txt

A config value injector for the Poodinis dependency injection framework using Mirage Config

Getting started

DUB Dependency

See the DUB project page for instructions on how to include Mirage Config into your project.

Quickstart

import poodinis : DependencyContainer, Value;
import poodinis.valueinjector.mirage : loadConfig;

import std.stdio : writeln;
import std.conv : to;

class Server
{
    @Value("server.host")
    private string host;

    @Value("server.port")
    private int port;

    public void run()
    {
        writeln("Running server on " ~ host ~ ":" ~ port.to!string);
    }
}

void main()
{
    auto container = new shared DependencyContainer();
    container.register!Server;
    container.loadConfig("config.ini");

    auto server = container.resolve!Server;
    server.run();
}

Functions such as loadConfig are the same as available in Mirage. All individual loaders and parses are available. For more information on how to use Mirage, see https://github.com/mbierlee/mirage-config/blob/main/README.md

History

For a full overview of changes, see CHANGES.md