server

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Gin    *gin.Engine
	Config *conf.Configuration
	DB     *gorm.DB

	ACLEnforcer   *casbin.Enforcer
	TestDB        *gorm.DB
	ModelRegistry *models.Model
	// contains filtered or unexported fields
}

Server ...

func NewServer

func NewServer() *Server

NewServer will create a new instance of the application

func (*Server) GetConfig

func (s *Server) GetConfig() *conf.Configuration

GetConfig return the current app configuration

func (*Server) GetDB

func (s *Server) GetDB() *gorm.DB

GetDB returns gorm (ORM)

func (*Server) GetModelRegistry

func (s *Server) GetModelRegistry() *models.Model

GetModelRegistry returns the model registry

func (*Server) GracefulShutdown

func (s *Server) GracefulShutdown()

GracefulShutdown Wait for interrupt signal to gracefully shutdown the server with a timeout of 5 seconds.

func (*Server) NewEnforcer

func (s *Server) NewEnforcer() error

func (*Server) NewRouter

func (s *Server) NewRouter() *gin.Engine

NewRouter ...

func (*Server) OpenRedis added in v0.1.4

func (s *Server) OpenRedis() error

func (*Server) RegisterJobs

func (s *Server) RegisterJobs()

RegisterJobs ...

func (*Server) SeedData

func (m *Server) SeedData() error

SeedData ...

func (*Server) ShutdownTest

func (s *Server) ShutdownTest()

ShutdownTest shuts down test server

func (*Server) Start

func (s *Server) Start() error

Start the http server

Jump to

Keyboard shortcuts

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