nats

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxPayloadSize = 1024 * 1024
View Source
const DnstapFstrmControlHeaderSize = 42
View Source
const DnstapFstrmMsgHeaderSize = 4

Variables

This section is empty.

Functions

func Setup

func Setup(bs json.RawMessage) (types.OutputPlugin, error)

Types

type Nats

type Nats struct {
	plugin.PluginCommon
	sync.Mutex

	*output.DnstapOutput

	// Hosts is the URL of the nats servers. Must not be empty.
	Hosts []string
	// Nats subject. Must not be empty.
	Subject string

	// Nats user, If a token is given, it is not used.
	User string
	// Nats password, If a token is given, it is not used.
	Password string
	// Nats token
	Token string

	// Max nats message size. Default is 1KByte.
	MaxSize int
	// Interval to flush nats messages.
	IntervalSec uint
	// Nats message format.
	Format pub.Format
	// contains filtered or unexported fields
}

The nats plugin outputs messages to the nats server. DTAPFrame or DNSTAP messages are taken from the Output Buffer and pushed together to the nats server. The timing of the push is when the size of the nats message is exceeded or when the number of seconds specified by IntervalSec elapses.

func (*Nats) Close

func (f *Nats) Close()

func (*Nats) Open

func (f *Nats) Open() error

func (*Nats) Publish

func (f *Nats) Publish(data []byte) error

func (*Nats) SetOutputContext

func (f *Nats) SetOutputContext(oc *types.OutputContext)

func (*Nats) Write

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

Jump to

Keyboard shortcuts

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