base

package
v3.8.31 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-2-Clause, BSD-2-Clause Imports: 24 Imported by: 0

Documentation

Overview

************************************************************************

  • Copyright 2018 Gravwell, Inc. All rights reserved.
  • Contact: <legal@gravwell.io> *
  • This software may be modified and distributed under the terms of the
  • BSD 2-clause license. See the LICENSE file for details. *************************************************************************

************************************************************************

  • Copyright 2018 Gravwell, Inc. All rights reserved.
  • Contact: <legal@gravwell.io> *
  • This software may be modified and distributed under the terms of the
  • BSD 2-clause license. See the LICENSE file for details. *************************************************************************

************************************************************************

  • Copyright 2018 Gravwell, Inc. All rights reserved.
  • Contact: <legal@gravwell.io> *
  • This software may be modified and distributed under the terms of the
  • BSD 2-clause license. See the LICENSE file for details. *************************************************************************

Index

Constants

View Source
const (
	TS_SIZE int = 12
)

Variables

This section is empty.

Functions

func OneShot

func OneShot(conn GeneratorConn, tag entry.EntryTag, src net.IP, cfg GeneratorConfig, dg DataGen, f Finalizer) (totalCount, totalBytes uint64, err error)

func Stream

func Stream(conn GeneratorConn, tag entry.EntryTag, src net.IP, cfg GeneratorConfig, dg DataGen, f Finalizer) (totalCount, totalBytes uint64, err error)

Types

type DataGen

type DataGen func(time.Time) []byte

type Finalizer added in v3.8.17

type Finalizer func(*entry.Entry)

type GeneratorConfig

type GeneratorConfig struct {
	ChaosTimestamps bool
	ChaosMode       bool
	ChaosWorkers    int
	Raw             string
	HEC             string
	Streaming       bool
	Compression     bool
	Tag             string
	ConnSet         []string
	Auth            string
	Tenant          string
	Count           uint64
	Duration        time.Duration
	Start           time.Time
	SRC             net.IP
	Logger          *log.Logger
	LogLevel        log.Level
	// contains filtered or unexported fields
}

func GetGeneratorConfig

func GetGeneratorConfig(defaultTag string) (gc GeneratorConfig, err error)

type GeneratorConn

type GeneratorConn interface {
	Close() error
	GetTag(string) (entry.EntryTag, error)
	NegotiateTag(string) (entry.EntryTag, error)
	LookupTag(entry.EntryTag) (string, bool)
	WaitForHot(time.Duration) error
	Write(entry.Timestamp, entry.EntryTag, []byte) error
	WriteBatch([]*entry.Entry) error
	WriteEntry(*entry.Entry) error
	Sync(time.Duration) error
	SourceIP() (net.IP, error)
}

func NewIngestMuxer

func NewIngestMuxer(name, guid string, gc GeneratorConfig, to time.Duration) (conn GeneratorConn, src net.IP, err error)

type RawConn

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

func (*RawConn) Close

func (rc *RawConn) Close() (err error)

func (*RawConn) GetTag

func (rc *RawConn) GetTag(v string) (tag entry.EntryTag, err error)

func (*RawConn) LookupTag

func (rc *RawConn) LookupTag(tag entry.EntryTag) (string, bool)

func (*RawConn) NegotiateTag

func (rc *RawConn) NegotiateTag(v string) (tag entry.EntryTag, err error)

func (*RawConn) SourceIP

func (rc *RawConn) SourceIP() (net.IP, error)

func (*RawConn) Sync

func (rc *RawConn) Sync(time.Duration) error

func (*RawConn) WaitForHot

func (rc *RawConn) WaitForHot(time.Duration) error

func (*RawConn) Write

func (rc *RawConn) Write(ts entry.Timestamp, tag entry.EntryTag, data []byte) error

func (*RawConn) WriteBatch

func (rc *RawConn) WriteBatch(ents []*entry.Entry) error

func (*RawConn) WriteEntry

func (rc *RawConn) WriteEntry(ent *entry.Entry) error

Jump to

Keyboard shortcuts

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