server

package
v0.0.0-...-fc1dba9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerStatic

func ServerStatic(prefix string, mode string, embedFs embed.FS) gin.HandlerFunc

假设vue/react项目输出文件夹名字为dist,拷贝到该go文件所在目录下 注意"dist"前后不能有 / r.Use(ServerStatic("dist", dist))

func SetDist

func SetDist(distFs embed.FS)

Types

type Server

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

func New

func New(conf *config.Config, logger *logrus.Logger) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Ping

func (s *Server) Ping() *ServerStatus

func (*Server) Run

func (s *Server) Run() error

graceful shutdown

type ServerStatus

type ServerStatus struct {
	Ping         bool `json:"ping"`
	DBRepository bool `json:"dbRepository"`
}

Jump to

Keyboard shortcuts

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