server

package
v0.0.0-...-d248f01 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoDBConnectRetryMax int = 5

Functions

func StartHttpServer

func StartHttpServer(cfg *configs.ServerConfigStruct) error

StartHttpServer 启动服务器

func StartMongoDBConnection

func StartMongoDBConnection(cfg *configs.ServerConfigStruct, silence bool) (*mongo.Client, error)

Types

type CustomFileLogHooks

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

func NewCustomFileLogHooks

func NewCustomFileLogHooks(file string, level []log.Level) (*CustomFileLogHooks, error)

NewCustomFileLogHooks 初始化文件日志

Usage:

NewCustomFileLogHooks("app.log", log.AllLevels)
NewCustomFileLogHooks("app.log", []log.Level{
	log.ErrorLevel,
	log.PanicLevel,
})

func (*CustomFileLogHooks) Close

func (h *CustomFileLogHooks) Close() error

Close 释放日志文件

func (*CustomFileLogHooks) Fire

func (h *CustomFileLogHooks) Fire(entry *log.Entry) error

Fire 将日志写入到文件中

func (*CustomFileLogHooks) Levels

func (h *CustomFileLogHooks) Levels() []log.Level

Levels 返回日志等级定义

Jump to

Keyboard shortcuts

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