Documentation ¶
Index ¶
Constants ¶
const ( // ErrType for errors ErrType uint8 = iota // LogType for logs LogType // SignalType for signals SignalType )
Variables ¶
var ( // ErrInvalidTimeout defines an error for an invalid Config Timeout value ErrInvalidTimeout = errors.New("Invalid Config Timeout") // ErrInvalidLager defines an error for an invalid Config Lager value ErrInvalidLager = errors.New("Invalid Lager") )
Functions ¶
This section is empty.
Types ¶
type BufferDecoder ¶
BufferDecoder is a Buffer and Decoder
type BufferEncoder ¶
BufferEncoder is a Buffer and Encoder
type Config ¶
type Config struct { // Timeout for receiving frames Timeout time.Duration // Lager is used to control the log destination Lager lager.Lager }
Config configures a Server or Client
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig creates config with default settings
type Conn ¶
type Conn interface { // Receive registers a receiver to receive t Receive(t uint8, r Receiver) // Send encodes a frame on conn using t and e Send(t uint8, e interface{}) error // Recv listens for frames and sends them to a receiver Recv() // Pool returns the pool used by the Conn Pool() Pool // Shutdown closes the gob connection Shutdown() // IsShutdown provides a way to listen for this connection to shutdown IsShutdown() chan struct{} }
Conn defines a mux connection
type Pool ¶
type Pool interface { NewBufferEncoder() BufferEncoder NewBufferDecoder() BufferDecoder NewEncoder(w io.Writer) Encoder NewDecoder(r io.Reader) Decoder NewReceiver(ch interface{}) Receiver NewClient(conn net.Conn, config *Config) (Client, error) NewServer(conn net.Conn, config *Config) (Server, error) }
Pool is an interface for interacting with encoding implementations
type Receiver ¶
Receiver defines an interface for receiving
func NewReceiver ¶
NewReceiver creates a new Receiver.
type SignalReceiver ¶
type SignalReceiver struct {
// contains filtered or unexported fields
}
SignalReceiver receives signals
func NewSignalReceiver ¶
func NewSignalReceiver(ch chan os.Signal, pool Pool) SignalReceiver
NewSignalReceiver creates a new signal receiver
func (SignalReceiver) Close ¶
func (r SignalReceiver) Close() error
Close and cleans up SignalReceiver
func (SignalReceiver) Receive ¶
func (r SignalReceiver) Receive(b []byte) error
Receive decodes bytes into signal and puts it on ch
type StringReceiver ¶
type StringReceiver struct {
// contains filtered or unexported fields
}
StringReceiver receives strings
func NewStringReceiver ¶
func NewStringReceiver(ch chan string, pool Pool) StringReceiver
NewStringReceiver returns a StringReceiver
func (StringReceiver) Close ¶
func (r StringReceiver) Close() error
Close and cleans up StringReceiver
func (StringReceiver) Receive ¶
func (r StringReceiver) Receive(b []byte) error
Receive decodes bytes into string and puts it on ch
type ValueReceiver ¶
type ValueReceiver struct {
// contains filtered or unexported fields
}
ValueReceiver uses reflection to send and receive values
func (*ValueReceiver) Close ¶
func (r *ValueReceiver) Close() error
func (*ValueReceiver) Receive ¶
func (r *ValueReceiver) Receive(b []byte) error