listener

package
v0.0.0-...-3030a97 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 8 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 实例化

Types

type Option

type Option func(*options)

Option 参数设置类型

func WithAddr

func WithAddr(s string) Option

WithAddr 设置addr

func WithCert deprecated

func WithCert(s string) Option

WithCert 设置cert

Deprecated: Set tls cert. punctuation properly. Use WithTlsOption instead.

func WithEndHook

func WithEndHook(f func()) Option

WithEndHook 设置结束回调函数

func WithHandler

func WithHandler(handler http.Handler) Option

WithHandler 设置handler

func WithKey deprecated

func WithKey(s string) Option

WithKey 设置key

Deprecated: Set tls key. punctuation properly. Use WithKey instead.

func WithReadTimeout

func WithReadTimeout(d int) Option

WithReadTimeout 设置读超时

func WithStartedHook

func WithStartedHook(f func()) Option

WithStartedHook 设置启动回调函数

func WithTlsOption

func WithTlsOption(certFile, keyFile string) Option

WithTlsOption 设置cert

func WithWriteTimeout

func WithWriteTimeout(d int) Option

WithWriteTimeout 设置写超时

type Server

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

func (*Server) Attempt

func (e *Server) Attempt() bool

Attempt 判断是否可以启动

func (*Server) Shutdown

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

Shutdown 停止

func (*Server) Start

func (e *Server) Start(ctx context.Context) (err 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