dio

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 17 Imported by: 2

README

DIO

一个基于 DI 的项目框架。内置了:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrateEnv

func AutoMigrateEnv() core.Dio

func GetBean

func GetBean(beanName string) (bean interface{}, ok bool)

func GetByType

func GetByType(beanType interface{}) (bean interface{}, ok bool)

func GetProperties added in v0.0.6

func GetProperties(prefix string, destType interface{}) interface{}

func GetPropertyString

func GetPropertyString(key string) string

func LoadConfig

func LoadConfig(configs fs.FS, filename string) core.Dio

func LoadDefaultConfig

func LoadDefaultConfig(configs fs.FS, filename string) core.Dio

func Logger added in v0.0.6

func Logger() core.Log

func New added in v0.0.3

func New() core.Dio

func NewZapLogger added in v0.0.6

func NewZapLogger(l core.Property, opts ...zap.Option) (core.Log, error)

func Provide

func Provide(prototype ...interface{}) core.Dio

func ProvideMultiBeanNotOnProperty

func ProvideMultiBeanNotOnProperty(beans []interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideMultiBeanOnProperty

func ProvideMultiBeanOnProperty(beans []interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideMultiNamedBean

func ProvideMultiNamedBean(namedBeanMap map[string]interface{}) core.Dio

func ProvideMultiNamedBeanNotOnProperty

func ProvideMultiNamedBeanNotOnProperty(namedBeanMap map[string]interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideMultiNamedBeanOnProperty

func ProvideMultiNamedBeanOnProperty(namedBeanMap map[string]interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideNamedBean

func ProvideNamedBean(beanName string, prototype interface{}) core.Dio

func ProvideNamedBeanNotOnProperty

func ProvideNamedBeanNotOnProperty(beanName string, prototype interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideNamedBeanOnProperty

func ProvideNamedBeanOnProperty(beanName string, prototype interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideNotOnProperty

func ProvideNotOnProperty(prototype interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func ProvideOnProperty

func ProvideOnProperty(prototype interface{}, property string, compareValue string, caseSensitive ...bool) core.Dio

func RegisterBean

func RegisterBean(bean interface{}) core.Dio

func RegisterNamedBean

func RegisterNamedBean(name string, bean interface{}) core.Dio

func Run

func Run(ctx context.Context)

func SetDefaultProperty

func SetDefaultProperty(key string, value interface{}) core.Dio

func SetDefaultPropertyMap

func SetDefaultPropertyMap(properties map[string]interface{}) core.Dio

func SetLogger added in v0.0.6

func SetLogger(log core.Log) core.Dio

func SetProperty

func SetProperty(key string, value interface{}) core.Dio

func SetPropertyMap

func SetPropertyMap(properties map[string]interface{}) core.Dio

func Use

func Use(plugins ...core.PluginConfig) core.Dio

func WrapZapLogger added in v0.0.6

func WrapZapLogger(logger *zap.Logger, opts ...zap.Option) core.Log

Types

type ZapLogger added in v0.0.6

type ZapLogger struct {
	// contains filtered or unexported fields
}

func (*ZapLogger) BeanName added in v0.0.6

func (l *ZapLogger) BeanName() string

func (*ZapLogger) Debug added in v0.0.6

func (l *ZapLogger) Debug(ctx context.Context, msg string, keyAndValues ...interface{})

func (*ZapLogger) Debugw added in v0.0.6

func (l *ZapLogger) Debugw(ctx context.Context, msg string, keyAndValues ...map[string]interface{})

func (*ZapLogger) Error added in v0.0.6

func (l *ZapLogger) Error(ctx context.Context, msg string, keyAndValues ...interface{})

func (*ZapLogger) Errorw added in v0.0.6

func (l *ZapLogger) Errorw(ctx context.Context, msg string, keyAndValues ...map[string]interface{})

func (*ZapLogger) Info added in v0.0.6

func (l *ZapLogger) Info(ctx context.Context, msg string, keyAndValues ...interface{})

func (*ZapLogger) Infow added in v0.0.6

func (l *ZapLogger) Infow(ctx context.Context, msg string, keyAndValues ...map[string]interface{})

func (*ZapLogger) Logger added in v0.0.6

func (l *ZapLogger) Logger() interface{}

func (*ZapLogger) Named added in v0.0.6

func (l *ZapLogger) Named(named string) (logger core.Log)

func (*ZapLogger) Skip added in v0.0.6

func (l *ZapLogger) Skip(skip int) (logger core.Log)

func (*ZapLogger) Trace added in v0.0.6

func (l *ZapLogger) Trace(ctx context.Context) context.Context

func (*ZapLogger) TraceWith added in v0.1.0

func (l *ZapLogger) TraceWith(ctx context.Context, val any) context.Context

func (*ZapLogger) Warn added in v0.0.6

func (l *ZapLogger) Warn(ctx context.Context, msg string, keyAndValues ...interface{})

func (*ZapLogger) Warnw added in v0.0.6

func (l *ZapLogger) Warnw(ctx context.Context, msg string, keyAndValues ...map[string]interface{})

Jump to

Keyboard shortcuts

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