server

package
v0.0.0-...-8ec9993 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: AGPL-3.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CompConfigName = "ConfigComponent"
	CompLogName    = "LogComponent"
	CompRouterName = "RouterComponent"
	CompDBName     = "DBComponent"
	CompRedisName  = "RedisComponent"
	CompMongoName  = "MongoComponent"
)

这个key是放在UseComps这个map里的,用来判断重复等

View Source
const (
	CompDBConfigKey     = "mysql"
	CompRedisConfigKey  = "redis"
	CompServerConfigKey = "server"
	CompJWTConfigKey    = "jwt"
	CompLogConfigKey    = "log"
	CompMQConfigKey     = "mq"
	CompMongoConfigKey  = "mongo"
)

这个key是作为配置文件的关键字

Variables

This section is empty.

Functions

func BeforeStart

func BeforeStart()

func CompUsed

func CompUsed(comp string) bool

func Serve

func Serve()

func Start

func Start()

func Use

func Use(c Component, options ...interface{})

通过反射直接在配置文件里面捞文件,然后初始化,最后放到useComps里面

Types

type Component

type Component interface {
	Init(options ...interface{}) error
}

Jump to

Keyboard shortcuts

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