shock

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2014 License: BSD-2-Clause Imports: 14 Imported by: 3 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) (int64, error)

source: http://stackoverflow.com/a/22259280 TODO this is not shock related, need another package

func FetchFile

func FetchFile(filename string, url string, token string, uncompress string) (size int64, err error)

fetch file by shock url

func FetchShockStream

func FetchShockStream(url string, token string) (r io.ReadCloser, err error)

func ShockDelete

func ShockDelete(host string, nodeid string, token string) (err error)

Types

type IdxInfo

type IdxInfo struct {
	Type        string `bson:"index_type" json:"-"`
	TotalUnits  int64  `bson:"total_units" json:"total_units"`
	AvgUnitSize int64  `bson:"average_unit_size" json:"average_unit_size"`
	Format      string `bson:"format" json:"-"`
}

type ShockClient

type ShockClient struct {
	Host  string
	Token string
}

TODO use Token

func (*ShockClient) Get_node_download_url

func (sc *ShockClient) Get_node_download_url(node ShockNode) (download_url string, err error)

func (*ShockClient) Get_request

func (sc *ShockClient) Get_request(resource string, query url.Values, response interface{}) (err error)

func (*ShockClient) Query

func (sc *ShockClient) Query(query url.Values) (sqr_p *ShockQueryResponse, err error)

example: query_response_p, err := sc.Shock_query(host, url.Values{"docker": {"1"}, "docker_image_name" : {"wgerlach/bowtie2:2.2.0"}});

type ShockNode

type ShockNode struct {
	Id         string             `bson:"id" json:"id"`
	Version    string             `bson:"version" json:"version"`
	File       shockfile          `bson:"file" json:"file"`
	Attributes interface{}        `bson:"attributes" json:"attributes"`
	Public     bool               `bson:"public" json:"public"`
	Indexes    map[string]IdxInfo `bson:"indexes" json:"indexes"`
	//Acl          Acl               `bson:"acl" json:"-"`
	//VersionParts map[string]string `bson:"version_parts" json:"-"`
	Tags []string `bson:"tags" json:"tags"`
	//Revisions    []ShockNode       `bson:"revisions" json:"-"`
	Linkages []linkage `bson:"linkage" json:"linkages"`
	//CreatedOn    time.Time `bson:"created_on" json:"created_on"`
	//LastModified time.Time `bson:"last_modified" json:"last_modified"`
	Type string `bson:"type" json:"type"`
}

func ShockGet

func ShockGet(host string, nodeid string, token string) (node *ShockNode, err error)

type ShockQueryResponse

type ShockQueryResponse struct {
	Code       int         `bson:"status" json:"status"`
	Data       []ShockNode `bson:"data" json:"data"`
	Errs       []string    `bson:"error" json:"error"`
	Limit      int         `bson:"limit" json:"limit"`
	Offset     int         `bson:"offset" json:"offset"`
	TotalCount int         `bson:"total_count" json:"total_count"`
}

type ShockResponse

type ShockResponse struct {
	Code int       `bson:"status" json:"status"`
	Data ShockNode `bson:"data" json:"data"`
	Errs []string  `bson:"error" json:"error"`
}

Jump to

Keyboard shortcuts

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