data

package
v1.1.25 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 45 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSetData = wire.NewSet(NewData)

ProviderSetData is data providers.

View Source
var ProviderSetRPCConn = wire.NewSet(
	NewHouYiConn,
	NewRabbitRPCConn,
)

ProviderSetRPCConn wire set

Functions

func GenBizDatabaseName

func GenBizDatabaseName(teamID uint32) string

GenBizDatabaseName 生成业务库名称

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data .

func NewData

func NewData(c *palaceconf.Bootstrap) (*Data, func(), error)

NewData .

func (*Data) CreateBizAlarmDatabase added in v1.1.0

func (d *Data) CreateBizAlarmDatabase(teamID uint32) error

CreateBizAlarmDatabase 创建告警历史业务库

func (*Data) CreateBizDatabase added in v1.1.0

func (d *Data) CreateBizDatabase(teamID uint32) error

CreateBizDatabase 创建业务库

func (*Data) GetAlarmGormDB

func (d *Data) GetAlarmGormDB(teamID uint32) (*gorm.DB, error)

GetAlarmGormDB 获取告警库连接

func (*Data) GetAlertConsumerStorage added in v1.1.0

func (d *Data) GetAlertConsumerStorage() watch.Storage

GetAlertConsumerStorage 获取告警持久化存储

func (*Data) GetAlertPersistenceDBQueue added in v1.1.0

func (d *Data) GetAlertPersistenceDBQueue() watch.Queue

GetAlertPersistenceDBQueue 获取持久化队列

func (*Data) GetAlertQueue

func (d *Data) GetAlertQueue() watch.Queue

GetAlertQueue 获取告警队列

func (*Data) GetBizDB

func (d *Data) GetBizDB(_ context.Context) *sql.DB

GetBizDB 获取业务库连接

func (*Data) GetBizGormDB

func (d *Data) GetBizGormDB(teamID uint32) (*gorm.DB, error)

GetBizGormDB 获取业务库连接

func (*Data) GetBizGormDBByName added in v1.1.0

func (d *Data) GetBizGormDBByName(databaseName string) (*gorm.DB, error)

GetBizGormDBByName 获取业务库连接

func (*Data) GetCacher

func (d *Data) GetCacher() cache.ICacher

GetCacher 获取缓存

func (*Data) GetCasBin added in v1.1.0

func (d *Data) GetCasBin(teamID uint32, tx ...*gorm.DB) *casbin.SyncedEnforcer

GetCasBin 获取casbin

func (*Data) GetCasbinByTx added in v1.1.0

func (d *Data) GetCasbinByTx(tx *gorm.DB) *casbin.SyncedEnforcer

func (*Data) GetEmail added in v1.1.0

func (d *Data) GetEmail() email.Interface

GetEmail 获取邮件发送器

func (*Data) GetFileLimitSize added in v1.1.0

func (d *Data) GetFileLimitSize() map[string]*conf.FileLimit

GetFileLimitSize 获取文件大小限制配置

func (*Data) GetMainDB

func (d *Data) GetMainDB(ctx context.Context) *gorm.DB

GetMainDB 获取主库连接

func (*Data) GetOssCli added in v1.1.0

func (d *Data) GetOssCli() oss.OssClient

GetOssCli 获取oss客户端

func (*Data) GetStrategyQueue

func (d *Data) GetStrategyQueue() watch.Queue

GetStrategyQueue 获取策略队列

func (*Data) OssIsOpen added in v1.1.0

func (d *Data) OssIsOpen() bool

OssIsOpen 是否开启oss

type HouYiConn added in v1.1.0

type HouYiConn struct {
	// contains filtered or unexported fields
}

HouYiConn HouYi服务连接

func NewHouYiConn added in v1.1.0

func NewHouYiConn(c *palaceconf.Bootstrap, data *Data) (*HouYiConn, func(), error)

NewHouYiConn 创建一个HouYi rpc连接

func (*HouYiConn) Health added in v1.1.0

func (l *HouYiConn) Health(ctx context.Context, req *api.CheckRequest) (*api.CheckReply, error)

Health 健康检查

func (*HouYiConn) Heartbeat added in v1.1.0

func (l *HouYiConn) Heartbeat(_ context.Context, req *api.HeartbeatRequest) error

Heartbeat 心跳

func (*HouYiConn) PushStrategy added in v1.1.0

PushStrategy 推送策略

func (*HouYiConn) Query added in v1.1.0

Query 查询数据

func (*HouYiConn) Sync added in v1.1.0

Sync 同步数据

func (*HouYiConn) SyncV2 added in v1.1.0

SyncV2 同步数据

type RabbitConn added in v1.1.0

type RabbitConn struct {
	// contains filtered or unexported fields
}

RabbitConn rabbit服务连接

func NewRabbitRPCConn added in v1.1.0

func NewRabbitRPCConn(c *palaceconf.Bootstrap, data *Data) (*RabbitConn, error)

NewRabbitRPCConn 创建一个rabbit rpc连接

func (*RabbitConn) Heartbeat added in v1.1.0

func (l *RabbitConn) Heartbeat(_ context.Context, req *api.HeartbeatRequest) error

Heartbeat 心跳

func (*RabbitConn) NotifyObject added in v1.1.0

func (l *RabbitConn) NotifyObject(ctx context.Context, in *pushapi.NotifyObjectRequest, opts ...microserver.Option) error

NotifyObject 发送通道配置

func (*RabbitConn) SendMsg added in v1.1.0

func (l *RabbitConn) SendMsg(ctx context.Context, in *hookapi.SendMsgRequest, opts ...microserver.Option) error

SendMsg 发送消息

func (*RabbitConn) SyncTeam added in v1.1.3

func (l *RabbitConn) SyncTeam(ctx context.Context, teamID uint32, srvs ...*Srv) error

type Srv added in v1.1.0

type Srv struct {
	// contains filtered or unexported fields
}

type SrvList added in v1.1.0

type SrvList struct {
	// contains filtered or unexported fields
}

func NewSrvList added in v1.1.0

func NewSrvList(depend bool) *SrvList

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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