registry

package
v0.0.0-...-5a3c2f8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package registry - Reference: http://stackoverflow.com/questions/28001872/golang-events-eventemitter-dispatcher-for-plugin-architecture

Index

Constants

This section is empty.

Variables

View Source
var AnalysisPlugins []AnalysisPlugin

AnalysisPlugins is the iterable collection of all active plugins

Functions

func CalculateBasicHashes

func CalculateBasicHashes(rd io.Reader) (sampledb.HashInfo, error)

CalculateBasicHashes uses a multiWriter to efficiently calculate file hashes REF: http://marcio.io/2015/07/calculating-multiple-file-hashes-in-a-single-pass/

func MagicFromFile

func MagicFromFile(path string) string

MagicFromFile returns a magic string for the file in the given path.

func PluginIterator

func PluginIterator(fiev sampledb.FileInfoEvent, s submitter.Submitter, uploader *uploader.Uploader) error

PluginIterator opens a given sample file and processes it with all registered plugins.

func RegisterAnalysisPlugin

func RegisterAnalysisPlugin(p AnalysisPlugin)

RegisterAnalysisPlugin makes an enrichment plugin available for usage

Types

type AnalysisPlugin

type AnalysisPlugin interface {
	Name() string
	ReInitialize() error
	ProcessFile(FileSample) (string, bool, error)
}

AnalysisPlugin defines the high level functions every EnrichPlugin has to provide.

type FileSample

type FileSample struct {
	FD       uintptr
	Info     os.FileInfo
	OrigPath string
}

FileSample is the struct passed to every plugin to handle the sample

Jump to

Keyboard shortcuts

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