server

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDiffListenAddress = errors.New("different listen address")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen  *Listen
	Mux     *mux.Config
	LogPath string
}

func (*Config) Check

func (c *Config) Check() error

type Listen

type Listen struct {
	Network string
	Address string
}

type MultiServer

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

func NewMultiServer

func NewMultiServer(conf []*Config) *MultiServer

func (*MultiServer) Close

func (m *MultiServer) Close()

func (*MultiServer) Reload

func (m *MultiServer) Reload(confs []*Config)

func (*MultiServer) Run

func (m *MultiServer) Run() error

func (*MultiServer) Start

func (m *MultiServer) Start() error

func (*MultiServer) Wait

func (m *MultiServer) Wait()

type Server

type Server struct {
	Listener net.Listener
	// contains filtered or unexported fields
}

func GetCtxServer

func GetCtxServer(ctx context.Context) (*Server, bool)

func NewServer

func NewServer(config *Config) (*Server, error)

func (*Server) Addr

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

func (*Server) Close

func (s *Server) Close() error

func (*Server) Reload

func (s *Server) Reload(config *Config) error

func (*Server) ServeConn added in v0.0.3

func (s *Server) ServeConn(ctx context.Context, conn net.Conn)

ServeConn dispatches the reader to the handler whose pattern most closely matches the reader.

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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