services

package
v0.0.0-...-79e9ee9 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2015 License: MPL-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketLister

type BucketLister struct {
	Bucket string

	Session *session.Session
	// contains filtered or unexported fields
}

BucketLister is a directory listing service for S3

func NewBucketLister

func NewBucketLister(bucket, prefix string, awsConfig *aws.Config) *BucketLister

NewBucketLister returns a *BucketLister

prefix is the starting point for this lister

func (*BucketLister) AddBucketLister

func (b *BucketLister) AddBucketLister(child *BucketLister)

AddBucketLister adds a lister to the root lister

If a lister is attached, it will show up as a directory link

func (*BucketLister) Empty

func (b *BucketLister) Empty() (bool, error)

Empty returns true if the bucket contains zero keys

func (*BucketLister) Mount

func (b *BucketLister) Mount() string

Mount returns the mount point of this lister

func (*BucketLister) ServeHTTP

func (b *BucketLister) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler

type File

type File struct {
	Name         string    `json:"name"`
	LastModified time.Time `json:"last_modified"`
	Size         int64     `json:"size"`
}

File represents an object in a PrefixListing

func (*File) Base

func (f *File) Base() string

func (*File) BaseEscaped

func (f *File) BaseEscaped() string

func (*File) LastModifiedString

func (f *File) LastModifiedString() string

func (*File) SizeString

func (f *File) SizeString() string

type Prefix

type Prefix string

Prefix represents a prefix path

func (Prefix) Escaped

func (p Prefix) Escaped() string

Escaped returns prefix escaped with special s3 rules

func (Prefix) URLEscaped

func (p Prefix) URLEscaped() string

URLEscaped returns prefix url encoded

type PrefixListing

type PrefixListing struct {
	Prefixes []string `json:"prefixes"`
	Files    []*File  `json:"files"`
}

PrefixListing is a compact listing of an S3 prefix

func (*PrefixListing) HasFile

func (p *PrefixListing) HasFile(key string) *File

HasFile returns *File if file exists in listing

func (*PrefixListing) PrefixStructs

func (p *PrefixListing) PrefixStructs() []Prefix

PrefixStructs returns prefix objects

type SortMountedAt

type SortMountedAt []*BucketLister

SortMountedAt sorts a slice of bucketlisters by mountedAt

func (SortMountedAt) Len

func (s SortMountedAt) Len() int

func (SortMountedAt) Less

func (s SortMountedAt) Less(i, j int) bool

func (SortMountedAt) Swap

func (s SortMountedAt) Swap(i, j int)

Jump to

Keyboard shortcuts

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