util

package
v0.0.0-...-dc1fca4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MD5String

func MD5String(s string) string

func OpenS3Key

func OpenS3Key(bucket, key string, srcCompressed bool) (io.ReadCloser, error)

func SizePretty

func SizePretty(raw int64) string

Types

type FileCache

type FileCache struct {
	Root          string
	Key           string
	Source        Source
	SrcCompressed bool
}

func (*FileCache) Open

func (f *FileCache) Open() (io.ReadCloser, error)

type GzipFileCloser

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

func (*GzipFileCloser) Close

func (f *GzipFileCloser) Close() error

func (*GzipFileCloser) Read

func (f *GzipFileCloser) Read(b []byte) (int, error)

type Progress

type Progress struct {
	Total     int64
	Writer    io.Writer
	Frequency time.Duration
	Suffix    chan string
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress() *Progress

func (*Progress) Close

func (p *Progress) Close() error

func (*Progress) Start

func (p *Progress) Start() chan int64

type ProgressWriter

type ProgressWriter struct {
	Writer io.Writer
	// contains filtered or unexported fields
}

func NewProgressWriter

func NewProgressWriter(w io.Writer) *ProgressWriter

func (*ProgressWriter) Close

func (w *ProgressWriter) Close() error

func (*ProgressWriter) Write

func (w *ProgressWriter) Write(b []byte) (int, error)

type S3Resource

type S3Resource struct {
	Key           string
	Bucket        string
	SrcCompressed bool
}

func (*S3Resource) Cacher

func (s *S3Resource) Cacher() *FileCache

type Source

type Source interface {
	Open() (io.Reader, error)
	Size() (int64, error)
}

func S3Reader

func S3Reader(bucket, key string) Source

Jump to

Keyboard shortcuts

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