internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACKWriter

type ACKWriter interface {
	Keepalive(int) error
	ACK(int) error
}

type BatchReader

type BatchReader interface {
	ReadBatch() (*lj.Batch, error)
}

type Config

type Config struct {
	TLS     *tls.Config
	Handler HandlerFactory
	Channel chan *lj.Batch
}

type Eventer

type Eventer interface {
	OnEvents(*lj.Batch) error
}

type Handler

type Handler interface {
	Run()
	Stop()
}

type HandlerFactory

type HandlerFactory func(Eventer, net.Conn) (Handler, error)

func DefaultHandler

func DefaultHandler(
	keepalive time.Duration,
	mk ProtocolFactory,
) HandlerFactory

type ProtocolFactory

type ProtocolFactory func(conn net.Conn) (BatchReader, ACKWriter, error)

type Server

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

func ListenAndServe

func ListenAndServe(addr string, opts Config) (*Server, error)

func ListenAndServeWith

func ListenAndServeWith(
	binder func(network, addr string) (net.Listener, error),
	addr string,
	opts Config,
) (*Server, error)

func NewWithListener

func NewWithListener(l net.Listener, opts Config) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Receive

func (s *Server) Receive() *lj.Batch

func (*Server) ReceiveChan

func (s *Server) ReceiveChan() <-chan *lj.Batch

Jump to

Keyboard shortcuts

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