generator

package
v0.0.0-...-424d171 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package generator provides basic interface to log generators. It's primary job is to wrap specific implementations of log generators and provide a shared public interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	FunctionMap = template.FuncMap{
		"ToLower": strings.ToLower,
		"ToUpper": strings.ToUpper,
	}
)

Functions

func Register

func Register(name string, factory Factory) error

Register associates a generator name with the generator factory.

Types

type Factory

type Factory = func(*ucfg.Config) (Generator, error)

Factory is the function signature of each generators New function. Given a config it returns a generator or an error.

func GetFactory

func GetFactory(name string) (Factory, error)

GetFactory retrieves a factory for a given name, or returns an error if there isn't a factory associated with that name.

type Generator

type Generator interface {
	Next() ([]byte, error)
}

Generator is the interface that wraps the Next method.

Next generates the next log message and returns it as an array of bytes.

func New

func New(cfg *ucfg.Config) (Generator, error)

New creates a new instance of the generator that is specified by the "type" in the ucfg.Config that is passed in. If no matching generator is found for that type than an error is returned.

Directories

Path Synopsis
aws
firewall
Package firewall generates AWS Network Firewall log messages.
Package firewall generates AWS Network Firewall log messages.
vpcflow
Package vpcflow generates version 2 AWS vpcflow log messages
Package vpcflow generates version 2 AWS vpcflow log messages
Package cef implements the generator for generic CEF logs.
Package cef implements the generator for generic CEF logs.
cisco
asa
Package asa implements the generator for Cisco ASA logs.
Package asa implements the generator for Cisco ASA logs.
citrix
cef
Package cef implements the generator for Citrix CEF logs.
Package cef implements the generator for Citrix CEF logs.
Package clf generates Common Log Format (clf) log messages.
Package clf generates Common Log Format (clf) log messages.
fortinet
firewall
Package firewall generates Fortinet Firewall log messages
Package firewall generates Fortinet Firewall log messages
Package winlog generates Windows Event Log XML records.
Package winlog generates Windows Event Log XML records.

Jump to

Keyboard shortcuts

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