network

package
v0.0.0-...-8613b64 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

A TCP server wrapper, implements Handler interface to handle client connections

A TCP server wrapper, implements Handler interface to handle client connections

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Handle(net.Conn)
}

type TCPServer

type TCPServer interface {
	Serve(handler Handler)
	Close()
}

func NewPlainServer

func NewPlainServer(name string, ip string, port int) (TCPServer, error)

return a new plain tcp(non TLS) server

func NewTLSServer

func NewTLSServer(name string, ip string, port int, caFile string, keyFile string) (TCPServer, error)

return a new TLS server

type WebServer

type WebServer struct {
	Root string
	// contains filtered or unexported fields
}

func NewWebServer

func NewWebServer(ip string, port int, root string, https bool, ca string, key string) *WebServer

func (*WebServer) Serve

func (self *WebServer) Serve(handlers map[string]http.Handler)

Jump to

Keyboard shortcuts

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