initialize

package
v0.0.0-...-1f4ee57 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEVELOPMENT = "dev"
	TEST        = "test"
	PRODUCT     = "prod"
	InitKey     = "initialize"
)

Variables

View Source
var (
	InitConfig = &Init{}
)

约定大于配置

Functions

func Start

func Start(conf Config, dao Dao) func()

Types

type BasicConfig

type BasicConfig struct {
	Module   string
	NoInject []string
}

type Config

type Config interface {
	NeedInit
}

type Dao

type Dao interface {
	Close()
	NeedInit
}

type Env

type Env string

type EnvConfig

type EnvConfig struct {
	conf_center.ConfigCenterEnvConfig
}

type Generate

type Generate interface {
	Generate() interface{}
}

type Init

type Init struct {
	EnvConfig *EnvConfig
	BasicConfig
	Env, ConfUrl string
	// contains filtered or unexported fields
}

func (*Init) CloseDao

func (init *Init) CloseDao()

func (*Init) GetServiceConfig

func (init *Init) GetServiceConfig() *ServerConfig

func (*Init) LoadConfig

func (init *Init) LoadConfig() *Init

func (*Init) Register

func (init *Init) Register()

func (*Init) SetInit

func (init *Init) SetInit(conf Config, dao Dao)

func (*Init) UnmarshalAndSet

func (init *Init) UnmarshalAndSet(bytes []byte)

type LogConfig

type LogConfig log.Config

func (*LogConfig) Init

func (conf *LogConfig) Init()

type NeedInit

type NeedInit interface {
	Init()
}

type ServerConfig

type ServerConfig struct {
	Protocol                               string
	Domain                                 string
	Port                                   string
	ReadTimeout                            time.Duration `expr:"$+5"`
	WriteTimeout                           time.Duration `expr:"$+5"`
	OpenTracing, SystemTracing, Prometheus bool
	Gin                                    *gini.Config
}

func (*ServerConfig) Init

func (c *ServerConfig) Init()

type ViperConfig

type ViperConfig struct {
	Remote   bool
	Provider string
	Endpoint string
	Path     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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