Documentation
¶
Index ¶
- Variables
- func InitTables(db *gorm.DB) error
- func NewDB(c *conf.Data) (*gorm.DB, error)
- func NewLogger() *zap.Logger
- func NewMongoDB(c *conf.Data) *mongo.Client
- func NewPostData(data *Data, l *zap.Logger) biz.PostData
- func NewRedis(c *conf.Data) redis.Cmdable
- func NewSaramaClient(c *conf.Data) (sarama.Client, error)
- func NewSyncProducer(c sarama.Client) sarama.SyncProducer
- type Data
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPostNotFound = errors.New("post not found") ErrInvalidParams = errors.New("invalid parameters") )
View Source
var ProviderSet = wire.NewSet(NewData, NewDB, NewRedis, NewLogger, NewMongoDB, NewPostData, NewSaramaClient, NewSyncProducer)
ProviderSet is data providers.
Functions ¶
func InitTables ¶
func NewSaramaClient ¶
NewSaramaClient 初始化Sarama客户端,用于连接到Kafka集群
func NewSyncProducer ¶
func NewSyncProducer(c sarama.Client) sarama.SyncProducer
NewSyncProducer 使用已有的Sarama客户端初始化同步生产者
Types ¶
Click to show internal directories.
Click to hide internal directories.