pub

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DnstapFstrmControlHeaderSize = 42
	DnstapFstrmMsgHeaderSize     = 4
)
View Source
const DefaultFormat = "JSON/V1"

Variables

View Source
var DtapFrameFSContentType = []byte("protobuf:dtap.DtapFrame")

FSContentType is the FrameStream content type for dnstap protobuf data.

Functions

func RegisterPublisher

func RegisterPublisher(f Format, newFunc NewFormatFunc)

Types

type ConsumerHandler

type ConsumerHandler interface {
	Consumer([][]byte) error
}

type Format

type Format string
const FormatDNSTAP Format = "DNSTAP"
const FormatDtapFrame Format = "DTAPFrame"
const (
	FormatV1JSON Format = "JSON/V1"
)

type FstrmPublisher

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

func NewFstrmPublisher

func NewFstrmPublisher(maxSize int, intervalSec uint, handler PublisherHandler) *FstrmPublisher

func (*FstrmPublisher) Close

func (f *FstrmPublisher) Close() error

func (*FstrmPublisher) Publish

func (f *FstrmPublisher) Publish() error

func (*FstrmPublisher) Start

func (f *FstrmPublisher) Start()

func (*FstrmPublisher) Write

func (f *FstrmPublisher) Write(dm *types.DnstapMessage) error

type FstrmPublisherMarshaler

type FstrmPublisherMarshaler func(*types.DnstapMessage) ([]byte, error)

type JsonV1Publisher

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

func (*JsonV1Publisher) Close

func (f *JsonV1Publisher) Close() error

func (*JsonV1Publisher) Publish

func (f *JsonV1Publisher) Publish() error

func (*JsonV1Publisher) Start

func (f *JsonV1Publisher) Start()

func (*JsonV1Publisher) Write

func (f *JsonV1Publisher) Write(dm *types.DnstapMessage) error

type NewFormatFunc

type NewFormatFunc func(maxSize int, intervalSec uint, handler PublisherHandler) Publisher

type Publisher

type Publisher interface {
	Write(*types.DnstapMessage) error
	Start()
	Close() error
	Publish() error
}

func NewFstrmDNSTAPPublisher

func NewFstrmDNSTAPPublisher(maxSize int, intervalSec uint, handler PublisherHandler) Publisher

func NewFstrmDtapFramePublisher

func NewFstrmDtapFramePublisher(maxSize int, intervalSec uint, handler PublisherHandler) Publisher

func NewJsonV1Publisher

func NewJsonV1Publisher(maxSize int, intervalSec uint, handler PublisherHandler) Publisher

func NewPublisher

func NewPublisher(f Format, maxSize int, intervalSec uint, handler PublisherHandler) Publisher

type PublisherHandler

type PublisherHandler interface {
	Publish([]byte) error
}

Jump to

Keyboard shortcuts

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