server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultServer

type DefaultServer struct {
	*http.Server
	*service.Registry
	// contains filtered or unexported fields
}

DefaultServer 默认服务器

func (*DefaultServer) Run

func (s *DefaultServer) Run()

Run 实现IBaseServer接口

func (*DefaultServer) Serve

func (s *DefaultServer) Serve(r *router.Router)

type IBaseServer

type IBaseServer interface {
	Run()
}

IBaseServer 服务器标准接口

func Default

func Default(options ...Option) IBaseServer

Default 构造函数

type Option

type Option func(server *DefaultServer)

func Addr

func Addr(addr string) Option

func Env

func Env(env string) Option

func Name

func Name(name string) Option

func Registry

func Registry(reg *service.Registry) Option

func Router

func Router(r *router.Router) Option

func RunMode

func RunMode(mode string) Option

func Startup

func Startup(startup func(*DefaultServer) error) Option

Jump to

Keyboard shortcuts

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