Documentation
¶
Index ¶
- type TempDir
- func (td *TempDir) CreateTempFileRandom(elems ...string) (*os.File, func(), error)
- func (td *TempDir) JoinPath(elems ...string) string
- func (td *TempDir) MkdirAllSub(dir string) (string, error)
- func (td *TempDir) MkdirTempRandom(elems ...string) (string, func(), error)
- func (td *TempDir) RemoveOutdated(d time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TempDir ¶
type TempDir struct {
// contains filtered or unexported fields
}
func New ¶
New create a new TempDir instance, "base" must be an existing directory, "sub" could be a multi-level directory and will be created if not exist
func (*TempDir) CreateTempFileRandom ¶
CreateTempFileRandom works like os.CreateTemp, the last path field is the "pattern"
func (*TempDir) MkdirAllSub ¶
MkdirAllSub works like os.MkdirAll, but the base directory must exist
func (*TempDir) MkdirTempRandom ¶
MkdirTempRandom works like os.MkdirTemp, the last path field is the "pattern"
func (*TempDir) RemoveOutdated ¶
Click to show internal directories.
Click to hide internal directories.