Documentation ¶
Index ¶
- Constants
- Variables
- func SetupViper(viper *viper.Viper, filename string) error
- type Server
- func (s *Server) InitializeRoutes(db *gorm.DB, dc *democlassifier.DemoClassifier, ...) error
- func (s *Server) SetDB(db *gorm.DB)
- func (s *Server) SetDemoClassifier(dc *democlassifier.DemoClassifier)
- func (s *Server) SetDownloaderInfo(di *downloaderinfo.DownloaderInfo)
- func (s *Server) Shutdown()
- func (s *Server) Start(pathEnv string)
Constants ¶
View Source
const ErrLoadViper = "couldn't load viper : %s"
ErrLoadViper error when can't load viper
Variables ¶
View Source
var ErrAnalyzerDeathMatchNotStarted = errors.New("analyzerDeathMatchNotStarted not started")
ErrAnalyzerDeathMatchNotStarted analyzer deathmatch not started
View Source
var ErrAnalyzerNotStarted = errors.New("analyzer not started")
ErrAnalyzerNotStarted analyzer not started
View Source
var ErrDBNotSetup = errors.New("DB not started")
ErrDBNotSetup DB not started
View Source
var ErrRouterNotInit = errors.New("ErrRouterNotInit")
ErrRouterNotInit router has not been init
Functions ¶
Types ¶
type Server ¶
type Server struct { Router *gin.Engine Config *viper.Viper Logger *custlogger.Logger SchemaDB string // contains filtered or unexported fields }
Server general struct of the server
func (*Server) InitializeRoutes ¶
func (s *Server) InitializeRoutes(db *gorm.DB, dc *democlassifier.DemoClassifier, di *downloaderinfo.DownloaderInfo, adm *analyzerdeathmatch.AnalyzerDeathMatch, a *analyzer.Analyzer, IP, keyAPI string, analyzerVersion int64, logGin, logBack *custlogger.Logger, useRateLimit bool, ) error
InitializeRoutes initialize routes, middlewares, CORS
func (*Server) SetDemoClassifier ¶
func (s *Server) SetDemoClassifier(dc *democlassifier.DemoClassifier)
SetDemoClassifier set the demo classifier of the server
func (*Server) SetDownloaderInfo ¶
func (s *Server) SetDownloaderInfo(di *downloaderinfo.DownloaderInfo)
SetDownloaderInfo set the downlaoder info of the server
Click to show internal directories.
Click to hide internal directories.