Documentation ¶
Index ¶
- func InitCasbin(db *gorm.DB) *casbin.Enforcer
- func InitConsumers(postConsumer *post.ReadEventConsumer, smsConsumer *sms.SMSConsumer, ...) []events.Consumer
- func InitDB() *gorm.DB
- func InitES() *elasticsearch.TypedClient
- func InitLimiter(redis redis.Cmdable) Limiter
- func InitLogger() *zap.Logger
- func InitMiddlewares(ih ijwt.Handler, l *zap.Logger) []gin.HandlerFunc
- func InitMongoDB() *mongo.Client
- func InitRanking(l *zap.Logger, svc service.RankingService) *cron.Cron
- func InitRedis() redis.Cmdable
- func InitSaramaClient() sarama.Client
- func InitSms() *sms.TencentSms
- func InitSyncProducer(c sarama.Client) sarama.SyncProducer
- func InitWebServer(userHdl *api.UserHandler, postHdl *api.PostHandler, ...) *gin.Engine
- func InitializeSnowflakeNode() *sf.Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConsumers ¶
func InitConsumers(postConsumer *post.ReadEventConsumer, smsConsumer *sms.SMSConsumer, emailConsumer *email.EmailConsumer, syncConsumer *sync.SyncConsumer, cacheConsumer *cache.CacheConsumer, publishConsumer *publish.PublishPostEventConsumer, checkConsumer *check.CheckConsumer, esConsumer *es.EsConsumer) []events.Consumer
InitConsumers 初始化并返回一个事件消费者
func InitLimiter ¶
func InitLimiter(redis redis.Cmdable) Limiter
func InitMiddlewares ¶
InitMiddlewares 初始化中间件
func InitMongoDB ¶
func InitRanking ¶
func InitRanking(l *zap.Logger, svc service.RankingService) *cron.Cron
func InitSaramaClient ¶
InitSaramaClient 初始化Sarama客户端,用于连接到Kafka集群
func InitSms ¶
func InitSms() *sms.TencentSms
func InitSyncProducer ¶
func InitSyncProducer(c sarama.Client) sarama.SyncProducer
InitSyncProducer 使用已有的Sarama客户端初始化同步生产者
func InitWebServer ¶
func InitWebServer(userHdl *api.UserHandler, postHdl *api.PostHandler, historyHdl *api.HistoryHandler, checkHdl *api.CheckHandler, m []gin.HandlerFunc, permHdl *api.PermissionHandler, rankingHdl *api.RankingHandler, plateHdl *api.PlateHandler, activityHdl *api.ActivityHandler, commentHdl *api.CommentHandler, searchHdl *api.SearchHandler, relationHdl *api.RelationHandler, lotteryDrawHdl *api.LotteryDrawHandler) *gin.Engine
InitWebServer 初始化web服务
func InitializeSnowflakeNode ¶
InitializeSnowflakeNode 初始化雪花节点
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.