utils

package
v0.0.0-...-b9e25f6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ContextDebugKey = "debug"
View Source
const ContextHistoryKey = "prevContext"
View Source
const (
	QidTimeOrigin = 167253120 // 2023-01-01T00:00:00Z
)

Variables

This section is empty.

Functions

func ContextHandleInterruptSignal

func ContextHandleInterruptSignal(ctx context.Context) context.Context

func ContextIsDebug

func ContextIsDebug(ctx context.Context) bool

func ContextPop

func ContextPop(ctx context.Context) context.Context

func ContextPush

func ContextPush(ctx context.Context) context.Context

func ContextSetDebug

func ContextSetDebug(parent context.Context, debug bool) context.Context

func ContextSetDebugAuto

func ContextSetDebugAuto(parent context.Context) context.Context

func GenerateQid

func GenerateQid(len int) string

func NewRangeReader

func NewRangeReader(r io.Reader, offset int64, length int64) (rr *rangeReader)

Types

type Range

type Range struct {
	From int64
	To   int64
}

func ParseHttpRangeHeader

func ParseHttpRangeHeader(s string) (r *Range, err error)

func (Range) HttpHeader

func (r Range) HttpHeader(size int64) string

func (Range) Length

func (r Range) Length() int64

func (*Range) Normalize

func (r *Range) Normalize(size int64) (err error)

type RangeError

type RangeError struct {
	Range Range
	// contains filtered or unexported fields
}

func (*RangeError) Error

func (re *RangeError) Error() string

Jump to

Keyboard shortcuts

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