Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalTimestamp(t float64) string
- func CheckNameFormat(req *http.Request, name string, target string) (string, error)
- func CollectRuntimeMetrics(statsdHost string, statsdPort, statsdPause int64, prefix string)
- func Copy(src io.Reader, dsts ...io.Writer) (written int64, err error)
- func CopyN(src io.Reader, n int64, dsts ...io.Writer) (written int64, err error)
- func FormatLastModified(lastModified time.Time) string
- func GetDefault(h http.Header, key string, dfl string) string
- func GetEpochFromTimestamp(timestamp string) (string, error)
- func GetTimestamp() string
- func GetTransactionId() string
- func HeaderGetDefault(h http.Header, key string, dfl string) string
- func Headers2Map(headers http.Header) map[string]string
- func IsOriginAllowed(allowedOriginHeader, requestOrigin string) bool
- func LooksTrue(check string) bool
- func Map2Headers(m map[string]string) http.Header
- func ParseContentTypeForSlo(contentType string, listedSize int64) (string, int64, error)
- func ParseDate(date string) (time.Time, error)
- func ParseIfMatch(s string) map[string]bool
- func ParseProxyPath(path string) (pathMap map[string]string, err error)
- func SliceFromCSV(csv string) []string
- func StandardizeTimestamp(timestamp string) (string, error)
- func StringInSlice(s string, slice []string) bool
- func UUID() string
- func Urlencode(str string) string
- type FreePool
- type HttpRange
- type KeyedLimit
- type MultiWriter
Constants ¶
const ONE_WEEK = 604800
Variables ¶
var GMT = time.FixedZone("GMT", 0)
var Version = "0.1"
Functions ¶
func CanonicalTimestamp ¶
func CheckNameFormat ¶
func CollectRuntimeMetrics ¶
func FormatLastModified ¶
func GetEpochFromTimestamp ¶
func GetTimestamp ¶
func GetTimestamp() string
func GetTransactionId ¶
func GetTransactionId() string
func IsOriginAllowed ¶
func ParseContentTypeForSlo ¶
func ParseIfMatch ¶
func ParseProxyPath ¶
will split out url path the proxy would receive and return map with keys: "vrs", "account", "container", "object"
func SliceFromCSV ¶
func StandardizeTimestamp ¶
func StringInSlice ¶
Types ¶
type FreePool ¶
func NewFreePool ¶
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) 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
}
MultiWriter is a streaming multipart writer, similar to the standard library's multipart.Writer, but compatible with Swift's output and with an API geared toward our common use, multi-range responses.
func NewMultiWriter ¶
func NewMultiWriter(w io.Writer, contentType string, contentLength int64) *MultiWriter
NewMultiWriter instantiates a new MultiWriter.
func (*MultiWriter) Boundary ¶
func (w *MultiWriter) Boundary() string
Boundary returns the MultiWriter's boundary string.
func (*MultiWriter) Close ¶
func (w *MultiWriter) Close() error
Close finalizes the output of the MultiWriter.
func (*MultiWriter) ContentLength ¶
func (w *MultiWriter) ContentLength() int64
ContentLength returns the expected Content-Length of the multipart body.
func (*MultiWriter) CreatePart ¶
func (w *MultiWriter) CreatePart(start, end int64) (io.Writer, error)
CreatePart begins a new part in the multi-part response, with the given content ranges.
func (*MultiWriter) Expect ¶
func (w *MultiWriter) Expect(start, end int64)
Expect adds an expected part to the Content-Length estimate for the multipart body.