Documentation
¶
Index ¶
- func ClickHouse(name string) driver.Conn
- func ClickHouseDB(name string) *gorm.DB
- func DB(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 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) 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 ClickHouseDB ¶ added in v1.1.9
ClickHouseDB 获取指定名称的ClickHouse GORM DB
func DefaultClickHouseDB ¶ added in v1.1.9
DefaultClickHouseDB 获取默认ClickHouse GORM DB
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) RegisterComponent ¶
RegisterComponent 注册组件
Click to show internal directories.
Click to hide internal directories.