ioc

package
v0.0.0-...-1b0a6d5 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 55 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 InitWeb

func InitWeb(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,
	roleHdl *api.RoleHandler,
	menuHdl *api.MenuHandler,
	apiHdl *api.ApiHandler,
) *gin.Engine

InitWeb 初始化web服务

func InitializeSnowflakeNode

func InitializeSnowflakeNode() *sf.Node

InitializeSnowflakeNode 初始化雪花节点

Types

type Cmd

type Cmd struct {
	Server   *gin.Engine
	Cron     *cron.Cron
	Consumer []events.Consumer
	Mock     mock.MockUserRepository
}

func InitWebServer

func InitWebServer() *Cmd

Jump to

Keyboard shortcuts

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