23 lines
		
	
	
		
			703 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			703 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package Func
 | |
| 
 | |
| import (
 | |
| 	"SafelineAPI/internal/app/SafelineRequest"
 | |
| 	"SafelineAPI/internal/app/logger"
 | |
| 	"SafelineAPI/internal/class/config"
 | |
| 	"SafelineAPI/internal/moudle"
 | |
| 	"SafelineAPI/pkg/utils"
 | |
| 	"log"
 | |
| )
 | |
| 
 | |
| func UpdateCertCheck(conf config.Config) ([]SafelineRequest.Nodes, bool) {
 | |
| 	certNodes := utils.GetList(conf.Server.Host.Url(), conf.Server.ApiToken.String())
 | |
| 	certUpsert := moudle.CheckNodes(certNodes, conf.Days)
 | |
| 	if len(certUpsert) != 0 {
 | |
| 		log.Printf("本次需要更新证书数量有 %s%d%s 个,现在开始更新...", logger.Yellow, len(certUpsert), logger.Reset)
 | |
| 	} else {
 | |
| 		log.Print("本次无需更新证书,即将退出本程序。")
 | |
| 		return nil, true
 | |
| 	}
 | |
| 	return certUpsert, false
 | |
| }
 |