di

package
v0.0.0-...-d741a62 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAndRefreshK8sClient

func InitAndRefreshK8sClient(K8sClient client.K8sClient, logger *zap.Logger, PromCache cache.MonitorCache, manager cn.CronManager) *cron.Cron

InitAndRefreshK8sClient 初始化并启动定时刷新任务 返回 cron 调度器实例以便调用者可以在需要时停止它

func InitCasbin

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

InitCasbin 初始化casbin

func InitDB

func InitDB() *gorm.DB

InitDB 初始化数据库

func InitGinServer

func InitGinServer(
	m []gin.HandlerFunc,
	userHdl *userApi.UserHandler,
	authApiHdl *systemApi.ApiHandler,
	authMenuHdl *systemApi.MenuHandler,
	authRoleHdl *systemApi.RoleHandler,
	authPermissionHdl *systemApi.PermissionHandler,
	treeNodeHdl *treeApi.TreeNodeHandler,
	treeAliResourceHdl *treeApi.AliResourceHandler,
	treeEcsResourceHdl *treeApi.EcsResourceHandler,
	treeEcsHdl *treeApi.EcsHandler,
	treeElbHdl *treeApi.ElbHandler,
	treeRdsHdl *treeApi.RdsHandler,
	notAuthHdl *notAuthHandler.NotAuthHandler,
	k8sClusterHdl *k8sApi.K8sClusterHandler,
	k8sConfigMapHdl *k8sApi.K8sConfigMapHandler,
	k8sDeploymentHdl *k8sApi.K8sDeploymentHandler,
	k8sNamespaceHdl *k8sApi.K8sNamespaceHandler,
	k8sNodeHdl *k8sApi.K8sNodeHandler,
	k8sPodHdl *k8sApi.K8sPodHandler,
	k8sSvcHdl *k8sApi.K8sSvcHandler,
	k8sTaintHdl *k8sApi.K8sTaintHandler,
	k8sYamlTaskHdl *k8sApi.K8sYamlTaskHandler,
	k8sYamlTemplateHdl *k8sApi.K8sYamlTemplateHandler,
	k8sAppHdl *k8sApi.K8sAppHandler,
	alertEventHdl *prometheusApi.AlertEventHandler,
	alertPoolHdl *prometheusApi.AlertPoolHandler,
	alertRuleHdl *prometheusApi.AlertRuleHandler,
	configYamlHdl *prometheusApi.ConfigYamlHandler,
	onDutyGroupHdl *prometheusApi.OnDutyGroupHandler,
	recordRuleHdl *prometheusApi.RecordRuleHandler,
	scrapePoolHdl *prometheusApi.ScrapePoolHandler,
	scrapeJobHdl *prometheusApi.ScrapeJobHandler,
	sendGroupHdl *prometheusApi.SendGroupHandler,
) *gin.Engine

InitGinServer 初始化web服务

func InitLogger

func InitLogger() *zap.Logger

InitLogger 将日志输出到./logs/cloudops-{日期}.log,并同时输出到控制台

func InitMiddlewares

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

InitMiddlewares 初始化中间件

func InitRedis

func InitRedis() redis.Cmdable

func InitTables

func InitTables(db *gorm.DB) error

func InitTrans

func InitTrans() error

InitTrans 初始化中文翻译器

func InitViper

func InitViper() error

InitViper 初始化viper配置

func InitWebHookViper

func InitWebHookViper()

Types

type Cmd

type Cmd struct {
	Server *gin.Engine
	Cron   *cron.Cron
	Start  service.AliResourceService
}

func InitWebServer

func InitWebServer() *Cmd

Jump to

Keyboard shortcuts

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