listener

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) server.Runnable

New 实例化

Types

type Option

type Option func(*options)

Option 参数设置类型

func WithAddr

func WithAddr(s string) Option

WithAddr 设置addr

func WithCert

func WithCert(s string) Option

WithCert 设置cert

func WithEndHook

func WithEndHook(f func()) Option

WithEndHook set EndHook

func WithHandler

func WithHandler(handler http.Handler) Option

WithHandler 设置handler

func WithHealthz added in v0.1.0

func WithHealthz(enable bool) Option

WithHealthz set healthz

func WithKey

func WithKey(s string) Option

WithKey 设置key

func WithMetrics added in v0.1.0

func WithMetrics(enable bool) Option

WithMetrics set metrics

func WithName added in v0.1.2

func WithName(name string) Option

WithName set name

func WithPprof added in v0.1.0

func WithPprof(enable bool) Option

WithPprof set pprof

func WithReadyz added in v0.1.0

func WithReadyz(enable bool) Option

WithReadyz set readyz

func WithStartedHook

func WithStartedHook(f func()) Option

WithStartedHook 设置启动回调函数

func WithTimeout

func WithTimeout(t int) Option

WithTimeout 设置timeout

type Server

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

Server server manage

func (*Server) Options

func (e *Server) Options(opts ...Option)

Options 设置参数

func (*Server) Shutdown

func (e *Server) Shutdown(ctx context.Context) error

Shutdown 停止

func (*Server) Start

func (e *Server) Start(ctx context.Context) error

Start server

func (*Server) String

func (e *Server) String() string

String string

Jump to

Keyboard shortcuts

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