util

package
v0.0.0-...-839106f Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UniqueMachineId = getUniqueMachineIdOrDie()

Functions

func CopyAndClose

func CopyAndClose(to io.WriteCloser, from io.ReadCloser) error

created this so that we can use defer for the reader, writer in for loops

func GetUniqueMachineId

func GetUniqueMachineId() (string, error)

func ListFilesRec

func ListFilesRec(basePath string) (ret map[RelPathType]LocalFileMeta, err error)

func PanicIf

func PanicIf(cond bool, msg string)

func PanicIfErr

func PanicIfErr(err error, msg string)

func PanicIfFalse

func PanicIfFalse(cond bool, msg string)

Types

type LocalFileMeta

type LocalFileMeta struct {
	BaseDir string
	RelPath RelPathType
	ModTime time.Time
	Md5sum  string // hex string of md5 hash
}

func GetLocalFileMeta

func GetLocalFileMeta(basePath, relPath string) (*LocalFileMeta, error)

type RelPathType

type RelPathType string

func (RelPathType) String

func (p RelPathType) String() string

Jump to

Keyboard shortcuts

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