├── manifest ├── doc.go ├── versioned.go └── schema1 │ └── verify.go ├── Godeps ├── _workspace │ ├── .gitignore │ └── src │ │ ├── github.com │ │ ├── Sirupsen │ │ │ └── logrus │ │ │ │ ├── .gitignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── terminal_openbsd.go │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── terminal_linux.go │ │ │ │ ├── terminal_darwin.go │ │ │ │ ├── terminal_freebsd.go │ │ │ │ ├── hooks │ │ │ │ ├── syslog │ │ │ │ │ ├── README.md │ │ │ │ │ └── syslog_test.go │ │ │ │ └── papertrail │ │ │ │ │ └── papertrail_test.go │ │ │ │ ├── terminal_notwindows.go │ │ │ │ ├── writer.go │ │ │ │ ├── terminal_windows.go │ │ │ │ ├── examples │ │ │ │ ├── hook │ │ │ │ │ └── hook.go │ │ │ │ └── basic │ │ │ │ │ └── basic.go │ │ │ │ ├── json_formatter.go │ │ │ │ ├── LICENSE │ │ │ │ ├── hooks.go │ │ │ │ └── entry_test.go │ │ ├── bradfitz │ │ │ └── http2 │ │ │ │ ├── .gitignore │ │ │ │ ├── h2demo │ │ │ │ ├── rootCA.srl │ │ │ │ ├── .gitignore │ │ │ │ ├── Makefile │ │ │ │ ├── README │ │ │ │ └── server.crt │ │ │ │ ├── Makefile │ │ │ │ ├── HACKING │ │ │ │ ├── LICENSE │ │ │ │ ├── README │ │ │ │ ├── pipe_test.go │ │ │ │ ├── errors_test.go │ │ │ │ ├── AUTHORS │ │ │ │ ├── gotrack_test.go │ │ │ │ ├── CONTRIBUTORS │ │ │ │ └── pipe.go │ │ ├── yvasiyarov │ │ │ ├── gorelic │ │ │ │ ├── .travis.yml │ │ │ │ ├── .gitignore │ │ │ │ ├── doc.go │ │ │ │ ├── nut.json │ │ │ │ └── examples │ │ │ │ │ └── example1.go │ │ │ ├── newrelic_platform_go │ │ │ │ ├── .travis.yml │ │ │ │ ├── doc.go │ │ │ │ ├── nut.json │ │ │ │ ├── README.md │ │ │ │ ├── agent.go │ │ │ │ └── metrica.go │ │ │ └── go-metrics │ │ │ │ ├── runtime_no_cgo.go │ │ │ │ ├── runtime_cgo.go │ │ │ │ ├── .gitignore │ │ │ │ ├── writer_test.go │ │ │ │ ├── cmd │ │ │ │ ├── never-read │ │ │ │ │ └── never-read.go │ │ │ │ └── metrics-bench │ │ │ │ │ └── metrics-bench.go │ │ │ │ ├── metrics.go │ │ │ │ ├── opentsdb_test.go │ │ │ │ ├── graphite_test.go │ │ │ │ ├── json_test.go │ │ │ │ ├── gauge_test.go │ │ │ │ ├── gauge_float64_test.go │ │ │ │ └── debug_test.go │ │ ├── ncw │ │ │ └── swift │ │ │ │ ├── .gitignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── compatibility_1_1.go │ │ │ │ ├── compatibility_1_0.go │ │ │ │ ├── watchdog_reader.go │ │ │ │ └── COPYING │ │ ├── gorilla │ │ │ ├── context │ │ │ │ ├── .travis.yml │ │ │ │ └── README.md │ │ │ ├── mux │ │ │ │ ├── .travis.yml │ │ │ │ ├── README.md │ │ │ │ └── bench_test.go │ │ │ └── handlers │ │ │ │ └── .travis.yml │ │ ├── noahdesu │ │ │ └── go-ceph │ │ │ │ └── rados │ │ │ │ └── doc.go │ │ ├── mitchellh │ │ │ └── mapstructure │ │ │ │ ├── .travis.yml │ │ │ │ ├── mapstructure_bugs_test.go │ │ │ │ ├── LICENSE │ │ │ │ └── error.go │ │ ├── spf13 │ │ │ ├── pflag │ │ │ │ ├── .travis.yml │ │ │ │ └── export_test.go │ │ │ └── cobra │ │ │ │ ├── .travis.yml │ │ │ │ └── .gitignore │ │ ├── docker │ │ │ ├── libtrust │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── doc.go │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── util_test.go │ │ │ │ ├── README.md │ │ │ │ └── filter.go │ │ │ └── docker │ │ │ │ └── pkg │ │ │ │ └── tarsum │ │ │ │ ├── testdata │ │ │ │ ├── xattr │ │ │ │ │ └── layer.tar │ │ │ │ └── 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158 │ │ │ │ │ └── json │ │ │ │ ├── writercloser.go │ │ │ │ └── builder_context.go │ │ ├── bugsnag │ │ │ ├── panicwrap │ │ │ │ ├── monitor_windows.go │ │ │ │ ├── LICENSE │ │ │ │ └── monitor.go │ │ │ ├── bugsnag-go │ │ │ │ ├── errors │ │ │ │ │ └── README.md │ │ │ │ ├── .travis.yml │ │ │ │ ├── panicwrap.go │ │ │ │ ├── LICENSE.txt │ │ │ │ └── json_tags.go │ │ │ └── osext │ │ │ │ ├── osext_plan9.go │ │ │ │ ├── osext_procfs.go │ │ │ │ ├── osext_windows.go │ │ │ │ ├── LICENSE │ │ │ │ └── osext.go │ │ ├── golang │ │ │ └── protobuf │ │ │ │ ├── AUTHORS │ │ │ │ ├── CONTRIBUTORS │ │ │ │ └── .gitignore │ │ ├── stevvooe │ │ │ └── resumable │ │ │ │ ├── README.md │ │ │ │ ├── sha512 │ │ │ │ └── sha512block_decl.go │ │ │ │ ├── sha256 │ │ │ │ └── sha256block_decl.go │ │ │ │ └── .gitignore │ │ ├── AdRoll │ │ │ └── goamz │ │ │ │ ├── cloudfront │ │ │ │ ├── testdata │ │ │ │ │ └── key.pub │ │ │ │ └── cloudfront_test.go │ │ │ │ ├── s3 │ │ │ │ └── export_test.go │ │ │ │ └── aws │ │ │ │ └── export_test.go │ │ ├── denverdino │ │ │ └── aliyungo │ │ │ │ ├── oss │ │ │ │ ├── config_test.go │ │ │ │ └── export.go │ │ │ │ └── util │ │ │ │ ├── signature_test.go │ │ │ │ ├── util_test.go │ │ │ │ ├── iso6801_test.go │ │ │ │ └── signature.go │ │ ├── Azure │ │ │ └── azure-sdk-for-go │ │ │ │ ├── .gitignore │ │ │ │ └── .travis.yml │ │ ├── inconshreveable │ │ │ └── mousetrap │ │ │ │ ├── trap_others.go │ │ │ │ ├── LICENSE │ │ │ │ └── README.md │ │ └── garyburd │ │ │ └── redigo │ │ │ └── redis │ │ │ └── test_test.go │ │ ├── gopkg.in │ │ ├── check.v1 │ │ │ ├── .gitignore │ │ │ ├── TODO │ │ │ ├── export_test.go │ │ │ └── README.md │ │ └── yaml.v2 │ │ │ └── suite_test.go │ │ ├── google.golang.org │ │ ├── api │ │ │ ├── .hgtags │ │ │ ├── TODO │ │ │ ├── lib │ │ │ │ └── codereview │ │ │ │ │ └── codereview.cfg │ │ │ ├── examples │ │ │ │ ├── gopher.png │ │ │ │ ├── tasks.go │ │ │ │ └── drive.go │ │ │ ├── .hgignore │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── googleapi │ │ │ │ ├── internal │ │ │ │ │ └── uritemplates │ │ │ │ │ │ ├── utils.go │ │ │ │ │ │ └── LICENSE │ │ │ │ ├── transport │ │ │ │ │ └── apikey.go │ │ │ │ └── types_test.go │ │ │ ├── NOTES │ │ │ ├── google-api-go-generator │ │ │ │ └── testdata │ │ │ │ │ ├── arrayofmapofstrings.json │ │ │ │ │ ├── arrayofmapofobjects.json │ │ │ │ │ ├── wrapnewlines.json │ │ │ │ │ ├── mapofobjects.json │ │ │ │ │ └── arrayofarray-1.json │ │ │ └── Makefile │ │ ├── grpc │ │ │ ├── .travis.yml │ │ │ ├── doc.go │ │ │ ├── health │ │ │ │ ├── grpc_health │ │ │ │ │ └── health.proto │ │ │ │ └── health.go │ │ │ ├── test │ │ │ │ ├── codec_perf │ │ │ │ │ ├── perf.proto │ │ │ │ │ └── perf.pb.go │ │ │ │ └── testdata │ │ │ │ │ └── server1.key │ │ │ ├── codes │ │ │ │ └── code_string.go │ │ │ ├── codegen.sh │ │ │ ├── README.md │ │ │ ├── benchmark │ │ │ │ └── server │ │ │ │ │ └── main.go │ │ │ ├── transport │ │ │ │ └── testdata │ │ │ │ │ └── server1.key │ │ │ ├── interop │ │ │ │ ├── client │ │ │ │ │ └── testdata │ │ │ │ │ │ └── server1.key │ │ │ │ └── server │ │ │ │ │ └── testdata │ │ │ │ │ └── server1.key │ │ │ ├── examples │ │ │ │ └── route_guide │ │ │ │ │ ├── testdata │ │ │ │ │ └── server1.key │ │ │ │ │ └── README.md │ │ │ ├── CONTRIBUTING.md │ │ │ └── Makefile │ │ └── cloud │ │ │ ├── key.json.enc │ │ │ ├── examples │ │ │ ├── storage │ │ │ │ ├── appengine │ │ │ │ │ └── app.yaml │ │ │ │ └── appenginevm │ │ │ │ │ └── app.yaml │ │ │ └── bigtable │ │ │ │ └── bigtable-hello │ │ │ │ ├── app.yaml │ │ │ │ └── README.md │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── internal │ │ │ ├── opts │ │ │ │ └── option.go │ │ │ └── transport │ │ │ │ ├── cancelreq.go │ │ │ │ └── cancelreq_legacy.go │ │ │ ├── datastore │ │ │ └── testdata │ │ │ │ └── index.yaml │ │ │ ├── bigquery │ │ │ └── doc.go │ │ │ ├── CONTRIBUTORS │ │ │ └── bigtable │ │ │ └── internal │ │ │ └── empty │ │ │ ├── empty.pb.go │ │ │ └── empty.proto │ │ └── golang.org │ │ └── x │ │ ├── oauth2 │ │ ├── google │ │ │ ├── testdata │ │ │ │ └── gcloud │ │ │ │ │ └── properties │ │ │ └── appengine_hook.go │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── .travis.yml │ │ ├── vk │ │ │ └── vk.go │ │ ├── github │ │ │ └── github.go │ │ ├── facebook │ │ │ └── facebook.go │ │ ├── linkedin │ │ │ └── linkedin.go │ │ ├── odnoklassniki │ │ │ └── odnoklassniki.go │ │ ├── client_appengine.go │ │ ├── internal │ │ │ └── token_test.go │ │ ├── paypal │ │ │ └── paypal.go │ │ ├── jwt │ │ │ └── example_test.go │ │ └── CONTRIBUTING.md │ │ ├── net │ │ ├── internal │ │ │ └── nettest │ │ │ │ ├── rlimit_windows.go │ │ │ │ ├── rlimit_stub.go │ │ │ │ ├── error_stub.go │ │ │ │ ├── rlimit.go │ │ │ │ ├── stack_stub.go │ │ │ │ ├── rlimit_unix.go │ │ │ │ ├── stack_unix.go │ │ │ │ ├── error_posix.go │ │ │ │ ├── stack.go │ │ │ │ └── stack_windows.go │ │ ├── context │ │ │ ├── ctxhttp │ │ │ │ ├── cancelreq.go │ │ │ │ └── cancelreq_go14.go │ │ │ └── withtimeout_test.go │ │ └── trace │ │ │ └── trace_test.go │ │ └── crypto │ │ └── bcrypt │ │ └── base64.go └── Readme ├── contrib ├── docker-integration │ ├── nginx │ │ ├── test.passwd │ │ ├── registry-noauth.conf │ │ ├── docker-registry-v2.conf │ │ ├── Dockerfile │ │ ├── registry-basic.conf │ │ ├── docker-registry.conf │ │ └── nginx.conf │ ├── test_runner.sh │ ├── run_engine.sh │ ├── docker-compose.yml │ └── helpers.bash └── compose │ ├── nginx │ ├── Dockerfile │ ├── docker-registry-v2.conf │ ├── docker-registry.conf │ ├── nginx.conf │ └── registry.conf │ └── docker-compose.yml ├── docs ├── images │ └── notifications.png ├── Dockerfile ├── osx │ ├── config.yml │ └── com.docker.registry.plist ├── storage-drivers │ ├── filesystem.md │ ├── inmemory.md │ ├── gcs.md │ └── azure.md ├── spec │ └── implementations.md ├── help.md └── migration.md ├── registry ├── doc.go ├── storage │ ├── driver │ │ ├── gcs │ │ │ └── doc.go │ │ ├── oss │ │ │ └── doc.go │ │ ├── rados │ │ │ ├── doc.go │ │ │ └── rados_test.go │ │ ├── inmemory │ │ │ └── driver_test.go │ │ ├── filesystem │ │ │ └── driver_test.go │ │ └── azure │ │ │ └── blockblob.go │ ├── doc.go │ ├── cache │ │ ├── memory │ │ │ └── memory_test.go │ │ └── cache.go │ ├── blobwriter_nonresumable.go │ └── util.go ├── handlers │ ├── basicauth.go │ ├── mail.go │ ├── basicauth_prego14.go │ └── hooks.go ├── api │ ├── v2 │ │ └── doc.go │ └── errcode │ │ └── handler.go ├── auth │ └── token │ │ └── stringset.go └── proxy │ └── proxyauth.go ├── cmd └── registry │ ├── rados.go │ ├── config-example.yml │ └── main.go ├── doc.go ├── MAINTAINERS ├── context ├── version_test.go ├── version.go └── util.go ├── project ├── hooks │ ├── configure-hooks.sh │ ├── README.md │ └── pre-commit └── dev-image │ └── Dockerfile ├── version ├── version.go ├── print.go └── version.sh ├── .mailmap ├── .gitignore ├── digest └── digester_resumable_test.go ├── Dockerfile ├── health ├── checks │ └── checks_test.go └── api │ └── api.go ├── .drone.yml └── uuid └── uuid_test.go /manifest/doc.go: -------------------------------------------------------------------------------- 1 | package manifest 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/.gitignore: -------------------------------------------------------------------------------- 1 | /pkg 2 | /bin 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | h2i/h2i 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/gorelic/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl: -------------------------------------------------------------------------------- 1 | E2CE26BF3285059C 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ncw/swift/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | test-env* 4 | junk/ -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/gopkg.in/check.v1/.gitignore: -------------------------------------------------------------------------------- 1 | _* 2 | *.swp 3 | *.[568] 4 | [568].out 5 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/test.passwd: -------------------------------------------------------------------------------- 1 | testuser:$apr1$YmLhHjm6$AjP4z8J1WgcUNxU8J4ue5. 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/.hgtags: -------------------------------------------------------------------------------- 1 | b571b553f8c057cb6952ce817dfb09b6e34a8c0b release 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/gopkg.in/check.v1/TODO: -------------------------------------------------------------------------------- 1 | - Assert(slice, Contains, item) 2 | - Parallel test support 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/properties: -------------------------------------------------------------------------------- 1 | [core] 2 | account = bar@example.com -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | script: 4 | - make test testrace 5 | -------------------------------------------------------------------------------- /docs/images/notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multiply/distribution/master/docs/images/notifications.png -------------------------------------------------------------------------------- /registry/doc.go: -------------------------------------------------------------------------------- 1 | // Package registry provides the main entrypoints for running a registry. 2 | package registry 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/TODO: -------------------------------------------------------------------------------- 1 | Moved to: 2 | https://github.com/google/google-api-go-client/issues 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/lib/codereview/codereview.cfg: -------------------------------------------------------------------------------- 1 | defaultcc: golang-codereviews@googlegroups.com 2 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/gorelic/.gitignore: -------------------------------------------------------------------------------- 1 | *.nut 2 | *.swp 3 | examples/example1 4 | examples/example_web 5 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/context/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - tip 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/mux/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - tip 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/noahdesu/go-ceph/rados/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Set of wrappers around librados API. 3 | */ 4 | package rados 5 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore: -------------------------------------------------------------------------------- 1 | h2demo 2 | h2demo.linux 3 | client-id.dat 4 | client-secret.dat 5 | token.dat 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | 6 | script: 7 | - go test 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/handlers/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.1 5 | - 1.2 6 | - 1.3 7 | - 1.4 8 | - tip 9 | -------------------------------------------------------------------------------- /cmd/registry/rados.go: -------------------------------------------------------------------------------- 1 | // +build include_rados 2 | 3 | package main 4 | 5 | import _ "github.com/docker/distribution/registry/storage/driver/rados" 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.3 7 | - 1.4 8 | - tip 9 | -------------------------------------------------------------------------------- /Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.2 4 | - 1.3 5 | - 1.4 6 | - tip 7 | install: 8 | - go get -t ./... 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4.2 5 | - tip 6 | script: 7 | - go test ./... 8 | - go build 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/key.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multiply/distribution/master/Godeps/_workspace/src/google.golang.org/cloud/key.json.enc -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/examples/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multiply/distribution/master/Godeps/_workspace/src/google.golang.org/api/examples/gopher.png -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/doc.go: -------------------------------------------------------------------------------- 1 | // Package newrelic_platform_go is New Relic Platform Agent SDK for Go language. 2 | package newrelic_platform_go 3 | -------------------------------------------------------------------------------- /registry/storage/driver/gcs/doc.go: -------------------------------------------------------------------------------- 1 | // Package gcs implements the Google Cloud Storage driver backend. Support can be 2 | // enabled by including the "include_gcs" build tag. 3 | package gcs 4 | -------------------------------------------------------------------------------- /registry/storage/driver/oss/doc.go: -------------------------------------------------------------------------------- 1 | // Package oss implements the Aliyun OSS Storage driver backend. Support can be 2 | // enabled by including the "include_oss" build tag. 3 | package oss 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ncw/swift/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.1.2 6 | - 1.2.2 7 | - 1.3 8 | - tip 9 | 10 | script: 11 | - go test 12 | -------------------------------------------------------------------------------- /registry/storage/doc.go: -------------------------------------------------------------------------------- 1 | // Package storage contains storage services for use in the registry 2 | // application. It should be considered an internal package, as of Go 1.4. 3 | package storage 4 | -------------------------------------------------------------------------------- /registry/storage/driver/rados/doc.go: -------------------------------------------------------------------------------- 1 | // Package rados implements the rados storage driver backend. Support can be 2 | // enabled by including the "include_rados" build tag. 3 | package rados 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_openbsd.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import "syscall" 4 | 5 | const ioctlReadTermios = syscall.TIOCGETA 6 | 7 | type Termios syscall.Termios 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libtrust/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Solomon Hykes 2 | Josh Hawn (github: jlhawn) 3 | Derek McGowan (github: dmcgowan) 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/tarsum/testdata/xattr/layer.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multiply/distribution/master/Godeps/_workspace/src/github.com/docker/docker/pkg/tarsum/testdata/xattr/layer.tar -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func numCgoCall() int64 { 8 | return runtime.NumCgoCall() 9 | } 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.7.3 2 | 3 | formatter/\*: allow configuration of timestamp layout 4 | 5 | # 0.7.2 6 | 7 | formatter/text: Add configuration option for time format (#158) 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/examples/storage/appengine/app.yaml: -------------------------------------------------------------------------------- 1 | application: 2 | version: v1 3 | runtime: go 4 | api_version: go1 5 | 6 | handlers: 7 | - url: /.* 8 | script: _go_app 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/.hgignore: -------------------------------------------------------------------------------- 1 | _obj 2 | _testmain.go 3 | clientid.dat 4 | clientsecret.dat 5 | google-api-go-generator/google-api-go-gen 6 | 7 | syntax:glob 8 | *.6 9 | *.8 10 | *~ 11 | *.out 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/panicwrap/monitor_windows.go: -------------------------------------------------------------------------------- 1 | package panicwrap 2 | 3 | import "fmt" 4 | 5 | func monitor(c *WrapConfig) (int, error) { 6 | return -1, fmt.Errorf("Monitor is not supported on windows") 7 | } 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/stevvooe/resumable/README.md: -------------------------------------------------------------------------------- 1 | # go-crypto 2 | A Subset of the Go `crypto` Package with a Resumable Hash Interface 3 | 4 | ### Documentation 5 | 6 | GoDocs: http://godoc.org/github.com/stevvooe/resumable 7 | -------------------------------------------------------------------------------- /registry/handlers/basicauth.go: -------------------------------------------------------------------------------- 1 | // +build go1.4 2 | 3 | package handlers 4 | 5 | import ( 6 | "net/http" 7 | ) 8 | 9 | func basicAuth(r *http.Request) (username, password string, ok bool) { 10 | return r.BasicAuth() 11 | } 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/.gitignore: -------------------------------------------------------------------------------- 1 | *.[68] 2 | *.a 3 | *.out 4 | *.swp 5 | _obj 6 | _testmain.go 7 | cmd/metrics-bench/metrics-bench 8 | cmd/metrics-example/metrics-example 9 | cmd/never-read/never-read 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/examples/storage/appenginevm/app.yaml: -------------------------------------------------------------------------------- 1 | runtime: go 2 | api_version: go1 3 | vm: true 4 | 5 | manual_scaling: 6 | instances: 1 7 | 8 | handlers: 9 | - url: /.* 10 | script: _go_app 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package grpc implements an RPC system called gRPC. 3 | 4 | See https://github.com/grpc/grpc for more information about gRPC. 5 | */ 6 | package grpc // import "google.golang.org/grpc" 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go: -------------------------------------------------------------------------------- 1 | package yaml_test 2 | 3 | import ( 4 | . "gopkg.in/check.v1" 5 | "testing" 6 | ) 7 | 8 | func Test(t *testing.T) { TestingT(t) } 9 | 10 | type S struct{} 11 | 12 | var _ = Suite(&S{}) 13 | -------------------------------------------------------------------------------- /docs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docs/base:hugo-github-linking 2 | MAINTAINER Mary Anthony (@moxiegirl) 3 | 4 | ENV PROJECT=registry 5 | 6 | # To get the git info for this repo 7 | COPY . /src 8 | 9 | COPY . /docs/content/$PROJECT/ 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/HACKING: -------------------------------------------------------------------------------- 1 | We only accept contributions from users who have gone through Go's 2 | contribution process (signed a CLA). 3 | 4 | Please acknowledge whether you have (and use the same email) if 5 | sending a pull request. 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/gorelic/doc.go: -------------------------------------------------------------------------------- 1 | // Package gorelic is an New Relic agent implementation for Go runtime. It collect a lot of metrics about Go scheduler, garbage collector and memory allocator and send them to NewRelic. 2 | package gorelic 3 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.4 7 | - tip 8 | 9 | install: 10 | - go get -v google.golang.org/api/... 11 | 12 | script: 13 | - go test -v google.golang.org/api/... 14 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/registry-noauth.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 0; 2 | chunked_transfer_encoding on; 3 | location /v2/ { 4 | include docker-registry-v2.conf; 5 | } 6 | location / { 7 | include docker-registry.conf; 8 | } 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/examples/bigtable/bigtable-hello/app.yaml: -------------------------------------------------------------------------------- 1 | runtime: go 2 | api_version: go1 3 | vm: true 4 | 5 | manual_scaling: 6 | instances: 1 7 | 8 | handlers: 9 | # Serve only the web root. 10 | - url: / 11 | script: _go_app 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/gopkg.in/check.v1/export_test.go: -------------------------------------------------------------------------------- 1 | package check 2 | 3 | func PrintLine(filename string, line int) (string, error) { 4 | return printLine(filename, line) 5 | } 6 | 7 | func Indent(s, with string) string { 8 | return indent(s, with) 9 | } 10 | -------------------------------------------------------------------------------- /contrib/compose/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.7 2 | 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | COPY registry.conf /etc/nginx/conf.d/registry.conf 5 | COPY docker-registry.conf /etc/nginx/docker-registry.conf 6 | COPY docker-registry-v2.conf /etc/nginx/docker-registry-v2.conf 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Google & the Go AUTHORS 2 | 3 | Go AUTHORS are: 4 | See https://code.google.com/p/go/source/browse/AUTHORS 5 | 6 | Licensed under the terms of Go itself: 7 | https://code.google.com/p/go/source/browse/LICENSE 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile: -------------------------------------------------------------------------------- 1 | h2demo.linux: h2demo.go 2 | GOOS=linux go build --tags=h2demo -o h2demo.linux . 3 | 4 | upload: h2demo.linux 5 | cat h2demo.linux | go run launch.go --write_object=http2-demo-server-tls/h2demo --write_object_is_public 6 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/golang/protobuf/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.[568ao] 3 | *.pb.go 4 | *.ao 5 | *.so 6 | *.pyc 7 | ._* 8 | .nfs.* 9 | [568a].out 10 | *~ 11 | *.orig 12 | core 13 | _obj 14 | _test 15 | _testmain.go 16 | compiler/protoc-gen-go 17 | compiler/testdata/extension_test 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/mux/README.md: -------------------------------------------------------------------------------- 1 | mux 2 | === 3 | [![Build Status](https://travis-ci.org/gorilla/mux.png?branch=master)](https://travis-ci.org/gorilla/mux) 4 | 5 | gorilla/mux is a powerful URL router and dispatcher. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/mux 8 | -------------------------------------------------------------------------------- /contrib/compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | nginx: 2 | build: "nginx" 3 | ports: 4 | - "5000:5000" 5 | links: 6 | - registryv1:registryv1 7 | - registryv2:registryv2 8 | registryv1: 9 | image: registry 10 | ports: 11 | - "5000" 12 | registryv2: 13 | build: "../../" 14 | ports: 15 | - "5000" 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/errors/README.md: -------------------------------------------------------------------------------- 1 | Adds stacktraces to errors in golang. 2 | 3 | This was made to help build the Bugsnag notifier but can be used standalone if 4 | you like to have stacktraces on errors. 5 | 6 | See [Godoc](https://godoc.org/github.com/bugsnag/bugsnag-go/errors) for the API docs. 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health/health.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package grpc.health; 4 | 5 | message HealthCheckRequest{ 6 | } 7 | 8 | message HealthCheckResponse{ 9 | } 10 | 11 | service HealthCheck{ 12 | rpc Check( HealthCheckRequest) returns ( HealthCheckResponse); 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.1 5 | - 1.2 6 | - 1.3 7 | - tip 8 | 9 | install: 10 | - go get github.com/bugsnag/panicwrap 11 | - go get github.com/bugsnag/osext 12 | - go get github.com/bitly/go-simplejson 13 | - go get github.com/revel/revel 14 | -------------------------------------------------------------------------------- /doc.go: -------------------------------------------------------------------------------- 1 | // Package distribution will define the interfaces for the components of 2 | // docker distribution. The goal is to allow users to reliably package, ship 3 | // and store content related to docker images. 4 | // 5 | // This is currently a work in progress. More details are available in the 6 | // README.md. 7 | package distribution 8 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Solomon Hykes (@shykes) 2 | Olivier Gambier (@dmp42) 3 | Stephen Day (@stevvooe) 4 | Derek McGowan (@dmcgowan) 5 | Richard Scothern (@richardscothern) 6 | Aaron Lehmann (@aaronlehmann) 7 | 8 | 9 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package nettest 6 | 7 | func maxOpenFiles() int { return 4 * defaultMaxOpenFiles /* actually it's 16581375 */ } 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/AdRoll/goamz/cloudfront/testdata/key.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0yMzp9DkPAE99DhsEaGkqougL 3 | vtmDKri4bZj0fFjmGmjyyjz9hlrsr87LHVWzH/7igK7040HG1UqypX3ijtJa9+6B 4 | KHwBBctboU3y4GfwFwVAOumY9UytFpyPlgUFrffZLQAywKkT24OgcfEj0G5kiQn7 5 | 60wFnmSUtOuITo708QIDAQAB 6 | -----END PUBLIC KEY----- 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package nettest 8 | 9 | func maxOpenFiles() int { return defaultMaxOpenFiles } 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/stevvooe/resumable/sha512/sha512block_decl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 6 | 7 | package sha512 8 | 9 | //go:noescape 10 | 11 | func block(dig *digest, p []byte) 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/stevvooe/resumable/sha256/sha256block_decl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 6 | 7 | package sha256 8 | 9 | //go:noescape 10 | 11 | func block(dig *digest, p []byte) 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package nettest 8 | 9 | func protocolNotSupported(err error) bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /contrib/docker-integration/test_runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" 5 | 6 | TESTS=${@:-.} 7 | 8 | function execute() { 9 | >&2 echo "++ $@" 10 | eval "$@" 11 | } 12 | 13 | execute time docker-compose build 14 | 15 | execute docker-compose up -d 16 | 17 | # Run the tests. 18 | execute time bats -p $TESTS 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.3 5 | - 1.4 6 | 7 | install: 8 | - export GOPATH="$HOME/gopath" 9 | - mkdir -p "$GOPATH/src/golang.org/x" 10 | - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" 11 | - go get -v -t -d golang.org/x/oauth2/... 12 | 13 | script: 14 | - go test -v golang.org/x/oauth2/... 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/gorelic/nut.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "0.0.6", 3 | "Vendor": "yvasiyarov", 4 | "Authors": [ 5 | { 6 | "FullName": "Yuriy Vasiyarov", 7 | "Email": "varyous@gmail.com" 8 | } 9 | ], 10 | "ExtraFiles": [ 11 | "README.md", 12 | "LICENSE" 13 | ], 14 | "Homepage": "https://github.com/yvasiyarov/gorelic" 15 | } 16 | -------------------------------------------------------------------------------- /manifest/versioned.go: -------------------------------------------------------------------------------- 1 | package manifest 2 | 3 | // Versioned provides a struct with just the manifest schemaVersion. Incoming 4 | // content with unknown schema version can be decoded against this struct to 5 | // check the version. 6 | type Versioned struct { 7 | // SchemaVersion is the image manifest schema that this image follows 8 | SchemaVersion int `json:"schemaVersion"` 9 | } 10 | -------------------------------------------------------------------------------- /docs/osx/config.yml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | log: 3 | level: info 4 | fields: 5 | service: registry 6 | environment: macbook-air 7 | storage: 8 | cache: 9 | blobdescriptor: inmemory 10 | filesystem: 11 | rootdirectory: /Users/Shared/Registry 12 | http: 13 | addr: 0.0.0.0:5000 14 | secret: mytokensecret 15 | debug: 16 | addr: localhost:5001 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_darwin.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/nut.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "0.0.1", 3 | "Vendor": "yvasiyarov", 4 | "Authors": [ 5 | { 6 | "FullName": "Yuriy Vasiyarov", 7 | "Email": "varyous@gmail.com" 8 | } 9 | ], 10 | "ExtraFiles": [ 11 | "README.md", 12 | "LICENSE" 13 | ], 14 | "Homepage": "https://github.com/yvasiyarov/newrelic_platform_go" 15 | } 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | Google Inc. 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/utils.go: -------------------------------------------------------------------------------- 1 | package uritemplates 2 | 3 | func Expand(path string, expansions map[string]string) (string, error) { 4 | template, err := Parse(path) 5 | if err != nil { 6 | return "", err 7 | } 8 | values := make(map[string]interface{}) 9 | for k, v := range expansions { 10 | values[k] = v 11 | } 12 | return template.Expand(values) 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.proto: -------------------------------------------------------------------------------- 1 | // Messages used for performance tests that may not reference grpc directly for 2 | // reasons of import cycles. 3 | syntax = "proto2"; 4 | 5 | package codec.perf; 6 | 7 | // Buffer is a message that contains a body of bytes that is used to exercise 8 | // encoding and decoding overheads. 9 | message Buffer { 10 | optional bytes body = 1; 11 | } 12 | -------------------------------------------------------------------------------- /cmd/registry/config-example.yml: -------------------------------------------------------------------------------- 1 | version: 0.1 2 | log: 3 | fields: 4 | service: registry 5 | storage: 6 | cache: 7 | blobdescriptor: inmemory 8 | filesystem: 9 | rootdirectory: /var/lib/registry 10 | http: 11 | addr: :5000 12 | headers: 13 | X-Content-Type-Options: [nosniff] 14 | health: 15 | storagedriver: 16 | enabled: true 17 | interval: 10s 18 | threshold: 3 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/spf13/cobra/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | cobra.test 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/google/appengine_hook.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine appenginevm 6 | 7 | package google 8 | 9 | import "google.golang.org/appengine" 10 | 11 | func init() { 12 | appengineTokenFunc = appengine.AccessToken 13 | } 14 | -------------------------------------------------------------------------------- /registry/storage/cache/memory/memory_test.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/docker/distribution/registry/storage/cache/cachecheck" 7 | ) 8 | 9 | // TestInMemoryBlobInfoCache checks the in memory implementation is working 10 | // correctly. 11 | func TestInMemoryBlobInfoCache(t *testing.T) { 12 | cachecheck.CheckBlobDescriptorCache(t, NewInMemoryBlobDescriptorCacheProvider()) 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/tarsum/writercloser.go: -------------------------------------------------------------------------------- 1 | package tarsum 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | type writeCloseFlusher interface { 8 | io.WriteCloser 9 | Flush() error 10 | } 11 | 12 | type nopCloseFlusher struct { 13 | io.Writer 14 | } 15 | 16 | func (n *nopCloseFlusher) Close() error { 17 | return nil 18 | } 19 | 20 | func (n *nopCloseFlusher) Flush() error { 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /contrib/compose/nginx/docker-registry-v2.conf: -------------------------------------------------------------------------------- 1 | proxy_pass http://docker-registry-v2; 2 | proxy_set_header Host $http_host; # required for docker client's sake 3 | proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP 4 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 5 | proxy_set_header X-Forwarded-Proto $scheme; 6 | proxy_read_timeout 900; 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/stevvooe/resumable/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/docker-registry-v2.conf: -------------------------------------------------------------------------------- 1 | proxy_pass http://docker-registry-v2; 2 | proxy_set_header Host $http_host; # required for docker client's sake 3 | proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP 4 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 5 | proxy_set_header X-Forwarded-Proto $scheme; 6 | proxy_read_timeout 900; 7 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/denverdino/aliyungo/oss/config_test.go: -------------------------------------------------------------------------------- 1 | package oss_test 2 | 3 | import ( 4 | "github.com/denverdino/aliyungo/oss" 5 | ) 6 | 7 | //Modify with your Access Key Id and Access Key Secret 8 | const ( 9 | TestAccessKeyId = "MY_ACCESS_KEY_ID" 10 | TestAccessKeySecret = "MY_ACCESS_KEY_ID" 11 | TestIAmRich = false 12 | TestRegion = oss.Beijing 13 | TestBucket = "denverdino" 14 | ) 15 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package nettest 6 | 7 | const defaultMaxOpenFiles = 256 8 | 9 | // MaxOpenFiles returns the maximum number of open files for the 10 | // caller's process. 11 | func MaxOpenFiles() int { return maxOpenFiles() } 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/gopkg.in/check.v1/README.md: -------------------------------------------------------------------------------- 1 | Instructions 2 | ============ 3 | 4 | Install the package with: 5 | 6 | go get gopkg.in/check.v1 7 | 8 | Import it with: 9 | 10 | import "gopkg.in/check.v1" 11 | 12 | and use _check_ as the package name inside the code. 13 | 14 | For more details, visit the project page: 15 | 16 | * http://labix.org/gocheck 17 | 18 | and the API documentation: 19 | 20 | * https://gopkg.in/check.v1 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.4 5 | - tip 6 | install: 7 | - go get -v google.golang.org/cloud/... 8 | script: 9 | - openssl aes-256-cbc -K $encrypted_912ff8fa81ad_key -iv $encrypted_912ff8fa81ad_iv -in key.json.enc -out key.json -d 10 | - GCLOUD_TESTS_GOLANG_PROJECT_ID="dulcet-port-762" GCLOUD_TESTS_GOLANG_KEY="$(pwd)/key.json" 11 | go test -v -tags=integration google.golang.org/cloud/... 12 | -------------------------------------------------------------------------------- /context/version_test.go: -------------------------------------------------------------------------------- 1 | package context 2 | 3 | import "testing" 4 | 5 | func TestVersionContext(t *testing.T) { 6 | ctx := Background() 7 | 8 | if GetVersion(ctx) != "" { 9 | t.Fatalf("context should not yet have a version") 10 | } 11 | 12 | expected := "2.1-whatever" 13 | ctx = WithVersion(ctx, expected) 14 | version := GetVersion(ctx) 15 | 16 | if version != expected { 17 | t.Fatalf("version was not set: %q != %q", version, expected) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.9 2 | 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | COPY registry.conf /etc/nginx/conf.d/registry.conf 5 | COPY docker-registry.conf /etc/nginx/docker-registry.conf 6 | COPY docker-registry-v2.conf /etc/nginx/docker-registry-v2.conf 7 | COPY registry-noauth.conf /etc/nginx/registry-noauth.conf 8 | COPY registry-basic.conf /etc/nginx/registry-basic.conf 9 | COPY test.passwd /etc/nginx/test.passwd 10 | COPY ssl /etc/nginx/ssl 11 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/denverdino/aliyungo/oss/export.go: -------------------------------------------------------------------------------- 1 | package oss 2 | 3 | import ( 4 | "github.com/denverdino/aliyungo/util" 5 | ) 6 | 7 | var originalStrategy = attempts 8 | 9 | func SetAttemptStrategy(s *util.AttemptStrategy) { 10 | if s == nil { 11 | attempts = originalStrategy 12 | } else { 13 | attempts = *s 14 | } 15 | } 16 | 17 | func SetListPartsMax(n int) { 18 | listPartsMax = n 19 | } 20 | 21 | func SetListMultiMax(n int) { 22 | listMultiMax = n 23 | } 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_freebsd.go: -------------------------------------------------------------------------------- 1 | /* 2 | Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin. 3 | */ 4 | package logrus 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios struct { 13 | Iflag uint32 14 | Oflag uint32 15 | Cflag uint32 16 | Lflag uint32 17 | Cc [20]uint8 18 | Ispeed uint32 19 | Ospeed uint32 20 | } 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.5 6 | 7 | package ctxhttp 8 | 9 | import "net/http" 10 | 11 | func canceler(client *http.Client, req *http.Request) func() { 12 | ch := make(chan struct{}) 13 | req.Cancel = ch 14 | 15 | return func() { 16 | close(ch) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of cloud authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as: 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | Google Inc. 10 | Palm Stone Games, Inc. 11 | Péter Szilágyi 12 | Tyler Treat 13 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/registry-basic.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 0; 2 | chunked_transfer_encoding on; 3 | location /v2/ { 4 | auth_basic "registry.localhost"; 5 | auth_basic_user_file test.passwd; 6 | add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always; 7 | include docker-registry-v2.conf; 8 | } 9 | location / { 10 | auth_basic "registry.localhost"; 11 | auth_basic_user_file test.passwd; 12 | include docker-registry.conf; 13 | } 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Azure/azure-sdk-for-go/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | # Editor swap files 27 | *.swp 28 | *~ 29 | .DS_Store 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/osext/osext_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package osext 6 | 7 | import "syscall" 8 | 9 | func executable() (string, error) { 10 | f, err := Open("/proc/" + itoa(Getpid()) + "/text") 11 | if err != nil { 12 | return "", err 13 | } 14 | defer f.Close() 15 | return syscall.Fd2path(int(f.Fd())) 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/writer_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "sort" 5 | "testing" 6 | ) 7 | 8 | func TestMetricsSorting(t *testing.T) { 9 | var namedMetrics = namedMetricSlice{ 10 | {name: "zzz"}, 11 | {name: "bbb"}, 12 | {name: "fff"}, 13 | {name: "ggg"}, 14 | } 15 | 16 | sort.Sort(namedMetrics) 17 | for i, name := range []string{"bbb", "fff", "ggg", "zzz"} { 18 | if namedMetrics[i].name != name { 19 | t.Fail() 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contrib/docker-integration/run_engine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -x 4 | 5 | DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-overlay} 6 | EXEC_DRIVER=${EXEC_DRIVER:-native} 7 | 8 | # Set IP address in /etc/hosts for localregistry 9 | IP=$(ifconfig eth0|grep "inet addr:"| cut -d: -f2 | awk '{ print $1}') 10 | echo "$IP localregistry" >> /etc/hosts 11 | 12 | sh install_certs.sh localregistry 13 | 14 | docker --daemon --log-level=panic \ 15 | --storage-driver="$DOCKER_GRAPHDRIVER" --exec-driver="$EXEC_DRIVER" 16 | -------------------------------------------------------------------------------- /project/hooks/configure-hooks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd $(dirname $0) 4 | 5 | REPO_ROOT=$(git rev-parse --show-toplevel) 6 | RESOLVE_REPO_ROOT_STATUS=$? 7 | if [ "$RESOLVE_REPO_ROOT_STATUS" -ne "0" ]; then 8 | echo -e "Unable to resolve repository root. Error:\n$REPO_ROOT" > /dev/stderr 9 | exit $RESOLVE_REPO_ROOT_STATUS 10 | fi 11 | 12 | set -e 13 | set -x 14 | 15 | # Just in case the directory doesn't exist 16 | mkdir -p $REPO_ROOT/.git/hooks 17 | 18 | ln -f -s $(pwd)/pre-commit $REPO_ROOT/.git/hooks/pre-commit -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libtrust/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package libtrust provides an interface for managing authentication and 3 | authorization using public key cryptography. Authentication is handled 4 | using the identity attached to the public key and verified through TLS 5 | x509 certificates, a key challenge, or signature. Authorization and 6 | access control is managed through a trust graph distributed between 7 | both remote trust servers and locally cached and managed data. 8 | */ 9 | package libtrust 10 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/cmd/never-read/never-read.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net" 6 | ) 7 | 8 | func main() { 9 | addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") 10 | l, err := net.ListenTCP("tcp", addr) 11 | if nil != err { 12 | log.Fatalln(err) 13 | } 14 | log.Println("listening", l.Addr()) 15 | for { 16 | c, err := l.AcceptTCP() 17 | if nil != err { 18 | log.Fatalln(err) 19 | } 20 | log.Println("accepted", c.RemoteAddr()) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/NOTES: -------------------------------------------------------------------------------- 1 | Discovery Service: 2 | https://developers.google.com/discovery/ 3 | https://developers.google.com/discovery/v1/reference/ 4 | 5 | The "type" key: 6 | http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 7 | 8 | The "format" key: 9 | http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 10 | https://developers.google.com/discovery/v1/type-format 11 | 12 | Google JSON format docs: 13 | http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml 14 | -------------------------------------------------------------------------------- /registry/api/v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package v2 describes routes, urls and the error codes used in the Docker 2 | // Registry JSON HTTP API V2. In addition to declarations, descriptors are 3 | // provided for routes and error codes that can be used for implementation and 4 | // automatically generating documentation. 5 | // 6 | // Definitions here are considered to be locked down for the V2 registry api. 7 | // Any changes must be considered carefully and should not proceed without a 8 | // change proposal in docker core. 9 | package v2 10 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/docker-registry.conf: -------------------------------------------------------------------------------- 1 | proxy_pass http://docker-registry; 2 | proxy_set_header Host $http_host; # required for docker client's sake 3 | proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP 4 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 5 | proxy_set_header X-Forwarded-Proto $scheme; 6 | proxy_set_header Authorization ""; # see https://github.com/docker/docker-registry/issues/170 7 | proxy_read_timeout 900; 8 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // Package is the overall, canonical project import path under which the 4 | // package was built. 5 | var Package = "github.com/docker/distribution" 6 | 7 | // Version indicates which version of the binary is running. This is set to 8 | // the latest release tag by hand, always suffixed by "+unknown". During 9 | // build, it will be replaced by the actual version. The value here will be 10 | // used if the registry is run after a go get based install. 11 | var Version = "v2.1.0+unknown" 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/denverdino/aliyungo/util/signature_test.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestCreateSignature(t *testing.T) { 8 | 9 | str := "GET&%2F&AccessKeyId%3Dtestid%26Action%3DDescribeRegions%26Format%3DXML%26RegionId%3Dregion1%26SignatureMethod%3DHMAC-SHA1%26SignatureNonce%3DNwDAxvLU6tFE0DVb%26SignatureVersion%3D1.0%26TimeStamp%3D2012-12-26T10%253A33%253A56Z%26Version%3D2014-05-26" 10 | 11 | signature := CreateSignature(str, "testsecret") 12 | 13 | t.Log(signature) 14 | } 15 | -------------------------------------------------------------------------------- /contrib/compose/nginx/docker-registry.conf: -------------------------------------------------------------------------------- 1 | proxy_pass http://docker-registry; 2 | proxy_set_header Host $http_host; # required for docker client's sake 3 | proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP 4 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 5 | proxy_set_header X-Forwarded-Proto $scheme; 6 | proxy_set_header Authorization ""; # For basic auth through nginx in v1 to work, please comment this line 7 | proxy_read_timeout 900; 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libtrust/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to libtrust 2 | 3 | Want to hack on libtrust? Awesome! Here are instructions to get you 4 | started. 5 | 6 | libtrust is a part of the [Docker](https://www.docker.com) project, and follows 7 | the same rules and principles. If you're already familiar with the way 8 | Docker does things, you'll feel right at home. 9 | 10 | Otherwise, go read 11 | [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md). 12 | 13 | Happy hacking! 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ncw/swift/compatibility_1_1.go: -------------------------------------------------------------------------------- 1 | // Go 1.1 and later compatibility functions 2 | // 3 | // +build go1.1 4 | 5 | package swift 6 | 7 | import ( 8 | "net/http" 9 | "time" 10 | ) 11 | 12 | // Cancel the request 13 | func cancelRequest(transport http.RoundTripper, req *http.Request) { 14 | if tr, ok := transport.(interface { 15 | CancelRequest(*http.Request) 16 | }); ok { 17 | tr.CancelRequest(req) 18 | } 19 | } 20 | 21 | // Reset a timer 22 | func resetTimer(t *time.Timer, d time.Duration) { 23 | t.Reset(d) 24 | } 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package nettest 8 | 9 | import ( 10 | "fmt" 11 | "runtime" 12 | ) 13 | 14 | // SupportsRawIPSocket reports whether the platform supports raw IP 15 | // sockets. 16 | func SupportsRawIPSocket() (string, bool) { 17 | return fmt.Sprintf("not supported on %s", runtime.GOOS), false 18 | } 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/README.md: -------------------------------------------------------------------------------- 1 | New Relic Platform Agent SDK for Go(golang) 2 | ==================== 3 | 4 | [![Build Status](https://travis-ci.org/yvasiyarov/newrelic_platform_go.png?branch=master)](https://travis-ci.org/yvasiyarov/newrelic_platform_go) 5 | 6 | This package provide very simple interface to NewRelic Platform http://newrelic.com/platform 7 | 8 | For example of usage see examples/wave_plugin.go 9 | 10 | For real-word example, you can have a look at: 11 | https://github.com/yvasiyarov/newrelic_sphinx 12 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package nettest 8 | 9 | import "syscall" 10 | 11 | func maxOpenFiles() int { 12 | var rlim syscall.Rlimit 13 | if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim); err != nil { 14 | return defaultMaxOpenFiles 15 | } 16 | return int(rlim.Cur) 17 | } 18 | -------------------------------------------------------------------------------- /registry/storage/blobwriter_nonresumable.go: -------------------------------------------------------------------------------- 1 | // +build noresumabledigest 2 | 3 | package storage 4 | 5 | import ( 6 | "github.com/docker/distribution/context" 7 | ) 8 | 9 | // resumeHashAt is a noop when resumable digest support is disabled. 10 | func (bw *blobWriter) resumeDigestAt(ctx context.Context, offset int64) error { 11 | return errResumableDigestNotAvailable 12 | } 13 | 14 | // storeHashState is a noop when resumable digest support is disabled. 15 | func (bw *blobWriter) storeHashState(ctx context.Context) error { 16 | return errResumableDigestNotAvailable 17 | } 18 | -------------------------------------------------------------------------------- /docs/storage-drivers/filesystem.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | # Filesystem storage driver 11 | 12 | An implementation of the `storagedriver.StorageDriver` interface which uses the local filesystem. 13 | 14 | ## Parameters 15 | 16 | `rootdirectory`: (optional) The root directory tree in which all registry files will be stored. Defaults to `/var/lib/registry`. 17 | -------------------------------------------------------------------------------- /docs/storage-drivers/inmemory.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | # In-memory storage driver 11 | 12 | An implementation of the `storagedriver.StorageDriver` interface which uses local memory for object storage. 13 | 14 | **IMPORTANT**: This storage driver *does not* persist data across runs, and primarily exists for testing. 15 | 16 | ## Parameters 17 | 18 | None 19 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Stephen J Day Stephen Day 2 | Stephen J Day Stephen Day 3 | Olivier Gambier Olivier Gambier 4 | Brian Bland Brian Bland 5 | Josh Hawn Josh Hawn 6 | Richard Scothern Richard 7 | Richard Scothern Richard Scothern 8 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/vk/vk.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package vk provides constants for using OAuth2 to access VK.com. 6 | package vk // import "golang.org/x/oauth2/vk" 7 | 8 | import ( 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // Endpoint is VK's OAuth 2.0 endpoint. 13 | var Endpoint = oauth2.Endpoint{ 14 | AuthURL: "https://oauth.vk.com/authorize", 15 | TokenURL: "https://oauth.vk.com/access_token", 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/opentsdb_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "net" 5 | "time" 6 | ) 7 | 8 | func ExampleOpenTSDB() { 9 | addr, _ := net.ResolveTCPAddr("net", ":2003") 10 | go OpenTSDB(DefaultRegistry, 1*time.Second, "some.prefix", addr) 11 | } 12 | 13 | func ExampleOpenTSDBWithConfig() { 14 | addr, _ := net.ResolveTCPAddr("net", ":2003") 15 | go OpenTSDBWithConfig(OpenTSDBConfig{ 16 | Addr: addr, 17 | Registry: DefaultRegistry, 18 | FlushInterval: 1 * time.Second, 19 | DurationUnit: time.Millisecond, 20 | }) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /contrib/docker-integration/docker-compose.yml: -------------------------------------------------------------------------------- 1 | nginx: 2 | build: "nginx" 3 | ports: 4 | - "5000:5000" 5 | - "5001:5001" 6 | - "5002:5002" 7 | - "5011:5011" 8 | - "5440:5440" 9 | - "5441:5441" 10 | - "5442:5442" 11 | - "5443:5443" 12 | - "5444:5444" 13 | - "5445:5445" 14 | - "5446:5446" 15 | - "5447:5447" 16 | - "5448:5448" 17 | links: 18 | - registryv1:registryv1 19 | - registryv2:registryv2 20 | registryv1: 21 | image: registry:0.9.1 22 | ports: 23 | - "5000" 24 | registryv2: 25 | build: "../../" 26 | ports: 27 | - "5000" 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/syslog/README.md: -------------------------------------------------------------------------------- 1 | # Syslog Hooks for Logrus :walrus: 2 | 3 | ## Usage 4 | 5 | ```go 6 | import ( 7 | "log/syslog" 8 | "github.com/Sirupsen/logrus" 9 | logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" 10 | ) 11 | 12 | func main() { 13 | log := logrus.New() 14 | hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 15 | 16 | if err == nil { 17 | log.Hooks.Add(hook) 18 | } 19 | } 20 | ``` 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | # never checkin from the bin file (for now) 27 | bin/* 28 | 29 | # Test key files 30 | *.pem 31 | 32 | # Cover profiles 33 | *.out 34 | 35 | # Editor/IDE specific files. 36 | *.sublime-project 37 | *.sublime-workspace 38 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /registry/storage/driver/inmemory/driver_test.go: -------------------------------------------------------------------------------- 1 | package inmemory 2 | 3 | import ( 4 | "testing" 5 | 6 | storagedriver "github.com/docker/distribution/registry/storage/driver" 7 | "github.com/docker/distribution/registry/storage/driver/testsuites" 8 | "gopkg.in/check.v1" 9 | ) 10 | 11 | // Hook up gocheck into the "go test" runner. 12 | func Test(t *testing.T) { check.TestingT(t) } 13 | 14 | func init() { 15 | inmemoryDriverConstructor := func() (storagedriver.StorageDriver, error) { 16 | return New(), nil 17 | } 18 | testsuites.RegisterSuite(inmemoryDriverConstructor, testsuites.NeverSkip) 19 | } 20 | -------------------------------------------------------------------------------- /registry/storage/util.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "github.com/docker/distribution/context" 5 | "github.com/docker/distribution/registry/storage/driver" 6 | ) 7 | 8 | // Exists provides a utility method to test whether or not a path exists in 9 | // the given driver. 10 | func exists(ctx context.Context, drv driver.StorageDriver, path string) (bool, error) { 11 | if _, err := drv.Stat(ctx, path); err != nil { 12 | switch err := err.(type) { 13 | case driver.PathNotFoundError: 14 | return false, nil 15 | default: 16 | return false, err 17 | } 18 | } 19 | 20 | return true, nil 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/AdRoll/goamz/s3/export_test.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "github.com/AdRoll/goamz/aws" 5 | ) 6 | 7 | var originalStrategy = attempts 8 | 9 | func SetAttemptStrategy(s *aws.AttemptStrategy) { 10 | if s == nil { 11 | attempts = originalStrategy 12 | } else { 13 | attempts = *s 14 | } 15 | } 16 | 17 | func Sign(auth aws.Auth, method, path string, params, headers map[string][]string) { 18 | sign(auth, method, path, params, headers) 19 | } 20 | 21 | func SetListPartsMax(n int) { 22 | listPartsMax = n 23 | } 24 | 25 | func SetListMultiMax(n int) { 26 | listMultiMax = n 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/github.com/bradfitz/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome. 18 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/pipe_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. 2 | // See https://code.google.com/p/go/source/browse/CONTRIBUTORS 3 | // Licensed under the same terms as Go itself: 4 | // https://code.google.com/p/go/source/browse/LICENSE 5 | 6 | package http2 7 | 8 | import ( 9 | "errors" 10 | "testing" 11 | ) 12 | 13 | func TestPipeClose(t *testing.T) { 14 | var p pipe 15 | p.c.L = &p.m 16 | a := errors.New("a") 17 | b := errors.New("b") 18 | p.Close(a) 19 | p.Close(b) 20 | _, err := p.Read(make([]byte, 1)) 21 | if err != a { 22 | t.Errorf("err = %v want %v", err, a) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/internal/opts/option.go: -------------------------------------------------------------------------------- 1 | // Package opts holds the DialOpts struct, configurable by 2 | // cloud.ClientOptions to set up transports for cloud packages. 3 | // 4 | // This is a separate page to prevent cycles between the core 5 | // cloud packages. 6 | package opts 7 | 8 | import ( 9 | "net/http" 10 | 11 | "golang.org/x/oauth2" 12 | "google.golang.org/grpc" 13 | ) 14 | 15 | type DialOpt struct { 16 | Endpoint string 17 | Scopes []string 18 | UserAgent string 19 | 20 | TokenSource oauth2.TokenSource 21 | 22 | HTTPClient *http.Client 23 | GRPCClient *grpc.ClientConn 24 | } 25 | -------------------------------------------------------------------------------- /digest/digester_resumable_test.go: -------------------------------------------------------------------------------- 1 | // +build !noresumabledigest 2 | 3 | package digest 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/stevvooe/resumable" 9 | _ "github.com/stevvooe/resumable/sha256" 10 | ) 11 | 12 | // TestResumableDetection just ensures that the resumable capability of a hash 13 | // is exposed through the digester type, which is just a hash plus a Digest 14 | // method. 15 | func TestResumableDetection(t *testing.T) { 16 | d := Canonical.New() 17 | 18 | if _, ok := d.Hash().(resumable.Hash); !ok { 19 | t.Fatalf("expected digester to implement resumable.Hash: %#v, %v", d, d.Hash()) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.5 6 | 7 | package ctxhttp 8 | 9 | import "net/http" 10 | 11 | type requestCanceler interface { 12 | CancelRequest(*http.Request) 13 | } 14 | 15 | func canceler(client *http.Client, req *http.Request) func() { 16 | rc, ok := client.Transport.(requestCanceler) 17 | if !ok { 18 | return func() {} 19 | } 20 | return func() { 21 | rc.CancelRequest(req) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/github/github.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package github provides constants for using OAuth2 to access Github. 6 | package github // import "golang.org/x/oauth2/github" 7 | 8 | import ( 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // Endpoint is Github's OAuth 2.0 endpoint. 13 | var Endpoint = oauth2.Endpoint{ 14 | AuthURL: "https://github.com/login/oauth/authorize", 15 | TokenURL: "https://github.com/login/oauth/access_token", 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/gorilla/mux/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package mux 6 | 7 | import ( 8 | "net/http" 9 | "testing" 10 | ) 11 | 12 | func BenchmarkMux(b *testing.B) { 13 | router := new(Router) 14 | handler := func(w http.ResponseWriter, r *http.Request) {} 15 | router.HandleFunc("/v1/{v1}", handler) 16 | 17 | request, _ := http.NewRequest("GET", "/v1/anything", nil) 18 | for i := 0; i < b.N; i++ { 19 | router.ServeHTTP(nil, request) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.4 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y librados-dev apache2-utils && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution 8 | ENV GOPATH $DISTRIBUTION_DIR/Godeps/_workspace:$GOPATH 9 | ENV DOCKER_BUILDTAGS include_rados include_oss include_gcs 10 | 11 | WORKDIR $DISTRIBUTION_DIR 12 | COPY . $DISTRIBUTION_DIR 13 | COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml 14 | RUN make PREFIX=/go clean binaries 15 | 16 | VOLUME ["/var/lib/registry"] 17 | EXPOSE 5000 18 | ENTRYPOINT ["registry"] 19 | CMD ["/etc/docker/registry/config.yml"] 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/papertrail/papertrail_test.go: -------------------------------------------------------------------------------- 1 | package logrus_papertrail 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/Sirupsen/logrus" 8 | "github.com/stvp/go-udp-testing" 9 | ) 10 | 11 | func TestWritingToUDP(t *testing.T) { 12 | port := 16661 13 | udp.SetAddr(fmt.Sprintf(":%d", port)) 14 | 15 | hook, err := NewPapertrailHook("localhost", port, "test") 16 | if err != nil { 17 | t.Errorf("Unable to connect to local UDP server.") 18 | } 19 | 20 | log := logrus.New() 21 | log.Hooks.Add(hook) 22 | 23 | udp.ShouldReceive(t, "foo", func() { 24 | log.Info("foo") 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/agent.go: -------------------------------------------------------------------------------- 1 | package newrelic_platform_go 2 | 3 | import ( 4 | "log" 5 | "os" 6 | ) 7 | 8 | type Agent struct { 9 | Host string `json:"host"` 10 | Version string `json:"version"` 11 | Pid int `json:"pid"` 12 | } 13 | 14 | func NewAgent(Version string) *Agent { 15 | agent := &Agent{ 16 | Version: Version, 17 | } 18 | return agent 19 | } 20 | 21 | func (agent *Agent) CollectEnvironmentInfo() { 22 | var err error 23 | agent.Pid = os.Getpid() 24 | if agent.Host, err = os.Hostname(); err != nil { 25 | log.Fatalf("Can not get hostname: %#v \n", err) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /contrib/docker-integration/helpers.bash: -------------------------------------------------------------------------------- 1 | # Start docker daemon 2 | function start_daemon() { 3 | # Drivers to use for Docker engines the tests are going to create. 4 | STORAGE_DRIVER=${STORAGE_DRIVER:-overlay} 5 | EXEC_DRIVER=${EXEC_DRIVER:-native} 6 | 7 | docker --daemon --log-level=panic \ 8 | --storage-driver="$STORAGE_DRIVER" --exec-driver="$EXEC_DRIVER" & 9 | DOCKER_PID=$! 10 | 11 | # Wait for it to become reachable. 12 | tries=10 13 | until docker version &> /dev/null; do 14 | (( tries-- )) 15 | if [ $tries -le 0 ]; then 16 | echo >&2 "error: daemon failed to start" 17 | exit 1 18 | fi 19 | sleep 1 20 | done 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/graphite_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "net" 5 | "time" 6 | ) 7 | 8 | func ExampleGraphite() { 9 | addr, _ := net.ResolveTCPAddr("net", ":2003") 10 | go Graphite(DefaultRegistry, 1*time.Second, "some.prefix", addr) 11 | } 12 | 13 | func ExampleGraphiteWithConfig() { 14 | addr, _ := net.ResolveTCPAddr("net", ":2003") 15 | go GraphiteWithConfig(GraphiteConfig{ 16 | Addr: addr, 17 | Registry: DefaultRegistry, 18 | FlushInterval: 1 * time.Second, 19 | DurationUnit: time.Millisecond, 20 | Percentiles: []float64{ 0.5, 0.75, 0.99, 0.999 }, 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/facebook/facebook.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package facebook provides constants for using OAuth2 to access Facebook. 6 | package facebook // import "golang.org/x/oauth2/facebook" 7 | 8 | import ( 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // Endpoint is Facebook's OAuth 2.0 endpoint. 13 | var Endpoint = oauth2.Endpoint{ 14 | AuthURL: "https://www.facebook.com/dialog/oauth", 15 | TokenURL: "https://graph.facebook.com/oauth/access_token", 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README: -------------------------------------------------------------------------------- 1 | 2 | Client: 3 | -- Firefox nightly with about:config network.http.spdy.enabled.http2draft set true 4 | -- Chrome: go to chrome://flags/#enable-spdy4, save and restart (button at bottom) 5 | 6 | Make CA: 7 | $ openssl genrsa -out rootCA.key 2048 8 | $ openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem 9 | ... install that to Firefox 10 | 11 | Make cert: 12 | $ openssl genrsa -out server.key 2048 13 | $ openssl req -new -key server.key -out server.csr 14 | $ openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 15 | 16 | 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/linkedin/linkedin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package linkedin provides constants for using OAuth2 to access LinkedIn. 6 | package linkedin // import "golang.org/x/oauth2/linkedin" 7 | 8 | import ( 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // Endpoint is LinkedIn's OAuth 2.0 endpoint. 13 | var Endpoint = oauth2.Endpoint{ 14 | AuthURL: "https://www.linkedin.com/uas/oauth2/authorization", 15 | TokenURL: "https://www.linkedin.com/uas/oauth2/accessToken", 16 | } 17 | -------------------------------------------------------------------------------- /project/hooks/README.md: -------------------------------------------------------------------------------- 1 | Git Hooks 2 | ========= 3 | 4 | To enforce valid and properly-formatted code, there is CI in place which runs `gofmt`, `golint`, and `go vet` against code in the repository. 5 | 6 | As an aid to prevent committing invalid code in the first place, a git pre-commit hook has been added to the repository, found in [pre-commit](./pre-commit). As it is impossible to automatically add linked hooks to a git repository, this hook should be linked into your `.git/hooks/pre-commit`, which can be done by running the `configure-hooks.sh` script in this directory. This script is the preferred method of configuring hooks, as it will be updated as more are added. -------------------------------------------------------------------------------- /context/version.go: -------------------------------------------------------------------------------- 1 | package context 2 | 3 | // WithVersion stores the application version in the context. The new context 4 | // gets a logger to ensure log messages are marked with the application 5 | // version. 6 | func WithVersion(ctx Context, version string) Context { 7 | ctx = WithValue(ctx, "version", version) 8 | // push a new logger onto the stack 9 | return WithLogger(ctx, GetLogger(ctx, "version")) 10 | } 11 | 12 | // GetVersion returns the application version from the context. An empty 13 | // string may returned if the version was not set on the context. 14 | func GetVersion(ctx Context) string { 15 | return GetStringValue(ctx, "version") 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/tarsum/testdata/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json: -------------------------------------------------------------------------------- 1 | {"id":"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158","comment":"Imported from -","created":"2013-06-13T14:03:50.821769-07:00","container_config":{"Hostname":"","Domainname":"","User":"","Memory":0,"MemorySwap":0,"CpuShares":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"ExposedPorts":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":null,"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"NetworkDisabled":false,"OnBuild":null},"docker_version":"0.4.0","architecture":"x86_64","Size":0} -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package nettest 8 | 9 | import ( 10 | "fmt" 11 | "os" 12 | "runtime" 13 | ) 14 | 15 | // SupportsRawIPSocket reports whether the platform supports raw IP 16 | // sockets. 17 | func SupportsRawIPSocket() (string, bool) { 18 | if os.Getuid() != 0 { 19 | return fmt.Sprintf("must be root on %s", runtime.GOOS), false 20 | } 21 | return "", true 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package odnoklassniki provides constants for using OAuth2 to access Odnoklassniki. 6 | package odnoklassniki // import "golang.org/x/oauth2/odnoklassniki" 7 | 8 | import ( 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // Endpoint is Odnoklassniki's OAuth 2.0 endpoint. 13 | var Endpoint = oauth2.Endpoint{ 14 | AuthURL: "https://www.odnoklassniki.ru/oauth/authorize", 15 | TokenURL: "https://api.odnoklassniki.ru/oauth/token.do", 16 | } 17 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Code; DO NOT EDIT 2 | 3 | package codes 4 | 5 | import "fmt" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i+1 >= Code(len(_Code_index)) { 13 | return fmt.Sprintf("Code(%d)", i) 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /project/dev-image/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | ENV GOLANG_VERSION 1.4rc1 4 | ENV GOPATH /var/cache/drone 5 | ENV GOROOT /usr/local/go 6 | ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin 7 | 8 | ENV LANG C 9 | ENV LC_ALL C 10 | 11 | RUN apt-get update && apt-get install -y \ 12 | wget ca-certificates git mercurial bzr \ 13 | --no-install-recommends \ 14 | && rm -rf /var/lib/apt/lists/* 15 | 16 | RUN wget https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz --quiet && \ 17 | tar -C /usr/local -xzf go$GOLANG_VERSION.linux-amd64.tar.gz && \ 18 | rm go${GOLANG_VERSION}.linux-amd64.tar.gz 19 | 20 | RUN go get github.com/axw/gocov/gocov github.com/mattn/goveralls github.com/golang/lint/golint 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/client_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine appenginevm 6 | 7 | // App Engine hooks. 8 | 9 | package oauth2 10 | 11 | import ( 12 | "net/http" 13 | 14 | "golang.org/x/net/context" 15 | "golang.org/x/oauth2/internal" 16 | "google.golang.org/appengine/urlfetch" 17 | ) 18 | 19 | func init() { 20 | internal.RegisterContextClientFunc(contextClientAppEngine) 21 | } 22 | 23 | func contextClientAppEngine(ctx context.Context) (*http.Client, error) { 24 | return urlfetch.Client(ctx), nil 25 | } 26 | -------------------------------------------------------------------------------- /registry/storage/driver/filesystem/driver_test.go: -------------------------------------------------------------------------------- 1 | package filesystem 2 | 3 | import ( 4 | "io/ioutil" 5 | "os" 6 | "testing" 7 | 8 | storagedriver "github.com/docker/distribution/registry/storage/driver" 9 | "github.com/docker/distribution/registry/storage/driver/testsuites" 10 | . "gopkg.in/check.v1" 11 | ) 12 | 13 | // Hook up gocheck into the "go test" runner. 14 | func Test(t *testing.T) { TestingT(t) } 15 | 16 | func init() { 17 | root, err := ioutil.TempDir("", "driver-") 18 | if err != nil { 19 | panic(err) 20 | } 21 | defer os.Remove(root) 22 | 23 | testsuites.RegisterSuite(func() (storagedriver.StorageDriver, error) { 24 | return New(root), nil 25 | }, testsuites.NeverSkip) 26 | } 27 | -------------------------------------------------------------------------------- /version/print.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | ) 8 | 9 | // FprintVersion outputs the version string to the writer, in the following 10 | // format, followed by a newline: 11 | // 12 | // 13 | // 14 | // For example, a binary "registry" built from github.com/docker/distribution 15 | // with version "v2.0" would print the following: 16 | // 17 | // registry github.com/docker/distribution v2.0 18 | // 19 | func FprintVersion(w io.Writer) { 20 | fmt.Fprintln(w, os.Args[0], Package, Version) 21 | } 22 | 23 | // PrintVersion outputs the version information, from Fprint, to stdout. 24 | func PrintVersion() { 25 | FprintVersion(os.Stdout) 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTerminal returns true if the given file descriptor is a terminal. 16 | func IsTerminal() bool { 17 | fd := syscall.Stdout 18 | var termios Termios 19 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 20 | return err == 0 21 | } 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/examples/tasks.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | 7 | tasks "google.golang.org/api/tasks/v1" 8 | ) 9 | 10 | func init() { 11 | registerDemo("tasks", tasks.TasksScope, tasksMain) 12 | } 13 | 14 | func tasksMain(client *http.Client, argv []string) { 15 | taskapi, err := tasks.New(client) 16 | if err != nil { 17 | log.Fatalf("Unable to create Tasks service: %v", err) 18 | } 19 | 20 | task, err := taskapi.Tasks.Insert("@default", &tasks.Task{ 21 | Title: "finish this API code generator thing", 22 | Notes: "ummmm", 23 | Due: "2011-10-15T12:00:00.000Z", 24 | }).Do() 25 | log.Printf("Got task, err: %#v, %v", task, err) 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Azure/azure-sdk-for-go/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | before_script: 6 | - go get -u golang.org/x/tools/cmd/vet 7 | - go get -u github.com/golang/lint/golint 8 | 9 | go: tip 10 | script: 11 | - test -z "$(gofmt -s -l -w management | tee /dev/stderr)" 12 | - test -z "$(gofmt -s -l -w storage | tee /dev/stderr)" 13 | - go build -v ./... 14 | - go test -v ./storage/... -check.v 15 | - test -z "$(golint ./storage/... | tee /dev/stderr)" 16 | - go vet ./storage/... 17 | - go test -v ./management/... 18 | - test -z "$(golint ./management/... | grep -v 'should have comment' | grep -v 'stutters' | tee /dev/stderr)" 19 | - go vet ./management/... 20 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/osext/osext_procfs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux netbsd openbsd 6 | 7 | package osext 8 | 9 | import ( 10 | "errors" 11 | "os" 12 | "runtime" 13 | ) 14 | 15 | func executable() (string, error) { 16 | switch runtime.GOOS { 17 | case "linux": 18 | return os.Readlink("/proc/self/exe") 19 | case "netbsd": 20 | return os.Readlink("/proc/curproc/exe") 21 | case "openbsd": 22 | return os.Readlink("/proc/curproc/file") 23 | } 24 | return "", errors.New("ExecPath not implemented for " + runtime.GOOS) 25 | } 26 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go: -------------------------------------------------------------------------------- 1 | package logrus_syslog 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "log/syslog" 6 | "testing" 7 | ) 8 | 9 | func TestLocalhostAddAndPrint(t *testing.T) { 10 | log := logrus.New() 11 | hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 12 | 13 | if err != nil { 14 | t.Errorf("Unable to connect to local syslog.") 15 | } 16 | 17 | log.Hooks.Add(hook) 18 | 19 | for _, level := range hook.Levels() { 20 | if len(log.Hooks[level]) != 1 { 21 | t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level])) 22 | } 23 | } 24 | 25 | log.Info("Congratulations!") 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libtrust/util_test.go: -------------------------------------------------------------------------------- 1 | package libtrust 2 | 3 | import ( 4 | "encoding/pem" 5 | "reflect" 6 | "testing" 7 | ) 8 | 9 | func TestAddPEMHeadersToKey(t *testing.T) { 10 | pk := &rsaPublicKey{nil, map[string]interface{}{}} 11 | blk := &pem.Block{Headers: map[string]string{"hosts": "localhost,127.0.0.1"}} 12 | addPEMHeadersToKey(blk, pk) 13 | 14 | val := pk.GetExtendedField("hosts") 15 | hosts, ok := val.([]string) 16 | if !ok { 17 | t.Fatalf("hosts type(%v), expected []string", reflect.TypeOf(val)) 18 | } 19 | expected := []string{"localhost", "127.0.0.1"} 20 | if !reflect.DeepEqual(hosts, expected) { 21 | t.Errorf("hosts(%v), expected %v", hosts, expected) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/json_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "testing" 7 | ) 8 | 9 | func TestRegistryMarshallJSON(t *testing.T) { 10 | b := &bytes.Buffer{} 11 | enc := json.NewEncoder(b) 12 | r := NewRegistry() 13 | r.Register("counter", NewCounter()) 14 | enc.Encode(r) 15 | if s := b.String(); "{\"counter\":{\"count\":0}}\n" != s { 16 | t.Fatalf(s) 17 | } 18 | } 19 | 20 | func TestRegistryWriteJSONOnce(t *testing.T) { 21 | r := NewRegistry() 22 | r.Register("counter", NewCounter()) 23 | b := &bytes.Buffer{} 24 | WriteJSONOnce(r, b) 25 | if s := b.String(); s != "{\"counter\":{\"count\":0}}\n" { 26 | t.Fail() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/datastore/testdata/index.yaml: -------------------------------------------------------------------------------- 1 | indexes: 2 | 3 | - kind: SQChild 4 | ancestor: yes 5 | properties: 6 | - name: T 7 | - name: I 8 | 9 | - kind: SQChild 10 | ancestor: yes 11 | properties: 12 | - name: T 13 | - name: I 14 | direction: desc 15 | 16 | - kind: SQChild 17 | ancestor: yes 18 | properties: 19 | - name: I 20 | - name: T 21 | - name: U 22 | 23 | - kind: SQChild 24 | ancestor: yes 25 | properties: 26 | - name: I 27 | - name: T 28 | - name: U 29 | 30 | - kind: SQChild 31 | ancestor: yes 32 | properties: 33 | - name: T 34 | - name: J 35 | 36 | - kind: SQChild 37 | ancestor: yes 38 | properties: 39 | - name: T 40 | - name: J 41 | - name: U -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/codegen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script serves as an example to demonstrate how to generate the gRPC-Go 4 | # interface and the related messages from .proto file. 5 | # 6 | # It assumes the installation of i) Google proto buffer compiler at 7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen 8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have 9 | # not, please install them first. 10 | # 11 | # We recommend running this script at $GOPATH/src. 12 | # 13 | # If this is not what you need, feel free to make your own scripts. Again, this 14 | # script is for demonstration purpose. 15 | # 16 | proto=$1 17 | protoc --go_out=plugins=grpc:. $proto 18 | -------------------------------------------------------------------------------- /contrib/compose/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | 4 | error_log /var/log/nginx/error.log warn; 5 | pid /var/run/nginx.pid; 6 | 7 | events { 8 | worker_connections 1024; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 16 | '$status $body_bytes_sent "$http_referer" ' 17 | '"$http_user_agent" "$http_x_forwarded_for"'; 18 | 19 | access_log /var/log/nginx/access.log main; 20 | 21 | sendfile on; 22 | 23 | keepalive_timeout 65; 24 | 25 | include /etc/nginx/conf.d/*.conf; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /registry/storage/driver/azure/blockblob.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | azure "github.com/Azure/azure-sdk-for-go/storage" 8 | ) 9 | 10 | // azureBlockStorage is adaptor between azure.BlobStorageClient and 11 | // blockStorage interface. 12 | type azureBlockStorage struct { 13 | azure.BlobStorageClient 14 | } 15 | 16 | func (b *azureBlockStorage) GetSectionReader(container, blob string, start, length int64) (io.ReadCloser, error) { 17 | return b.BlobStorageClient.GetBlobRange(container, blob, fmt.Sprintf("%v-%v", start, start+length-1)) 18 | } 19 | 20 | func newAzureBlockStorage(b azure.BlobStorageClient) azureBlockStorage { 21 | a := azureBlockStorage{} 22 | a.BlobStorageClient = b 23 | return a 24 | } 25 | -------------------------------------------------------------------------------- /contrib/docker-integration/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | 4 | error_log /var/log/nginx/error.log warn; 5 | pid /var/run/nginx.pid; 6 | 7 | events { 8 | worker_connections 1024; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 16 | '$status $body_bytes_sent "$http_referer" ' 17 | '"$http_user_agent" "$http_x_forwarded_for"'; 18 | 19 | access_log /var/log/nginx/access.log main; 20 | 21 | sendfile on; 22 | 23 | keepalive_timeout 65; 24 | 25 | include /etc/nginx/conf.d/*.conf; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() *io.PipeWriter { 10 | reader, writer := io.Pipe() 11 | 12 | go logger.writerScanner(reader) 13 | runtime.SetFinalizer(writer, writerFinalizer) 14 | 15 | return writer 16 | } 17 | 18 | func (logger *Logger) writerScanner(reader *io.PipeReader) { 19 | scanner := bufio.NewScanner(reader) 20 | for scanner.Scan() { 21 | logger.Print(scanner.Text()) 22 | } 23 | if err := scanner.Err(); err != nil { 24 | logger.Errorf("Error while reading from Writer: %s", err) 25 | } 26 | reader.Close() 27 | } 28 | 29 | func writerFinalizer(writer *io.PipeWriter) { 30 | writer.Close() 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/docker/pkg/tarsum/builder_context.go: -------------------------------------------------------------------------------- 1 | package tarsum 2 | 3 | // This interface extends TarSum by adding the Remove method. In general 4 | // there was concern about adding this method to TarSum itself so instead 5 | // it is being added just to "BuilderContext" which will then only be used 6 | // during the .dockerignore file processing - see builder/evaluator.go 7 | type BuilderContext interface { 8 | TarSum 9 | Remove(string) 10 | } 11 | 12 | func (bc *tarSum) Remove(filename string) { 13 | for i, fis := range bc.sums { 14 | if fis.Name() == filename { 15 | bc.sums = append(bc.sums[:i], bc.sums[i+1:]...) 16 | // Note, we don't just return because there could be 17 | // more than one with this name 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /health/checks/checks_test.go: -------------------------------------------------------------------------------- 1 | package checks 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestFileChecker(t *testing.T) { 8 | if err := FileChecker("/tmp").Check(); err == nil { 9 | t.Errorf("/tmp was expected as exists") 10 | } 11 | 12 | if err := FileChecker("NoSuchFileFromMoon").Check(); err != nil { 13 | t.Errorf("NoSuchFileFromMoon was expected as not exists, error:%v", err) 14 | } 15 | } 16 | 17 | func TestHTTPChecker(t *testing.T) { 18 | if err := HTTPChecker("https://www.google.cybertron", 200, 0, nil).Check(); err == nil { 19 | t.Errorf("Google on Cybertron was expected as not exists") 20 | } 21 | 22 | if err := HTTPChecker("https://www.google.pt", 200, 0, nil).Check(); err != nil { 23 | t.Errorf("Google at Portugal was expected as exists, error:%v", err) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/spec/implementations.md: -------------------------------------------------------------------------------- 1 | # Distribution API Implementations 2 | 3 | This is a list of known implementations of the Distribution API spec. 4 | 5 | ## [Docker Distribution Registry](https://github.com/docker/distribution) 6 | 7 | Docker distribution is the reference implementation of the distribution API 8 | specification. It aims to fully implement the entire specification. 9 | 10 | ### Releases 11 | #### 2.0.1 (_in development_) 12 | Implements API 2.0.1 13 | 14 | _Known Issues_ 15 | - No resumable push support 16 | - Content ranges ignored 17 | - Blob upload status will always return a starting range of 0 18 | 19 | #### 2.0.0 20 | Implements API 2.0.0 21 | 22 | _Known Issues_ 23 | - No resumable push support 24 | - No PATCH implementation for blob upload 25 | - Content ranges ignored 26 | 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/AdRoll/goamz/aws/export_test.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | ) 7 | 8 | // V4Signer: 9 | // Exporting methods for testing 10 | 11 | func (s *V4Signer) RequestTime(req *http.Request) time.Time { 12 | return s.requestTime(req) 13 | } 14 | 15 | func (s *V4Signer) CanonicalRequest(req *http.Request) string { 16 | return s.canonicalRequest(req, "") 17 | } 18 | 19 | func (s *V4Signer) StringToSign(t time.Time, creq string) string { 20 | return s.stringToSign(t, creq) 21 | } 22 | 23 | func (s *V4Signer) Signature(t time.Time, sts string) string { 24 | return s.signature(t, sts) 25 | } 26 | 27 | func (s *V4Signer) Authorization(header http.Header, t time.Time, signature string) string { 28 | return s.authorization(header, t, signature) 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if the given file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stdout 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/cmd/metrics-bench/metrics-bench.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/rcrowley/go-metrics" 6 | "time" 7 | ) 8 | 9 | func main() { 10 | r := metrics.NewRegistry() 11 | for i := 0; i < 10000; i++ { 12 | r.Register(fmt.Sprintf("counter-%d", i), metrics.NewCounter()) 13 | r.Register(fmt.Sprintf("gauge-%d", i), metrics.NewGauge()) 14 | r.Register(fmt.Sprintf("gaugefloat64-%d", i), metrics.NewGaugeFloat64()) 15 | r.Register(fmt.Sprintf("histogram-uniform-%d", i), metrics.NewHistogram(metrics.NewUniformSample(1028))) 16 | r.Register(fmt.Sprintf("histogram-exp-%d", i), metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015))) 17 | r.Register(fmt.Sprintf("meter-%d", i), metrics.NewMeter()) 18 | } 19 | time.Sleep(600e9) 20 | } 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/examples/hook/hook.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "github.com/Sirupsen/logrus/hooks/airbrake" 6 | ) 7 | 8 | var log = logrus.New() 9 | 10 | func init() { 11 | log.Formatter = new(logrus.TextFormatter) // default 12 | log.Hooks.Add(airbrake.NewHook("https://example.com", "xyz", "development")) 13 | } 14 | 15 | func main() { 16 | log.WithFields(logrus.Fields{ 17 | "animal": "walrus", 18 | "size": 10, 19 | }).Info("A group of walrus emerges from the ocean") 20 | 21 | log.WithFields(logrus.Fields{ 22 | "omg": true, 23 | "number": 122, 24 | }).Warn("The group's number increased tremendously!") 25 | 26 | log.WithFields(logrus.Fields{ 27 | "omg": true, 28 | "number": 100, 29 | }).Fatal("The ice breaks!") 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/README.md: -------------------------------------------------------------------------------- 1 | #gRPC-Go 2 | 3 | [![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) [![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc) 4 | 5 | The Go implementation of [gRPC](https://github.com/grpc/grpc) 6 | 7 | Installation 8 | ------------ 9 | 10 | To install this package, you need to install Go 1.4 and setup your Go workspace on your computer. The simplest way to install the library is to run: 11 | 12 | ``` 13 | $ go get google.golang.org/grpc 14 | ``` 15 | 16 | Documentation 17 | ------------- 18 | You can find more detailed documentation and examples in the [grpc-common repository](http://github.com/grpc/grpc-common). 19 | 20 | Status 21 | ------ 22 | Alpha - ready for early adopters. 23 | 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/panicwrap.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package bugsnag 4 | 5 | import ( 6 | "github.com/bugsnag/panicwrap" 7 | "github.com/bugsnag/bugsnag-go/errors" 8 | ) 9 | 10 | // NOTE: this function does not return when you call it, instead it 11 | // re-exec()s the current process with panic monitoring. 12 | func defaultPanicHandler() { 13 | defer defaultNotifier.dontPanic() 14 | 15 | err := panicwrap.BasicMonitor(func(output string) { 16 | toNotify, err := errors.ParsePanic(output) 17 | 18 | if err != nil { 19 | defaultNotifier.Config.log("bugsnag.handleUncaughtPanic: %v", err) 20 | } 21 | Notify(toNotify, SeverityError, Configuration{Synchronous: true}) 22 | }) 23 | 24 | if err != nil { 25 | defaultNotifier.Config.log("bugsnag.handleUncaughtPanic: %v", err) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libtrust/README.md: -------------------------------------------------------------------------------- 1 | # libtrust 2 | 3 | Libtrust is library for managing authentication and authorization using public key cryptography. 4 | 5 | Authentication is handled using the identity attached to the public key. 6 | Libtrust provides multiple methods to prove possession of the private key associated with an identity. 7 | - TLS x509 certificates 8 | - Signature verification 9 | - Key Challenge 10 | 11 | Authorization and access control is managed through a distributed trust graph. 12 | Trust servers are used as the authorities of the trust graph and allow caching portions of the graph for faster access. 13 | 14 | ## Copyright and license 15 | 16 | Code and documentation copyright 2014 Docker, inc. Code released under the Apache 2.0 license. 17 | Docs released under Creative commons. 18 | 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/context/withtimeout_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | func ExampleWithTimeout() { 15 | // Pass a context with a timeout to tell a blocking function that it 16 | // should abandon its work after the timeout elapses. 17 | ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond) 18 | select { 19 | case <-time.After(200 * time.Millisecond): 20 | fmt.Println("overslept") 21 | case <-ctx.Done(): 22 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 23 | } 24 | // Output: 25 | // context deadline exceeded 26 | } 27 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_posix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows 6 | 7 | package nettest 8 | 9 | import ( 10 | "os" 11 | "syscall" 12 | ) 13 | 14 | func protocolNotSupported(err error) bool { 15 | switch err := err.(type) { 16 | case syscall.Errno: 17 | switch err { 18 | case syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT: 19 | return true 20 | } 21 | case *os.SyscallError: 22 | switch err := err.Err.(type) { 23 | case syscall.Errno: 24 | switch err { 25 | case syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT: 26 | return true 27 | } 28 | } 29 | } 30 | return false 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/errors_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // See https://code.google.com/p/go/source/browse/CONTRIBUTORS 5 | // Licensed under the same terms as Go itself: 6 | // https://code.google.com/p/go/source/browse/LICENSE 7 | 8 | package http2 9 | 10 | import "testing" 11 | 12 | func TestErrCodeString(t *testing.T) { 13 | tests := []struct { 14 | err ErrCode 15 | want string 16 | }{ 17 | {ErrCodeProtocol, "PROTOCOL_ERROR"}, 18 | {0xd, "HTTP_1_1_REQUIRED"}, 19 | {0xf, "unknown error code 0xf"}, 20 | } 21 | for i, tt := range tests { 22 | got := tt.err.String() 23 | if got != tt.want { 24 | t.Errorf("%d. Error = %q; want %q", i, got, tt.want) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/internal/token_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package internal contains support packages for oauth2 package. 6 | package internal 7 | 8 | import ( 9 | "fmt" 10 | "testing" 11 | ) 12 | 13 | func Test_providerAuthHeaderWorks(t *testing.T) { 14 | for _, p := range brokenAuthHeaderProviders { 15 | if providerAuthHeaderWorks(p) { 16 | t.Errorf("URL: %s not found in list", p) 17 | } 18 | p := fmt.Sprintf("%ssomesuffix", p) 19 | if providerAuthHeaderWorks(p) { 20 | t.Errorf("URL: %s not found in list", p) 21 | } 22 | } 23 | p := "https://api.not-in-the-list-example.com/" 24 | if !providerAuthHeaderWorks(p) { 25 | t.Errorf("URL: %s found in list", p) 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/spf13/pflag/export_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pflag 6 | 7 | import ( 8 | "io/ioutil" 9 | "os" 10 | ) 11 | 12 | // Additional routines compiled into the package only during testing. 13 | 14 | // ResetForTesting clears all flag state and sets the usage function as directed. 15 | // After calling ResetForTesting, parse errors in flag handling will not 16 | // exit the program. 17 | func ResetForTesting(usage func()) { 18 | CommandLine = &FlagSet{ 19 | name: os.Args[0], 20 | errorHandling: ContinueOnError, 21 | output: ioutil.Discard, 22 | } 23 | Usage = usage 24 | } 25 | 26 | // GetCommandLine returns the default FlagSet. 27 | func GetCommandLine() *FlagSet { 28 | return CommandLine 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/gauge_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import "testing" 4 | 5 | func BenchmarkGuage(b *testing.B) { 6 | g := NewGauge() 7 | b.ResetTimer() 8 | for i := 0; i < b.N; i++ { 9 | g.Update(int64(i)) 10 | } 11 | } 12 | 13 | func TestGauge(t *testing.T) { 14 | g := NewGauge() 15 | g.Update(int64(47)) 16 | if v := g.Value(); 47 != v { 17 | t.Errorf("g.Value(): 47 != %v\n", v) 18 | } 19 | } 20 | 21 | func TestGaugeSnapshot(t *testing.T) { 22 | g := NewGauge() 23 | g.Update(int64(47)) 24 | snapshot := g.Snapshot() 25 | g.Update(int64(0)) 26 | if v := snapshot.Value(); 47 != v { 27 | t.Errorf("g.Value(): 47 != %v\n", v) 28 | } 29 | } 30 | 31 | func TestGetOrRegisterGauge(t *testing.T) { 32 | r := NewRegistry() 33 | NewRegisteredGauge("foo", r).Update(47) 34 | if g := GetOrRegisterGauge("foo", r); 47 != g.Value() { 35 | t.Fatal(g) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /version/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This bash script outputs the current, desired content of version.go, using 4 | # git describe. For best effect, pipe this to the target file. Generally, this 5 | # only needs to updated for releases. The actual value of will be replaced 6 | # during build time if the makefile is used. 7 | 8 | set -e 9 | 10 | cat < 2 | +++ 3 | title = "Getting help" 4 | description = "Getting help with the Registry" 5 | keywords = ["registry, on-prem, images, tags, repository, distribution, help, 101, TL;DR"] 6 | [menu.main] 7 | parent="smn_registry" 8 | weight=9 9 | +++ 10 | 11 | 12 | # Getting help 13 | 14 | If you need help, or just want to chat, you can reach us: 15 | 16 | - on irc: `#docker-distribution` on freenode 17 | - on the [mailing list](https://groups.google.com/a/dockerproject.org/forum/#!forum/distribution) (mail at ) 18 | 19 | If you want to report a bug: 20 | 21 | - be sure to first read about [how to contribute](https://github.com/docker/distribution/blob/master/CONTRIBUTING.md) 22 | - you can then do so on the [GitHub project bugtracker](https://github.com/docker/distribution/issues) 23 | 24 | You can also find out more about the Docker's project [Getting Help resources](https://docs.docker.com/project/get-help). 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/osext/osext_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package osext 6 | 7 | import ( 8 | "syscall" 9 | "unicode/utf16" 10 | "unsafe" 11 | ) 12 | 13 | var ( 14 | kernel = syscall.MustLoadDLL("kernel32.dll") 15 | getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW") 16 | ) 17 | 18 | // GetModuleFileName() with hModule = NULL 19 | func executable() (exePath string, err error) { 20 | return getModuleFileName() 21 | } 22 | 23 | func getModuleFileName() (string, error) { 24 | var n uint32 25 | b := make([]uint16, syscall.MAX_PATH) 26 | size := uint32(len(b)) 27 | 28 | r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size)) 29 | n = uint32(r0) 30 | if n == 0 { 31 | return "", e1 32 | } 33 | return string(utf16.Decode(b[0:n])), nil 34 | } 35 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/benchmark/server/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "math" 6 | "net" 7 | "net/http" 8 | _ "net/http/pprof" 9 | "time" 10 | 11 | "google.golang.org/grpc/benchmark" 12 | "google.golang.org/grpc/grpclog" 13 | ) 14 | 15 | var ( 16 | duration = flag.Int("duration", math.MaxInt32, "The duration in seconds to run the benchmark server") 17 | ) 18 | 19 | func main() { 20 | flag.Parse() 21 | go func() { 22 | lis, err := net.Listen("tcp", ":0") 23 | if err != nil { 24 | grpclog.Fatalf("Failed to listen: %v", err) 25 | } 26 | grpclog.Println("Server profiling address: ", lis.Addr().String()) 27 | if err := http.Serve(lis, nil); err != nil { 28 | grpclog.Fatalf("Failed to serve: %v", err) 29 | } 30 | }() 31 | addr, stopper := benchmark.StartServer(":0") // listen on all interfaces 32 | grpclog.Println("Server Address: ", addr) 33 | <-time.After(time.Duration(*duration) * time.Second) 34 | stopper() 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/osext/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Daniel Theophanes 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | -------------------------------------------------------------------------------- /registry/storage/driver/rados/rados_test.go: -------------------------------------------------------------------------------- 1 | // +build include_rados 2 | 3 | package rados 4 | 5 | import ( 6 | "os" 7 | "testing" 8 | 9 | storagedriver "github.com/docker/distribution/registry/storage/driver" 10 | "github.com/docker/distribution/registry/storage/driver/testsuites" 11 | 12 | "gopkg.in/check.v1" 13 | ) 14 | 15 | // Hook up gocheck into the "go test" runner. 16 | func Test(t *testing.T) { check.TestingT(t) } 17 | 18 | func init() { 19 | poolname := os.Getenv("RADOS_POOL") 20 | username := os.Getenv("RADOS_USER") 21 | 22 | driverConstructor := func() (storagedriver.StorageDriver, error) { 23 | parameters := DriverParameters{ 24 | poolname, 25 | username, 26 | defaultChunkSize, 27 | } 28 | 29 | return New(parameters) 30 | } 31 | 32 | skipCheck := func() string { 33 | if poolname == "" { 34 | return "RADOS_POOL must be set to run Rado tests" 35 | } 36 | return "" 37 | } 38 | 39 | testsuites.RegisterSuite(driverConstructor, skipCheck) 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/test/testdata/server1.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDhwxUnKCwlSaWAwzOB2LSHVegJHv7DDWminTg4wzLLsf+LQ8nZ 3 | bpjfn5vgIzxCuRh4Rp9QYM5FhfrJX9wcYawP/HTbJ7p7LVQO2QYAP+akMTHxgKuM 4 | BzVV++3wWToKfVZUjFX8nfTfGMGwWAHJDnlEGnU4tl9UujoCV4ENJtzFoQIDAQAB 5 | AoGAJ+6hpzNr24yTQZtFWQpDpEyFplddKJMOxDya3S9ppK3vTWrIITV2xNcucw7I 6 | ceTbdyrGsyjsU0/HdCcIf9ym2jfmGLUwmyhltKVw0QYcFB0XLkc0nI5YvEYoeVDg 7 | omZIXn1E3EW+sSIWSbkMu9bY2kstKXR2UZmMgWDtmBEPMaECQQD6yT4TAZM5hGBb 8 | ciBKgMUP6PwOhPhOMPIvijO50Aiu6iuCV88l1QIy38gWVhxjNrq6P346j4IBg+kB 9 | 9alwpCODAkEA5nSnm9k6ykYeQWNS0fNWiRinCdl23A7usDGSuKKlm019iomJ/Rgd 10 | MKDOp0q/2OostbteOWM2MRFf4jMH3wyVCwJAfAdjJ8szoNKTRSagSbh9vWygnB2v 11 | IByc6l4TTuZQJRGzCveafz9lovuB3WohCABdQRd9ukCXL2CpsEpqzkafOQJAJUjc 12 | USedDlq3zGZwYM1Yw8d8RuirBUFZNqJelYai+nRYClDkRVFgb5yksoYycbq5TxGo 13 | VeqKOvgPpj4RWPHlLwJAGUMk3bqT91xBUCnLRs/vfoCpHpg6eywQTBDAV6xkyz4a 14 | RH3I7/+yj3ZxR2JoWHgUwZ7lZk1VnhffFye7SBXyag== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /cmd/registry/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "net/http/pprof" 5 | 6 | "github.com/docker/distribution/registry" 7 | _ "github.com/docker/distribution/registry/auth/htpasswd" 8 | _ "github.com/docker/distribution/registry/auth/silly" 9 | _ "github.com/docker/distribution/registry/auth/token" 10 | _ "github.com/docker/distribution/registry/proxy" 11 | _ "github.com/docker/distribution/registry/storage/driver/azure" 12 | _ "github.com/docker/distribution/registry/storage/driver/filesystem" 13 | _ "github.com/docker/distribution/registry/storage/driver/gcs" 14 | _ "github.com/docker/distribution/registry/storage/driver/inmemory" 15 | _ "github.com/docker/distribution/registry/storage/driver/middleware/cloudfront" 16 | _ "github.com/docker/distribution/registry/storage/driver/oss" 17 | _ "github.com/docker/distribution/registry/storage/driver/s3" 18 | _ "github.com/docker/distribution/registry/storage/driver/swift" 19 | ) 20 | 21 | func main() { 22 | registry.Cmd.Execute() 23 | } 24 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "discovery#restDescription", 3 | "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", 4 | "discoveryVersion": "v1", 5 | "id": "arrayofmapofstrings:v1", 6 | "name": "arrayofmapofstrings", 7 | "version": "v1", 8 | "title": "Example API", 9 | "description": "The Example API demonstrates an array of arrays.", 10 | "ownerDomain": "google.com", 11 | "ownerName": "Google", 12 | "protocol": "rest", 13 | "schemas": { 14 | "Analyze": { 15 | "id": "Analyze", 16 | "type": "object", 17 | "properties": { 18 | "errors": { 19 | "type": "array", 20 | "description": "List of errors with the data.", 21 | "items": { 22 | "type": "object", 23 | "additionalProperties": { 24 | "type": "string", 25 | "description": "Error level followed by a detailed error message." 26 | } 27 | } 28 | } 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/transport/testdata/server1.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDhwxUnKCwlSaWAwzOB2LSHVegJHv7DDWminTg4wzLLsf+LQ8nZ 3 | bpjfn5vgIzxCuRh4Rp9QYM5FhfrJX9wcYawP/HTbJ7p7LVQO2QYAP+akMTHxgKuM 4 | BzVV++3wWToKfVZUjFX8nfTfGMGwWAHJDnlEGnU4tl9UujoCV4ENJtzFoQIDAQAB 5 | AoGAJ+6hpzNr24yTQZtFWQpDpEyFplddKJMOxDya3S9ppK3vTWrIITV2xNcucw7I 6 | ceTbdyrGsyjsU0/HdCcIf9ym2jfmGLUwmyhltKVw0QYcFB0XLkc0nI5YvEYoeVDg 7 | omZIXn1E3EW+sSIWSbkMu9bY2kstKXR2UZmMgWDtmBEPMaECQQD6yT4TAZM5hGBb 8 | ciBKgMUP6PwOhPhOMPIvijO50Aiu6iuCV88l1QIy38gWVhxjNrq6P346j4IBg+kB 9 | 9alwpCODAkEA5nSnm9k6ykYeQWNS0fNWiRinCdl23A7usDGSuKKlm019iomJ/Rgd 10 | MKDOp0q/2OostbteOWM2MRFf4jMH3wyVCwJAfAdjJ8szoNKTRSagSbh9vWygnB2v 11 | IByc6l4TTuZQJRGzCveafz9lovuB3WohCABdQRd9ukCXL2CpsEpqzkafOQJAJUjc 12 | USedDlq3zGZwYM1Yw8d8RuirBUFZNqJelYai+nRYClDkRVFgb5yksoYycbq5TxGo 13 | VeqKOvgPpj4RWPHlLwJAGUMk3bqT91xBUCnLRs/vfoCpHpg6eywQTBDAV6xkyz4a 14 | RH3I7/+yj3ZxR2JoWHgUwZ7lZk1VnhffFye7SBXyag== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS: -------------------------------------------------------------------------------- 1 | # This file is like Go's AUTHORS file: it lists Copyright holders. 2 | # The list of humans who have contributd is in the CONTRIBUTORS file. 3 | # 4 | # To contribute to this project, because it will eventually be folded 5 | # back in to Go itself, you need to submit a CLA: 6 | # 7 | # http://golang.org/doc/contribute.html#copyright 8 | # 9 | # Then you get added to CONTRIBUTORS and you or your company get added 10 | # to the AUTHORS file. 11 | 12 | Blake Mizerany github=bmizerany 13 | Daniel Morsing github=DanielMorsing 14 | Gabriel Aszalos github=gbbr 15 | Google, Inc. 16 | Keith Rarick github=kr 17 | Matthew Keenan github=mattkeenan 18 | Matt Layher github=mdlayher 19 | Perry Abbott github=pabbott0 20 | Tatsuhiro Tsujikawa github=tatsuhiro-t 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "discovery#restDescription", 3 | "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", 4 | "discoveryVersion": "v1", 5 | "id": "arrayofmapofstrings:v1", 6 | "name": "arrayofmapofstrings", 7 | "version": "v1", 8 | "title": "Example API", 9 | "description": "The Example API demonstrates an array of arrays.", 10 | "ownerDomain": "google.com", 11 | "ownerName": "Google", 12 | "protocol": "rest", 13 | "schemas": { 14 | "Analyze": { 15 | "id": "Analyze", 16 | "type": "object", 17 | "properties": { 18 | "errors": { 19 | "type": "array", 20 | "description": "List of errors with the data.", 21 | "items": { 22 | "type": "object", 23 | "additionalProperties": { 24 | "$ref": "Property", 25 | "description": "Error level followed by a detailed error message." 26 | } 27 | } 28 | } 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/interop/client/testdata/server1.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDhwxUnKCwlSaWAwzOB2LSHVegJHv7DDWminTg4wzLLsf+LQ8nZ 3 | bpjfn5vgIzxCuRh4Rp9QYM5FhfrJX9wcYawP/HTbJ7p7LVQO2QYAP+akMTHxgKuM 4 | BzVV++3wWToKfVZUjFX8nfTfGMGwWAHJDnlEGnU4tl9UujoCV4ENJtzFoQIDAQAB 5 | AoGAJ+6hpzNr24yTQZtFWQpDpEyFplddKJMOxDya3S9ppK3vTWrIITV2xNcucw7I 6 | ceTbdyrGsyjsU0/HdCcIf9ym2jfmGLUwmyhltKVw0QYcFB0XLkc0nI5YvEYoeVDg 7 | omZIXn1E3EW+sSIWSbkMu9bY2kstKXR2UZmMgWDtmBEPMaECQQD6yT4TAZM5hGBb 8 | ciBKgMUP6PwOhPhOMPIvijO50Aiu6iuCV88l1QIy38gWVhxjNrq6P346j4IBg+kB 9 | 9alwpCODAkEA5nSnm9k6ykYeQWNS0fNWiRinCdl23A7usDGSuKKlm019iomJ/Rgd 10 | MKDOp0q/2OostbteOWM2MRFf4jMH3wyVCwJAfAdjJ8szoNKTRSagSbh9vWygnB2v 11 | IByc6l4TTuZQJRGzCveafz9lovuB3WohCABdQRd9ukCXL2CpsEpqzkafOQJAJUjc 12 | USedDlq3zGZwYM1Yw8d8RuirBUFZNqJelYai+nRYClDkRVFgb5yksoYycbq5TxGo 13 | VeqKOvgPpj4RWPHlLwJAGUMk3bqT91xBUCnLRs/vfoCpHpg6eywQTBDAV6xkyz4a 14 | RH3I7/+yj3ZxR2JoWHgUwZ7lZk1VnhffFye7SBXyag== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/interop/server/testdata/server1.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDhwxUnKCwlSaWAwzOB2LSHVegJHv7DDWminTg4wzLLsf+LQ8nZ 3 | bpjfn5vgIzxCuRh4Rp9QYM5FhfrJX9wcYawP/HTbJ7p7LVQO2QYAP+akMTHxgKuM 4 | BzVV++3wWToKfVZUjFX8nfTfGMGwWAHJDnlEGnU4tl9UujoCV4ENJtzFoQIDAQAB 5 | AoGAJ+6hpzNr24yTQZtFWQpDpEyFplddKJMOxDya3S9ppK3vTWrIITV2xNcucw7I 6 | ceTbdyrGsyjsU0/HdCcIf9ym2jfmGLUwmyhltKVw0QYcFB0XLkc0nI5YvEYoeVDg 7 | omZIXn1E3EW+sSIWSbkMu9bY2kstKXR2UZmMgWDtmBEPMaECQQD6yT4TAZM5hGBb 8 | ciBKgMUP6PwOhPhOMPIvijO50Aiu6iuCV88l1QIy38gWVhxjNrq6P346j4IBg+kB 9 | 9alwpCODAkEA5nSnm9k6ykYeQWNS0fNWiRinCdl23A7usDGSuKKlm019iomJ/Rgd 10 | MKDOp0q/2OostbteOWM2MRFf4jMH3wyVCwJAfAdjJ8szoNKTRSagSbh9vWygnB2v 11 | IByc6l4TTuZQJRGzCveafz9lovuB3WohCABdQRd9ukCXL2CpsEpqzkafOQJAJUjc 12 | USedDlq3zGZwYM1Yw8d8RuirBUFZNqJelYai+nRYClDkRVFgb5yksoYycbq5TxGo 13 | VeqKOvgPpj4RWPHlLwJAGUMk3bqT91xBUCnLRs/vfoCpHpg6eywQTBDAV6xkyz4a 14 | RH3I7/+yj3ZxR2JoWHgUwZ7lZk1VnhffFye7SBXyag== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # People who have agreed to one of the CLAs and can contribute patches. 2 | # The AUTHORS file lists the copyright holders; this file 3 | # lists people. For example, Google employees are listed here 4 | # but not in AUTHORS, because Google holds the copyright. 5 | # 6 | # https://developers.google.com/open-source/cla/individual 7 | # https://developers.google.com/open-source/cla/corporate 8 | # 9 | # Names should be added to this file as: 10 | # Name 11 | 12 | # Keep the list alphabetically sorted. 13 | 14 | Andrew Gerrand 15 | Brad Fitzpatrick 16 | Burcu Dogan 17 | Dave Day 18 | David Symonds 19 | Glenn Lewis 20 | Johan Euphrosine 21 | Luna Duclos 22 | Michael McGreevy 23 | Péter Szilágyi 24 | Tyler Treat 25 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/crypto/bcrypt/base64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/testdata/server1.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDhwxUnKCwlSaWAwzOB2LSHVegJHv7DDWminTg4wzLLsf+LQ8nZ 3 | bpjfn5vgIzxCuRh4Rp9QYM5FhfrJX9wcYawP/HTbJ7p7LVQO2QYAP+akMTHxgKuM 4 | BzVV++3wWToKfVZUjFX8nfTfGMGwWAHJDnlEGnU4tl9UujoCV4ENJtzFoQIDAQAB 5 | AoGAJ+6hpzNr24yTQZtFWQpDpEyFplddKJMOxDya3S9ppK3vTWrIITV2xNcucw7I 6 | ceTbdyrGsyjsU0/HdCcIf9ym2jfmGLUwmyhltKVw0QYcFB0XLkc0nI5YvEYoeVDg 7 | omZIXn1E3EW+sSIWSbkMu9bY2kstKXR2UZmMgWDtmBEPMaECQQD6yT4TAZM5hGBb 8 | ciBKgMUP6PwOhPhOMPIvijO50Aiu6iuCV88l1QIy38gWVhxjNrq6P346j4IBg+kB 9 | 9alwpCODAkEA5nSnm9k6ykYeQWNS0fNWiRinCdl23A7usDGSuKKlm019iomJ/Rgd 10 | MKDOp0q/2OostbteOWM2MRFf4jMH3wyVCwJAfAdjJ8szoNKTRSagSbh9vWygnB2v 11 | IByc6l4TTuZQJRGzCveafz9lovuB3WohCABdQRd9ukCXL2CpsEpqzkafOQJAJUjc 12 | USedDlq3zGZwYM1Yw8d8RuirBUFZNqJelYai+nRYClDkRVFgb5yksoYycbq5TxGo 13 | VeqKOvgPpj4RWPHlLwJAGUMk3bqT91xBUCnLRs/vfoCpHpg6eywQTBDAV6xkyz4a 14 | RH3I7/+yj3ZxR2JoWHgUwZ7lZk1VnhffFye7SBXyag== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /health/api/api.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "errors" 5 | "net/http" 6 | 7 | "github.com/docker/distribution/health" 8 | ) 9 | 10 | var ( 11 | updater = health.NewStatusUpdater() 12 | ) 13 | 14 | // DownHandler registers a manual_http_status that always returns an Error 15 | func DownHandler(w http.ResponseWriter, r *http.Request) { 16 | if r.Method == "POST" { 17 | updater.Update(errors.New("Manual Check")) 18 | } else { 19 | w.WriteHeader(http.StatusNotFound) 20 | } 21 | } 22 | 23 | // UpHandler registers a manual_http_status that always returns nil 24 | func UpHandler(w http.ResponseWriter, r *http.Request) { 25 | if r.Method == "POST" { 26 | updater.Update(nil) 27 | } else { 28 | w.WriteHeader(http.StatusNotFound) 29 | } 30 | } 31 | 32 | // init sets up the two endpoints to bring the service up and down 33 | func init() { 34 | health.Register("manual_http_status", updater) 35 | http.HandleFunc("/debug/health/down", DownHandler) 36 | http.HandleFunc("/debug/health/up", UpHandler) 37 | } 38 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/denverdino/aliyungo/util/util_test.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestGenerateRandomECSPassword(t *testing.T) { 8 | for i := 0; i < 10; i++ { 9 | s := GenerateRandomECSPassword() 10 | 11 | if len(s) < 8 || len(s) > 30 { 12 | t.Errorf("Generated ECS password [%v]: bad len", s) 13 | } 14 | 15 | hasDigit := false 16 | hasLower := false 17 | hasUpper := false 18 | 19 | for j := range s { 20 | 21 | switch { 22 | case '0' <= s[j] && s[j] <= '9': 23 | hasDigit = true 24 | case 'a' <= s[j] && s[j] <= 'z': 25 | hasLower = true 26 | case 'A' <= s[j] && s[j] <= 'Z': 27 | hasUpper = true 28 | } 29 | } 30 | 31 | if !hasDigit { 32 | t.Errorf("Generated ECS password [%v]: no digit", s) 33 | } 34 | 35 | if !hasLower { 36 | t.Errorf("Generated ECS password [%v]: no lower letter ", s) 37 | } 38 | 39 | if !hasUpper { 40 | t.Errorf("Generated ECS password [%v]: no upper letter", s) 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /project/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | REPO_ROOT=$(git rev-parse --show-toplevel) 4 | RESOLVE_REPO_ROOT_STATUS=$? 5 | if [ "$RESOLVE_REPO_ROOT_STATUS" -ne "0" ]; then 6 | printf "Unable to resolve repository root. Error:\n%s\n" "$RESOLVE_REPO_ROOT_STATUS" > /dev/stderr 7 | exit $RESOLVE_REPO_ROOT_STATUS 8 | fi 9 | 10 | cd $REPO_ROOT 11 | 12 | GOFMT_ERRORS=$(gofmt -s -l . 2>&1) 13 | if [ -n "$GOFMT_ERRORS" ]; then 14 | printf 'gofmt failed for the following files:\n%s\n\nPlease run "gofmt -s -l ." in the root of your repository before committing\n' "$GOFMT_ERRORS" > /dev/stderr 15 | exit 1 16 | fi 17 | 18 | GOLINT_ERRORS=$(golint ./... 2>&1) 19 | if [ -n "$GOLINT_ERRORS" ]; then 20 | printf "golint failed with the following errors:\n%s\n" "$GOLINT_ERRORS" > /dev/stderr 21 | exit 1 22 | fi 23 | 24 | GOVET_ERRORS=$(go vet ./... 2>&1) 25 | GOVET_STATUS=$? 26 | if [ "$GOVET_STATUS" -ne "0" ]; then 27 | printf "govet failed with the following errors:\n%s\n" "$GOVET_ERRORS" > /dev/stderr 28 | exit $GOVET_STATUS 29 | fi 30 | -------------------------------------------------------------------------------- /manifest/schema1/verify.go: -------------------------------------------------------------------------------- 1 | package schema1 2 | 3 | import ( 4 | "crypto/x509" 5 | 6 | "github.com/Sirupsen/logrus" 7 | "github.com/docker/libtrust" 8 | ) 9 | 10 | // Verify verifies the signature of the signed manifest returning the public 11 | // keys used during signing. 12 | func Verify(sm *SignedManifest) ([]libtrust.PublicKey, error) { 13 | js, err := libtrust.ParsePrettySignature(sm.Raw, "signatures") 14 | if err != nil { 15 | logrus.WithField("err", err).Debugf("(*SignedManifest).Verify") 16 | return nil, err 17 | } 18 | 19 | return js.Verify() 20 | } 21 | 22 | // VerifyChains verifies the signature of the signed manifest against the 23 | // certificate pool returning the list of verified chains. Signatures without 24 | // an x509 chain are not checked. 25 | func VerifyChains(sm *SignedManifest, ca *x509.CertPool) ([][]*x509.Certificate, error) { 26 | js, err := libtrust.ParsePrettySignature(sm.Raw, "signatures") 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | return js.VerifyChains(ca) 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/osext/osext.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Extensions to the standard "os" package. 6 | package osext 7 | 8 | import "path/filepath" 9 | 10 | // Executable returns an absolute path that can be used to 11 | // re-invoke the current program. 12 | // It may not be valid after the current program exits. 13 | func Executable() (string, error) { 14 | p, err := executable() 15 | return filepath.Clean(p), err 16 | } 17 | 18 | // Returns same path as Executable, returns just the folder 19 | // path. Excludes the executable name. 20 | func ExecutableFolder() (string, error) { 21 | p, err := Executable() 22 | if err != nil { 23 | return "", err 24 | } 25 | folder, _ := filepath.Split(p) 26 | return folder, nil 27 | } 28 | 29 | // Depricated. Same as Executable(). 30 | func GetExePath() (exePath string, err error) { 31 | return Executable() 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ncw/swift/watchdog_reader.go: -------------------------------------------------------------------------------- 1 | package swift 2 | 3 | import ( 4 | "io" 5 | "time" 6 | ) 7 | 8 | // An io.Reader which resets a watchdog timer whenever data is read 9 | type watchdogReader struct { 10 | timeout time.Duration 11 | reader io.Reader 12 | timer *time.Timer 13 | } 14 | 15 | // Returns a new reader which will kick the watchdog timer whenever data is read 16 | func newWatchdogReader(reader io.Reader, timeout time.Duration, timer *time.Timer) *watchdogReader { 17 | return &watchdogReader{ 18 | timeout: timeout, 19 | reader: reader, 20 | timer: timer, 21 | } 22 | } 23 | 24 | // Read reads up to len(p) bytes into p 25 | func (t *watchdogReader) Read(p []byte) (n int, err error) { 26 | // FIXME limit the amount of data read in one chunk so as to not exceed the timeout? 27 | resetTimer(t.timer, t.timeout) 28 | n, err = t.reader.Read(p) 29 | resetTimer(t.timer, t.timeout) 30 | return 31 | } 32 | 33 | // Check it satisfies the interface 34 | var _ io.Reader = &watchdogReader{} 35 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "discovery#restDescription", 3 | "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", 4 | "discoveryVersion": "v1", 5 | "id": "wrapnewlines:v1", 6 | "name": "wrapnewlines", 7 | "version": "v1", 8 | "title": "Example API", 9 | "description": "The Example API demonstrates wrapping of descriptions containing newlines.", 10 | "ownerDomain": "google.com", 11 | "ownerName": "Google", 12 | "protocol": "rest", 13 | "schemas": { 14 | "Thing": { 15 | "id": "Thing", 16 | "type": "object", 17 | "description": "don't care", 18 | "properties": { 19 | "oneline": { 20 | "type": "string", 21 | "description": "First sentence. Second sentence. Description is long enough to be wrapped." 22 | }, 23 | "twoline": { 24 | "type": "string", 25 | "description": "First sentence.\nSecond sentence. Description is long enough to be wrapped." 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/health/health.go: -------------------------------------------------------------------------------- 1 | // Package health provides some utility functions to health-check a server. The implementation 2 | // is based on protobuf. Users need to write their own implementations if other IDLs are used. 3 | package health 4 | 5 | import ( 6 | "time" 7 | 8 | "golang.org/x/net/context" 9 | "google.golang.org/grpc" 10 | healthpb "google.golang.org/grpc/health/grpc_health" 11 | ) 12 | 13 | // HealthCheck is the client side function to health-check a server 14 | func HealthCheck(t time.Duration, cc *grpc.ClientConn) error { 15 | ctx, _ := context.WithTimeout(context.Background(), t) 16 | hc := healthpb.NewHealthCheckClient(cc) 17 | req := new(healthpb.HealthCheckRequest) 18 | _, err := hc.Check(ctx, req) 19 | return err 20 | } 21 | 22 | type HealthServer struct { 23 | } 24 | 25 | func (s *HealthServer) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { 26 | out := new(healthpb.HealthCheckResponse) 27 | return out, nil 28 | } 29 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/paypal/paypal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package paypal provides constants for using OAuth2 to access PayPal. 6 | package paypal // import "golang.org/x/oauth2/paypal" 7 | 8 | import ( 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // Endpoint is PayPal's OAuth 2.0 endpoint in live (production) environment. 13 | var Endpoint = oauth2.Endpoint{ 14 | AuthURL: "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", 15 | TokenURL: "https://api.paypal.com/v1/identity/openidconnect/tokenservice", 16 | } 17 | 18 | // SandboxEndpoint is PayPal's OAuth 2.0 endpoint in sandbox (testing) environment. 19 | var SandboxEndpoint = oauth2.Endpoint{ 20 | AuthURL: "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", 21 | TokenURL: "https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice", 22 | } 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/gotrack_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // See https://code.google.com/p/go/source/browse/CONTRIBUTORS 5 | // Licensed under the same terms as Go itself: 6 | // https://code.google.com/p/go/source/browse/LICENSE 7 | 8 | package http2 9 | 10 | import ( 11 | "fmt" 12 | "strings" 13 | "testing" 14 | ) 15 | 16 | func TestGoroutineLock(t *testing.T) { 17 | DebugGoroutines = true 18 | g := newGoroutineLock() 19 | g.check() 20 | 21 | sawPanic := make(chan interface{}) 22 | go func() { 23 | defer func() { sawPanic <- recover() }() 24 | g.check() // should panic 25 | }() 26 | e := <-sawPanic 27 | if e == nil { 28 | t.Fatal("did not see panic from check in other goroutine") 29 | } 30 | if !strings.Contains(fmt.Sprint(e), "wrong goroutine") { 31 | t.Errorf("expected on see panic about running on the wrong goroutine; got %v", e) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file is like Go's CONTRIBUTORS file: it lists humans. 2 | # The list of copyright holders (which may be companies) are in the AUTHORS file. 3 | # 4 | # To contribute to this project, because it will eventually be folded 5 | # back in to Go itself, you need to submit a CLA: 6 | # 7 | # http://golang.org/doc/contribute.html#copyright 8 | # 9 | # Then you get added to CONTRIBUTORS and you or your company get added 10 | # to the AUTHORS file. 11 | 12 | Blake Mizerany github=bmizerany 13 | Brad Fitzpatrick github=bradfitz 14 | Daniel Morsing github=DanielMorsing 15 | Gabriel Aszalos github=gbbr 16 | Keith Rarick github=kr 17 | Matthew Keenan github=mattkeenan 18 | Matt Layher github=mdlayher 19 | Perry Abbott github=pabbott0 20 | Tatsuhiro Tsujikawa github=tatsuhiro-t 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/gauge_float64_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import "testing" 4 | 5 | func BenchmarkGuageFloat64(b *testing.B) { 6 | g := NewGaugeFloat64() 7 | b.ResetTimer() 8 | for i := 0; i < b.N; i++ { 9 | g.Update(float64(i)) 10 | } 11 | } 12 | 13 | func TestGaugeFloat64(t *testing.T) { 14 | g := NewGaugeFloat64() 15 | g.Update(float64(47.0)) 16 | if v := g.Value(); float64(47.0) != v { 17 | t.Errorf("g.Value(): 47.0 != %v\n", v) 18 | } 19 | } 20 | 21 | func TestGaugeFloat64Snapshot(t *testing.T) { 22 | g := NewGaugeFloat64() 23 | g.Update(float64(47.0)) 24 | snapshot := g.Snapshot() 25 | g.Update(float64(0)) 26 | if v := snapshot.Value(); float64(47.0) != v { 27 | t.Errorf("g.Value(): 47.0 != %v\n", v) 28 | } 29 | } 30 | 31 | func TestGetOrRegisterGaugeFloat64(t *testing.T) { 32 | r := NewRegistry() 33 | NewRegisteredGaugeFloat64("foo", r).Update(float64(47.0)) 34 | t.Logf("registry: %v", r) 35 | if g := GetOrRegisterGaugeFloat64("foo", r); float64(47.0) != g.Value() { 36 | t.Fatal(g) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | image: dmp42/go:stable 2 | 3 | script: 4 | # To be spoofed back into the test image 5 | - go get github.com/modocache/gover 6 | 7 | - go get -t ./... 8 | 9 | # Go fmt 10 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 11 | # Go lint 12 | - test -z "$(golint ./... | tee /dev/stderr)" 13 | # Go vet 14 | - go vet ./... 15 | # Go test 16 | - go test -v -race -cover ./... 17 | # Helper to concatenate reports 18 | - gover 19 | # Send to coverall 20 | - goveralls -service drone.io -coverprofile=gover.coverprofile -repotoken {{COVERALLS_TOKEN}} 21 | 22 | # Do we want these as well? 23 | # - go get code.google.com/p/go.tools/cmd/goimports 24 | # - test -z "$(goimports -l -w ./... | tee /dev/stderr)" 25 | # http://labix.org/gocheck 26 | 27 | notify: 28 | email: 29 | recipients: 30 | - distribution@docker.com 31 | 32 | slack: 33 | team: docker 34 | channel: "#dt" 35 | username: mom 36 | token: {{SLACK_TOKEN}} 37 | on_success: true 38 | on_failure: true 39 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to grpc! Here is some guideline 4 | and information about how to do so. 5 | 6 | ## Getting started 7 | 8 | ### Legal requirements 9 | 10 | In order to protect both you and ourselves, you will need to sign the 11 | [Contributor License Agreement](https://cla.developers.google.com/clas). 12 | 13 | ### Filing Issues 14 | When filing an issue, make sure to answer these five questions: 15 | 16 | 1. What version of Go are you using (`go version`)? 17 | 2. What operating system and processor architecture are you using? 18 | 3. What did you do? 19 | 4. What did you expect to see? 20 | 5. What did you see instead? 21 | 22 | ### Contributing code 23 | Please read the Contribution Guidelines before sending patches. 24 | 25 | We will not accept GitHub pull requests once Gerrit is setup (we will use Gerrit instead for code review). 26 | 27 | Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. 28 | -------------------------------------------------------------------------------- /registry/storage/cache/cache.go: -------------------------------------------------------------------------------- 1 | // Package cache provides facilities to speed up access to the storage 2 | // backend. 3 | package cache 4 | 5 | import ( 6 | "fmt" 7 | 8 | "github.com/docker/distribution" 9 | ) 10 | 11 | // BlobDescriptorCacheProvider provides repository scoped 12 | // BlobDescriptorService cache instances and a global descriptor cache. 13 | type BlobDescriptorCacheProvider interface { 14 | distribution.BlobDescriptorService 15 | 16 | RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) 17 | } 18 | 19 | // ValidateDescriptor provides a helper function to ensure that caches have 20 | // common criteria for admitting descriptors. 21 | func ValidateDescriptor(desc distribution.Descriptor) error { 22 | if err := desc.Digest.Validate(); err != nil { 23 | return err 24 | } 25 | 26 | if desc.Size < 0 { 27 | return fmt.Errorf("cache: invalid length in descriptor: %v < 0", desc.Size) 28 | } 29 | 30 | if desc.MediaType == "" { 31 | return fmt.Errorf("cache: empty mediatype on descriptor: %v", desc) 32 | } 33 | 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/internal/transport/cancelreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build go1.5 16 | 17 | package transport 18 | 19 | import "net/http" 20 | 21 | // makeReqCancel returns a closure that cancels the given http.Request 22 | // when called. 23 | func makeReqCancel(req *http.Request) func(http.RoundTripper) { 24 | c := make(chan struct{}) 25 | req.Cancel = c 26 | return func(http.RoundTripper) { 27 | close(c) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package nettest provides utilities for IP testing. 6 | package nettest // import "golang.org/x/net/internal/nettest" 7 | 8 | import "net" 9 | 10 | // SupportsIPv4 reports whether the platform supports IPv4 networking 11 | // functionality. 12 | func SupportsIPv4() bool { 13 | ln, err := net.Listen("tcp4", "127.0.0.1:0") 14 | if err != nil { 15 | return false 16 | } 17 | ln.Close() 18 | return true 19 | } 20 | 21 | // SupportsIPv6 reports whether the platform supports IPv6 networking 22 | // functionality. 23 | func SupportsIPv6() bool { 24 | ln, err := net.Listen("tcp6", "[::1]:0") 25 | if err != nil { 26 | return false 27 | } 28 | ln.Close() 29 | return true 30 | } 31 | 32 | // ProtocolNotSupported reports whether err is a protocol not 33 | // supported error. 34 | func ProtocolNotSupported(err error) bool { 35 | return protocolNotSupported(err) 36 | } 37 | -------------------------------------------------------------------------------- /docs/storage-drivers/gcs.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | # Google Cloud Storage driver 11 | 12 | An implementation of the `storagedriver.StorageDriver` interface which uses Google Cloud for object storage. 13 | 14 | ## Parameters 15 | 16 | `bucket`: The name of your Google Cloud Storage bucket where you wish to store objects (needs to already be created prior to driver initialization). 17 | 18 | `keyfile`: (optional) A private key file in JSON format, used for [Service Account Authentication](https://cloud.google.com/storage/docs/authentication#service_accounts). 19 | 20 | **Note** Instead of a key file you can use [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). 21 | 22 | `rootdirectory`: (optional) The root directory tree in which all registry files will be stored. Defaults to the empty string (bucket root). 23 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/README.md: -------------------------------------------------------------------------------- 1 | # Description 2 | The route guide server and client demonstrate how to use grpc go libraries to 3 | perform unary, client streaming, server streaming and full duplex RPCs. 4 | 5 | Please refer to [Getting Started Guide for Go] (https://github.com/grpc/grpc-common/blob/master/go/gotutorial.md) for more information. 6 | 7 | See the definition of the route guide service in proto/route_guide.proto. 8 | 9 | # Run the sample code 10 | To compile and run the server, assuming you are in the root of the route_guide 11 | folder, i.e., .../examples/route_guide/, simply: 12 | 13 | ```sh 14 | $ go run server/server.go 15 | ``` 16 | 17 | Likewise, to run the client: 18 | 19 | ```sh 20 | $ go run client/client.go 21 | ``` 22 | 23 | # Optional command line flags 24 | The server and client both take optional command line flags. For example, the 25 | client and server run without TLS by default. To enable TLS: 26 | 27 | ```sh 28 | $ go run server/server.go -tls=true 29 | ``` 30 | 31 | and 32 | 33 | ```sh 34 | $ go run client/client.go -tls=true 35 | ``` 36 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/go-metrics/debug_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "runtime" 5 | "runtime/debug" 6 | "testing" 7 | "time" 8 | ) 9 | 10 | func BenchmarkDebugGCStats(b *testing.B) { 11 | r := NewRegistry() 12 | RegisterDebugGCStats(r) 13 | b.ResetTimer() 14 | for i := 0; i < b.N; i++ { 15 | CaptureDebugGCStatsOnce(r) 16 | } 17 | } 18 | 19 | func TestDebugGCStatsBlocking(t *testing.T) { 20 | if g := runtime.GOMAXPROCS(0); g < 2 { 21 | t.Skipf("skipping TestDebugGCMemStatsBlocking with GOMAXPROCS=%d\n", g) 22 | return 23 | } 24 | ch := make(chan int) 25 | go testDebugGCStatsBlocking(ch) 26 | var gcStats debug.GCStats 27 | t0 := time.Now() 28 | debug.ReadGCStats(&gcStats) 29 | t1 := time.Now() 30 | t.Log("i++ during debug.ReadGCStats:", <-ch) 31 | go testDebugGCStatsBlocking(ch) 32 | d := t1.Sub(t0) 33 | t.Log(d) 34 | time.Sleep(d) 35 | t.Log("i++ during time.Sleep:", <-ch) 36 | } 37 | 38 | func testDebugGCStatsBlocking(ch chan int) { 39 | i := 0 40 | for { 41 | select { 42 | case ch <- i: 43 | return 44 | default: 45 | i++ 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /registry/handlers/mail.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "errors" 5 | "net/smtp" 6 | "strings" 7 | ) 8 | 9 | // mailer provides fields of email configuration for sending. 10 | type mailer struct { 11 | Addr, Username, Password, From string 12 | Insecure bool 13 | To []string 14 | } 15 | 16 | // sendMail allows users to send email, only if mail parameters is configured correctly. 17 | func (mail *mailer) sendMail(subject, message string) error { 18 | addr := strings.Split(mail.Addr, ":") 19 | if len(addr) != 2 { 20 | return errors.New("Invalid Mail Address") 21 | } 22 | host := addr[0] 23 | msg := []byte("To:" + strings.Join(mail.To, ";") + 24 | "\r\nFrom: " + mail.From + 25 | "\r\nSubject: " + subject + 26 | "\r\nContent-Type: text/plain\r\n\r\n" + 27 | message) 28 | auth := smtp.PlainAuth( 29 | "", 30 | mail.Username, 31 | mail.Password, 32 | host, 33 | ) 34 | err := smtp.SendMail( 35 | mail.Addr, 36 | auth, 37 | mail.From, 38 | mail.To, 39 | []byte(msg), 40 | ) 41 | if err != nil { 42 | return err 43 | } 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import "testing" 4 | 5 | // GH-1 6 | func TestDecode_NilValue(t *testing.T) { 7 | input := map[string]interface{}{ 8 | "vfoo": nil, 9 | "vother": nil, 10 | } 11 | 12 | var result Map 13 | err := Decode(input, &result) 14 | if err != nil { 15 | t.Fatalf("should not error: %s", err) 16 | } 17 | 18 | if result.Vfoo != "" { 19 | t.Fatalf("value should be default: %s", result.Vfoo) 20 | } 21 | 22 | if result.Vother != nil { 23 | t.Fatalf("Vother should be nil: %s", result.Vother) 24 | } 25 | } 26 | 27 | // GH-10 28 | func TestDecode_mapInterfaceInterface(t *testing.T) { 29 | input := map[interface{}]interface{}{ 30 | "vfoo": nil, 31 | "vother": nil, 32 | } 33 | 34 | var result Map 35 | err := Decode(input, &result) 36 | if err != nil { 37 | t.Fatalf("should not error: %s", err) 38 | } 39 | 40 | if result.Vfoo != "" { 41 | t.Fatalf("value should be default: %s", result.Vfoo) 42 | } 43 | 44 | if result.Vother != nil { 45 | t.Fatalf("Vother should be nil: %s", result.Vother) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type JSONFormatter struct { 9 | // TimestampFormat sets the format used for marshaling timestamps. 10 | TimestampFormat string 11 | } 12 | 13 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 14 | data := make(Fields, len(entry.Data)+3) 15 | for k, v := range entry.Data { 16 | switch v := v.(type) { 17 | case error: 18 | // Otherwise errors are ignored by `encoding/json` 19 | // https://github.com/Sirupsen/logrus/issues/137 20 | data[k] = v.Error() 21 | default: 22 | data[k] = v 23 | } 24 | } 25 | prefixFieldClashes(data) 26 | 27 | if f.TimestampFormat == "" { 28 | f.TimestampFormat = DefaultTimestampFormat 29 | } 30 | 31 | data["time"] = entry.Time.Format(f.TimestampFormat) 32 | data["msg"] = entry.Message 33 | data["level"] = entry.Level.String() 34 | 35 | serialized, err := json.Marshal(data) 36 | if err != nil { 37 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 38 | } 39 | return append(serialized, '\n'), nil 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. 2 | // See https://code.google.com/p/go/source/browse/CONTRIBUTORS 3 | // Licensed under the same terms as Go itself: 4 | // https://code.google.com/p/go/source/browse/LICENSE 5 | 6 | package http2 7 | 8 | import ( 9 | "sync" 10 | ) 11 | 12 | type pipe struct { 13 | b buffer 14 | c sync.Cond 15 | m sync.Mutex 16 | } 17 | 18 | // Read waits until data is available and copies bytes 19 | // from the buffer into p. 20 | func (r *pipe) Read(p []byte) (n int, err error) { 21 | r.c.L.Lock() 22 | defer r.c.L.Unlock() 23 | for r.b.Len() == 0 && !r.b.closed { 24 | r.c.Wait() 25 | } 26 | return r.b.Read(p) 27 | } 28 | 29 | // Write copies bytes from p into the buffer and wakes a reader. 30 | // It is an error to write more data than the buffer can hold. 31 | func (w *pipe) Write(p []byte) (n int, err error) { 32 | w.c.L.Lock() 33 | defer w.c.L.Unlock() 34 | defer w.c.Signal() 35 | return w.b.Write(p) 36 | } 37 | 38 | func (c *pipe) Close(err error) { 39 | c.c.L.Lock() 40 | defer c.c.L.Unlock() 41 | defer c.c.Signal() 42 | c.b.Close(err) 43 | } 44 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "discovery#restDescription", 3 | "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", 4 | "discoveryVersion": "v1", 5 | "id": "additionalpropsobjs:v1", 6 | "name": "additionalpropsobjs", 7 | "version": "v1", 8 | "title": "Example API", 9 | "description": "The Example API demonstrates an associative array.", 10 | "ownerDomain": "google.com", 11 | "ownerName": "Google", 12 | "protocol": "rest", 13 | "schemas": { 14 | "Entity": { 15 | "id": "Entity", 16 | "type": "object", 17 | "externalTypeName": "apphosting.client.datastoreservice.proto.Entity", 18 | "properties": { 19 | "properties": { 20 | "type": "object", 21 | "description": "The entity's properties.", 22 | "additionalProperties": { 23 | "$ref": "Property", 24 | "description": "The name of the property. Properties with names matching regex \"__.*__\" are reserved. A reserved property name is forbidden in certain documented contexts. The name cannot be \"\"." 25 | } 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: \ 2 | all \ 3 | deps \ 4 | updatedeps \ 5 | testdeps \ 6 | updatetestdeps \ 7 | build \ 8 | proto \ 9 | test \ 10 | testrace \ 11 | clean \ 12 | 13 | all: test testrace 14 | 15 | deps: 16 | go get -d -v google.golang.org/grpc/... 17 | 18 | updatedeps: 19 | go get -d -v -u -f google.golang.org/grpc/... 20 | 21 | testdeps: 22 | go get -d -v -t google.golang.org/grpc/... 23 | 24 | updatetestdeps: 25 | go get -d -v -t -u -f google.golang.org/grpc/... 26 | 27 | build: deps 28 | go build google.golang.org/grpc/... 29 | 30 | proto: 31 | @ if ! which protoc > /dev/null; then \ 32 | echo "error: protoc not installed" >&2; \ 33 | exit 1; \ 34 | fi 35 | go get -v github.com/golang/protobuf/protoc-gen-go 36 | for file in $$(git ls-files '*.proto'); do \ 37 | protoc -I $$(dirname $$file) --go_out=plugins=grpc:$$(dirname $$file) $$file; \ 38 | done 39 | 40 | test: testdeps 41 | go test -v -cpu 1,4 google.golang.org/grpc/... 42 | 43 | testrace: testdeps 44 | go test -v -race -cpu 1,4 google.golang.org/grpc/... 45 | 46 | clean: 47 | go clean google.golang.org/grpc/... 48 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/jwt/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The oauth2 Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package jwt_test 6 | 7 | import ( 8 | "golang.org/x/oauth2" 9 | "golang.org/x/oauth2/jwt" 10 | ) 11 | 12 | func ExampleJWTConfig() { 13 | conf := &jwt.Config{ 14 | Email: "xxx@developer.com", 15 | // The contents of your RSA private key or your PEM file 16 | // that contains a private key. 17 | // If you have a p12 file instead, you 18 | // can use `openssl` to export the private key into a pem file. 19 | // 20 | // $ openssl pkcs12 -in key.p12 -out key.pem -nodes 21 | // 22 | // It only supports PEM containers with no passphrase. 23 | PrivateKey: []byte("-----BEGIN RSA PRIVATE KEY-----..."), 24 | Subject: "user@example.com", 25 | TokenURL: "https://provider.com/o/oauth2/token", 26 | } 27 | // Initiate an http.Client, the following GET request will be 28 | // authorized and authenticated on the behalf of user@example.com. 29 | client := conf.Client(oauth2.NoContext) 30 | client.Get("...") 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Bugsnag 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/garyburd/redigo/redis/test_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Gary Burd 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package redis 16 | 17 | import ( 18 | "bufio" 19 | "net" 20 | "time" 21 | ) 22 | 23 | func SetNowFunc(f func() time.Time) { 24 | nowFunc = f 25 | } 26 | 27 | type nopCloser struct{ net.Conn } 28 | 29 | func (nopCloser) Close() error { return nil } 30 | 31 | // NewConnBufio is a hook for tests. 32 | func NewConnBufio(rw bufio.ReadWriter) Conn { 33 | return &conn{br: rw.Reader, bw: rw.Writer, conn: nopCloser{}} 34 | } 35 | 36 | var ( 37 | ErrNegativeInt = errNegativeInt 38 | ) 39 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: perf.proto 3 | // DO NOT EDIT! 4 | 5 | /* 6 | Package codec_perf is a generated protocol buffer package. 7 | 8 | It is generated from these files: 9 | perf.proto 10 | 11 | It has these top-level messages: 12 | Buffer 13 | */ 14 | package codec_perf 15 | 16 | import proto "github.com/golang/protobuf/proto" 17 | import math "math" 18 | 19 | // Reference imports to suppress errors if they are not otherwise used. 20 | var _ = proto.Marshal 21 | var _ = math.Inf 22 | 23 | // Buffer is a message that contains a body of bytes that is used to exercise 24 | // encoding and decoding overheads. 25 | type Buffer struct { 26 | Body []byte `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` 27 | XXX_unrecognized []byte `json:"-"` 28 | } 29 | 30 | func (m *Buffer) Reset() { *m = Buffer{} } 31 | func (m *Buffer) String() string { return proto.CompactTextString(m) } 32 | func (*Buffer) ProtoMessage() {} 33 | 34 | func (m *Buffer) GetBody() []byte { 35 | if m != nil { 36 | return m.Body 37 | } 38 | return nil 39 | } 40 | 41 | func init() { 42 | } 43 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Joshua Tacoma 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/ncw/swift/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 by Nick Craig-Wood http://www.craig-wood.com/nick/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/Makefile: -------------------------------------------------------------------------------- 1 | API_JSON = $(wildcard */*/*-api.json) 2 | 3 | # Download all API specifications and rebuild Go bindings. 4 | # All downloaded files are cached in $TMPDIR for reuse with 'cached' below. 5 | all: generator 6 | $(GOPATH)/bin/google-api-go-generator -cache=false -install -api=* 7 | 8 | # Reuse cached API specifications in $TMPDIR and rebuild Go bindings. 9 | cached: generator 10 | $(GOPATH)/bin/google-api-go-generator -cache=true -install -api=* 11 | 12 | # Only rebuild Go bindings, do not modify API specifications. 13 | # For every existing */*/*-api.json file, */*/*-gen.go will be built. 14 | local: $(API_JSON:-api.json=-gen.go) 15 | 16 | # Pattern rule for the 'local' target. 17 | # Translates otherwise unnamed targets with a -gen.go suffix into the 18 | # matching input file with a -api.json suffix. $< is the input file. 19 | %-gen.go: %-api.json generator 20 | $(GOPATH)/bin/google-api-go-generator -api_json_file=$< 21 | 22 | # Rebuild and install $(GOPATH)/bin/google-api-go-generator 23 | generator: 24 | go install google.golang.org/api/googleapi 25 | go install google.golang.org/api/google-api-go-generator 26 | 27 | .PHONY: all cached local generator 28 | -------------------------------------------------------------------------------- /registry/api/errcode/handler.go: -------------------------------------------------------------------------------- 1 | package errcode 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | ) 7 | 8 | // ServeJSON attempts to serve the errcode in a JSON envelope. It marshals err 9 | // and sets the content-type header to 'application/json'. It will handle 10 | // ErrorCoder and Errors, and if necessary will create an envelope. 11 | func ServeJSON(w http.ResponseWriter, err error) error { 12 | w.Header().Set("Content-Type", "application/json; charset=utf-8") 13 | var sc int 14 | 15 | switch errs := err.(type) { 16 | case Errors: 17 | if len(errs) < 1 { 18 | break 19 | } 20 | 21 | if err, ok := errs[0].(ErrorCoder); ok { 22 | sc = err.ErrorCode().Descriptor().HTTPStatusCode 23 | } 24 | case ErrorCoder: 25 | sc = errs.ErrorCode().Descriptor().HTTPStatusCode 26 | err = Errors{err} // create an envelope. 27 | default: 28 | // We just have an unhandled error type, so just place in an envelope 29 | // and move along. 30 | err = Errors{err} 31 | } 32 | 33 | if sc == 0 { 34 | sc = http.StatusInternalServerError 35 | } 36 | 37 | w.WriteHeader(sc) 38 | 39 | if err := json.NewEncoder(w).Encode(err); err != nil { 40 | return err 41 | } 42 | 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/panicwrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/migration.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # Migrating a 1.0 registry to 2.0 8 | 9 | TODO: This needs to be revised in light of Olivier's work 10 | 11 | A few thoughts here: 12 | 13 | There was no "1.0". There was an implementation of the Registry API V1 but only a version 0.9 of the service was released. 14 | The image formats are not compatible in any way. One must convert v1 images to v2 images using a docker client or other tool. 15 | One can migrate images from one version to the other by pulling images from the old registry and pushing them to the v2 registry. 16 | 17 | ----- 18 | 19 | The Docker Registry 2.0 is backward compatible with images created by the earlier specification. If you are migrating a private registry to version 2.0, you should use the following process: 20 | 21 | 1. Configure and test a 2.0 registry image in a sandbox environment. 22 | 23 | 2. Back up up your production image storage. 24 | 25 | Your production image storage should reside on a volume or storage backend. 26 | Make sure you have a backup of its contents. 27 | 28 | 3. Stop your existing registry service. 29 | 30 | 4. Restart your registry with your tested 2.0 image. -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/AdRoll/goamz/cloudfront/cloudfront_test.go: -------------------------------------------------------------------------------- 1 | package cloudfront 2 | 3 | import ( 4 | "crypto/x509" 5 | "encoding/pem" 6 | "io/ioutil" 7 | "net/url" 8 | "testing" 9 | "time" 10 | ) 11 | 12 | func TestSignedCannedURL(t *testing.T) { 13 | rawKey, err := ioutil.ReadFile("testdata/key.pem") 14 | if err != nil { 15 | t.Fatal(err) 16 | } 17 | 18 | pemKey, _ := pem.Decode(rawKey) 19 | privateKey, err := x509.ParsePKCS1PrivateKey(pemKey.Bytes) 20 | if err != nil { 21 | t.Fatal(err) 22 | } 23 | 24 | cf := &CloudFront{ 25 | key: privateKey, 26 | keyPairId: "test-key-pair-1231245", 27 | BaseURL: "https://cloudfront.com", 28 | } 29 | 30 | expireTime, err := time.Parse(time.RFC3339, "2014-03-28T14:00:21Z") 31 | if err != nil { 32 | t.Fatal(err) 33 | } 34 | 35 | query := make(url.Values) 36 | query.Add("test", "value") 37 | 38 | uri, err := cf.CannedSignedURL("test", "test=value", expireTime) 39 | if err != nil { 40 | t.Fatal(err) 41 | } 42 | 43 | parsed, err := url.Parse(uri) 44 | if err != nil { 45 | t.Fatal(err) 46 | } 47 | 48 | signature := parsed.Query().Get("Signature") 49 | if signature == "" { 50 | t.Fatal("Encoded signature is empty") 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /registry/handlers/basicauth_prego14.go: -------------------------------------------------------------------------------- 1 | // +build !go1.4 2 | 3 | package handlers 4 | 5 | import ( 6 | "encoding/base64" 7 | "net/http" 8 | "strings" 9 | ) 10 | 11 | // NOTE(stevvooe): This is basic auth support from go1.4 present to ensure we 12 | // can compile on go1.3 and earlier. 13 | 14 | // BasicAuth returns the username and password provided in the request's 15 | // Authorization header, if the request uses HTTP Basic Authentication. 16 | // See RFC 2617, Section 2. 17 | func basicAuth(r *http.Request) (username, password string, ok bool) { 18 | auth := r.Header.Get("Authorization") 19 | if auth == "" { 20 | return 21 | } 22 | return parseBasicAuth(auth) 23 | } 24 | 25 | // parseBasicAuth parses an HTTP Basic Authentication string. 26 | // "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" returns ("Aladdin", "open sesame", true). 27 | func parseBasicAuth(auth string) (username, password string, ok bool) { 28 | if !strings.HasPrefix(auth, "Basic ") { 29 | return 30 | } 31 | c, err := base64.StdEncoding.DecodeString(strings.TrimPrefix(auth, "Basic ")) 32 | if err != nil { 33 | return 34 | } 35 | cs := string(c) 36 | s := strings.IndexByte(cs, ':') 37 | if s < 0 { 38 | return 39 | } 40 | return cs[:s], cs[s+1:], true 41 | } 42 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/examples/basic/basic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.New() 8 | 9 | func init() { 10 | log.Formatter = new(logrus.JSONFormatter) 11 | log.Formatter = new(logrus.TextFormatter) // default 12 | log.Level = logrus.DebugLevel 13 | } 14 | 15 | func main() { 16 | defer func() { 17 | err := recover() 18 | if err != nil { 19 | log.WithFields(logrus.Fields{ 20 | "omg": true, 21 | "err": err, 22 | "number": 100, 23 | }).Fatal("The ice breaks!") 24 | } 25 | }() 26 | 27 | log.WithFields(logrus.Fields{ 28 | "animal": "walrus", 29 | "number": 8, 30 | }).Debug("Started observing beach") 31 | 32 | log.WithFields(logrus.Fields{ 33 | "animal": "walrus", 34 | "size": 10, 35 | }).Info("A group of walrus emerges from the ocean") 36 | 37 | log.WithFields(logrus.Fields{ 38 | "omg": true, 39 | "number": 122, 40 | }).Warn("The group's number increased tremendously!") 41 | 42 | log.WithFields(logrus.Fields{ 43 | "temperature": -4, 44 | }).Debug("Temperature changes") 45 | 46 | log.WithFields(logrus.Fields{ 47 | "animal": "orca", 48 | "size": 9009, 49 | }).Panic("It's over 9000!") 50 | } 51 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/bugsnag-go/json_tags.go: -------------------------------------------------------------------------------- 1 | // The code is stripped from: 2 | // http://golang.org/src/pkg/encoding/json/tags.go?m=text 3 | 4 | package bugsnag 5 | 6 | import ( 7 | "strings" 8 | ) 9 | 10 | // tagOptions is the string following a comma in a struct field's "json" 11 | // tag, or the empty string. It does not include the leading comma. 12 | type tagOptions string 13 | 14 | // parseTag splits a struct field's json tag into its name and 15 | // comma-separated options. 16 | func parseTag(tag string) (string, tagOptions) { 17 | if idx := strings.Index(tag, ","); idx != -1 { 18 | return tag[:idx], tagOptions(tag[idx+1:]) 19 | } 20 | return tag, tagOptions("") 21 | } 22 | 23 | // Contains reports whether a comma-separated list of options 24 | // contains a particular substr flag. substr must be surrounded by a 25 | // string boundary or commas. 26 | func (o tagOptions) Contains(optionName string) bool { 27 | if len(o) == 0 { 28 | return false 29 | } 30 | s := string(o) 31 | for s != "" { 32 | var next string 33 | i := strings.Index(s, ",") 34 | if i >= 0 { 35 | s, next = s[:i], s[i+1:] 36 | } 37 | if s == optionName { 38 | return true 39 | } 40 | s = next 41 | } 42 | return false 43 | } 44 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/denverdino/aliyungo/util/iso6801_test.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "encoding/json" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestISO8601Time(t *testing.T) { 10 | now := NewISO6801Time(time.Now().UTC()) 11 | 12 | data, err := json.Marshal(now) 13 | if err != nil { 14 | t.Fatal(err) 15 | } 16 | 17 | _, err = time.Parse(`"`+formatISO8601+`"`, string(data)) 18 | if err != nil { 19 | t.Fatal(err) 20 | } 21 | 22 | var now2 ISO6801Time 23 | err = json.Unmarshal(data, &now2) 24 | if err != nil { 25 | t.Fatal(err) 26 | } 27 | 28 | if now != now2 { 29 | t.Errorf("Time %s does not equal expected %s", now2, now) 30 | } 31 | 32 | if now.String() != now2.String() { 33 | t.Fatalf("String format for %s does not equal expected %s", now2, now) 34 | } 35 | 36 | type TestTimeStruct struct { 37 | A int 38 | B *ISO6801Time 39 | } 40 | var testValue TestTimeStruct 41 | err = json.Unmarshal([]byte("{\"A\": 1, \"B\":\"\"}"), &testValue) 42 | if err != nil { 43 | t.Fatal(err) 44 | } 45 | t.Logf("%v", testValue) 46 | if !testValue.B.IsDefault() { 47 | t.Fatal("Invaid Unmarshal result for ISO6801Time from empty value") 48 | } 49 | t.Logf("ISO6801Time String(): %s", now2.String()) 50 | } 51 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/googleapi/transport/apikey.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package transport contains HTTP transports used to make 6 | // authenticated API requests. 7 | package transport 8 | 9 | import ( 10 | "errors" 11 | "net/http" 12 | ) 13 | 14 | // APIKey is an HTTP Transport which wraps an underlying transport and 15 | // appends an API Key "key" parameter to the URL of outgoing requests. 16 | type APIKey struct { 17 | // Key is the API Key to set on requests. 18 | Key string 19 | 20 | // Transport is the underlying HTTP transport. 21 | // If nil, http.DefaultTransport is used. 22 | Transport http.RoundTripper 23 | } 24 | 25 | func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) { 26 | rt := t.Transport 27 | if rt == nil { 28 | rt = http.DefaultTransport 29 | if rt == nil { 30 | return nil, errors.New("googleapi/transport: no Transport specified or available") 31 | } 32 | } 33 | newReq := *req 34 | args := newReq.URL.Query() 35 | args.Set("key", t.Key) 36 | newReq.URL.RawQuery = args.Encode() 37 | return rt.RoundTrip(&newReq) 38 | } 39 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/trace/trace_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package trace 6 | 7 | import ( 8 | "reflect" 9 | "testing" 10 | ) 11 | 12 | type s struct{} 13 | 14 | func (s) String() string { return "lazy string" } 15 | 16 | // TestReset checks whether all the fields are zeroed after reset. 17 | func TestReset(t *testing.T) { 18 | tr := New("foo", "bar") 19 | tr.LazyLog(s{}, false) 20 | tr.LazyPrintf("%d", 1) 21 | tr.SetRecycler(func(_ interface{}) {}) 22 | tr.SetTraceInfo(3, 4) 23 | tr.SetMaxEvents(100) 24 | tr.SetError() 25 | tr.Finish() 26 | 27 | tr.(*trace).reset() 28 | 29 | if !reflect.DeepEqual(tr, new(trace)) { 30 | t.Errorf("reset didn't clear all fields: %+v", tr) 31 | } 32 | } 33 | 34 | // TestResetLog checks whether all the fields are zeroed after reset. 35 | func TestResetLog(t *testing.T) { 36 | el := NewEventLog("foo", "bar") 37 | el.Printf("message") 38 | el.Errorf("error") 39 | el.Finish() 40 | 41 | el.(*eventLog).reset() 42 | 43 | if !reflect.DeepEqual(el, new(eventLog)) { 44 | t.Errorf("reset didn't clear all fields: %+v", el) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/googleapi/types_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package googleapi 6 | 7 | import ( 8 | "encoding/json" 9 | "reflect" 10 | "testing" 11 | ) 12 | 13 | func TestTypes(t *testing.T) { 14 | type T struct { 15 | I32 Int32s 16 | I64 Int64s 17 | U32 Uint32s 18 | U64 Uint64s 19 | F64 Float64s 20 | } 21 | v := &T{ 22 | I32: Int32s{-1, 2, 3}, 23 | I64: Int64s{-1, 2, 1 << 33}, 24 | U32: Uint32s{1, 2}, 25 | U64: Uint64s{1, 2, 1 << 33}, 26 | F64: Float64s{1.5, 3.33}, 27 | } 28 | got, err := json.Marshal(v) 29 | if err != nil { 30 | t.Fatal(err) 31 | } 32 | want := `{"I32":["-1","2","3"],"I64":["-1","2","8589934592"],"U32":["1","2"],"U64":["1","2","8589934592"],"F64":["1.5","3.33"]}` 33 | if string(got) != want { 34 | t.Fatalf("Marshal mismatch.\n got: %s\nwant: %s\n", got, want) 35 | } 36 | 37 | v2 := new(T) 38 | if err := json.Unmarshal(got, v2); err != nil { 39 | t.Fatalf("Unmarshal: %v", err) 40 | } 41 | if !reflect.DeepEqual(v, v2) { 42 | t.Fatalf("Unmarshal didn't produce same results.\n got: %#v\nwant: %#v\n", v, v2) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/denverdino/aliyungo/util/signature.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "crypto/hmac" 5 | "crypto/sha1" 6 | "encoding/base64" 7 | "net/url" 8 | "strings" 9 | ) 10 | 11 | //CreateSignature creates signature for string following Aliyun rules 12 | func CreateSignature(stringToSignature, accessKeySecret string) string { 13 | // Crypto by HMAC-SHA1 14 | hmacSha1 := hmac.New(sha1.New, []byte(accessKeySecret)) 15 | hmacSha1.Write([]byte(stringToSignature)) 16 | sign := hmacSha1.Sum(nil) 17 | 18 | // Encode to Base64 19 | base64Sign := base64.StdEncoding.EncodeToString(sign) 20 | 21 | return base64Sign 22 | } 23 | 24 | func percentReplace(str string) string { 25 | str = strings.Replace(str, "+", "%20", -1) 26 | str = strings.Replace(str, "*", "%2A", -1) 27 | str = strings.Replace(str, "%7E", "~", -1) 28 | 29 | return str 30 | } 31 | 32 | // CreateSignatureForRequest creates signature for query string values 33 | func CreateSignatureForRequest(method string, values *url.Values, accessKeySecret string) string { 34 | 35 | canonicalizedQueryString := percentReplace(values.Encode()) 36 | 37 | stringToSign := method + "&%2F&" + url.QueryEscape(canonicalizedQueryString) 38 | 39 | return CreateSignature(stringToSign, accessKeySecret) 40 | } 41 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/internal/transport/cancelreq_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !go1.5 16 | 17 | package transport 18 | 19 | import "net/http" 20 | 21 | // makeReqCancel returns a closure that cancels the given http.Request 22 | // when called. 23 | func makeReqCancel(req *http.Request) func(http.RoundTripper) { 24 | // Go 1.4 and prior do not have a reliable way of cancelling a request. 25 | // Transport.CancelRequest will only work if the request is already in-flight. 26 | return func(r http.RoundTripper) { 27 | if t, ok := r.(*http.Transport); ok { 28 | t.CancelRequest(req) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type levelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks levelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks levelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /contrib/compose/nginx/registry.conf: -------------------------------------------------------------------------------- 1 | # Docker registry proxy for api versions 1 and 2 2 | 3 | upstream docker-registry { 4 | server registryv1:5000; 5 | } 6 | 7 | upstream docker-registry-v2 { 8 | server registryv2:5000; 9 | } 10 | 11 | # No client auth or TLS 12 | server { 13 | listen 5000; 14 | server_name localhost; 15 | 16 | # disable any limits to avoid HTTP 413 for large image uploads 17 | client_max_body_size 0; 18 | 19 | # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486) 20 | chunked_transfer_encoding on; 21 | 22 | location /v2/ { 23 | # Do not allow connections from docker 1.5 and earlier 24 | # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents 25 | if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) { 26 | return 404; 27 | } 28 | 29 | # To add basic authentication to v2 use auth_basic setting plus add_header 30 | # auth_basic "registry.localhost"; 31 | # auth_basic_user_file test.password; 32 | # add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always; 33 | 34 | include docker-registry-v2.conf; 35 | } 36 | 37 | location / { 38 | include docker-registry.conf; 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /uuid/uuid_test.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | const iterations = 1000 8 | 9 | func TestUUID4Generation(t *testing.T) { 10 | for i := 0; i < iterations; i++ { 11 | u := Generate() 12 | 13 | if u[6]&0xf0 != 0x40 { 14 | t.Fatalf("version byte not correctly set: %v, %08b %08b", u, u[6], u[6]&0xf0) 15 | } 16 | 17 | if u[8]&0xc0 != 0x80 { 18 | t.Fatalf("top order 8th byte not correctly set: %v, %b", u, u[8]) 19 | } 20 | } 21 | } 22 | 23 | func TestParseAndEquality(t *testing.T) { 24 | for i := 0; i < iterations; i++ { 25 | u := Generate() 26 | 27 | parsed, err := Parse(u.String()) 28 | if err != nil { 29 | t.Fatalf("error parsing uuid %v: %v", u, err) 30 | } 31 | 32 | if parsed != u { 33 | t.Fatalf("parsing round trip failed: %v != %v", parsed, u) 34 | } 35 | } 36 | 37 | for _, c := range []string{ 38 | "bad", 39 | "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", // correct length, incorrect format 40 | " 20cc7775-2671-43c7-8742-51d1cfa23258", // leading space 41 | "20cc7775-2671-43c7-8742-51d1cfa23258 ", // trailing space 42 | "00000000-0000-0000-0000-x00000000000", // out of range character 43 | } { 44 | if _, err := Parse(c); err == nil { 45 | t.Fatalf("parsing %q should have failed", c) 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/empty/empty.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: google.golang.org/cloud/bigtable/internal/empty/empty.proto 3 | // DO NOT EDIT! 4 | 5 | /* 6 | Package google_protobuf is a generated protocol buffer package. 7 | 8 | It is generated from these files: 9 | google.golang.org/cloud/bigtable/internal/empty/empty.proto 10 | 11 | It has these top-level messages: 12 | Empty 13 | */ 14 | package google_protobuf 15 | 16 | import proto "github.com/golang/protobuf/proto" 17 | import fmt "fmt" 18 | import math "math" 19 | 20 | // Reference imports to suppress errors if they are not otherwise used. 21 | var _ = proto.Marshal 22 | var _ = fmt.Errorf 23 | var _ = math.Inf 24 | 25 | // A generic empty message that you can re-use to avoid defining duplicated 26 | // empty messages in your APIs. A typical example is to use it as the request 27 | // or the response type of an API method. For instance: 28 | // 29 | // service Foo { 30 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 31 | // } 32 | // 33 | type Empty struct { 34 | } 35 | 36 | func (m *Empty) Reset() { *m = Empty{} } 37 | func (m *Empty) String() string { return proto.CompactTextString(m) } 38 | func (*Empty) ProtoMessage() {} 39 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | // Error implements the error interface and can represents multiple 11 | // errors that occur in the course of a single decode. 12 | type Error struct { 13 | Errors []string 14 | } 15 | 16 | func (e *Error) Error() string { 17 | points := make([]string, len(e.Errors)) 18 | for i, err := range e.Errors { 19 | points[i] = fmt.Sprintf("* %s", err) 20 | } 21 | 22 | sort.Strings(points) 23 | return fmt.Sprintf( 24 | "%d error(s) decoding:\n\n%s", 25 | len(e.Errors), strings.Join(points, "\n")) 26 | } 27 | 28 | // WrappedErrors implements the errwrap.Wrapper interface to make this 29 | // return value more useful with the errwrap and go-multierror libraries. 30 | func (e *Error) WrappedErrors() []error { 31 | if e == nil { 32 | return nil 33 | } 34 | 35 | result := make([]error, len(e.Errors)) 36 | for i, e := range e.Errors { 37 | result[i] = errors.New(e) 38 | } 39 | 40 | return result 41 | } 42 | 43 | func appendErrors(errors []string, err error) []string { 44 | switch e := err.(type) { 45 | case *Error: 46 | return append(errors, e.Errors...) 47 | default: 48 | return append(errors, e.Error()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /docs/osx/com.docker.registry.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.docker.registry 7 | KeepAlive 8 | 9 | StandardErrorPath 10 | /Users/Shared/Registry/registry.log 11 | StandardOutPath 12 | /Users/Shared/Registry/registry.log 13 | Program 14 | /usr/local/libexec/registry 15 | ProgramArguments 16 | 17 | /usr/local/libexec/registry 18 | /Users/Shared/Registry/config.yml 19 | 20 | Sockets 21 | 22 | http-listen-address 23 | 24 | SockServiceName 25 | 5000 26 | SockType 27 | dgram 28 | SockFamily 29 | IPv4 30 | 31 | http-debug-address 32 | 33 | SockServiceName 34 | 5001 35 | SockType 36 | dgram 37 | SockFamily 38 | IPv4 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDPjCCAiYCCQDizia/MoUFnDANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJV 3 | UzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xFDASBgNVBAoT 4 | C0JyYWRmaXR6aW5jMRIwEAYDVQQDEwlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEW 5 | DmJyYWRAZGFuZ2EuY29tMB4XDTE0MDcxNTIwNTAyN1oXDTE1MTEyNzIwNTAyN1ow 6 | RzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQHEwJTRjEeMBwGA1UE 7 | ChMVYnJhZGZpdHogaHR0cDIgc2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A 8 | MIIBCgKCAQEAs1Y9CyLFrdL8VQWN1WaifDqaZFnoqjHhCMlc1TfG2zA+InDifx2l 9 | gZD3o8FeNnAcfM2sPlk3+ZleOYw9P/CklFVDlvqmpCv9ss/BEp/dDaWvy1LmJ4c2 10 | dbQJfmTxn7CV1H3TsVJvKdwFmdoABb41NoBp6+NNO7OtDyhbIMiCI0pL3Nefb3HL 11 | A7hIMo3DYbORTtJLTIH9W8YKrEWL0lwHLrYFx/UdutZnv+HjdmO6vCN4na55mjws 12 | /vjKQUmc7xeY7Xe20xDEG2oDKVkL2eD7FfyrYMS3rO1ExP2KSqlXYG/1S9I/fz88 13 | F0GK7HX55b5WjZCl2J3ERVdnv/0MQv+sYQIDAQABMA0GCSqGSIb3DQEBBQUAA4IB 14 | AQC0zL+n/YpRZOdulSu9tS8FxrstXqGWoxfe+vIUgqfMZ5+0MkjJ/vW0FqlLDl2R 15 | rn4XaR3e7FmWkwdDVbq/UB6lPmoAaFkCgh9/5oapMaclNVNnfF3fjCJfRr+qj/iD 16 | EmJStTIN0ZuUjAlpiACmfnpEU55PafT5Zx+i1yE4FGjw8bJpFoyD4Hnm54nGjX19 17 | KeCuvcYFUPnBm3lcL0FalF2AjqV02WTHYNQk7YF/oeO7NKBoEgvGvKG3x+xaOeBI 18 | dwvdq175ZsGul30h+QjrRlXhH/twcuaT3GSdoysDl9cCYE8f1Mk8PD6gan3uBCJU 19 | 90p6/CbU71bGbfpM2PHot2fm 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/empty/empty.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.protobuf; 18 | 19 | option java_multiple_files = true; 20 | option java_outer_classname = "EmptyProto"; 21 | option java_package = "com.google.protobuf"; 22 | 23 | 24 | // A generic empty message that you can re-use to avoid defining duplicated 25 | // empty messages in your APIs. A typical example is to use it as the request 26 | // or the response type of an API method. For instance: 27 | // 28 | // service Foo { 29 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 30 | // } 31 | // 32 | message Empty { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /docs/storage-drivers/azure.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | # Microsoft Azure storage driver 11 | 12 | An implementation of the `storagedriver.StorageDriver` interface which uses [Microsoft Azure Blob Storage][azure-blob-storage] for object storage. 13 | 14 | ## Parameters 15 | 16 | The following parameters must be used to authenticate and configure the storage driver (case-sensitive): 17 | 18 | * `accountname`: Name of the Azure Storage Account. 19 | * `accountkey`: Primary or Secondary Key for the Storage Account. 20 | * `container`: Name of the root storage container in which all registry data will be stored. Must comply the storage container name [requirements][create-container-api]. 21 | * `realm`: (optional) Domain name suffix for the Storage Service API endpoint. Defaults to `core.windows.net`. For example realm for "Azure in China" would be `core.chinacloudapi.cn` and realm for "Azure Government" would be `core.usgovcloudapi.net`. 22 | 23 | [azure-blob-storage]: http://azure.microsoft.com/en-us/services/storage/ 24 | [create-container-api]: https://msdn.microsoft.com/en-us/library/azure/dd179468.aspx 25 | -------------------------------------------------------------------------------- /registry/proxy/proxyauth.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import ( 4 | "net/http" 5 | "net/url" 6 | 7 | "github.com/docker/distribution/registry/client/auth" 8 | ) 9 | 10 | const tokenURL = "https://auth.docker.io/token" 11 | 12 | type userpass struct { 13 | username string 14 | password string 15 | } 16 | 17 | type credentials struct { 18 | creds map[string]userpass 19 | } 20 | 21 | func (c credentials) Basic(u *url.URL) (string, string) { 22 | up := c.creds[u.String()] 23 | 24 | return up.username, up.password 25 | } 26 | 27 | // ConfigureAuth authorizes with the upstream registry 28 | func ConfigureAuth(remoteURL, username, password string, cm auth.ChallengeManager) (auth.CredentialStore, error) { 29 | if err := ping(cm, remoteURL+"/v2/", "Docker-Distribution-Api-Version"); err != nil { 30 | return nil, err 31 | } 32 | 33 | creds := map[string]userpass{ 34 | tokenURL: { 35 | username: username, 36 | password: password, 37 | }, 38 | } 39 | return credentials{creds: creds}, nil 40 | } 41 | 42 | func ping(manager auth.ChallengeManager, endpoint, versionHeader string) error { 43 | resp, err := http.Get(endpoint) 44 | if err != nil { 45 | return err 46 | } 47 | defer resp.Body.Close() 48 | 49 | if err := manager.AddResponse(resp); err != nil { 50 | return err 51 | } 52 | 53 | return nil 54 | } 55 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/Sirupsen/logrus/entry_test.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestEntryPanicln(t *testing.T) { 12 | errBoom := fmt.Errorf("boom time") 13 | 14 | defer func() { 15 | p := recover() 16 | assert.NotNil(t, p) 17 | 18 | switch pVal := p.(type) { 19 | case *Entry: 20 | assert.Equal(t, "kaboom", pVal.Message) 21 | assert.Equal(t, errBoom, pVal.Data["err"]) 22 | default: 23 | t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal) 24 | } 25 | }() 26 | 27 | logger := New() 28 | logger.Out = &bytes.Buffer{} 29 | entry := NewEntry(logger) 30 | entry.WithField("err", errBoom).Panicln("kaboom") 31 | } 32 | 33 | func TestEntryPanicf(t *testing.T) { 34 | errBoom := fmt.Errorf("boom again") 35 | 36 | defer func() { 37 | p := recover() 38 | assert.NotNil(t, p) 39 | 40 | switch pVal := p.(type) { 41 | case *Entry: 42 | assert.Equal(t, "kaboom true", pVal.Message) 43 | assert.Equal(t, errBoom, pVal.Data["err"]) 44 | default: 45 | t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal) 46 | } 47 | }() 48 | 49 | logger := New() 50 | logger.Out = &bytes.Buffer{} 51 | entry := NewEntry(logger) 52 | entry.WithField("err", errBoom).Panicf("kaboom %v", true) 53 | } 54 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/docker/libtrust/filter.go: -------------------------------------------------------------------------------- 1 | package libtrust 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | // FilterByHosts filters the list of PublicKeys to only those which contain a 8 | // 'hosts' pattern which matches the given host. If *includeEmpty* is true, 9 | // then keys which do not specify any hosts are also returned. 10 | func FilterByHosts(keys []PublicKey, host string, includeEmpty bool) ([]PublicKey, error) { 11 | filtered := make([]PublicKey, 0, len(keys)) 12 | 13 | for _, pubKey := range keys { 14 | var hosts []string 15 | switch v := pubKey.GetExtendedField("hosts").(type) { 16 | case []string: 17 | hosts = v 18 | case []interface{}: 19 | for _, value := range v { 20 | h, ok := value.(string) 21 | if !ok { 22 | continue 23 | } 24 | hosts = append(hosts, h) 25 | } 26 | } 27 | 28 | if len(hosts) == 0 { 29 | if includeEmpty { 30 | filtered = append(filtered, pubKey) 31 | } 32 | continue 33 | } 34 | 35 | // Check if any hosts match pattern 36 | for _, hostPattern := range hosts { 37 | match, err := filepath.Match(hostPattern, host) 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | if match { 43 | filtered = append(filtered, pubKey) 44 | continue 45 | } 46 | } 47 | } 48 | 49 | return filtered, nil 50 | } 51 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/cloud/examples/bigtable/bigtable-hello/README.md: -------------------------------------------------------------------------------- 1 | # Cloud Bigtable on Managed VMs using Go 2 | # (Hello World for Cloud Bigtable) 3 | 4 | This app counts how often each user visits. 5 | 6 | ## Prerequisites 7 | 8 | 1. Set up Cloud Console. 9 | 1. Go to the [Cloud Console](https://cloud.google.com/console) and create or select your project. 10 | You will need the project ID later. 11 | 1. Go to **Settings > Project Billing Settings** and enable billing. 12 | 1. Select **APIs & Auth > APIs**. 13 | 1. Enable the **Cloud Bigtable API** and the **Cloud Bigtable Admin API**. 14 | (You may need to search for the API). 15 | 1. Set up gcloud. 16 | 1. `gcloud components update` 17 | 1. `gcloud auth login` 18 | 1. `gcloud config set project PROJECT_ID` 19 | 1. Download App Engine SDK for Go. 20 | 1. `go get -u google.golang.org/appengine/...` 21 | 1. In helloworld.go, change the constants `project`, `zone` and `cluster` 22 | 23 | ## Running locally 24 | 25 | 1. From the sample project folder, `gcloud preview app run app.yaml` 26 | 27 | ## Deploying on Google App Engine Managed VM 28 | 29 | 1. Install and start [Docker](https://cloud.google.com/appengine/docs/managed-vms/getting-started#install_docker). 30 | 1. From the sample project folder, `aedeploy gcloud preview app deploy app.yaml` 31 | -------------------------------------------------------------------------------- /registry/handlers/hooks.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "fmt" 7 | "strings" 8 | "text/template" 9 | 10 | "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | // logHook is for hooking Panic in web application 14 | type logHook struct { 15 | LevelsParam []string 16 | Mail *mailer 17 | } 18 | 19 | // Fire forwards an error to LogHook 20 | func (hook *logHook) Fire(entry *logrus.Entry) error { 21 | addr := strings.Split(hook.Mail.Addr, ":") 22 | if len(addr) != 2 { 23 | return errors.New("Invalid Mail Address") 24 | } 25 | host := addr[0] 26 | subject := fmt.Sprintf("[%s] %s: %s", entry.Level, host, entry.Message) 27 | 28 | html := ` 29 | {{.Message}} 30 | 31 | {{range $key, $value := .Data}} 32 | {{$key}}: {{$value}} 33 | {{end}} 34 | ` 35 | b := bytes.NewBuffer(make([]byte, 0)) 36 | t := template.Must(template.New("mail body").Parse(html)) 37 | if err := t.Execute(b, entry); err != nil { 38 | return err 39 | } 40 | body := fmt.Sprintf("%s", b) 41 | 42 | return hook.Mail.sendMail(subject, body) 43 | } 44 | 45 | // Levels contains hook levels to be catched 46 | func (hook *logHook) Levels() []logrus.Level { 47 | levels := []logrus.Level{} 48 | for _, v := range hook.LevelsParam { 49 | lv, _ := logrus.ParseLevel(v) 50 | levels = append(levels, lv) 51 | } 52 | return levels 53 | } 54 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/newrelic_platform_go/metrica.go: -------------------------------------------------------------------------------- 1 | package newrelic_platform_go 2 | 3 | import ( 4 | "math" 5 | ) 6 | 7 | type IMetrica interface { 8 | GetValue() (float64, error) 9 | GetName() string 10 | GetUnits() string 11 | } 12 | 13 | type MetricaValue interface{} 14 | 15 | type SimpleMetricaValue float64 16 | 17 | type AggregatedMetricaValue struct { 18 | Min float64 `json:"min"` 19 | Max float64 `json:"max"` 20 | Total float64 `json:"total"` 21 | Count int `json:"count"` 22 | SumOfSquares float64 `json:"sum_of_squares"` 23 | } 24 | 25 | func NewAggregatedMetricaValue(existValue float64, newValue float64) *AggregatedMetricaValue { 26 | v := &AggregatedMetricaValue{ 27 | Min: math.Min(newValue, existValue), 28 | Max: math.Max(newValue, existValue), 29 | Total: newValue + existValue, 30 | Count: 2, 31 | SumOfSquares: newValue*newValue + existValue*existValue, 32 | } 33 | return v 34 | } 35 | 36 | func (aggregatedValue *AggregatedMetricaValue) Aggregate(newValue float64) { 37 | aggregatedValue.Min = math.Min(newValue, aggregatedValue.Min) 38 | aggregatedValue.Max = math.Max(newValue, aggregatedValue.Max) 39 | aggregatedValue.Total += newValue 40 | aggregatedValue.Count++ 41 | aggregatedValue.SumOfSquares += newValue * newValue 42 | } 43 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/bugsnag/panicwrap/monitor.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package panicwrap 4 | 5 | import ( 6 | "github.com/bugsnag/osext" 7 | "os" 8 | "os/exec" 9 | "syscall" 10 | ) 11 | 12 | func monitor(c *WrapConfig) (int, error) { 13 | 14 | // If we're the child process, absorb panics. 15 | if Wrapped(c) { 16 | panicCh := make(chan string) 17 | 18 | go trackPanic(os.Stdin, os.Stderr, c.DetectDuration, panicCh) 19 | 20 | // Wait on the panic data 21 | panicTxt := <-panicCh 22 | if panicTxt != "" { 23 | if !c.HidePanic { 24 | os.Stderr.Write([]byte(panicTxt)) 25 | } 26 | 27 | c.Handler(panicTxt) 28 | } 29 | 30 | os.Exit(0) 31 | } 32 | 33 | exePath, err := osext.Executable() 34 | if err != nil { 35 | return -1, err 36 | } 37 | cmd := exec.Command(exePath, os.Args[1:]...) 38 | 39 | read, write, err := os.Pipe() 40 | if err != nil { 41 | return -1, err 42 | } 43 | 44 | cmd.Stdin = read 45 | cmd.Stdout = os.Stdout 46 | cmd.Stderr = os.Stderr 47 | cmd.Env = append(os.Environ(), c.CookieKey+"="+c.CookieValue) 48 | 49 | if err != nil { 50 | return -1, err 51 | } 52 | err = cmd.Start() 53 | if err != nil { 54 | return -1, err 55 | } 56 | 57 | err = syscall.Dup2(int(write.Fd()), int(os.Stderr.Fd())) 58 | if err != nil { 59 | return -1, err 60 | } 61 | 62 | return -1, nil 63 | } 64 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/github.com/yvasiyarov/gorelic/examples/example1.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "github.com/yvasiyarov/gorelic" 6 | "log" 7 | "math/rand" 8 | "runtime" 9 | "time" 10 | ) 11 | 12 | var newrelicLicense = flag.String("newrelic-license", "", "Newrelic license") 13 | 14 | func allocateAndSum(arraySize int) int { 15 | arr := make([]int, arraySize, arraySize) 16 | for i := range arr { 17 | arr[i] = rand.Int() 18 | } 19 | time.Sleep(time.Duration(rand.Intn(3000)) * time.Millisecond) 20 | 21 | result := 0 22 | for _, v := range arr { 23 | result += v 24 | } 25 | //log.Printf("Array size is: %d, sum is: %d\n", arraySize, result) 26 | return result 27 | } 28 | 29 | func doSomeJob(numRoutines int) { 30 | for { 31 | for i := 0; i < numRoutines; i++ { 32 | go allocateAndSum(rand.Intn(1024) * 1024) 33 | } 34 | log.Printf("All %d routines started\n", numRoutines) 35 | time.Sleep(1000 * time.Millisecond) 36 | runtime.GC() 37 | } 38 | } 39 | 40 | func main() { 41 | 42 | flag.Parse() 43 | if *newrelicLicense == "" { 44 | log.Fatalf("Please, pass a valid newrelic license key.\n Use --help to get more information about available options\n") 45 | } 46 | agent := gorelic.NewAgent() 47 | agent.Verbose = true 48 | agent.NewrelicLicense = *newrelicLicense 49 | agent.Run() 50 | 51 | doSomeJob(100) 52 | } 53 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package nettest 6 | 7 | import ( 8 | "fmt" 9 | "runtime" 10 | "syscall" 11 | ) 12 | 13 | // SupportsRawIPSocket reports whether the platform supports raw IP 14 | // sockets. 15 | func SupportsRawIPSocket() (string, bool) { 16 | // From http://msdn.microsoft.com/en-us/library/windows/desktop/ms740548.aspx: 17 | // Note: To use a socket of type SOCK_RAW requires administrative privileges. 18 | // Users running Winsock applications that use raw sockets must be a member of 19 | // the Administrators group on the local computer, otherwise raw socket calls 20 | // will fail with an error code of WSAEACCES. On Windows Vista and later, access 21 | // for raw sockets is enforced at socket creation. In earlier versions of Windows, 22 | // access for raw sockets is enforced during other socket operations. 23 | s, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_RAW, 0) 24 | if err == syscall.WSAEACCES { 25 | return fmt.Sprintf("no access to raw socket allowed on %s", runtime.GOOS), false 26 | } 27 | if err != nil { 28 | return err.Error(), false 29 | } 30 | syscall.Closesocket(s) 31 | return "", true 32 | } 33 | -------------------------------------------------------------------------------- /Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "discovery#restDescription", 3 | "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", 4 | "discoveryVersion": "v1", 5 | "id": "arrayofarray:v1", 6 | "name": "arrayofarray", 7 | "version": "v1", 8 | "title": "Example API", 9 | "description": "The Example API demonstrates an array of arrays.", 10 | "ownerDomain": "google.com", 11 | "ownerName": "Google", 12 | "protocol": "rest", 13 | "schemas": { 14 | "GeoJsonMultiPolygon": { 15 | "id": "GeoJsonMultiPolygon", 16 | "type": "object", 17 | "description": "Multi Polygon", 18 | "properties": { 19 | "coordinates": { 20 | "type": "array", 21 | "description": "Coordinate arrays.", 22 | "items": { 23 | "type": "array", 24 | "items": { 25 | "type": "array", 26 | "items": { 27 | "type": "array", 28 | "items": { 29 | "type": "number", 30 | "format": "double" 31 | } 32 | } 33 | } 34 | } 35 | }, 36 | "type": { 37 | "type": "string", 38 | "description": "Identifies this object as a multi-polygon.", 39 | "enum": [ 40 | "MultiPolygon" 41 | ], 42 | "enumDescriptions": [ 43 | "" 44 | ] 45 | } 46 | } 47 | } 48 | } 49 | } 50 | --------------------------------------------------------------------------------