base

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackgroudReqID

func BackgroudReqID(prefix string) string

func FixHttpRange

func FixHttpRange(start, end int64, size int64) (from, to int64, err error)

convert [start, end] => [from , to )

func GenMetric

func GenMetric(stat interface{}) (map[string]float64, error)

func IsEIO

func IsEIO(err error) bool

func IsEmptyDisk

func IsEmptyDisk(filename string) (bool, error)

func IsFileExists

func IsFileExists(filename string) (bool, error)

func ParseHttpRangeStr

func ParseHttpRangeStr(rangeBytesStr string) (start int64, end int64, err error)

parse rangeStr to => [start, end]

Types

type Reader

type Reader struct {
	io.ReaderAt
	Offset int64
}

func (*Reader) Read

func (p *Reader) Read(val []byte) (n int, err error)

type TimeReader

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

func NewTimeReader

func NewTimeReader(reader io.Reader) *TimeReader

func (*TimeReader) Duration

func (r *TimeReader) Duration() time.Duration

func (*TimeReader) Read

func (r *TimeReader) Read(p []byte) (n int, err error)

type TimeWriter

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

func NewTimeWriter

func NewTimeWriter(writer io.Writer) *TimeWriter

func (*TimeWriter) Duration

func (r *TimeWriter) Duration() time.Duration

func (*TimeWriter) Write

func (r *TimeWriter) Write(p []byte) (n int, err error)

type Writer

type Writer struct {
	io.WriterAt
	Offset int64
}

func (*Writer) Write

func (p *Writer) Write(val []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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