utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 10 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 CreateFilePath

func CreateFilePath(path string) error

func FullPathInSnykCacheDir

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

func IsCiEnvironment

func IsCiEnvironment() bool

func MergeMaps

func MergeMaps[K comparable, V any](mapA map[K]V, mapB map[K]V) map[K]V

func SnykCacheDir

func SnykCacheDir() (string, error)

func SnykCacheDirImpl

func SnykCacheDirImpl(osUtil SnykOSUtil) (string, error)

func SnykTempDirectory

func SnykTempDirectory(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
	GetWriter() io.Writer
}

func NewOutputDestination

func NewOutputDestination() OutputDestination

type OutputDestinationImpl

type OutputDestinationImpl struct{}

func (*OutputDestinationImpl) GetWriter

func (odi *OutputDestinationImpl) GetWriter() io.Writer

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 SnykOSUtil

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

func NewSnykOSUtil

func NewSnykOSUtil() SnykOSUtil

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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