utils

package
v0.0.0-...-a5f9fc7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILEPERM_755 fs.FileMode = 0755 // Owner=rwx, Group=r-x, Other=r-x
	FILEPERM_666 fs.FileMode = 0666 // Owner=rw-, Group=rw-, Other=rw-
)

Variables

This section is empty.

Functions

func FullPathInVulnmapCacheDir

func FullPathInVulnmapCacheDir(cacheDir string, filename string) (string, error)

func VulnmapCacheDir

func VulnmapCacheDir() (string, error)

func VulnmapCacheDirImpl

func VulnmapCacheDirImpl(osUtil VulnmapOSUtil) (string, error)

func VulnmapTempDirectory

func VulnmapTempDirectory(debugLogger *log.Logger) (string, error)

Types

type OutputDestination

type OutputDestination interface {
	Println(a ...any) (n int, err error)
	Remove(name string) error
	WriteFile(filename string, data []byte, perm fs.FileMode) error
}

func NewOutputDestination

func NewOutputDestination() OutputDestination

type OutputDestinationImpl

type OutputDestinationImpl struct{}

func (*OutputDestinationImpl) Println

func (odi *OutputDestinationImpl) Println(a ...any) (n int, err error)

func (*OutputDestinationImpl) Remove

func (odi *OutputDestinationImpl) Remove(name string) error

func (*OutputDestinationImpl) WriteFile

func (odi *OutputDestinationImpl) WriteFile(filename string, data []byte, perm fs.FileMode) error

type ToLog

type ToLog struct {
	Logger *log.Logger
}

ToLog is an io.Writer that can be used to write into a log.Logger, for example into an existing zerolog.Logger

func (*ToLog) Write

func (w *ToLog) Write(p []byte) (n int, err error)

type ToZeroLogDebug

type ToZeroLogDebug struct {
	Logger *zerolog.Logger
}

ToZeroLogDebug is an io.Writer that can be used for example with log.Logger to write to an existing zerolog writer

func (*ToZeroLogDebug) Write

func (w *ToZeroLogDebug) Write(p []byte) (n int, err error)

Write writes debug messages to the given zerolog logger

type VulnmapOSUtil

type VulnmapOSUtil interface {
	UserCacheDir() (string, error)
	MkdirAll(path string, perm os.FileMode) error
	Stat(name string) (os.FileInfo, error)
	TempDir() string
}

func NewVulnmapOSUtil

func NewVulnmapOSUtil() VulnmapOSUtil

Jump to

Keyboard shortcuts

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