listener

package
v1.3.24 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 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 默认健康检查服务

func NewMetrics

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

NewMetrics 新建默认监控服务

func NewReadyz

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

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

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
}

func (*Server) Attempt

func (e *Server) Attempt() bool

Attempt 判断是否可以启动

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 开始

func (*Server) String

func (e *Server) String() string

Jump to

Keyboard shortcuts

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