server

package
v0.0.0-...-9a83fbb Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 5 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 {
	Options *ServerOptions
	Route   gin.IRouter
	// contains filtered or unexported fields
}

func NewServer

func NewServer(g *gin.Engine, options *ServerOptions) *Server

func (Server) Run

func (s Server) Run() error

type ServerBuiler

type ServerBuiler struct {
	App *app.AppBuilder

	Options *ServerOptions
	// 只在程序启动过程中进行操作,以保证协程安全
	Items map[string]any
	// contains filtered or unexported fields
}

func NewServerBuilder

func NewServerBuilder(builder *app.AppBuilder) *ServerBuiler

func (*ServerBuiler) Add

func (b *ServerBuiler) Add(module func(*ServerBuiler)) *ServerBuiler

func (*ServerBuiler) Build

func (b *ServerBuiler) Build() (*Server, error)

func (*ServerBuiler) Configure

func (b *ServerBuiler) Configure(action ServerConfigureFunc) *ServerBuiler

配置服务,该方法参数在App.Run中、gin.Run之前运行

func (*ServerBuiler) PreConfigure

func (b *ServerBuiler) PreConfigure(action ServerConfigureFunc) *ServerBuiler

配置服务,该方法参数在App.Run中、gin.Run之前运行

type ServerConfigureFunc

type ServerConfigureFunc func(s *Server) error

type ServerOptions

type ServerOptions struct {
	Port     int
	RootUrl  string
	LogLevel zerolog.Level
}

Jump to

Keyboard shortcuts

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