callbacks

package
v0.0.0-...-4ffc68c Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileHandle

func GetFileHandle(filename string) (io.WriteCloser, error)

Returns the filehandle for callback if filename is empty or "-" it will output to stdout otherwise it will write to a file of the given name

Types

type AnalyserFormatType

type AnalyserFormatType struct {
	Data any    `json:"data"`
	ID   string `json:"id"`
}

type Callback

type Callback interface {
	Call(OutputType, string) error
	CleanUp() error
	// contains filtered or unexported methods
}

type FileCallBack

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

func NewFileCallback

func NewFileCallback(fileHandle io.WriteCloser, format OutputFormat) FileCallBack

func SetupCallback

func SetupCallback(filename string, format OutputFormat) (FileCallBack, error)

SetupCallback returns a FileCallback if filename is empty or "-" it will output to stdout otherwise it will write to a file of the given name

func (FileCallBack) Call

func (c FileCallBack) Call(output OutputType, tag string) error

func (FileCallBack) CleanUp

func (c FileCallBack) CleanUp() error

type OutputFormat

type OutputFormat int
const (
	Raw OutputFormat = iota
	AnalyserJSON
)

type OutputType

type OutputType interface {
	GetAnalyserFormat() ([]*AnalyserFormatType, error)
}

Jump to

Keyboard shortcuts

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