utils

package
v0.0.0-...-ff000d2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandPath

func ExpandPath(path string) (string, error)

func ExportData

func ExportData(events []data.Event, format string, fileName string) error

func FilterEvents

func FilterEvents(params data.ParseParams, events []data.Event) []data.Event

func GenerateReport

func GenerateReport(events []data.Event, fn string) error

func GetActionType

func GetActionType(logLine string) data.ActionType

func GetHostKeyCallback

func GetHostKeyCallback(insecure bool) (ssh.HostKeyCallback, error)

GetHostKeyCallback returns appropriate SSH host key callback based on security settings If insecure is true, returns InsecureIgnoreHostKey (NOT RECOMMENDED) Otherwise, attempts to use known_hosts file for verification

func GetSSHAuthMethods

func GetSSHAuthMethods(keyPath string, password string) ([]ssh.AuthMethod, error)

GetSSHAuthMethods returns SSH authentication methods based on provided credentials

func IsInWhiteList

func IsInWhiteList(serial string) bool

func LoadSSHPrivateKey

func LoadSSHPrivateKey(keyPath string, passphrase []byte) (ssh.Signer, error)

LoadSSHPrivateKey loads SSH private key from file Supports RSA, ECDSA, ED25519 keys with or without passphrase

func LoadWhiteList

func LoadWhiteList(wlPath string) error

func PrintEvents

func PrintEvents(e []data.Event)

func RemoveDuplicates

func RemoveDuplicates(events []data.Event) []data.Event

func Submatch

func Submatch(r *regexp.Regexp, logLine string, idx int) string

func TimeStampToTime

func TimeStampToTime(timeStampString string) time.Time

Types

type Serial

type Serial struct {
	Serial     string
	IsIgnore   bool
	Commentary string
}

func WhiteListSerialInfo

func WhiteListSerialInfo(serial string) *Serial

Jump to

Keyboard shortcuts

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