listener

package
v0.0.0-...-31becf5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, opts ...Option) server.Runnable

New 实例化

func NewHealthz

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

NewHealthz default heealthz server

func NewMetrics

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

NewMetrics 新建默认监控服务

func NewReadyz

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

NewReadyz default readyz server

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 WithKey

func WithKey(s string) Option

WithKey 设置key

func WithStartedHook

func WithStartedHook(f func()) Option

WithStartedHook 设置启动回调函数

type Server

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

Server server manager

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 start

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