gim

package module
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 6 Imported by: 7

README

Gim

Modular framework based on dependency injection. The modularization design is borrowed from NestJS.

Usage

see examples

Design

It follows the simple inversion of control(IoC) idea of using singletons as providers and inject the required singletons where needed across the whole application. However circular reference(dependency) is not supported yet.

Every Gim module corresponds to an IoC container where providers inside can depend on each other. Above this, a module can export some(or all) of its providers for consumption by parent modules.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Name      string
	Imports   []*Module
	Exports   []interface{}
	Providers []interface{}
	// contains filtered or unexported fields
}

func (*Module) Bootstrap

func (main *Module) Bootstrap()

func (*Module) Get added in v0.2.0

func (a *Module) Get(prov interface{}) interface{}

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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