di

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 7 Imported by: 19

README

odi

Object Dependency Injection

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(object any) any

Clone 克隆

func Dispose

func Dispose(object any)

Dispose 释放

func Provide

func Provide(kind string, constructor func() any)

Provide 注册

func Resolve

func Resolve(r io.Reader, opts ...Option) (any, error)

Resolve 解析

Types

type Config

type Config struct {
	Resolver string
	Key      string
}

func NewDefaultConfig

func NewDefaultConfig() *Config

type Option

type Option func(o *Config)

func WithKey

func WithKey(key string) Option

func WithResolver

func WithResolver(resolver string) Option

Directories

Path Synopsis
test module

Jump to

Keyboard shortcuts

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