reader

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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