Back to godoc.org

Package server

v1.0.0
Latest Go to latest

The latest major version is .

Published: Oct 16, 2020 | License: MIT | Module: github.com/Jarnpher553/gemini

Index

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier