netcap: github.com/dreadl0ck/netcap/io Index | Files

package io

import "github.com/dreadl0ck/netcap/io"

Implements IO primitives

Index

Package Files

atomicDelimitedWriter.go chanWriter.go csvWriter.go

type AtomicDelimitedWriter Uses

type AtomicDelimitedWriter struct {
    sync.Mutex
    // contains filtered or unexported fields
}

AtomicDelimitedWriter writes delimited proto messages synchronized

func NewAtomicDelimitedWriter Uses

func NewAtomicDelimitedWriter(w *delimited.Writer) *AtomicDelimitedWriter

NewAtomicDelimitedWriter takes a delimited.WriterAtomic and returns an atomic version

func (*AtomicDelimitedWriter) PutProto Uses

func (a *AtomicDelimitedWriter) PutProto(pb proto.Message) error

PutProto writes a protocol buffer into the writer and returns an error

type CSVWriter Uses

type CSVWriter struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func NewCSVWriter Uses

func NewCSVWriter(w io.Writer) *CSVWriter

func (*CSVWriter) Close Uses

func (w *CSVWriter) Close() error

func (*CSVWriter) WriteHeader Uses

func (w *CSVWriter) WriteHeader(msg proto.Message) (int, error)

func (*CSVWriter) WriteRecord Uses

func (w *CSVWriter) WriteRecord(msg proto.Message) (int, error)

type ChanWriter Uses

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

chanWriter writes into a []byte chan

func NewChanWriter Uses

func NewChanWriter() *ChanWriter

TODO make chan buf size configurable

func (*ChanWriter) Chan Uses

func (w *ChanWriter) Chan() <-chan []byte

func (*ChanWriter) Close Uses

func (w *ChanWriter) Close() error

func (*ChanWriter) Write Uses

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

Package io imports 7 packages (graph) and is imported by 2 packages. Updated 2019-12-28. Refresh now. Tools for package owners.