common

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CliHelpRequested    bool
	CliVersionRequested bool
)
View Source
var (
	ErrAlreadyClosed     = errors.New("already closed")
	ErrDoesContainBox    = errors.New("does contain box")
	ErrDoesNotContainBox = errors.New("does not contain box")
)

Functions

func BytesToUint16

func BytesToUint16(in []byte) uint16

func BytesToUint32

func BytesToUint32(in []byte) uint32

func BytesToUint64

func BytesToUint64(in []byte) uint64

func Close

func Close(what io.Closer) error

func ConcatBytes

func ConcatBytes(args ...interface{}) []byte

func Crc64Of

func Crc64Of(args ...interface{}) []byte

func IsDoesContainBox

func IsDoesContainBox(err error) bool

func IsDoesNotContainBox

func IsDoesNotContainBox(err error) bool

func MustRead

func MustRead(from io.Reader, to []byte)

func MustReadBytes

func MustReadBytes(from io.Reader, amount int) []byte

func MustWrite

func MustWrite(what []byte, to io.Writer)

func MustWritef

func MustWritef(to io.Writer, pattern string, args ...interface{})

func NewApp

func NewApp() *cli.App

func NewPathError

func NewPathError(operation string, path string, detail error) *os.PathError

func PosFileMode

func PosFileMode(v os.FileMode) *os.FileMode

func PtimeTime

func PtimeTime(v time.Time) *time.Time

func Read

func Read(from io.Reader, to []byte) error

func ReadBytes

func ReadBytes(from io.Reader, amount int) ([]byte, error)

func RunApp

func RunApp(a *cli.App)

func Seek

func Seek(to FileOffset, on io.Seeker) error

func ShowAppVersion

func ShowAppVersion(ctx *cli.Context) error

func Uint16ToBytes

func Uint16ToBytes(in uint16) []byte

func Uint32ToBytes

func Uint32ToBytes(in uint32) []byte

func Uint64ToBytes

func Uint64ToBytes(in uint64) []byte

func UnderlyingError

func UnderlyingError(err error) error

func Write

func Write(what []byte, to io.Writer) error

func Writef

func Writef(to io.Writer, pattern string, args ...interface{}) error

Types

type CliTime

type CliTime struct {
	*time.Time
}

func (*CliTime) Set

func (instance *CliTime) Set(plain string) error

func (CliTime) String

func (instance CliTime) String() string

type ExtendedFileInfo

type ExtendedFileInfo interface {
	FileInfo
	ChecksumString() string
}

type File

type File interface {
	io.Closer
	io.Reader
	io.Seeker
	Readdir(count int) ([]os.FileInfo, error)
	Stat() (os.FileInfo, error)
	GetFileInfo() (FileInfo, error)
}

type FileInfo added in v0.8.0

type FileInfo interface {
	os.FileInfo
	Path() string
}

type FileOffset

type FileOffset int64

type FilePredicate added in v0.6.0

type FilePredicate func(name string) (bool, error)

type FileSize

type FileSize int64

type OnClose

type OnClose func() error

Jump to

Keyboard shortcuts

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