converters

package
v0.0.0-...-d9a865f Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_PROCESS_COUNT = 8
)
View Source
const (
	// Number of lines to keep in the stderr buffer.
	STDERR_RING_SIZE = 512
)

Variables

This section is empty.

Functions

func NewCacheFile

func NewCacheFile(cachePath string) (*cacheFile, error)

func ReadLine

func ReadLine(reader *bufio.Reader) ([]byte, error)

Types

type CachedConverter

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

func NewCache

func NewCache(converterName, executablePath, indexCachePath string) (*CachedConverter, error)

func (*CachedConverter) Close

func (cache *CachedConverter) Close() error

func (*CachedConverter) Contains

func (cache *CachedConverter) Contains(streamID uint64) bool

func (*CachedConverter) Data

func (cache *CachedConverter) Data(stream *index.Stream, moreDetails bool) (data []index.Data, clientBytes, serverBytes uint64, err error)

func (*CachedConverter) DataForSearch

func (cache *CachedConverter) DataForSearch(streamID uint64) ([2][]byte, [][2]int, uint64, uint64, bool, error)

func (*CachedConverter) InvalidateChangedStreams

func (cache *CachedConverter) InvalidateChangedStreams(streams *bitmask.LongBitmask) bitmask.LongBitmask

func (*CachedConverter) MaxProcessCount

func (cache *CachedConverter) MaxProcessCount() int

func (*CachedConverter) Name

func (cache *CachedConverter) Name() string

func (*CachedConverter) Reset

func (cache *CachedConverter) Reset() error

func (*CachedConverter) Statistics

func (cache *CachedConverter) Statistics() *Statistics

func (*CachedConverter) Stderr

func (cache *CachedConverter) Stderr(pid int) *ProcessStderr

type Converter

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

func New

func New(converterName, executablePath string) *Converter

func (*Converter) Data

func (converter *Converter) Data(stream *index.Stream, moreDetails bool) (data []index.Data, clientBytes, serverBytes uint64, err error)

func (*Converter) MaxProcessCount

func (converter *Converter) MaxProcessCount() int

func (*Converter) Name

func (converter *Converter) Name() string

func (*Converter) ProcessStats

func (converter *Converter) ProcessStats() []ProcessStats

func (*Converter) Reset

func (converter *Converter) Reset()

Stop the converter process.

func (*Converter) Stderr

func (converter *Converter) Stderr(pid int) *ProcessStderr

type Process

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

func NewProcess

func NewProcess(converterName string, executablePath string) *Process

To stop the process, close the input channel. The output channel will be closed when the process exits.

func (*Process) ExitCode

func (process *Process) ExitCode() int

func (*Process) Pid

func (process *Process) Pid() int

func (*Process) Stderr

func (process *Process) Stderr() []string

type ProcessStats

type ProcessStats struct {
	Running  bool
	ExitCode int
	Pid      int
	Errors   int
}

type ProcessStderr

type ProcessStderr struct {
	Pid    int
	Stderr []string
}

type Statistics

type Statistics struct {
	Name              string
	CachedStreamCount uint64
	Processes         []ProcessStats
}

Jump to

Keyboard shortcuts

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