reader

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFixedSizeBuffer

func NewFixedSizeBuffer(size int) *fixedSizeBuffer

Types

type Frame

type Frame interface {
	Messages() [][]byte
	Release()
}

Frame represents single frame received from clients. For more details read `frame` documentations.

type ListenerConfig

type ListenerConfig interface {
	Listen(ctx context.Context, network, address string) (net.Listener, error)
}

type NewWorkerConstructor

type NewWorkerConstructor = func(connection net.Conn, frameChannel chan Frame) Worker

type Reader

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

Reader exposes unix socket and reads the messages send by clients and forwards it further to the 'Frame' channel.

Reader implements very simple separator based protocol in order to receive multiple messages on single UNIX stream connection. Protocol is specified as series of following: <message_data><separator>

Where:

  • <separator> is message separator character: `;`
  • <message_data> is any arbitrary data forming single message with following restrictions: it could not contain <separator> and maximal message size is 64kB - 1(for separator)

func NewReader

func NewReader(address string) *Reader

func (*Reader) OutChannel

func (r *Reader) OutChannel() chan Frame

func (*Reader) Run

func (r *Reader) Run(ctx context.Context) error

type Worker

type Worker interface {
	Run(ctx context.Context) error
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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