server

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn is a wrapped net.Conn

func (*Conn) Flush

func (c *Conn) Flush() error

Flush sends all pending data over the connection

func (*Conn) Read

func (c *Conn) Read(p []byte) (int, error)

func (*Conn) Write

func (c *Conn) Write(p []byte) (int, error)

type Http

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

Http implements transport.Server interface.

func NewHttp

func NewHttp(conf *config.Config) *Http

NewHttp returns a new instance of *Http.

func (*Http) GoServe

func (s *Http) GoServe()

GoServe implements transport.Server interface.

func (*Http) ListenAddr

func (s *Http) ListenAddr() net.Addr

ListenAddr implements transport.Server interface.

func (*Http) SetHandler

func (s *Http) SetHandler(h transport.RequestHandler)

func (*Http) Stop

func (s *Http) Stop() error

Stop implements transport.Server interface.

type MockSocket

type MockSocket struct {
	*Socket
	// contains filtered or unexported fields
}

MockSocket is a socket server using a net.Pipe internally

func NewMockSocket

func NewMockSocket(conf *config.Config) *MockSocket

NewMockSocket returns a new instance of a mock socket server

func (*MockSocket) Dial

func (s *MockSocket) Dial() (net.Conn, error)

Dial returns a net.Pipe client connection

type Socket

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

Socket handles socket connections

func NewSocket

func NewSocket(addr string, conf *config.Config) *Socket

NewSocket will return a new instance of a log server

func (*Socket) Conns

func (s *Socket) Conns() []*Conn

Conns returns a list of current connections. For debugging.

func (*Socket) GoServe

func (s *Socket) GoServe()

GoServe starts a server without blocking the current goroutine

func (*Socket) ListenAddr

func (s *Socket) ListenAddr() net.Addr

ListenAddr returns the listen address of the server.

func (*Socket) ListenAndServe

func (s *Socket) ListenAndServe() error

ListenAndServe starts serving requests

func (*Socket) SetHandler

func (s *Socket) SetHandler(h transport.RequestHandler)

SetHandler implements transport.Server

func (*Socket) Shutdown

func (s *Socket) Shutdown() error

Shutdown implements internal.LifecycleManager, shutting down the server

func (*Socket) Stop

func (s *Socket) Stop() error

Stop can be called to shut down the server

Jump to

Keyboard shortcuts

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