endless

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRE_SIGNAL = iota
	POST_SIGNAL

	STATE_INIT
	STATE_RUNNING
	STATE_SHUTTING_DOWN
	STATE_TERMINATE
)

Variables

View Source
var (
	DefaultReadTimeOut    time.Duration
	DefaultWriteTimeOut   time.Duration
	DefaultMaxHeaderBytes int
	DefaultHammerTime     time.Duration
)

Functions

func EndlessFushin

func EndlessFushin(srv *fushinHttp.Server) error

EndlessFushin 直接对endless的快速调用 以fushinServer初始化

func EndlessHooks

func EndlessHooks(addr string, hd http.Handler, beforeHooks func(add string)) error

EndlessHooks 直接对endless的快速调用 增加必备hooks

func EndlessRun

func EndlessRun(address string, hd http.Handler) error

EndlessRun 直接对endless的快速调用

func ListenAndServe

func ListenAndServe(addr string, handler http.Handler) error

ListenAndServe listens on the TCP network address addr and then calls Serve with handler to handle requests on incoming connections. Handler is typically nil, in which case the DefaultServeMux is used.

func ListenAndServeTLS

func ListenAndServeTLS(addr string, certFile string, keyFile string, handler http.Handler) error

ListenAndServeTLS acts identically to ListenAndServe, except that it expects HTTPS connections. Additionally, files containing a certificate and matching private key for the server must be provided. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate followed by the CA's certificate.

func NewServer

func NewServer(addr string, handler http.Handler) (srv *endlessServer)

NewServer returns an intialized endlessServer Object. Calling Serve on it will actually "start" the server.

Types

type EndlessConfig

type EndlessConfig struct {
	Addr         string
	Handler      http.Handler
	IdleTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	BeforeBegin  func(add string)
}

type EndlessServer

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

func NewEndless

func NewEndless(cf EndlessConfig) *EndlessServer

NewEndless 新建endless服务

func (*EndlessServer) Close

func (e *EndlessServer) Close() error

Close for endlessServer

func (*EndlessServer) RegHooksShutdown

func (e *EndlessServer) RegHooksShutdown(f func())

RegHooksShutdown Register hooks on Shutdown for endlessServer

func (*EndlessServer) Shutdown

func (e *EndlessServer) Shutdown()

Shutdown for endlessServer

func (*EndlessServer) ShutdownCtx

func (e *EndlessServer) ShutdownCtx(ctx context.Context) error

ShutdownCtx for endlessServer

Jump to

Keyboard shortcuts

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