nfsmain

package
v0.0.0-...-c455b0d Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrListenerStopped = errors.New("listener is stopped")
)

Functions

func Start

func Start(config *goconfig.ConfigFile) error

func Stop

func Stop()

Types

type AppLine

type AppLine interface {
	Start() error
	Stop()
	GetDB() string

	// should be able to handle concurrent calls
	Update(points models.Points)
}

type StoppableListener

type StoppableListener struct {
	*net.TCPListener
	// contains filtered or unexported fields
}

func NewStoppableListener

func NewStoppableListener(l *net.TCPListener) *StoppableListener

func (*StoppableListener) Accept

func (sl *StoppableListener) Accept() (net.Conn, error)

func (*StoppableListener) Stop

func (sl *StoppableListener) Stop()

type StoppableServer

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

func NewStoppableServer

func NewStoppableServer(config *goconfig.ConfigFile, apps map[string]AppLine) (*StoppableServer, error)

func (*StoppableServer) ServeHTTP

func (s *StoppableServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

this function can be called in parallel multiple times

func (*StoppableServer) Start

func (s *StoppableServer) Start(l *net.TCPListener)

Start and Stop can be called in parallel therefore we have to ensure that when we return from Start, we have already initialised the server correctly

func (*StoppableServer) Stop

func (s *StoppableServer) Stop()

Jump to

Keyboard shortcuts

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