ioc

package
v0.0.0-...-d13da26 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package ioc 依赖反转

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(l logger.LoggerV1) *gorm.DB

func InitKafka

func InitKafka() sarama.Client

func InitLogger

func InitLogger() logger.LoggerV1

func InitMiddlewares

func InitMiddlewares(redisClient redis.Cmdable,
	l logger2.LoggerV1,
	jwtHdl ijwt.Handler) []gin.HandlerFunc

func InitRedis

func InitRedis() redis.Cmdable

func InitSMSService

func InitSMSService(cmd redis.Cmdable) sms.Service

func InitWebServer

func InitWebServer(mdls []gin.HandlerFunc, userHdl *web.UserHandler,
	oauth2WechatHdl *web.OAuth2WechatHandler, articleHdl *web.ArticleHandler) *gin.Engine

func InitWechatService

func InitWechatService(l logger2.LoggerV1) wechat.Service

func NewConsumers

NewConsumers 面临的问题依旧是所有的 Consumer 在这里注册一下

func NewSyncProducer

func NewSyncProducer(client sarama.Client) sarama.SyncProducer

Types

type Configer

type Configer interface {
	GetString(ctx context.Context, key string) (string, error)
	MustGetString(ctx context.Context, key string) string
	GetStringOrDefault(ctc context.Context, key string, def string) string
}

type DoSomething

type DoSomething interface {
	DoABC() string
}

type DoSomethingFunc

type DoSomethingFunc func() string

func (DoSomethingFunc) DoABC

func (d DoSomethingFunc) DoABC() string

type ViperConfigerAdapter

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

Jump to

Keyboard shortcuts

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