common

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCreationTime added in v1.0.1

func GetCreationTime(path string) (time.Time, error)

func GetOwnerAndGroup added in v1.0.1

func GetOwnerAndGroup(path string) (uid, gid string, err error)

func HasPermissions added in v1.0.1

func HasPermissions(path string, perms os.FileMode) (bool, error)

HasPermissions checks if a file or directory has at least the specified permissions

func IsLessPermissiveThan added in v1.0.1

func IsLessPermissiveThan(path string, maxPerms os.FileMode) (bool, error)

IsLessPermissiveThan checks if a file or directory’s permissions are no more permissive than the given mode

func IsMorePermissiveThan added in v1.0.1

func IsMorePermissiveThan(path string, minPerms os.FileMode) (bool, error)

IsMorePermissiveThan checks if a file or directory’s permissions are at least as permissive as the given mode

func IsPathInBase

func IsPathInBase(path, baseDir string) (bool, error)

IsPathInBase checks if a path is within the base directory

func RelStartsWithParent

func RelStartsWithParent(rel string) bool

RelStartsWithParent checks if a relative path escapes the base directory

func SanitizePath added in v1.0.1

func SanitizePath(path string) (string, error)

SanitizePath removes redundant separators and resolves relative components in a path

Types

This section is empty.

Jump to

Keyboard shortcuts

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