server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomLogFormatter

func CustomLogFormatter(param gin.LogFormatterParams) string

CustomLogFormatter is a custom formatter for logging messages

func NewGinEngine

func NewGinEngine(c *Config) *gin.Engine

NewGinEngine creates a new GinEngine instance

Types

type AppServer

type AppServer struct {
	// contains filtered or unexported fields
}

func (*AppServer) PreRun

func (s *AppServer) PreRun() error

PreRun is a function that will be called before the server starts to run

func (*AppServer) Run

func (s *AppServer) Run(addr ...string) error

Run is a function that will be called when the server starts to run

type Config

type Config struct {
	LoggingDirectory string
	DB               *gorm.DB
}

func NewConfig

func NewConfig() *Config

func (*Config) New

func (c *Config) New() (*AppServer, error)

New creates a new AppServer instance from Config

type Server

type Server interface {
	PreRun() error
	Run() error
}

Jump to

Keyboard shortcuts

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