common

package
v0.0.0-...-6bbe1e0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ONE_WEEK = 604800

Variables

View Source
var GMT = time.FixedZone("GMT", 0)
View Source
var Version = "0.1"

Functions

func CanonicalTimestamp

func CanonicalTimestamp(t float64) string

func CheckNameFormat

func CheckNameFormat(req *http.Request, name string, target string) (string, error)

func CollectRuntimeMetrics

func CollectRuntimeMetrics(statsdHost string, statsdPort, statsdPause int64, prefix string)

func Copy

func Copy(src io.Reader, dsts ...io.Writer) (written int64, err error)

func CopyN

func CopyN(src io.Reader, n int64, dsts ...io.Writer) (written int64, err error)

func FormatLastModified

func FormatLastModified(lastModified time.Time) string

func GetDefault

func GetDefault(h http.Header, key string, dfl string) string

func GetEpochFromTimestamp

func GetEpochFromTimestamp(timestamp string) (string, error)

func GetTimestamp

func GetTimestamp() string

func GetTransactionId

func GetTransactionId() string

func HeaderGetDefault

func HeaderGetDefault(h http.Header, key string, dfl string) string

func Headers2Map

func Headers2Map(headers http.Header) map[string]string

func LooksTrue

func LooksTrue(check string) bool

func Map2Headers

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

func ParseContentTypeForSlo

func ParseContentTypeForSlo(contentType string, listedSize int64) (string, int64, error)

func ParseDate

func ParseDate(date string) (time.Time, error)

func ParseProxyPath

func ParseProxyPath(path string) (pathMap map[string]string, err error)

will split out url path the proxy would receive and return map with keys: "vrs", "account", "container", "object"

func SetRlimits

func SetRlimits()

func SliceFromCSV

func SliceFromCSV(csv string) []string

func StandardizeTimestamp

func StandardizeTimestamp(timestamp string) (string, error)

func StringInSlice

func StringInSlice(s string, slice []string) bool

func UUID

func UUID() string

func Urlencode

func Urlencode(str string) string

Types

type FreePool

type FreePool []*unsafe.Pointer

func NewFreePool

func NewFreePool(size int) FreePool

func (FreePool) Get

func (a FreePool) Get() interface{}

func (FreePool) Put

func (a FreePool) Put(v interface{})

type HttpRange

type HttpRange struct {
	Start, End int64
}

func ParseRange

func ParseRange(rangeHeader string, fileSize int64) (reqRanges []HttpRange, err error)

type KeyedLimit

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

More like a map of semaphores. I don't know what to call it.

func NewKeyedLimit

func NewKeyedLimit(limitPerKey int64, totalLimit int64) *KeyedLimit

func (*KeyedLimit) Acquire

func (k *KeyedLimit) Acquire(key string, force bool) int64

func (*KeyedLimit) Keys

func (k *KeyedLimit) Keys() []string

func (*KeyedLimit) Lock

func (k *KeyedLimit) Lock(key string)

func (*KeyedLimit) MarshalJSON

func (k *KeyedLimit) MarshalJSON() ([]byte, error)

func (*KeyedLimit) Release

func (k *KeyedLimit) Release(key string)

func (*KeyedLimit) Unlock

func (k *KeyedLimit) Unlock(key string)

type MultiWriter

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

func NewMultiWriter

func NewMultiWriter(w io.Writer) *MultiWriter

func (*MultiWriter) Boundary

func (w *MultiWriter) Boundary() string

func (*MultiWriter) Close

func (w *MultiWriter) Close() error

func (*MultiWriter) CreatePart

func (w *MultiWriter) CreatePart(header textproto.MIMEHeader) (io.Writer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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