dependency

package
v0.0.0-...-3dd14bf Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dependency manages

Index

Constants

This section is empty.

Variables

View Source
var FileSystem fs.FS

FileSystem file system used to get embedded files

Functions

This section is empty.

Types

type Injector

type Injector interface {
	// Inject takes any data type and fill of required dependencies (dependency injection)
	Inject(interface{}) error
}

Injector defines a dependency injector

func NewInjector

func NewInjector(p Profile) Injector

NewInjector is an abstract factory to Injector, it builds a instance of Injector interface based on the Profile based as parameter

Supported profiles: Default

If pass a parameter an invalid profile it panics

type InjectorFunc

type InjectorFunc func(interface{}) error

InjectorFunc function that implements the Injector interface

func (InjectorFunc) Inject

func (f InjectorFunc) Inject(i interface{}) error

type Profile

type Profile uint

Profile defines options of dependency injection

const (
	// Default defines the production profile
	Default Profile = iota
)

Supported profiles for dependency injection

Jump to

Keyboard shortcuts

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