sandbox

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sandbox allows checking files before re-uploading them, so any given version of a file need only be uploaded once rather than being uploaded repeatedly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetList

func GetList() []string

GetList returns a list of the ids of all the sandboxes on the system.

func Purge added in v0.11.8

func Purge(olderThan time.Duration) (int, error)

Purge cleans out old sandboxes from the database older than the given duration.

Types

type ByDate added in v0.11.8

type ByDate []*Sandbox

ByDate is a type for sorting Sandboxes... by date.

func (ByDate) Len added in v0.11.8

func (a ByDate) Len() int

func (ByDate) Less added in v0.11.8

func (a ByDate) Less(i, j int) bool

func (ByDate) Swap added in v0.11.8

func (a ByDate) Swap(i, j int)

type Sandbox

type Sandbox struct {
	ID           string
	CreationTime time.Time
	Completed    bool
	Checksums    []string
}

Sandbox is a slice of checksums of files, marked completed once they've all been uploaded or if they've already been uploaded.

func AllSandboxes added in v0.5.2

func AllSandboxes() []*Sandbox

AllSandboxes returns all sandboxes on the server.

func Get

func Get(sandboxID string) (*Sandbox, error)

Get a sandbox.

func New

func New(checksumHash map[string]interface{}) (*Sandbox, error)

New creates a new sandbox, given a map of null values with file checksums as keys.

func (*Sandbox) Delete

func (s *Sandbox) Delete() error

Delete a sandbox.

func (*Sandbox) GetName

func (s *Sandbox) GetName() string

GetName returns the sandbox's id.

func (*Sandbox) IsComplete

func (s *Sandbox) IsComplete() error

IsComplete returns true if the sandbox is complete.

func (*Sandbox) Save

func (s *Sandbox) Save() error

Save the sandbox.

func (*Sandbox) URLType

func (s *Sandbox) URLType() string

URLType returns the base element of a sandbox's URL.

func (*Sandbox) UploadChkList

func (s *Sandbox) UploadChkList() map[string]map[string]interface{}

UploadChkList builds the list of file checksums and whether or not they need to be uploaded. If they do, the upload URL is also provided.

Jump to

Keyboard shortcuts

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