http

package
v2.0.5-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeaderToMap

func HeaderToMap(header http.Header) map[string]string

HeaderToMap coverts request headers to map[string]string.

func MapToHeader

func MapToHeader(m map[string]string) http.Header

MapToHeader coverts map[string]string to request headers.

func PickHeader

func PickHeader(header http.Header, key, defaultValue string) string

PickHeader pick header with key.

Types

type Range

type Range struct {
	StartIndex uint64 `json:"start_index"`
	EndIndex   uint64 `json:"end_index"`
}

func GetRange

func GetRange(rangeStr string) (r *Range, err error)

GetRange parses Range according to range string. rangeStr: "start-end"

func ParseRange

func ParseRange(rangeStr string, length uint64) (*Range, error)

ParseRange parses the start and the end from rangeStr and returns them. length is file total length

func (Range) Length

func (r Range) Length() uint64

func (Range) String

func (r Range) String() string

Jump to

Keyboard shortcuts

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