server

package
v0.0.0-...-625f0bf Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeHTTP

func ServeHTTP(handle appHandler) gin.HandlerFunc

ServeHTTP wraps the results from the handler into a JSON response

func SetupRouter

func SetupRouter(globalConfig *config.Config) *gin.Engine

SetupRouter creates the router and returns it

Types

type Handlers

type Handlers struct {
	ItemHandler  handlers.ItemHandler
	OrderHandler handlers.OrderHandler
	UserHandler  handlers.UserHandler
	StatHandler  handlers.StatHandler
}

func InitHandlers

func InitHandlers(services *Services) *Handlers

type Middlewares

type Middlewares struct {
	AuthMiddleware      *middlewares.AuthMiddleware
	GroupAuthMiddleware *middlewares.GroupAuthMiddleware
}

func InitMiddlewares

func InitMiddlewares(config *config.Config, repos *Repositories) *Middlewares

type Repositories

type Repositories struct {
	UserRepository  repositories.UserRepository
	ItemRepository  repositories.ItemRepository
	OrderRepository repositories.OrderRepository
	StatRepository  repositories.StatRepository
}

func InitRepositories

func InitRepositories(db *sqlx.DB) *Repositories

type Services

type Services struct {
	ItemService  services.ItemService
	OrderService services.OrderService
	UserService  services.UserService
	StatService  services.StatService
}

func InitServices

func InitServices(repos *Repositories, config *config.Config) *Services

Jump to

Keyboard shortcuts

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