Documentation
¶
Index ¶
- func ClickHouse(name string) driver.Conn
- func ClickHouseDB(name string) *gorm.DB
- func DefaultClickHouse() driver.Conn
- func DefaultClickHouseDB() *gorm.DB
- func DefaultDB() *gorm.DB
- func DefaultSlaveDB() *gorm.DB
- func GetRedis() *redis.Client
- func GetRedisCluster() *redis.ClusterClient
- func GetRedisCmdable() redis.Cmdable
- func MasterDB(name string) *gorm.DB
- func SlaveDB(name string) *gorm.DB
- type Component
- type Frame
- func (f *Frame) AfterStart(hook Hook) *Frame
- func (f *Frame) BeforeStop(hook Hook) *Frame
- func (f *Frame) Config() *config.ConfigComponent
- func (f *Frame) RegisterComponent(component Component)
- func (f *Frame) Run() error
- func (f *Frame) SetLogger(logger *zap.Logger)
- func (f *Frame) Start(ctx context.Context) error
- func (f *Frame) Stop(ctx context.Context) error
- type FrameConfig
- type Hook
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClickHouse ¶ added in v1.1.7
ClickHouse 获取指定名称的ClickHouse原生连接
func ClickHouseDB ¶ added in v1.1.9
ClickHouseDB 获取指定名称的ClickHouse GORM DB
func DefaultClickHouse ¶ added in v1.1.7
DefaultClickHouse 获取默认ClickHouse原生连接
func DefaultClickHouseDB ¶ added in v1.1.9
DefaultClickHouseDB 获取默认ClickHouse GORM DB
func GetRedisCmdable ¶ added in v1.3.0
获取通用Redis接口(自动适配单机/集群)
优先返回集群实例,其次返回单机实例 业务代码使用此方法无需关心底层是单机还是集群
Types ¶
type Component ¶
type Component interface {
// Start 启动组件
Start(ctx context.Context) error
// Stop 停止组件
Stop(ctx context.Context) error
}
Component 定义组件接口
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame 框架核心结构
func (*Frame) AfterStart ¶ added in v1.0.6
AfterStart 注册启动后的钩子函数
func (*Frame) BeforeStop ¶ added in v1.0.6
BeforeStop 注册停止前的钩子函数
func (*Frame) Config ¶ added in v1.3.0
func (f *Frame) Config() *config.ConfigComponent
Config 获取应用配置
func (*Frame) RegisterComponent ¶
RegisterComponent 注册组件
type FrameConfig ¶
FrameConfig 框架配置
Click to show internal directories.
Click to hide internal directories.