server

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncHandler added in v0.3.0

type FuncHandler func(context.Context, *net.TCPConn)

func HandleFunc added in v0.3.0

func HandleFunc(f func(context.Context, *net.TCPConn)) FuncHandler

func (FuncHandler) Handle added in v0.3.0

func (f FuncHandler) Handle(ctx context.Context, conn *net.TCPConn)

type Handler added in v0.3.0

type Handler interface {
	Handle(context.Context, *net.TCPConn)
}

type Option

type Option func(*Server) error

func WithReadySignal

func WithReadySignal(cb func(net.Addr)) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Server

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

func New

func New(addr string, handler Handler, opts ...Option) (*Server, error)

func (*Server) Listen

func (s *Server) Listen() error

func (*Server) LocalAddr

func (s *Server) LocalAddr() net.Addr

func (*Server) Stop

func (s *Server) Stop() error

Jump to

Keyboard shortcuts

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