mirror of
				https://github.com/cloudreve/cloudreve.git
				synced 2025-10-31 00:27:31 +08:00 
			
		
		
		
	 79b8784934
			
		
	
	79b8784934
	
	
	
		
			
			* Code: compatible with semantic import versioning * Tools & Docs: compatible with semantic import versioning * Clean go.mod & go.sum
		
			
				
	
	
		
			34 lines
		
	
	
		
			800 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			800 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package bootstrap
 | |
| 
 | |
| import (
 | |
| 	model "github.com/cloudreve/Cloudreve/v3/models"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/aria2"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/auth"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/cache"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/conf"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/crontab"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/email"
 | |
| 	"github.com/cloudreve/Cloudreve/v3/pkg/task"
 | |
| 	"github.com/gin-gonic/gin"
 | |
| )
 | |
| 
 | |
| // Init 初始化启动
 | |
| func Init(path string) {
 | |
| 	InitApplication()
 | |
| 	conf.Init(path)
 | |
| 	// Debug 关闭时,切换为生产模式
 | |
| 	if !conf.SystemConfig.Debug {
 | |
| 		gin.SetMode(gin.ReleaseMode)
 | |
| 	}
 | |
| 	cache.Init()
 | |
| 	if conf.SystemConfig.Mode == "master" {
 | |
| 		model.Init()
 | |
| 		task.Init()
 | |
| 		aria2.Init(false)
 | |
| 		email.Init()
 | |
| 		crontab.Init()
 | |
| 		InitStatic()
 | |
| 	}
 | |
| 	auth.Init()
 | |
| }
 |