utils

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILEPERM_755 = fileperms.FILEPERM_755
	FILEPERM_666 = fileperms.FILEPERM_666
)

FILEPERM_755 and FILEPERM_666 are kept here as aliases for existing consumers of this package; the canonical definitions live in internal/fileperms so they can be imported without an import cycle by packages this package itself depends on.

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 NetworkRetriesEnabled added in v0.17.0

func NetworkRetriesEnabled(config configuration.Configuration) bool

Keeps app.go's default-attempts policy and the retry-middleware transport-error policy from drifting apart.

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