ioc

package
v0.0.0-...-f664ad0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCasbin

func InitCasbin(db *gorm.DB) *casbin.Enforcer

InitCasbin 初始化casbin

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 InitDB

func InitDB() *gorm.DB

InitDB 初始化数据库

func InitES

func InitES() *elasticsearch.TypedClient

InitES 初始化elasticsearch

func InitLimiter

func InitLimiter(redis redis.Cmdable) Limiter

func InitLogger

func InitLogger() *zap.Logger

InitLogger 将日志输出到控制台

func InitMiddlewares

func InitMiddlewares(ih ijwt.Handler, l *zap.Logger) []gin.HandlerFunc

InitMiddlewares 初始化中间件

func InitMongoDB

func InitMongoDB() *mongo.Client

func InitRanking

func InitRanking(l *zap.Logger, svc service.RankingService) *cron.Cron

func InitRedis

func InitRedis() redis.Cmdable

func InitSaramaClient

func InitSaramaClient() sarama.Client

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

func InitializeSnowflakeNode() *sf.Node

InitializeSnowflakeNode 初始化雪花节点

Types

This section is empty.

Jump to

Keyboard shortcuts

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