writer

package
v0.0.0-...-d07672d Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QueueIsClosedError    = errors.New("queue is closed")
	QueueIsFullError      = errors.New("queue is full")
	DropWriteMessageError = errors.New("message writing failure and drop it")
)

Functions

This section is empty.

Types

type FeatureOpts

type FeatureOpts struct {
	EnableMetrics          bool `json:"enableMetrics,omitempty" yaml:"enableMetrics,omitempty"` // 开启 metrics 记录
	EnableBufferedIoWriter bool `json:"enableBufferedIoWriter,omitempty" yaml:"enableBufferedIoWriter,omitempty"`
}

func NewDefaultFeatureOpts

func NewDefaultFeatureOpts() *FeatureOpts

type Writer

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

func NewBufferedWriter

func NewBufferedWriter(w io.Writer, queueCap uint32, featureOpts *FeatureOpts) *Writer

func (*Writer) Stop

func (w *Writer) Stop()

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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