eq_pipe

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SimpleFormatVersionFirst = iota + 1
)

Variables

View Source
var (
	ErrorIncompatibleSessionData = errors.New("incompatible session data")
)

Functions

This section is empty.

Types

type Factory

type Factory interface {
	// Create a new pipe
	New(batchId string) Pipe

	// Restore a pipe from the session
	Restore(id SessionId) (pipe Pipe, err error)
}

Pipe factory

func NewSimple

func NewSimple(l esl.Logger, f eq_pipe_preserve.Factory) Factory

func NewTransientSimple

func NewTransientSimple(l esl.Logger) Factory

type Pipe

type Pipe interface {
	// Enqueue the data
	Enqueue(d []byte)

	// Dequeue the data from the pipe. Returns nil if the pipe is empty.
	Dequeue() (d []byte)

	// Delete the data.
	Delete(d []byte)

	// Size of the pipe.
	Size() int

	// Close & clean up this pipe.
	Close()

	// Close & preserve the state
	Preserve() (id SessionId, err error)
}

type SessionId

type SessionId string

Jump to

Keyboard shortcuts

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