memdir

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memdir is used to create temporary directories while writing to the filesystem to handle security and concurrency issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScopedPath

func ScopedPath(path, subPath string) (string, error)

ScopedPath joins path with subpath, returning the result if and only if it is still within the original path. (Security measure to prevent '..' shenanigans)

Types

type SubPath

type SubPath struct {
	// contains filtered or unexported fields
}

func NewSubPath

func NewSubPath(subPath string) SubPath

func (SubPath) Extract

func (s SubPath) Extract(srcPath, dstPath string) error

type TmpDir

type TmpDir struct {
	// contains filtered or unexported fields
}

func NewTmpDir

func NewTmpDir(id string) *TmpDir

func (*TmpDir) Create

func (d *TmpDir) Create() error

func (*TmpDir) Path

func (d *TmpDir) Path() string

func (*TmpDir) Remove

func (d *TmpDir) Remove() error

Jump to

Keyboard shortcuts

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