util

package
v0.0.0-...-ca41431 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortFileInfosByName

func SortFileInfosByName(fis []os.FileInfo)

SortFileInfosByName sorts fis by name, alphabetically.

func WriteKeyTempFile

func WriteKeyTempFile(namePrefix string, keyData []byte) (filename string, tmp *os.File, err error)

WriteKeyTempFile writes data to a temp file whose filename contains some function of namePrefix. On Linux, the temp file is unlinked and the filename by which to access it is /proc/self/fd/N, where N is the fd of the file. The caller should call the Remove method on the returned File when done using it.

Types

type FileInfo

type FileInfo struct {
	Name_    string
	Mode_    os.FileMode
	Size_    int64
	ModTime_ time.Time
	Sys_     interface{}
}

FileInfo implements os.FileInfo.

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() interface{}

type NopCloser

type NopCloser struct {
	io.ReadSeeker
}

NopCloser wraps an io.ReadSeeker to add a no-op Close method.

func (NopCloser) Close

func (nc NopCloser) Close() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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