server

package
v0.0.0-...-bd0fe52 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

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

func SetupViper

func SetupViper(viper *viper.Viper, filename string) error

SetupViper configure des variables automatiqument

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) SetDB

func (s *Server) SetDB(db *gorm.DB)

SetDB set the db of the server

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

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown shutdown the server

func (*Server) Start

func (s *Server) Start(pathEnv string)

Start start the server

Jump to

Keyboard shortcuts

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