setuputil

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 27 Imported by: 9

README

setup

安装wire: go install github.com/google/wire/cmd/wire@latest



Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetDBConn = func(launcherManager LauncherManager) (*gorm.DB, error) {
	dbConn, err := launcherManager.GetPostgresDBConn()
	if err != nil {
		return nil, err
	}
	return dbConn, nil
}

GetDBConn recommend Postgres

Functions

func Close

func Close(launcherManager LauncherManager) error

func GetAuthManager

func GetAuthManager(launcherManager LauncherManager) (authpkg.AuthRepo, error)

func GetConsulClient

func GetConsulClient(launcherManager LauncherManager) (*consulapi.Client, error)

func GetJaegerExporter

func GetJaegerExporter(launcherManager LauncherManager) (*otlptrace.Exporter, error)

func GetLogger

func GetLogger(launcherManager LauncherManager) (log.Logger, error)

func GetLoggerForHelper

func GetLoggerForHelper() (log.Logger, error)

func GetLoggerForMiddleware

func GetLoggerForMiddleware(launcherManager LauncherManager) (log.Logger, error)

func GetMongoClient

func GetMongoClient(launcherManager LauncherManager) (*mongo.Client, error)

func GetMysqlDBConn

func GetMysqlDBConn(launcherManager LauncherManager) (*gorm.DB, error)

func GetPostgresDBConn

func GetPostgresDBConn(launcherManager LauncherManager) (*gorm.DB, error)

func GetRabbitmqConn

func GetRabbitmqConn(launcherManager LauncherManager) (*amqp.ConnectionWrapper, error)

func GetRecommendDBConn

func GetRecommendDBConn(launcherManager LauncherManager) (*gorm.DB, error)

GetRecommendDBConn 获取数据库连接

func GetRedisClient

func GetRedisClient(launcherManager LauncherManager) (redis.UniversalClient, error)

func GetServiceAPIManager

func GetServiceAPIManager(launcherManager LauncherManager) (clientutil.ServiceAPIManager, error)

func GetTokenManager

func GetTokenManager(launcherManager LauncherManager) (authpkg.TokenManger, error)

func LoadingConfig

func LoadingConfig(configFilePath string, configOpts ...configutil.Option) (*configpb.Bootstrap, error)

Types

type LauncherManager

type LauncherManager interface {
	GetConfig() *configpb.Bootstrap

	GetLogger() (log.Logger, error)
	GetLoggerForMiddleware() (log.Logger, error)
	GetLoggerForHelper() (log.Logger, error)

	GetRedisClient() (redis.UniversalClient, error)
	GetMysqlDBConn() (*gorm.DB, error)
	GetPostgresDBConn() (*gorm.DB, error)
	GetMongoClient() (*mongo.Client, error)
	GetConsulClient() (*consulapi.Client, error)
	GetJaegerExporter() (*otlptrace.Exporter, error)
	GetRabbitmqConn() (*amqp.ConnectionWrapper, error)

	GetTokenManager() (authpkg.TokenManger, error)
	GetAuthManager() (authpkg.AuthRepo, error)

	GetServiceApiManager() (clientutil.ServiceAPIManager, error)

	Close() error
}

func NewLauncherManager

func NewLauncherManager(configFilePath string, configOpts ...configutil.Option) (LauncherManager, error)

func NewLauncherManagerWithCleanup

func NewLauncherManagerWithCleanup(configFilePath string, configOpts ...configutil.Option) (LauncherManager, func(), error)

func NewSingletonLauncherManager

func NewSingletonLauncherManager(configFilePath string) (LauncherManager, error)

Jump to

Keyboard shortcuts

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