server

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: GPL-2.0 Imports: 21 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      // Database connection
	ModelRegistry *models.Model // Model registry for migration
}

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

func (s *Server) RegisterJobs()

RegisterJobs ...

func (*Server) SeedData added in v1.0.0

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