Documentation ¶
Index ¶
- Constants
- func AppDBChange(appKey string, changeType dgorm.ChangeType) error
- func HttpServer() *http.HttpServer
- func Init()
- func InitAppDB(configFunc dgorm.AppConfigFunc, changeFunc dgorm.AppChangeFunc)
- func Plugs(plugins ...Plugin) error
- func RegisterHeaderFunc(f func(ctx *routing.Context, header map[string]string) map[string]string)
- func RegisterRpcPlugin(plugins ...server.Plugin)
- func RpcCall(ctx *routing.Context, serverName, funcName string, args interface{}, ...) error
- func RpcServer(handler interface{}, auth ...rpcx.AuthFunc)
- func SRpcCall(ctx *routing.Context, serverName, funcName string, args interface{}, ...) error
- type DB
- type Plugin
- type Redis
- type RpcClient
Constants ¶
View Source
const (
GoDandelionConnChange = "go_dandelion_conn_change"
)
Variables ¶
This section is empty.
Functions ¶
func AppDBChange ¶
func AppDBChange(appKey string, changeType dgorm.ChangeType) error
AppDBChange 用于上报应用数据库发生变更。 如中心服务器修改应用数据库,则需要上报,运 营服务订阅到消息后,自动刷新应用数据库连接 依赖于redis
func HttpServer ¶
func HttpServer() *http.HttpServer
func InitAppDB ¶
func InitAppDB(configFunc dgorm.AppConfigFunc, changeFunc dgorm.AppChangeFunc)
InitAppDB 初始化应用数据库 configFunc 定义获取相关应用数据库连接方法。用于在应 用数据库连接发生变更行为时,各服务自动获取最新的数据 库连接,不用额外进行重连刷新操作
changeFunc 定义相关数据库变更时,业务需要执行的方法 发生变更时,进行回调处理。如,增加新的应用,服务需要 创建表单等操作
func RegisterHeaderFunc ¶
func RegisterRpcPlugin ¶
Types ¶
type Plugin ¶
type Plugin interface { // Config 返回需要初始化的配置,建议使用第二层级 Config() interface{} InitPlugin() error }
Click to show internal directories.
Click to hide internal directories.