server

package
v0.0.0-...-88b4fc5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoHandler = errors.New("no invalid handler")
	ErrNoServer  = errors.New("no invalid server")
)

Functions

func DisplayHandlers

func DisplayHandlers() string

func DisplayProtocols

func DisplayProtocols() string

func GetTlsConfig

func GetTlsConfig() (*tls.Config, error)

func MakeServerQuicConf

func MakeServerQuicConf() *quic.Config

Types

type EchoHandler

type EchoHandler struct{}

type EchoProccessor

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

func (*EchoProccessor) Proccess

func (p *EchoProccessor) Proccess(conn net.Conn) error

func (*EchoProccessor) Stop

func (p *EchoProccessor) Stop()

type Handler

type Handler interface {
	// contains filtered or unexported methods
}

func GetHandler

func GetHandler(htype HandlerType) (Handler, error)

type HandlerType

type HandlerType string
const (
	HDothing HandlerType = "DoNothing"
	HEcho    HandlerType = "Echo"
)

type Http3Server

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

func NewHttp3Server

func NewHttp3Server(addr string) *Http3Server

func (*Http3Server) Start

func (s *Http3Server) Start() error

func (*Http3Server) Stop

func (s *Http3Server) Stop()

type HttpServer

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

func NewHttpServer

func NewHttpServer(addr string) *HttpServer

func (*HttpServer) Start

func (s *HttpServer) Start() error

func (*HttpServer) Stop

func (s *HttpServer) Stop()

type Proccessor

type Proccessor interface {
	Proccess(conn net.Conn) error
	Stop()
}

type Processor

type Processor struct{}

func (*Processor) Process

type ProtocolType

type ProtocolType string
const (
	PQuic      ProtocolType = "quic"
	PQuicEarly ProtocolType = "quic_e"
	PUdp       ProtocolType = "udp"
	PHttp3     ProtocolType = "http3"
	PTcp       ProtocolType = "tcp"
	PTls       ProtocolType = "tls"
	PHttp      ProtocolType = "http"
)

type QuicEarlyServer

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

func NewQuicEarlyServer

func NewQuicEarlyServer(addr string) *QuicEarlyServer

func (*QuicEarlyServer) Start

func (s *QuicEarlyServer) Start() error

func (*QuicEarlyServer) Stop

func (s *QuicEarlyServer) Stop()

type QuicHandler

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

func NewQuicHanlder

func NewQuicHanlder(s quic.Session) *QuicHandler

func (*QuicHandler) Process

func (qh *QuicHandler) Process()

func (*QuicHandler) ReadLoop

func (qh *QuicHandler) ReadLoop() error

func (*QuicHandler) Start

func (qh *QuicHandler) Start() error

func (*QuicHandler) Stop

func (qh *QuicHandler) Stop() error

func (*QuicHandler) WriteLoop

func (qh *QuicHandler) WriteLoop()

func (*QuicHandler) WriteToStream

func (qh *QuicHandler) WriteToStream(msgContainer *msg.MessageContainer) error

type QuicServer

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

func NewQuicServer

func NewQuicServer(addr string) *QuicServer

func (*QuicServer) Start

func (s *QuicServer) Start() error

func (*QuicServer) Stop

func (s *QuicServer) Stop()

type Server

type Server interface {
	Start() error
	Stop()
}

func GetHttp3Server

func GetHttp3Server(protocol ProtocolType, htype HandlerType, addr string) Server

func GetHttpServer

func GetHttpServer(protocol ProtocolType, htype HandlerType, addr string) Server

func GetQuicEarlyServer

func GetQuicEarlyServer(protocol ProtocolType, htype HandlerType, addr string) Server

func GetQuicServer

func GetQuicServer(protocol ProtocolType, htype HandlerType, addr string) Server

func GetServer

func GetServer(protocol ProtocolType, htype HandlerType, addr string) (Server, error)

func GetTcpServer

func GetTcpServer(protocol ProtocolType, htype HandlerType, addr string) Server

func GetTlsServer

func GetTlsServer(protocol ProtocolType, htype HandlerType, addr string) Server

func GetUdpServer

func GetUdpServer(protocol ProtocolType, htype HandlerType, addr string) Server

type ServerHandler

type ServerHandler func(net.Conn, <-chan struct{}) error

type TcpServer

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

func NewTcpServer

func NewTcpServer(addr string) *TcpServer

func (*TcpServer) Start

func (s *TcpServer) Start() error

func (*TcpServer) Stop

func (s *TcpServer) Stop()

type TlsServer

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

func NewTlsServer

func NewTlsServer(htype HandlerType, addr string) *TlsServer

func (*TlsServer) Start

func (s *TlsServer) Start() error

func (*TlsServer) Stop

func (s *TlsServer) Stop()

type UdpServer

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

func NewUdpServer

func NewUdpServer(addr string) *UdpServer

func (*UdpServer) Start

func (s *UdpServer) Start() error

func (*UdpServer) Stop

func (s *UdpServer) Stop()

Jump to

Keyboard shortcuts

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