providers

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 26 Imported by: 7

Documentation

Overview

gen for home toolset

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterProvider

func AfterProvider(bean interface{}, alias string)

func GetAllProvider

func GetAllProvider() []interface{}

func GetBean

func GetBean(alias string) interface{}

GetBean 只能返回指针的值

func SetConfigDir

func SetConfigDir(fs *embed.FS)

Types

type Bean

type Bean interface {
	// GetBean 只能返回指针的值
	GetBean(alias string) interface{}
}

type ConfigProvider

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

ConfigProvider @Bean("config")

func NewConfigProvider

func NewConfigProvider() *ConfigProvider

func (*ConfigProvider) Boot

func (c *ConfigProvider) Boot()

func (*ConfigProvider) GetBean

func (c *ConfigProvider) GetBean(alias string) interface{}

GetBean 约定大于一切, 自己接收的代码和配置结构要人工约束成一致

func (*ConfigProvider) Init

func (c *ConfigProvider) Init()

type DatabaseProvider

type DatabaseProvider struct {
	*services.Config `inject:"config, database"`
}

DatabaseProvider @Bean("database")

func NewDatabaseProvider

func NewDatabaseProvider() *DatabaseProvider

func (*DatabaseProvider) GetBean

func (m *DatabaseProvider) GetBean(alias string) interface{}

func (*DatabaseProvider) Init

func (m *DatabaseProvider) Init()

type FrameworkProvider

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

FrameworkProvider @Bean

func NewFrameworkProvider

func NewFrameworkProvider() *FrameworkProvider

type GroupConfig

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

func (*GroupConfig) GetMiddleware

func (g *GroupConfig) GetMiddleware() []string

func (*GroupConfig) GetPrefix

func (g *GroupConfig) GetPrefix() string

func (*GroupConfig) Middleware

func (g *GroupConfig) Middleware(m ...string) *GroupConfig

func (*GroupConfig) Prefix

func (g *GroupConfig) Prefix(prefix string) *GroupConfig

type LogProvider

type LogProvider struct {
	*services.Config `inject:"config, app"`
}

LogProvider @Bean

func NewLogProvider

func NewLogProvider() *LogProvider

func (*LogProvider) Init

func (l *LogProvider) Init()

type MysqlProvider

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

MysqlProvider @Bean("mysql")

func NewMysqlProvider

func NewMysqlProvider() *MysqlProvider

func (*MysqlProvider) GetBean

func (m *MysqlProvider) GetBean(alias string) interface{}

func (*MysqlProvider) Init

func (m *MysqlProvider) Init()

type RedisProvider

type RedisProvider struct {
	*services.Config `inject:"config, database"`
	// contains filtered or unexported fields
}

RedisProvider @Bean("redis")

func NewRedisProvider

func NewRedisProvider() *RedisProvider

func (*RedisProvider) GetBean

func (m *RedisProvider) GetBean(alias string) interface{}

func (*RedisProvider) Init

func (m *RedisProvider) Init()

type RouteProvider

type RouteProvider struct {
	Route            map[string]map[*api.Config]func(c *gin.Context)
	RouteGroupConfig map[string]*GroupConfig
}

RouteProvider 路由提供者 @Bean

func NewRouteProvider

func NewRouteProvider() *RouteProvider

func (*RouteProvider) Group

func (a *RouteProvider) Group(group string) *GroupConfig

func (*RouteProvider) Init

func (a *RouteProvider) Init()

func (*RouteProvider) LoadRoute

func (a *RouteProvider) LoadRoute(routes []interface{})

Jump to

Keyboard shortcuts

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