diff --git a/glide.lock b/glide.lock index 6e3677963..c35f693aa 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: a8dbae01be6173ddeceed9debaf995f8007df052cabb90838a1652e0da0baa70 -updated: 2017-06-11T01:58:27.005608286-07:00 +hash: c3a20e76f70802a5cb8ead0c4ac29c6bca272a3d738d9b95538d9fc238ad450c +updated: 2017-06-30T11:01:18.063490786-07:00 imports: - name: code.cloudfoundry.org/bytefmt version: f4415fafc5619dd75599a54a7c91fb3948ad58bd @@ -40,7 +40,7 @@ imports: subpackages: - cli/config/configfile - name: github.com/docker/distribution - version: 99cb7c0946d2f5a38015443e515dc916295064d7 + version: a25b9ef0c9fe242ac04bb20d3a028442b7d266b6 subpackages: - context - digest @@ -89,6 +89,10 @@ imports: version: 4da3e2cfbabc9f751898f250b49f2439785783a1 - name: github.com/fsouza/go-dockerclient version: c933ed18bef34ec2955de03de8ef9a3bb996e3df +- name: github.com/funcy/functions_go + version: 5d9948e8b1292c5421b5dd98bb6a9b5535d5e1ba + subpackages: + - models - name: github.com/garyburd/redigo version: 95d11dba2d44531bdb8022752b98912baafae03a subpackages: @@ -201,8 +205,6 @@ imports: version: b938d81255b5473c57635324295cb0fe398c7a58 - name: github.com/PuerkitoBio/urlesc version: bbf7a2afc14f93e1e0a5c06df524fbd75e5031e5 -- name: github.com/satori/go.uuid - version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b - name: github.com/Sirupsen/logrus version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f repo: https://github.com/sirupsen/logrus diff --git a/glide.yaml b/glide.yaml index 7e97a3bd4..1c19b7010 100644 --- a/glide.yaml +++ b/glide.yaml @@ -3,10 +3,13 @@ excludeDirs: - fn import: - package: code.cloudfoundry.org/bytefmt +- package: github.com/funcy/functions_go + subpackages: + - models - package: github.com/Sirupsen/logrus repo: https://github.com/sirupsen/logrus vcs: git - version: v0.11.5 + version: ^v0.11.5 subpackages: - hooks/syslog - package: github.com/amir/raidman @@ -25,6 +28,7 @@ import: subpackages: - cli/config/configfile - package: github.com/docker/distribution + version: ^2.6.1 subpackages: - manifest/schema1 - package: github.com/fsouza/go-dockerclient diff --git a/vendor/github.com/docker/distribution/AUTHORS b/vendor/github.com/docker/distribution/AUTHORS index 9e80e062b..252ff8aa2 100644 --- a/vendor/github.com/docker/distribution/AUTHORS +++ b/vendor/github.com/docker/distribution/AUTHORS @@ -1,6 +1,8 @@ +a-palchikov Aaron Lehmann Aaron Schlesinger Aaron Vinson +Adam Duke Adam Enger Adrian Mouat Ahmet Alp Balkan @@ -19,6 +21,7 @@ Anis Elleuch Anton Tiurin Antonio Mercado Antonio Murdaca +Anusha Ragunathan Arien Holthuizen Arnaud Porterie Arthur Baars @@ -26,12 +29,16 @@ Asuka Suzuki Avi Miller Ayose Cazorla BadZen +Ben Bodenmiller Ben Firshman bin liu Brian Bland burnettk Carson A +Cezar Sa Espinola +Charles Smith Chris Dillon +cuiwei13 cyli Daisuke Fujita Daniel Huhn @@ -48,11 +55,14 @@ Diogo Mónica DJ Enriquez Donald Huang Doug Davis +Edgar Lee Eric Yang +Fabio Berchtold Fabio Huser farmerworking Felix Yan Florentin Raud +Frank Chen Frederick F. Kautz IV gabriell nascimento Gleb Schukin @@ -64,16 +74,23 @@ HuKeping Ian Babrou igayoso Jack Griffin +James Findley Jason Freidman +Jason Heiss Jeff Nickoloff +Jess Frazelle Jessie Frazelle jhaohai Jianqing Wang +Jihoon Chung +Joao Fernandes +John Mulhausen John Starks Jon Johnson Jon Poler Jonathan Boulle Jordan Liggitt +Josh Chorlton Josh Hawn Julien Fernandez Ke Xu @@ -84,22 +101,30 @@ Kenny Leung Li Yi Liu Hua liuchang0812 +Lloyd Ramey Louis Kottmann Luke Carpenter +Marcus Martins Mary Anthony Matt Bentley Matt Duch Matt Moore Matt Robenolt +Matthew Green Michael Prokop Michal Minar +Michal Minář +Mike Brown Miquel Sabaté +Misty Stanley-Jones +Misty Stanley-Jones Morgan Bauer moxiegirl Nathan Sullivan nevermosby Nghia Tran Nikita Tarasov +Noah Treuhaft Nuutti Kotivuori Oilbeater Olivier Gambier @@ -108,17 +133,23 @@ Omer Cohen Patrick Devine Phil Estes Philip Misiowiec +Pierre-Yves Ritschard +Qiao Anran +Randy Barlow Richard Scothern Rodolfo Carvalho Rusty Conover Sean Boran Sebastiaan van Stijn +Sebastien Coavoux Serge Dubrouski Sharif Nassar Shawn Falkner-Horine Shreyas Karnik Simon Thulbourn +spacexnice Spencer Rinehart +Stan Hu Stefan Majewsky Stefan Weil Stephen J Day @@ -134,6 +165,8 @@ Tonis Tiigi Tony Holdstock-Brown Trevor Pounds Troels Thomsen +Victor Vieux +Victoria Bialas Vincent Batts Vincent Demeester Vincent Giersch @@ -142,6 +175,8 @@ weiyuan.yl xg.song xiekeyang Yann ROBERT +yaoyao.xyy +yuexiao-wang yuzou zhouhaibing089 姜继忠 diff --git a/vendor/github.com/docker/distribution/BUILDING.md b/vendor/github.com/docker/distribution/BUILDING.md index d9577022b..2d5a10119 100644 --- a/vendor/github.com/docker/distribution/BUILDING.md +++ b/vendor/github.com/docker/distribution/BUILDING.md @@ -11,7 +11,7 @@ Most people should use the [official Registry docker image](https://hub.docker.c People looking for advanced operational use cases might consider rolling their own image with a custom Dockerfile inheriting `FROM registry:2`. -OS X users who want to run natively can do so following [the instructions here](osx-setup-guide.md). +OS X users who want to run natively can do so following [the instructions here](https://github.com/docker/docker.github.io/blob/master/registry/recipes/osx-setup-guide.md). ### Gotchas diff --git a/vendor/github.com/docker/distribution/CHANGELOG.md b/vendor/github.com/docker/distribution/CHANGELOG.md index 3445c090c..b1a5c6824 100644 --- a/vendor/github.com/docker/distribution/CHANGELOG.md +++ b/vendor/github.com/docker/distribution/CHANGELOG.md @@ -1,9 +1,88 @@ # Changelog +## 2.6.1 (2017-04-05) + +#### Registry +- Fix `Forwarded` header handling, revert use of `X-Forwarded-Port` +- Use driver `Stat` for registry health check + +## 2.6.0 (2017-01-18) + +#### Storage +- S3: fixed bug in delete due to read-after-write inconsistency +- S3: allow EC2 IAM roles to be used when authorizing region endpoints +- S3: add Object ACL Support +- S3: fix delete method's notion of subpaths +- S3: use multipart upload API in `Move` method for performance +- S3: add v2 signature signing for legacy S3 clones +- Swift: add simple heuristic to detect incomplete DLOs during read ops +- Swift: support different user and tenant domains +- Swift: bulk deletes in chunks +- Aliyun OSS: fix delete method's notion of subpaths +- Aliyun OSS: optimize data copy after upload finishes +- Azure: close leaking response body +- Fix storage drivers dropping non-EOF errors when listing repositories +- Compare path properly when listing repositories in catalog +- Add a foreign layer URL host whitelist +- Improve catalog enumerate runtime + +#### Registry +- Export `storage.CreateOptions` in top-level package +- Enable notifications to endpoints that use self-signed certificates +- Properly validate multi-URL foreign layers +- Add control over validation of URLs in pushed manifests +- Proxy mode: fix socket leak when pull is cancelled +- Tag service: properly handle error responses on HEAD request +- Support for custom authentication URL in proxying registry +- Add configuration option to disable access logging +- Add notification filtering by target media type +- Manifest: `References()` returns all children +- Honor `X-Forwarded-Port` and Forwarded headers +- Reference: Preserve tag and digest in With* functions +- Add policy configuration for enforcing repository classes + +#### Client +- Changes the client Tags `All()` method to follow links +- Allow registry clients to connect via HTTP2 +- Better handling of OAuth errors in client + +#### Spec +- Manifest: clarify relationship between urls and foreign layers +- Authorization: add support for repository classes + +#### Manifest +- Override media type returned from `Stat()` for existing manifests +- Add plugin mediatype to distribution manifest + +#### Docs +- Document `TOOMANYREQUESTS` error code +- Document required Let's Encrypt port +- Improve documentation around implementation of OAuth2 +- Improve documentation for configuration + +#### Auth +- Add support for registry type in scope +- Add support for using v2 ping challenges for v1 +- Add leeway to JWT `nbf` and `exp` checking +- htpasswd: dynamically parse htpasswd file +- Fix missing auth headers with PATCH HTTP request when pushing to default port + +#### Dockerfile +- Update to go1.7 +- Reorder Dockerfile steps for better layer caching + +#### Notes + +Documentation has moved to the documentation repository at +`github.com/docker/docker.github.io/tree/master/registry` + +The registry is go 1.7 compliant, and passes newer, more restrictive `lint` and `vet` ing. + + ## 2.5.0 (2016-06-14) -### Storage -- Ensure uploads directory is cleaned after upload is commited +#### Storage +- Ensure uploads directory is cleaned after upload is committed - Add ability to cap concurrent operations in filesystem driver - S3: Add 'us-gov-west-1' to the valid region list - Swift: Handle ceph not returning Last-Modified header for HEAD requests @@ -23,13 +102,13 @@ - Update the auth spec scope grammar to reflect the fact that hostnames are optionally supported - Clarify API documentation around catalog fetch behavior -### API +#### API - Support returning HTTP 429 (Too Many Requests) -### Documentation +#### Documentation - Update auth documentation examples to show "expires in" as int -### Docker Image +#### Docker Image - Use Alpine Linux as base image diff --git a/vendor/github.com/docker/distribution/Dockerfile b/vendor/github.com/docker/distribution/Dockerfile index bc3c78577..426954a11 100644 --- a/vendor/github.com/docker/distribution/Dockerfile +++ b/vendor/github.com/docker/distribution/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.6-alpine +FROM golang:1.7-alpine ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution ENV DOCKER_BUILDTAGS include_oss include_gcs diff --git a/vendor/github.com/docker/distribution/Godeps/Godeps.json b/vendor/github.com/docker/distribution/Godeps/Godeps.json index 92252c697..dbdd89149 100644 --- a/vendor/github.com/docker/distribution/Godeps/Godeps.json +++ b/vendor/github.com/docker/distribution/Godeps/Godeps.json @@ -8,8 +8,8 @@ "Deps": [ { "ImportPath": "github.com/Azure/azure-sdk-for-go/storage", - "Comment": "v1.2-334-g95361a2", - "Rev": "95361a2573b1fa92a00c5fc2707a80308483c6f9" + "Comment": "v5.0.0-beta-6-g0b5fe2a", + "Rev": "0b5fe2abe0271ba07049eacaa65922d67c319543" }, { "ImportPath": "github.com/Sirupsen/logrus", @@ -167,15 +167,15 @@ }, { "ImportPath": "github.com/denverdino/aliyungo/common", - "Rev": "6ffb587da9da6d029d0ce517b85fecc82172d502" + "Rev": "afedced274aa9a7fcdd47ac97018f0f8db4e5de2" }, { "ImportPath": "github.com/denverdino/aliyungo/oss", - "Rev": "6ffb587da9da6d029d0ce517b85fecc82172d502" + "Rev": "afedced274aa9a7fcdd47ac97018f0f8db4e5de2" }, { "ImportPath": "github.com/denverdino/aliyungo/util", - "Rev": "6ffb587da9da6d029d0ce517b85fecc82172d502" + "Rev": "afedced274aa9a7fcdd47ac97018f0f8db4e5de2" }, { "ImportPath": "github.com/docker/goamz/aws", diff --git a/vendor/github.com/docker/distribution/Jenkinsfile b/vendor/github.com/docker/distribution/Jenkinsfile deleted file mode 100644 index fa29520b5..000000000 --- a/vendor/github.com/docker/distribution/Jenkinsfile +++ /dev/null @@ -1,8 +0,0 @@ -// Only run on Linux atm -wrappedNode(label: 'docker') { - deleteDir() - stage "checkout" - checkout scm - - documentationChecker("docs") -} diff --git a/vendor/github.com/docker/distribution/Makefile b/vendor/github.com/docker/distribution/Makefile index a0602d0b2..47b8f1d0b 100644 --- a/vendor/github.com/docker/distribution/Makefile +++ b/vendor/github.com/docker/distribution/Makefile @@ -13,7 +13,7 @@ endif GO_LDFLAGS=-ldflags "-X `go list ./version`.Version=$(VERSION)" -.PHONY: clean all fmt vet lint build test binaries +.PHONY: all build binaries clean dep-restore dep-save dep-validate fmt lint test test-full vet .DEFAULT: all all: fmt vet lint build test binaries @@ -27,22 +27,25 @@ version/version.go: # Required for go 1.5 to build GO15VENDOREXPERIMENT := 1 +# Go files +GOFILES=$(shell find . -type f -name '*.go') + # Package list -PKGS := $(shell go list -tags "${DOCKER_BUILDTAGS}" ./... | grep -v ^github.com/docker/distribution/vendor/) +PKGS=$(shell go list -tags "${DOCKER_BUILDTAGS}" ./... | grep -v ^github.com/docker/distribution/vendor/) # Resolving binary dependencies for specific targets -GOLINT := $(shell which golint || echo '') -GODEP := $(shell which godep || echo '') +GOLINT=$(shell which golint || echo '') +GODEP=$(shell which godep || echo '') -${PREFIX}/bin/registry: $(wildcard **/*.go) +${PREFIX}/bin/registry: $(GOFILES) @echo "+ $@" @go build -tags "${DOCKER_BUILDTAGS}" -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/registry -${PREFIX}/bin/digest: $(wildcard **/*.go) +${PREFIX}/bin/digest: $(GOFILES) @echo "+ $@" @go build -tags "${DOCKER_BUILDTAGS}" -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/digest -${PREFIX}/bin/registry-api-descriptor-template: $(wildcard **/*.go) +${PREFIX}/bin/registry-api-descriptor-template: $(GOFILES) @echo "+ $@" @go build -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/registry-api-descriptor-template diff --git a/vendor/github.com/docker/distribution/README.md b/vendor/github.com/docker/distribution/README.md index 99fd59457..a6e8db0fb 100644 --- a/vendor/github.com/docker/distribution/README.md +++ b/vendor/github.com/docker/distribution/README.md @@ -19,7 +19,7 @@ This repository contains the following components: | **registry** | An implementation of the [Docker Registry HTTP API V2](docs/spec/api.md) for use with docker 1.6+. | | **libraries** | A rich set of libraries for interacting with distribution components. Please see [godoc](https://godoc.org/github.com/docker/distribution) for details. **Note**: These libraries are **unstable**. | | **specifications** | _Distribution_ related specifications are available in [docs/spec](docs/spec) | -| **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/index.md) related just to the registry. | +| **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/) related just to the registry. | ### How does this integrate with Docker engine? @@ -68,7 +68,7 @@ others, it is not. For example, users with their own software products may want to maintain a registry for private, company images. Also, you may wish to deploy your own image repository for images used to test or in continuous integration. For these -use cases and others, [deploying your own registry instance](docs/deploying.md) +use cases and others, [deploying your own registry instance](https://github.com/docker/docker.github.io/blob/master/registry/deploying.md) may be the better choice. ### Migration to Registry 2.0 diff --git a/vendor/github.com/docker/distribution/RELEASE-CHECKLIST.md b/vendor/github.com/docker/distribution/RELEASE-CHECKLIST.md new file mode 100644 index 000000000..49235cecd --- /dev/null +++ b/vendor/github.com/docker/distribution/RELEASE-CHECKLIST.md @@ -0,0 +1,36 @@ +## Registry Release Checklist + +10. Compile release notes detailing features and since the last release. Update the `CHANGELOG.md` file. + +20. Update the version file: `https://github.com/docker/distribution/blob/master/version/version.go` + +30. Update the `MAINTAINERS` (if necessary), `AUTHORS` and `.mailmap` files. + + ``` +make AUTHORS +``` + +40. Create a signed tag. + + Distribution uses semantic versioning. Tags are of the format `vx.y.z[-rcn]` +You will need PGP installed and a PGP key which has been added to your Github account. The comment for the tag should include the release notes. + +50. Push the signed tag + +60. Create a new [release](https://github.com/docker/distribution/releases). In the case of a release candidate, tick the `pre-release` checkbox. + +70. Update the registry binary in [distribution library image repo](https://github.com/docker/distribution-library-image) by running the update script and opening a pull request. + +80. Update the official image. Add the new version in the [official images repo](https://github.com/docker-library/official-images) by appending a new version to the `registry/registry` file with the git hash pointed to by the signed tag. Update the major version to point to the latest version and the minor version to point to new patch release if necessary. +e.g. to release `2.3.1` + + `2.3.1 (new)` + + `2.3.0 -> 2.3.0` can be removed + + `2 -> 2.3.1` + + `2.3 -> 2.3.1` + +90. Build a new distribution/registry image on [Docker hub](https://hub.docker.com/u/distribution/dashboard) by adding a new automated build with the new tag and re-building the images. + diff --git a/vendor/github.com/docker/distribution/circle.yml b/vendor/github.com/docker/distribution/circle.yml index 52348a4bc..61f8be0cb 100644 --- a/vendor/github.com/docker/distribution/circle.yml +++ b/vendor/github.com/docker/distribution/circle.yml @@ -8,7 +8,7 @@ machine: post: # go - - gvm install go1.6 --prefer-binary --name=stable + - gvm install go1.7 --prefer-binary --name=stable environment: # Convenient shortcuts to "common" locations diff --git a/vendor/github.com/docker/distribution/configuration/configuration.go b/vendor/github.com/docker/distribution/configuration/configuration.go index 55b9fcba1..ec50a6b18 100644 --- a/vendor/github.com/docker/distribution/configuration/configuration.go +++ b/vendor/github.com/docker/distribution/configuration/configuration.go @@ -203,6 +203,19 @@ type Configuration struct { } `yaml:"urls,omitempty"` } `yaml:"manifests,omitempty"` } `yaml:"validation,omitempty"` + + // Policy configures registry policy options. + Policy struct { + // Repository configures policies for repositories + Repository struct { + // Classes is a list of repository classes which the + // registry allows content for. This class is matched + // against the configuration media type inside uploaded + // manifests. When non-empty, the registry will enforce + // the class in authorized resources. + Classes []string `yaml:"classes"` + } `yaml:"repository,omitempty"` + } `yaml:"policy,omitempty"` } // LogHook is composed of hook Level and Type. diff --git a/vendor/github.com/docker/distribution/contrib/token-server/main.go b/vendor/github.com/docker/distribution/contrib/token-server/main.go index 6a4c1778b..e9d6d64fa 100644 --- a/vendor/github.com/docker/distribution/contrib/token-server/main.go +++ b/vendor/github.com/docker/distribution/contrib/token-server/main.go @@ -18,6 +18,10 @@ import ( "github.com/gorilla/mux" ) +var ( + enforceRepoClass bool +) + func main() { var ( issuer = &TokenIssuer{} @@ -44,6 +48,8 @@ func main() { flag.StringVar(&cert, "tlscert", "", "Certificate file for TLS") flag.StringVar(&certKey, "tlskey", "", "Certificate key for TLS") + flag.BoolVar(&enforceRepoClass, "enforce-class", false, "Enforce policy for single repository class") + flag.Parse() if debug { @@ -157,6 +163,8 @@ type tokenResponse struct { ExpiresIn int `json:"expires_in,omitempty"` } +var repositoryClassCache = map[string]string{} + func filterAccessList(ctx context.Context, scope string, requestedAccessList []auth.Access) []auth.Access { if !strings.HasSuffix(scope, "/") { scope = scope + "/" @@ -168,6 +176,16 @@ func filterAccessList(ctx context.Context, scope string, requestedAccessList []a context.GetLogger(ctx).Debugf("Resource scope not allowed: %s", access.Name) continue } + if enforceRepoClass { + if class, ok := repositoryClassCache[access.Name]; ok { + if class != access.Class { + context.GetLogger(ctx).Debugf("Different repository class: %q, previously %q", access.Class, class) + continue + } + } else if strings.EqualFold(access.Action, "push") { + repositoryClassCache[access.Name] = access.Class + } + } } else if access.Type == "registry" { if access.Name != "catalog" { context.GetLogger(ctx).Debugf("Unknown registry resource: %s", access.Name) @@ -183,6 +201,18 @@ func filterAccessList(ctx context.Context, scope string, requestedAccessList []a return grantedAccessList } +type acctSubject struct{} + +func (acctSubject) String() string { return "acctSubject" } + +type requestedAccess struct{} + +func (requestedAccess) String() string { return "requestedAccess" } + +type grantedAccess struct{} + +func (grantedAccess) String() string { return "grantedAccess" } + // getToken handles authenticating the request and authorizing access to the // requested scopes. func (ts *tokenServer) getToken(ctx context.Context, w http.ResponseWriter, r *http.Request) { @@ -225,17 +255,17 @@ func (ts *tokenServer) getToken(ctx context.Context, w http.ResponseWriter, r *h username := context.GetStringValue(ctx, "auth.user.name") - ctx = context.WithValue(ctx, "acctSubject", username) - ctx = context.WithLogger(ctx, context.GetLogger(ctx, "acctSubject")) + ctx = context.WithValue(ctx, acctSubject{}, username) + ctx = context.WithLogger(ctx, context.GetLogger(ctx, acctSubject{})) context.GetLogger(ctx).Info("authenticated client") - ctx = context.WithValue(ctx, "requestedAccess", requestedAccessList) - ctx = context.WithLogger(ctx, context.GetLogger(ctx, "requestedAccess")) + ctx = context.WithValue(ctx, requestedAccess{}, requestedAccessList) + ctx = context.WithLogger(ctx, context.GetLogger(ctx, requestedAccess{})) grantedAccessList := filterAccessList(ctx, username, requestedAccessList) - ctx = context.WithValue(ctx, "grantedAccess", grantedAccessList) - ctx = context.WithLogger(ctx, context.GetLogger(ctx, "grantedAccess")) + ctx = context.WithValue(ctx, grantedAccess{}, grantedAccessList) + ctx = context.WithLogger(ctx, context.GetLogger(ctx, grantedAccess{})) token, err := ts.issuer.CreateJWT(username, service, grantedAccessList) if err != nil { @@ -347,17 +377,17 @@ func (ts *tokenServer) postToken(ctx context.Context, w http.ResponseWriter, r * return } - ctx = context.WithValue(ctx, "acctSubject", subject) - ctx = context.WithLogger(ctx, context.GetLogger(ctx, "acctSubject")) + ctx = context.WithValue(ctx, acctSubject{}, subject) + ctx = context.WithLogger(ctx, context.GetLogger(ctx, acctSubject{})) context.GetLogger(ctx).Info("authenticated client") - ctx = context.WithValue(ctx, "requestedAccess", requestedAccessList) - ctx = context.WithLogger(ctx, context.GetLogger(ctx, "requestedAccess")) + ctx = context.WithValue(ctx, requestedAccess{}, requestedAccessList) + ctx = context.WithLogger(ctx, context.GetLogger(ctx, requestedAccess{})) grantedAccessList := filterAccessList(ctx, subject, requestedAccessList) - ctx = context.WithValue(ctx, "grantedAccess", grantedAccessList) - ctx = context.WithLogger(ctx, context.GetLogger(ctx, "grantedAccess")) + ctx = context.WithValue(ctx, grantedAccess{}, grantedAccessList) + ctx = context.WithLogger(ctx, context.GetLogger(ctx, grantedAccess{})) token, err := ts.issuer.CreateJWT(subject, service, grantedAccessList) if err != nil { diff --git a/vendor/github.com/docker/distribution/contrib/token-server/token.go b/vendor/github.com/docker/distribution/contrib/token-server/token.go index e69fb9c19..b0c2abff7 100644 --- a/vendor/github.com/docker/distribution/contrib/token-server/token.go +++ b/vendor/github.com/docker/distribution/contrib/token-server/token.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "io" + "regexp" "strings" "time" @@ -32,12 +33,18 @@ func ResolveScopeSpecifiers(ctx context.Context, scopeSpecs []string) []auth.Acc resourceType, resourceName, actions := parts[0], parts[1], parts[2] + resourceType, resourceClass := splitResourceClass(resourceType) + if resourceType == "" { + continue + } + // Actions should be a comma-separated list of actions. for _, action := range strings.Split(actions, ",") { requestedAccess := auth.Access{ Resource: auth.Resource{ - Type: resourceType, - Name: resourceName, + Type: resourceType, + Class: resourceClass, + Name: resourceName, }, Action: action, } @@ -55,6 +62,19 @@ func ResolveScopeSpecifiers(ctx context.Context, scopeSpecs []string) []auth.Acc return requestedAccessList } +var typeRegexp = regexp.MustCompile(`^([a-z0-9]+)(\([a-z0-9]+\))?$`) + +func splitResourceClass(t string) (string, string) { + matches := typeRegexp.FindStringSubmatch(t) + if len(matches) < 2 { + return "", "" + } + if len(matches) == 2 || len(matches[2]) < 2 { + return matches[1], "" + } + return matches[1], matches[2][1 : len(matches[2])-1] +} + // ResolveScopeList converts a scope list from a token request's // `scope` parameter into a list of standard access objects. func ResolveScopeList(ctx context.Context, scopeList string) []auth.Access { @@ -62,12 +82,19 @@ func ResolveScopeList(ctx context.Context, scopeList string) []auth.Access { return ResolveScopeSpecifiers(ctx, scopes) } +func scopeString(a auth.Access) string { + if a.Class != "" { + return fmt.Sprintf("%s(%s):%s:%s", a.Type, a.Class, a.Name, a.Action) + } + return fmt.Sprintf("%s:%s:%s", a.Type, a.Name, a.Action) +} + // ToScopeList converts a list of access to a // scope list string func ToScopeList(access []auth.Access) string { var s []string for _, a := range access { - s = append(s, fmt.Sprintf("%s:%s:%s", a.Type, a.Name, a.Action)) + s = append(s, scopeString(a)) } return strings.Join(s, ",") } @@ -102,6 +129,7 @@ func (issuer *TokenIssuer) CreateJWT(subject string, audience string, grantedAcc accessEntries = append(accessEntries, &token.ResourceActions{ Type: resource.Type, + Class: resource.Class, Name: resource.Name, Actions: actions, }) diff --git a/vendor/github.com/docker/distribution/docs/Dockerfile b/vendor/github.com/docker/distribution/docs/Dockerfile deleted file mode 100644 index fcc634229..000000000 --- a/vendor/github.com/docker/distribution/docs/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM docs/base:oss -MAINTAINER Docker Docs - -ENV PROJECT=registry - -# To get the git info for this repo -COPY . /src -RUN rm -rf /docs/content/$PROJECT/ -COPY . /docs/content/$PROJECT/ diff --git a/vendor/github.com/docker/distribution/docs/Makefile b/vendor/github.com/docker/distribution/docs/Makefile deleted file mode 100644 index 585bc871a..000000000 --- a/vendor/github.com/docker/distribution/docs/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -.PHONY: all default docs docs-build docs-shell shell test - -# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs) -DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) - -# to allow `make DOCSPORT=9000 docs` -DOCSPORT := 8000 - -# Get the IP ADDRESS -DOCKER_IP=$(shell python -c "import urlparse ; print urlparse.urlparse('$(DOCKER_HOST)').hostname or ''") -HUGO_BASE_URL=$(shell test -z "$(DOCKER_IP)" && echo localhost || echo "$(DOCKER_IP)") -HUGO_BIND_IP=0.0.0.0 - -GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) -GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g") -DOCKER_DOCS_IMAGE := registry-docs$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN)) - -DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE - -# for some docs workarounds (see below in "docs-build" target) -GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null) - -default: docs - -docs: docs-build - $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP) - -docs-draft: docs-build - $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --buildDrafts="true" --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP) - -docs-shell: docs-build - $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash - -docs-build: - docker build -t "$(DOCKER_DOCS_IMAGE)" . - -test: docs-build - $(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" diff --git a/vendor/github.com/docker/distribution/docs/README.md b/vendor/github.com/docker/distribution/docs/README.md new file mode 100644 index 000000000..b26dc3754 --- /dev/null +++ b/vendor/github.com/docker/distribution/docs/README.md @@ -0,0 +1,16 @@ +# The docs have been moved! + +The documentation for Registry has been merged into +[the general documentation repo](https://github.com/docker/docker.github.io). +Commit history has been preserved. + +The docs for Registry are now here: +https://github.com/docker/docker.github.io/tree/master/registry + +> Note: The definitive [./spec directory](spec/) directory and +[configuration.md](configuration.md) file will be maintained in this repository +and be refreshed periodically in +[the general documentation repo](https://github.com/docker/docker.github.io). + +As always, the docs in the general repo remain open-source and we appreciate +your feedback and pull requests! diff --git a/vendor/github.com/docker/distribution/docs/architecture.md b/vendor/github.com/docker/distribution/docs/architecture.md deleted file mode 100644 index 392517608..000000000 --- a/vendor/github.com/docker/distribution/docs/architecture.md +++ /dev/null @@ -1,54 +0,0 @@ - - -# Architecture - -## Design -**TODO(stevvooe):** Discuss the architecture of the registry, internally and externally, in a few different deployment scenarios. - -### Eventual Consistency - -> **NOTE:** This section belongs somewhere, perhaps in a design document. We -> are leaving this here so the information is not lost. - -Running the registry on eventually consistent backends has been part of the -design from the beginning. This section covers some of the approaches to -dealing with this reality. - -There are a few classes of issues that we need to worry about when -implementing something on top of the storage drivers: - -1. Read-After-Write consistency (see this [article on - s3](http://shlomoswidler.com/2009/12/read-after-write-consistency-in-amazon.html)). -2. [Write-Write Conflicts](http://en.wikipedia.org/wiki/Write%E2%80%93write_conflict). - -In reality, the registry must worry about these kinds of errors when doing the -following: - -1. Accepting data into a temporary upload file may not have latest data block - yet (read-after-write). -2. Moving uploaded data into its blob location (write-write race). -3. Modifying the "current" manifest for given tag (write-write race). -4. A whole slew of operations around deletes (read-after-write, delete-write - races, garbage collection, etc.). - -The backend path layout employs a few techniques to avoid these problems: - -1. Large writes are done to private upload directories. This alleviates most - of the corruption potential under multiple writers by avoiding multiple - writers. -2. Constraints in storage driver implementations, such as support for writing - after the end of a file to extend it. -3. Digest verification to avoid data corruption. -4. Manifest files are stored by digest and cannot change. -5. All other non-content files (links, hashes, etc.) are written as an atomic - unit. Anything that requires additions and deletions is broken out into - separate "files". Last writer still wins. - -Unfortunately, one must play this game when trying to build something like -this on top of eventually consistent storage systems. If we run into serious -problems, we can wrap the storagedrivers in a shared consistency layer but -that would increase complexity and hinder registry cluster performance. diff --git a/vendor/github.com/docker/distribution/docs/compatibility.md b/vendor/github.com/docker/distribution/docs/compatibility.md deleted file mode 100644 index cba7e378d..000000000 --- a/vendor/github.com/docker/distribution/docs/compatibility.md +++ /dev/null @@ -1,84 +0,0 @@ - - -# Registry Compatibility - -## Synopsis -*If a manifest is pulled by _digest_ from a registry 2.3 with Docker Engine 1.9 -and older, and the manifest was pushed with Docker Engine 1.10, a security check -will cause the Engine to receive a manifest it cannot use and the pull will fail.* - -## Registry Manifest Support - -Historically, the registry has supported a [single manifest type](./spec/manifest-v2-1.md) -known as _Schema 1_. - -With the move toward multiple architecture images the distribution project -introduced two new manifest types: Schema 2 manifests and manifest lists. The -registry 2.3 supports all three manifest types and in order to be compatible -with older Docker engines will, in certain cases, do an on-the-fly -transformation of a manifest before serving the JSON in the response. - -This conversion has some implications for pulling manifests by digest and this -document enumerate these implications. - - -## Content Addressable Storage (CAS) - -Manifests are stored and retrieved in the registry by keying off a digest -representing a hash of the contents. One of the advantages provided by CAS is -security: if the contents are changed, then the digest will no longer match. -This prevents any modification of the manifest by a MITM attack or an untrusted -third party. - -When a manifest is stored by the registry, this digest is returned in the HTTP -response headers and, if events are configured, delivered within the event. The -manifest can either be retrieved by the tag, or this digest. - -For registry versions 2.2.1 and below, the registry will always store and -serve _Schema 1_ manifests. The Docker Engine 1.10 will first -attempt to send a _Schema 2_ manifest, falling back to sending a -Schema 1 type manifest when it detects that the registry does not -support the new version. - - -## Registry v2.3 - -### Manifest Push with Docker 1.9 and Older - -The Docker Engine will construct a _Schema 1_ manifest which the -registry will persist to disk. - -When the manifest is pulled by digest or tag with any docker version, a -_Schema 1_ manifest will be returned. - -### Manifest Push with Docker 1.10 - -The docker engine will construct a _Schema 2_ manifest which the -registry will persist to disk. - -When the manifest is pulled by digest or tag with Docker Engine 1.10, a -_Schema 2_ manifest will be returned. The Docker Engine 1.10 -understands the new manifest format. - -When the manifest is pulled by *tag* with Docker Engine 1.9 and older, the -manifest is converted on-the-fly to _Schema 1_ and sent in the -response. The Docker Engine 1.9 is compatible with this older format. - -*When the manifest is pulled by _digest_ with Docker Engine 1.9 and older, the -same rewriting process will not happen in the registry. If this were to happen -the digest would no longer match the hash of the manifest and would violate the -constraints of CAS.* - -For this reason if a manifest is pulled by _digest_ from a registry 2.3 with Docker -Engine 1.9 and older, and the manifest was pushed with Docker Engine 1.10, a -security check will cause the Engine to receive a manifest it cannot use and the -pull will fail. diff --git a/vendor/github.com/docker/distribution/docs/configuration.md b/vendor/github.com/docker/distribution/docs/configuration.md index fb3de48e2..a1c66b21c 100644 --- a/vendor/github.com/docker/distribution/docs/configuration.md +++ b/vendor/github.com/docker/distribution/docs/configuration.md @@ -1,497 +1,487 @@ - +--- +title: "Configuring a registry" +description: "Explains how to configure a registry" +keywords: registry, on-prem, images, tags, repository, distribution, configuration +--- -# Registry Configuration Reference - -The Registry configuration is based on a YAML file, detailed below. While it comes with sane default values out of the box, you are heavily encouraged to review it exhaustively before moving your systems to production. +The Registry configuration is based on a YAML file, detailed below. While it +comes with sane default values out of the box, you should review it exhaustively +before moving your systems to production. ## Override specific configuration options -In a typical setup where you run your Registry from the official image, you can specify a configuration variable from the environment by passing `-e` arguments to your `docker run` stanza, or from within a Dockerfile using the `ENV` instruction. +In a typical setup where you run your Registry from the official image, you can +specify a configuration variable from the environment by passing `-e` arguments +to your `docker run` stanza or from within a Dockerfile using the `ENV` +instruction. To override a configuration option, create an environment variable named -`REGISTRY_variable` where *`variable`* is the name of the configuration option +`REGISTRY_variable` where `variable` is the name of the configuration option and the `_` (underscore) represents indention levels. For example, you can configure the `rootdirectory` of the `filesystem` storage backend: - storage: - filesystem: - rootdirectory: /var/lib/registry +```none +storage: + filesystem: + rootdirectory: /var/lib/registry +``` To override this value, set an environment variable like this: - REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere +```none +REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/somewhere +``` This variable overrides the `/var/lib/registry` value to the `/somewhere` directory. ->**NOTE**: It is highly recommended to create a base configuration file with which environment variables can be used to tweak individual values. Overriding configuration sections with environment variables is not recommended. +> **Note**: Create a base configuration file with environment variables that can +> be configured to tweak individual values. Overriding configuration sections +> with environment variables is not recommended. ## Overriding the entire configuration file -If the default configuration is not a sound basis for your usage, or if you are having issues overriding keys from the environment, you can specify an alternate YAML configuration file by mounting it as a volume in the container. +If the default configuration is not a sound basis for your usage, or if you are +having issues overriding keys from the environment, you can specify an alternate +YAML configuration file by mounting it as a volume in the container. -Typically, create a new configuration file from scratch, and call it `config.yml`, then: +Typically, create a new configuration file from scratch,named `config.yml`, then +specify it in the `docker run` command: - docker run -d -p 5000:5000 --restart=always --name registry \ - -v `pwd`/config.yml:/etc/docker/registry/config.yml \ - registry:2 +```bash +$ docker run -d -p 5000:5000 --restart=always --name registry \ + -v `pwd`/config.yml:/etc/docker/registry/config.yml \ + registry:2 +``` -You can (and probably should) use [this as a starting point](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml). +Use this +[example YAML file](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml) +as a starting point. ## List of configuration options -This section lists all the registry configuration options. Some options in -the list are mutually exclusive. So, make sure to read the detailed reference -information about each option that appears later in this page. +These are all configuration options for the registry. Some options in the list +are mutually exclusive. Read the detailed reference information about each +option before finalizing your configuration. - version: 0.1 - log: - accesslog: - disabled: true - level: debug - formatter: text - fields: - service: registry - environment: staging - hooks: - - type: mail - disabled: true - levels: - - panic - options: - smtp: - addr: mail.example.com:25 - username: mailuser - password: password - insecure: true - from: sender@example.com - to: - - errors@example.com - loglevel: debug # deprecated: use "log" - storage: - filesystem: - rootdirectory: /var/lib/registry - maxthreads: 100 - azure: - accountname: accountname - accountkey: base64encodedaccountkey - container: containername - gcs: - bucket: bucketname - keyfile: /path/to/keyfile - rootdirectory: /gcs/object/name/prefix - chunksize: 5242880 - s3: - accesskey: awsaccesskey - secretkey: awssecretkey - region: us-west-1 - regionendpoint: http://myobjects.local - bucket: bucketname - encrypt: true - keyid: mykeyid - secure: true - v4auth: true - chunksize: 5242880 - multipartcopychunksize: 33554432 - multipartcopymaxconcurrency: 100 - multipartcopythresholdsize: 33554432 - rootdirectory: /s3/object/name/prefix - swift: - username: username - password: password - authurl: https://storage.myprovider.com/auth/v1.0 or https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth - tenant: tenantname - tenantid: tenantid - domain: domain name for Openstack Identity v3 API - domainid: domain id for Openstack Identity v3 API - insecureskipverify: true - region: fr - container: containername - rootdirectory: /swift/object/name/prefix - oss: - accesskeyid: accesskeyid - accesskeysecret: accesskeysecret - region: OSS region name - endpoint: optional endpoints - internal: optional internal endpoint - bucket: OSS bucket - encrypt: optional data encryption setting - secure: optional ssl setting - chunksize: optional size valye - rootdirectory: optional root directory - inmemory: # This driver takes no parameters - delete: - enabled: false - redirect: - disable: false - cache: - blobdescriptor: redis - maintenance: - uploadpurging: - enabled: true - age: 168h - interval: 24h - dryrun: false - readonly: - enabled: false - auth: - silly: - realm: silly-realm - service: silly-service - token: - realm: token-realm - service: token-service - issuer: registry-token-issuer - rootcertbundle: /root/certs/bundle - htpasswd: - realm: basic-realm - path: /path/to/htpasswd - middleware: - registry: - - name: ARegistryMiddleware - options: - foo: bar - repository: - - name: ARepositoryMiddleware - options: - foo: bar - storage: - - name: cloudfront - options: - baseurl: https://my.cloudfronted.domain.com/ - privatekey: /path/to/pem - keypairid: cloudfrontkeypairid - duration: 3000s - storage: - - name: redirect - options: - baseurl: https://example.com/ - reporting: - bugsnag: - apikey: bugsnagapikey - releasestage: bugsnagreleasestage - endpoint: bugsnagendpoint - newrelic: - licensekey: newreliclicensekey - name: newrelicname - verbose: true - http: - addr: localhost:5000 - prefix: /my/nested/registry/ - host: https://myregistryaddress.org:5000 - secret: asecretforlocaldevelopment - relativeurls: false - tls: - certificate: /path/to/x509/public - key: /path/to/x509/private - clientcas: - - /path/to/ca.pem - - /path/to/another/ca.pem - letsencrypt: - cachefile: /path/to/cache-file - email: emailused@letsencrypt.com - debug: - addr: localhost:5001 - headers: - X-Content-Type-Options: [nosniff] - http2: - disabled: false - notifications: - endpoints: - - name: alistener - disabled: false - url: https://my.listener.com/event - headers: - timeout: 500 - threshold: 5 - backoff: 1000 - ignoredmediatypes: - - application/octet-stream - redis: - addr: localhost:6379 - password: asecret - db: 0 - dialtimeout: 10ms - readtimeout: 10ms - writetimeout: 10ms - pool: - maxidle: 16 - maxactive: 64 - idletimeout: 300s - health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 - file: - - file: /path/to/checked/file - interval: 10s - http: - - uri: http://server.to.check/must/return/200 - headers: - Authorization: [Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==] - statuscode: 200 - timeout: 3s - interval: 10s - threshold: 3 - tcp: - - addr: redis-server.domain.com:6379 - timeout: 3s - interval: 10s - threshold: 3 - proxy: - remoteurl: https://registry-1.docker.io - username: [username] - password: [password] - compatibility: - schema1: - signingkeyfile: /etc/registry/key.json - validation: +```none +version: 0.1 +log: + accesslog: + disabled: true + level: debug + formatter: text + fields: + service: registry + environment: staging + hooks: + - type: mail + disabled: true + levels: + - panic + options: + smtp: + addr: mail.example.com:25 + username: mailuser + password: password + insecure: true + from: sender@example.com + to: + - errors@example.com +loglevel: debug # deprecated: use "log" +storage: + filesystem: + rootdirectory: /var/lib/registry + maxthreads: 100 + azure: + accountname: accountname + accountkey: base64encodedaccountkey + container: containername + gcs: + bucket: bucketname + keyfile: /path/to/keyfile + rootdirectory: /gcs/object/name/prefix + chunksize: 5242880 + s3: + accesskey: awsaccesskey + secretkey: awssecretkey + region: us-west-1 + regionendpoint: http://myobjects.local + bucket: bucketname + encrypt: true + keyid: mykeyid + secure: true + v4auth: true + chunksize: 5242880 + multipartcopychunksize: 33554432 + multipartcopymaxconcurrency: 100 + multipartcopythresholdsize: 33554432 + rootdirectory: /s3/object/name/prefix + swift: + username: username + password: password + authurl: https://storage.myprovider.com/auth/v1.0 or https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth + tenant: tenantname + tenantid: tenantid + domain: domain name for Openstack Identity v3 API + domainid: domain id for Openstack Identity v3 API + insecureskipverify: true + region: fr + container: containername + rootdirectory: /swift/object/name/prefix + oss: + accesskeyid: accesskeyid + accesskeysecret: accesskeysecret + region: OSS region name + endpoint: optional endpoints + internal: optional internal endpoint + bucket: OSS bucket + encrypt: optional data encryption setting + secure: optional ssl setting + chunksize: optional size valye + rootdirectory: optional root directory + inmemory: # This driver takes no parameters + delete: + enabled: false + redirect: + disable: false + cache: + blobdescriptor: redis + maintenance: + uploadpurging: enabled: true - manifests: - urls: - allow: - - ^https?://([^/]+\.)*example\.com/ - deny: - - ^https?://www\.example\.com/ + age: 168h + interval: 24h + dryrun: false + readonly: + enabled: false +auth: + silly: + realm: silly-realm + service: silly-service + token: + realm: token-realm + service: token-service + issuer: registry-token-issuer + rootcertbundle: /root/certs/bundle + htpasswd: + realm: basic-realm + path: /path/to/htpasswd +middleware: + registry: + - name: ARegistryMiddleware + options: + foo: bar + repository: + - name: ARepositoryMiddleware + options: + foo: bar + storage: + - name: cloudfront + options: + baseurl: https://my.cloudfronted.domain.com/ + privatekey: /path/to/pem + keypairid: cloudfrontkeypairid + duration: 3000s + storage: + - name: redirect + options: + baseurl: https://example.com/ +reporting: + bugsnag: + apikey: bugsnagapikey + releasestage: bugsnagreleasestage + endpoint: bugsnagendpoint + newrelic: + licensekey: newreliclicensekey + name: newrelicname + verbose: true +http: + addr: localhost:5000 + prefix: /my/nested/registry/ + host: https://myregistryaddress.org:5000 + secret: asecretforlocaldevelopment + relativeurls: false + tls: + certificate: /path/to/x509/public + key: /path/to/x509/private + clientcas: + - /path/to/ca.pem + - /path/to/another/ca.pem + letsencrypt: + cachefile: /path/to/cache-file + email: emailused@letsencrypt.com + debug: + addr: localhost:5001 + headers: + X-Content-Type-Options: [nosniff] + http2: + disabled: false +notifications: + endpoints: + - name: alistener + disabled: false + url: https://my.listener.com/event + headers: + timeout: 500 + threshold: 5 + backoff: 1000 + ignoredmediatypes: + - application/octet-stream +redis: + addr: localhost:6379 + password: asecret + db: 0 + dialtimeout: 10ms + readtimeout: 10ms + writetimeout: 10ms + pool: + maxidle: 16 + maxactive: 64 + idletimeout: 300s +health: + storagedriver: + enabled: true + interval: 10s + threshold: 3 + file: + - file: /path/to/checked/file + interval: 10s + http: + - uri: http://server.to.check/must/return/200 + headers: + Authorization: [Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==] + statuscode: 200 + timeout: 3s + interval: 10s + threshold: 3 + tcp: + - addr: redis-server.domain.com:6379 + timeout: 3s + interval: 10s + threshold: 3 +proxy: + remoteurl: https://registry-1.docker.io + username: [username] + password: [password] +compatibility: + schema1: + signingkeyfile: /etc/registry/key.json +validation: + enabled: true + manifests: + urls: + allow: + - ^https?://([^/]+\.)*example\.com/ + deny: + - ^https?://www\.example\.com/ +``` In some instances a configuration option is **optional** but it contains child -options marked as **required**. This indicates that you can omit the parent with +options marked as **required**. In these cases, you can omit the parent with all its children. However, if the parent is included, you must also include all the children marked **required**. -## version +## `version` - version: 0.1 +```none +version: 0.1 +``` The `version` option is **required**. It specifies the configuration's version. It is expected to remain a top-level field, to allow for a consistent version check before parsing the remainder of the configuration file. -## log +## `log` The `log` subsection configures the behavior of the logging system. The logging system outputs everything to stdout. You can adjust the granularity and format with this configuration section. - log: - accesslog: - disabled: true - level: debug - formatter: text - fields: - service: registry - environment: staging +```none +log: + accesslog: + disabled: true + level: debug + formatter: text + fields: + service: registry + environment: staging +``` - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- level - - no - - Sets the sensitivity of logging output. Permitted values are - error, warn, info and - debug. The default is info. -
- formatter - - no - - This selects the format of logging output. The format primarily affects how keyed - attributes for a log line are encoded. Options are text, json or - logstash. The default is text. -
- fields - - no - - A map of field names to values. These are added to every log line for - the context. This is useful for identifying log messages source after - being mixed in other systems. -
+| Parameter | Required | Description | +|-------------|----------|-------------| +| `level` | no | Sets the sensitivity of logging output. Permitted values are `error`, `warn`, `info`, and `debug`. The default is `info`. | +| `formatter` | no | This selects the format of logging output. The format primarily affects how keyed attributes for a log line are encoded. Options are `text`, `json`, and `logstash`. The default is `text`. | +| `fields` | no | A map of field names to values. These are added to every log line for the context. This is useful for identifying log messages source after being mixed in other systems. | -### accesslog +### `accesslog` - accesslog: - disabled: true +```none +accesslog: + disabled: true +``` Within `log`, `accesslog` configures the behavior of the access logging system. By default, the access logging system outputs to stdout in [Combined Log Format](https://httpd.apache.org/docs/2.4/logs.html#combined). Access logging can be disabled by setting the boolean flag `disabled` to `true`. -## hooks +## `hooks` - hooks: - - type: mail - levels: - - panic - options: - smtp: - addr: smtp.sendhost.com:25 - username: sendername - password: password - insecure: true - from: name@sendhost.com - to: - - name@receivehost.com +```none +hooks: + - type: mail + levels: + - panic + options: + smtp: + addr: smtp.sendhost.com:25 + username: sendername + password: password + insecure: true + from: name@sendhost.com + to: + - name@receivehost.com +``` The `hooks` subsection configures the logging hooks' behavior. This subsection includes a sequence handler which you can use for sending mail, for example. Refer to `loglevel` to configure the level of messages printed. -## loglevel +## `loglevel` > **DEPRECATED:** Please use [log](#log) instead. - loglevel: debug +```none +loglevel: debug +``` Permitted values are `error`, `warn`, `info` and `debug`. The default is `info`. -## storage +## `storage` - storage: - filesystem: - rootdirectory: /var/lib/registry - azure: - accountname: accountname - accountkey: base64encodedaccountkey - container: containername - gcs: - bucket: bucketname - keyfile: /path/to/keyfile - rootdirectory: /gcs/object/name/prefix - s3: - accesskey: awsaccesskey - secretkey: awssecretkey - region: us-west-1 - regionendpoint: http://myobjects.local - bucket: bucketname - encrypt: true - keyid: mykeyid - secure: true - v4auth: true - chunksize: 5242880 - multipartcopychunksize: 33554432 - multipartcopymaxconcurrency: 100 - multipartcopythresholdsize: 33554432 - rootdirectory: /s3/object/name/prefix - swift: - username: username - password: password - authurl: https://storage.myprovider.com/auth/v1.0 or https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth - tenant: tenantname - tenantid: tenantid - domain: domain name for Openstack Identity v3 API - domainid: domain id for Openstack Identity v3 API - insecureskipverify: true - region: fr - container: containername - rootdirectory: /swift/object/name/prefix - oss: - accesskeyid: accesskeyid - accesskeysecret: accesskeysecret - region: OSS region name - endpoint: optional endpoints - internal: optional internal endpoint - bucket: OSS bucket - encrypt: optional data encryption setting - secure: optional ssl setting - chunksize: optional size valye - rootdirectory: optional root directory - inmemory: - delete: - enabled: false - cache: - blobdescriptor: inmemory - maintenance: - uploadpurging: - enabled: true - age: 168h - interval: 24h - dryrun: false - redirect: - disable: false +```none +storage: + filesystem: + rootdirectory: /var/lib/registry + azure: + accountname: accountname + accountkey: base64encodedaccountkey + container: containername + gcs: + bucket: bucketname + keyfile: /path/to/keyfile + rootdirectory: /gcs/object/name/prefix + s3: + accesskey: awsaccesskey + secretkey: awssecretkey + region: us-west-1 + regionendpoint: http://myobjects.local + bucket: bucketname + encrypt: true + keyid: mykeyid + secure: true + v4auth: true + chunksize: 5242880 + multipartcopychunksize: 33554432 + multipartcopymaxconcurrency: 100 + multipartcopythresholdsize: 33554432 + rootdirectory: /s3/object/name/prefix + swift: + username: username + password: password + authurl: https://storage.myprovider.com/auth/v1.0 or https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth + tenant: tenantname + tenantid: tenantid + domain: domain name for Openstack Identity v3 API + domainid: domain id for Openstack Identity v3 API + insecureskipverify: true + region: fr + container: containername + rootdirectory: /swift/object/name/prefix + oss: + accesskeyid: accesskeyid + accesskeysecret: accesskeysecret + region: OSS region name + endpoint: optional endpoints + internal: optional internal endpoint + bucket: OSS bucket + encrypt: optional data encryption setting + secure: optional ssl setting + chunksize: optional size valye + rootdirectory: optional root directory + inmemory: + delete: + enabled: false + cache: + blobdescriptor: inmemory + maintenance: + uploadpurging: + enabled: true + age: 168h + interval: 24h + dryrun: false + readonly: + enabled: false + redirect: + disable: false +``` -The storage option is **required** and defines which storage backend is in use. -You must configure one backend; if you configure more, the registry returns an error. You can choose any of these backend storage drivers: +The `storage` option is **required** and defines which storage backend is in +use. You must configure exactly one backend. If you configure more, the registry +returns an error. You can choose any of these backend storage drivers: -| Storage driver | Description -| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `filesystem` | Uses the local disk to store registry files. It is ideal for development and may be appropriate for some small-scale production applications. See the [driver's reference documentation](storage-drivers/filesystem.md). | -| `azure` | Uses Microsoft's Azure Blob Storage. See the [driver's reference documentation](storage-drivers/azure.md). | -| `gcs` | Uses Google Cloud Storage. See the [driver's reference documentation](storage-drivers/gcs.md). | -| `s3` | Uses Amazon's Simple Storage Service (S3) and compatible Storage Services. See the [driver's reference documentation](storage-drivers/s3.md). | -| `swift` | Uses Openstack Swift object storage. See the [driver's reference documentation](storage-drivers/swift.md). | -| `oss` | Uses Aliyun OSS for object storage. See the [driver's reference documentation](storage-drivers/oss.md). | +| Storage driver | Description | +|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `filesystem` | Uses the local disk to store registry files. It is ideal for development and may be appropriate for some small-scale production applications. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/filesystem.md). | +| `azure` | Uses Microsoft Azure Blob Storage. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/azure.md). | +| `gcs` | Uses Google Cloud Storage. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/gcs.md). | +| `s3` | Uses Amazon Simple Storage Service (S3) and compatible Storage Services. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/s3.md). | +| `swift` | Uses Openstack Swift object storage. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/swift.md). | +| `oss` | Uses Aliyun OSS for object storage. See the [driver's reference documentation](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/oss.md). | -For purely tests purposes, you can use the [`inmemory` storage -driver](storage-drivers/inmemory.md). If you would like to run a registry from -volatile memory, use the [`filesystem` driver](storage-drivers/filesystem.md) on -a ramdisk. +For testing only, you can use the [`inmemory` storage +driver](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/inmemory.md). +If you would like to run a registry from volatile memory, use the +[`filesystem` driver](https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers/filesystem.md) +on a ramdisk. -If you are deploying a registry on Windows, be aware that a Windows volume -mounted from the host is not recommended. Instead, you can use a S3, or Azure, -backing data-store. If you do use a Windows volume, you must ensure that the -`PATH` to the mount point is within Windows' `MAX_PATH` limits (typically 255 -characters). Failure to do so can result in the following error message: +If you are deploying a registry on Windows, a Windows volume mounted from the +host is not recommended. Instead, you can use a S3 or Azure backing +data-store. If you do use a Windows volume, the length of the `PATH` to +the mount point must be within the `MAX_PATH` limits (typically 255 characters), +or this error will occur: - mkdir /XXX protocol error and your registry will not function properly. +```none +mkdir /XXX protocol error and your registry will not function properly. +``` -### Maintenance +### `maintenance` -Currently upload purging and read-only mode are the only maintenance functions available. -These and future maintenance functions which are related to storage can be configured under -the maintenance section. +Currently, upload purging and read-only mode are the only `maintenance` +functions available. -### Upload Purging +### `uploadpurging` -Upload purging is a background process that periodically removes orphaned files from the upload -directories of the registry. Upload purging is enabled by default. To -configure upload directory purging, the following parameters -must be set. +Upload purging is a background process that periodically removes orphaned files +from the upload directories of the registry. Upload purging is enabled by +default. To configure upload directory purging, the following parameters must +be set. -| Parameter | Required | Description - --------- | -------- | ----------- -`enabled` | yes | Set to true to enable upload purging. Default=true. | -`age` | yes | Upload directories which are older than this age will be deleted. Default=168h (1 week) -`interval` | yes | The interval between upload directory purging. Default=24h. -`dryrun` | yes | dryrun can be set to true to obtain a summary of what directories will be deleted. Default=false. +| Parameter | Required | Description | +|------------|----------|----------------------------------------------------------------------------------------------------| +| `enabled` | yes | Set to `true` to enable upload purging. Defaults to `true`. | +| `age` | yes | Upload directories which are older than this age will be deleted.Defaults to `168h` (1 week). | +| `interval` | yes | The interval between upload directory purging. Defaults to `24h`. | +| `dryrun` | yes | Set `dryrun` to `true` to obtain a summary of what directories will be deleted. Defaults to `false`.| -Note: `age` and `interval` are strings containing a number with optional fraction and a unit suffix: e.g. 45m, 2h10m, 168h (1 week). +> **Note**: `age` and `interval` are strings containing a number with optional +fraction and a unit suffix. Some examples: `45m`, `2h10m`, `168h`. -### Read-only mode +### `readonly` If the `readonly` section under `maintenance` has `enabled` set to `true`, clients will not be allowed to write to the registry. This mode is useful to @@ -501,239 +491,153 @@ restarted with readonly's `enabled` set to true. After the garbage collection pass finishes, the registry may be restarted again, this time with `readonly` removed from the configuration (or set to false). -### delete +### `delete` -Use the `delete` subsection to enable the deletion of image blobs and manifests +Use the `delete` structure to enable the deletion of image blobs and manifests by digest. It defaults to false, but it can be enabled by writing the following on the configuration file: - delete: - enabled: true +```none +delete: + enabled: true +``` -### cache +### `cache` -Use the `cache` subsection to enable caching of data accessed in the storage +Use the `cache` structure to enable caching of data accessed in the storage backend. Currently, the only available cache provides fast access to layer -metadata. This, if configured, uses the `blobdescriptor` field. +metadata, which uses the `blobdescriptor` field if configured. -You can set `blobdescriptor` field to `redis` or `inmemory`. The `redis` value uses -a Redis pool to cache layer metadata. The `inmemory` value uses an in memory -map. +You can set `blobdescriptor` field to `redis` or `inmemory`. If set to `redis`,a +Redis pool caches layer metadata. If set to `inmemory`, an in-memory map caches +layer metadata. ->**NOTE**: Formerly, `blobdescriptor` was known as `layerinfo`. While these ->are equivalent, `layerinfo` has been deprecated, in favor or ->`blobdescriptor`. +> **NOTE**: Formerly, `blobdescriptor` was known as `layerinfo`. While these +> are equivalent, `layerinfo` has been deprecated. -### redirect +### `redirect` The `redirect` subsection provides configuration for managing redirects from content backends. For backends that support it, redirecting is enabled by -default. Certain deployment scenarios may prefer to route all data through the -Registry, rather than redirecting to the backend. This may be more efficient -when using a backend that is not co-located or when a registry instance is -doing aggressive caching. +default. In certain deployment scenarios, you may decide to route all data +through the Registry, rather than redirecting to the backend. This may be more +efficient when using a backend that is not co-located or when a registry +instance is aggressively caching. -Redirects can be disabled by adding a single flag `disable`, set to `true` +To disable redirects, add a single flag `disable`, set to `true` under the `redirect` section: - redirect: - disable: true +```none +redirect: + disable: true +``` +## `auth` -## auth +```none +auth: + silly: + realm: silly-realm + service: silly-service + token: + realm: token-realm + service: token-service + issuer: registry-token-issuer + rootcertbundle: /root/certs/bundle + htpasswd: + realm: basic-realm + path: /path/to/htpasswd +``` - auth: - silly: - realm: silly-realm - service: silly-service - token: - realm: token-realm - service: token-service - issuer: registry-token-issuer - rootcertbundle: /root/certs/bundle - htpasswd: - realm: basic-realm - path: /path/to/htpasswd +The `auth` option is **optional**. Possible auth providers include: -The `auth` option is **optional**. There are -currently 3 possible auth providers, `silly`, `token` and `htpasswd`. You can configure only -one `auth` provider. +- [`silly`](#silly) +- [`token`](#token) +- [`htpasswd`](#token) -### silly +You can configure only one authentication provider. -The `silly` auth is only for development purposes. It simply checks for the -existence of the `Authorization` header in the HTTP request. It has no regard for -the header's value. If the header does not exist, the `silly` auth responds with a -challenge response, echoing back the realm, service, and scope that access was -denied for. +### `silly` + +The `silly` authentication provider is only appropriate for development. It simply checks +for the existence of the `Authorization` header in the HTTP request. It does not +check the header's value. If the header does not exist, the `silly` auth +responds with a challenge response, echoing back the realm, service, and scope +for which access was denied. The following values are used to configure the response: - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- realm - - yes - - The realm in which the registry server authenticates. -
- service - - yes - - The service being authenticated. -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `realm` | yes | The realm in which the registry server authenticates. | +| `service` | yes | The service being authenticated. | + +### `token` + +Token-based authentication allows you to decouple the authentication system from +the registry. It is an established authentication paradigm with a high degree of +security. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `realm` | yes | The realm in which the registry server authenticates. | +| `service` | yes | The service being authenticated. | +| `issuer` | yes | The name of the token issuer. The issuer inserts this into the token so it must match the value configured for the issuer. | +| `rootcertbundle` | yes | The absolute path to the root certificate bundle. This bundle contains the public part of the certificates used to sign authentication tokens. | +For more information about Token based authentication configuration, see the +[specification](spec/auth/token.md). -### token +### `htpasswd` -Token based authentication allows the authentication system to be decoupled from -the registry. It is a well established authentication paradigm with a high -degree of security. +The _htpasswd_ authentication backed allows you to configure basic +authentication using an +[Apache htpasswd file](https://httpd.apache.org/docs/2.4/programs/htpasswd.html). +The only supported password format is +[`bcrypt`](http://en.wikipedia.org/wiki/Bcrypt). Entries with other hash types +are ignored. The `htpasswd` file is loaded once, at startup. If the file is +invalid, the registry will display an error and will not start. - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- realm - - yes - - The realm in which the registry server authenticates. -
- service - - yes - - The service being authenticated. -
- issuer - - yes - -The name of the token issuer. The issuer inserts this into -the token so it must match the value configured for the issuer. -
- rootcertbundle - - yes - -The absolute path to the root certificate bundle. This bundle contains the -public part of the certificates that is used to sign authentication tokens. -
- -For more information about Token based authentication configuration, see the [specification](spec/auth/token.md). - -### htpasswd - -The _htpasswd_ authentication backed allows one to configure basic auth using an -[Apache htpasswd -file](https://httpd.apache.org/docs/2.4/programs/htpasswd.html). Only -[`bcrypt`](http://en.wikipedia.org/wiki/Bcrypt) format passwords are supported. -Entries with other hash types will be ignored. The htpasswd file is loaded once, -at startup. If the file is invalid, the registry will display an error and will -not start. - -> __WARNING:__ This authentication scheme should only be used with TLS -> configured, since basic authentication sends passwords as part of the http +> **Warning**: Only use the `htpasswd` authentication scheme with TLS +> configured, since basic authentication sends passwords as part of the HTTP > header. - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- realm - - yes - - The realm in which the registry server authenticates. -
- path - - yes - - Path to htpasswd file to load at startup. -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `realm` | yes | The realm in which the registry server authenticates. | +| `path` | yes | The path to the `htpasswd` file to load at startup. | -## middleware +## `middleware` -The `middleware` option is **optional**. Use this option to inject middleware at -named hook points. All middleware must implement the same interface as the -object they're wrapping. This means a registry middleware must implement the -`distribution.Namespace` interface, repository middleware must implement -`distribution.Repository`, and storage middleware must implement +The `middleware` structure is **optional**. Use this option to inject middleware at +named hook points. Each middleware must implement the same interface as the +object it is wrapping. For instance, a registry middleware must implement the +`distribution.Namespace` interface, while a repository middleware must implement +`distribution.Repository`, and a storage middleware must implement `driver.StorageDriver`. -An example configuration of the `cloudfront` middleware, a storage middleware: +This is an example configuration of the `cloudfront` middleware, a storage +middleware: - middleware: - registry: - - name: ARegistryMiddleware - options: - foo: bar - repository: - - name: ARepositoryMiddleware - options: - foo: bar - storage: - - name: cloudfront - options: - baseurl: https://my.cloudfronted.domain.com/ - privatekey: /path/to/pem - keypairid: cloudfrontkeypairid - duration: 3000s +```none +middleware: + registry: + - name: ARegistryMiddleware + options: + foo: bar + repository: + - name: ARepositoryMiddleware + options: + foo: bar + storage: + - name: cloudfront + options: + baseurl: https://my.cloudfronted.domain.com/ + privatekey: /path/to/pem + keypairid: cloudfrontkeypairid + duration: 3000s +``` Each middleware entry has `name` and `options` entries. The `name` must correspond to the name under which the middleware registers itself. The @@ -743,382 +647,134 @@ it supports any interesting structures desired, leaving it up to the middleware initialization function to best determine how to handle the specific interpretation of the options. -### cloudfront +### `cloudfront` - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- baseurl - - yes - - SCHEME://HOST[/PATH] at which Cloudfront is served. -
- privatekey - - yes - - Private Key for Cloudfront provided by AWS. -
- keypairid - - yes - - Key pair ID provided by AWS. -
- duration - - no - - Specify a `duration` by providing an integer and a unit. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. For example, `3000s` is a valid duration; there should be no space between the integer and unit. If you do not specify a `duration` or specify an integer without a time unit, this defaults to 20 minutes. -
-### redirect +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `baseurl` | yes | The `SCHEME://HOST[/PATH]` at which Cloudfront is served. | +| `privatekey` | yes | The private key for Cloudfront, provided by AWS. | +| `keypairid` | yes | The key pair ID provided by AWS. | +| `duration` | no | An integer and unit for the duration of the Cloudfront session. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, or `h`. For example, `3000s` is valid, but `3000 s` is not. If you do not specify a `duration` or you specify an integer without a time unit, the duration defaults to `20m` (20 minutes).| -In place of the `cloudfront` storage middleware, the `redirect` -storage middleware can be used to specify a custom URL to a location -of a proxy for the layer stored by the S3 storage driver. +### `redirect` -| Parameter | Required | Description | -| --- | --- | --- | -| baseurl | yes | `SCHEME://HOST` at which layers are served. Can also contain port. For example, `https://example.com:5443`. | +You can use the `redirect` storage middleware to specify a custom URL to a +location of a proxy for the layer stored by the S3 storage driver. -## reporting +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------------------------------------------------------------| +| `baseurl` | yes | `SCHEME://HOST` at which layers are served. Can also contain port. For example, `https://example.com:5443`. | - reporting: - bugsnag: - apikey: bugsnagapikey - releasestage: bugsnagreleasestage - endpoint: bugsnagendpoint - newrelic: - licensekey: newreliclicensekey - name: newrelicname - verbose: true +## `reporting` + +``` +reporting: + bugsnag: + apikey: bugsnagapikey + releasestage: bugsnagreleasestage + endpoint: bugsnagendpoint + newrelic: + licensekey: newreliclicensekey + name: newrelicname + verbose: true +``` The `reporting` option is **optional** and configures error and metrics -reporting tools. At the moment only two services are supported, [New -Relic](http://newrelic.com/) and [Bugsnag](http://bugsnag.com), a valid -configuration may contain both. +reporting tools. At the moment only two services are supported: -### bugsnag +- [Bugsnag](#bugsnag) +- [New Relic](#new-relic) - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- apikey - - yes - - API Key provided by Bugsnag -
- releasestage - - no - - Tracks where the registry is deployed, for example, - production,staging, or - development. -
- endpoint - - no - - Specify the enterprise Bugsnag endpoint. -
+A valid configuration may contain both. + +### `bugsnag` + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `apikey` | yes | The API Key provided by Bugsnag. | +| `releasestage` | no | Tracks where the registry is deployed, using a string like `production`, `staging`, or `development`.| +| `endpoint`| no | The enterprise Bugsnag endpoint. | + +### `newrelic` + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `licensekey` | yes | License key provided by New Relic. | +| `name` | no | New Relic application name. | +| `verbose`| no | Set to `true` to enable New Relic debugging output on `stdout`. | + +## `http` + +```none +http: + addr: localhost:5000 + net: tcp + prefix: /my/nested/registry/ + host: https://myregistryaddress.org:5000 + secret: asecretforlocaldevelopment + relativeurls: false + tls: + certificate: /path/to/x509/public + key: /path/to/x509/private + clientcas: + - /path/to/ca.pem + - /path/to/another/ca.pem + letsencrypt: + cachefile: /path/to/cache-file + email: emailused@letsencrypt.com + debug: + addr: localhost:5001 + headers: + X-Content-Type-Options: [nosniff] + http2: + disabled: false +``` + +The `http` option details the configuration for the HTTP server that hosts the +registry. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `addr` | yes | The address for which the server should accept connections. The form depends on a network type (see the `net` option). Use `HOST:PORT` for TCP and `FILE` for a UNIX socket. | +| `net` | no | The network used to create a listening socket. Known networks are `unix` and `tcp`. | +| `prefix` | no | If the server does not run at the root path, set this to the value of the prefix. The root path is the section before `v2`. It requires both preceding and trailing slashes, such as in the example `/path/`. | +| `host` | no | A fully-qualified URL for an externally-reachable address for the registry. If present, it is used when creating generated URLs. Otherwise, these URLs are derived from client requests. | +| `secret` | no | A random piece of data used to sign state that may be stored with the client to protect against tampering. For production environments you should generate a random piece of data using a cryptographically secure random generator. If you omit the secret, the registry will automatically generate a secret when it starts. **If you are building a cluster of registries behind a load balancer, you MUST ensure the secret is the same for all registries.**| +| `relativeurls`| no | If `true`, the registry returns relative URLs in Location headers. The client is responsible for resolving the correct URL. **This option is not compatible with Docker 1.7 and earlier.**| -### newrelic +### `tls` - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- licensekey - - yes - - License key provided by New Relic. -
- name - - no - - New Relic application name. -
- verbose - - no - - Enable New Relic debugging output on stdout. -
- -## http - - http: - addr: localhost:5000 - net: tcp - prefix: /my/nested/registry/ - host: https://myregistryaddress.org:5000 - secret: asecretforlocaldevelopment - relativeurls: false - tls: - certificate: /path/to/x509/public - key: /path/to/x509/private - clientcas: - - /path/to/ca.pem - - /path/to/another/ca.pem - letsencrypt: - cachefile: /path/to/cache-file - email: emailused@letsencrypt.com - debug: - addr: localhost:5001 - headers: - X-Content-Type-Options: [nosniff] - http2: - disabled: false - -The `http` option details the configuration for the HTTP server that hosts the registry. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- addr - - yes - - The address for which the server should accept connections. The form depends on a network type (see net option): - HOST:PORT for tcp and FILE for a unix socket. -
- net - - no - - The network which is used to create a listening socket. Known networks are unix and tcp. - The default empty value means tcp. -
- prefix - - no - -If the server does not run at the root path use this value to specify the -prefix. The root path is the section before v2. It -should have both preceding and trailing slashes, for example /path/. -
- host - - no - -This parameter specifies an externally-reachable address for the registry, as a -fully qualified URL. If present, it is used when creating generated URLs. -Otherwise, these URLs are derived from client requests. -
- secret - - yes - -A random piece of data. This is used to sign state that may be stored with the -client to protect against tampering. For production environments you should generate a -random piece of data using a cryptographically secure random generator. This -configuration parameter may be omitted, in which case the registry will automatically -generate a secret at launch. -

-WARNING: If you are building a cluster of registries behind a load balancer, you MUST -ensure the secret is the same for all registries. -

- relativeurls - - no - - Specifies that the registry should return relative URLs in Location headers. - The client is responsible for resolving the correct URL. This option is not - compatible with Docker 1.7 and earlier. -
- - -### tls - -The `tls` struct within `http` is **optional**. Use this to configure TLS -for the server. If you already have a server such as Nginx or Apache running on -the same host as the registry, you may prefer to configure TLS termination there +The `tls` structure within `http` is **optional**. Use this to configure TLS +for the server. If you already have a web server running on +the same host as the registry, you may prefer to configure TLS on that web server and proxy connections to the registry server. - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- certificate - - yes - - Absolute path to x509 cert file -
- key - - yes - - Absolute path to x509 private key file. -
- clientcas - - no - - An array of absolute paths to an x509 CA file -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `certificate` | yes | Absolute path to the x509 certificate file. | +| `key` | yes | Absolute path to the x509 private key file. | +| `clientcas` | no | An array of absolute paths to x509 CA files. | -### letsencrypt +### `letsencrypt` -The `letsencrypt` struct within `tls` is **optional**. Use this to configure TLS -certificates provided by [Let's Encrypt](https://letsencrypt.org/how-it-works/). +The `letsencrypt` structure within `tls` is **optional**. Use this to configure +TLS certificates provided by +[Let's Encrypt](https://letsencrypt.org/how-it-works/). ->**NOTE**: When using Let's Encrypt ensure that the outward facing address is -> accessible on port `443`. The registry defaults to listening on `5000`, if -> run as a container consider adding the flag `-p 443:5000` to the `docker run` -> command or similar setting in cloud configuration. +>**NOTE**: When using Let's Encrypt, ensure that the outward-facing address is +> accessible on port `443`. The registry defaults to listening on port `5000`. +> If you run the registry as a container, consider adding the flag `-p 443:5000` +> to the `docker run` command or using a similar setting in a cloud +> configuration. - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- cachefile - - yes - - Absolute path to a file for the Let's Encrypt agent to cache data -
- email - - yes - - Email used to register with Let's Encrypt. -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `cachefile` | yes | Absolute path to a file where the Let's Encrypt agent can cache data. | +| `email` | yes | The email address used to register with Let's Encrypt. | -### debug +### `debug` The `debug` option is **optional** . Use it to configure a debug server that can be helpful in diagnosing problems. The debug endpoint can be used for @@ -1126,11 +782,10 @@ monitoring registry metrics and health, as well as profiling. Sensitive information may be available via the debug endpoint. Please be certain that access to the debug endpoint is locked down in a production environment. -The `debug` section takes a single, required `addr` parameter. This parameter -specifies the `HOST:PORT` on which the debug server should accept connections. +The `debug` section takes a single required `addr` parameter, which specifies +the `HOST:PORT` on which the debug server should accept connections. - -### headers +### `headers` The `headers` option is **optional** . Use it to specify headers that the HTTP server should include in responses. This can be used for security headers such @@ -1142,846 +797,325 @@ header's payload values. Including `X-Content-Type-Options: [nosniff]` is recommended, so that browsers will not interpret content as HTML if they are directed to load a page from the -registry. This header is included in the example configuration files. +registry. This header is included in the example configuration file. -### http2 +### `http2` -The `http2` struct within `http` is **optional**. Use this to control http2 +The `http2` structure within `http` is **optional**. Use this to control http2 settings for the registry. - - - - - - - - - - - -
ParameterRequiredDescription
- disabled - - no - - A boolean that determines if http2 support should be disabled -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `disabled` | no | If `true`, then `http2` support is disabled. | -## notifications +## `notifications` - notifications: - endpoints: - - name: alistener - disabled: false - url: https://my.listener.com/event - headers: - timeout: 500 - threshold: 5 - backoff: 1000 - ignoredmediatypes: - - application/octet-stream +```none +notifications: + endpoints: + - name: alistener + disabled: false + url: https://my.listener.com/event + headers: + timeout: 500 + threshold: 5 + backoff: 1000 + ignoredmediatypes: + - application/octet-stream +``` The notifications option is **optional** and currently may contain a single option, `endpoints`. -### endpoints +### `endpoints` -Endpoints is a list of named services (URLs) that can accept event notifications. +The `endpoints` structure contains a list of named services (URLs) that can +accept event notifications. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- name - - yes - -A human readable name for the service. -
- disabled - - no - -A boolean to enable/disable notifications for a service. -
- url - - yes - -The URL to which events should be published. -
- headers - - yes - - Static headers to add to each request. Each header's name should be a key - underneath headers, and each value is a list of payloads for that - header name. Note that values must always be lists. -
- timeout - - yes - - An HTTP timeout value. This field takes a positive integer and an optional - suffix indicating the unit of time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. -
- threshold - - yes - - An integer specifying how long to wait before backing off a failure. -
- backoff - - yes - - How long the system backs off before retrying. This field takes a positive - integer and an optional suffix indicating the unit of time. Possible units - are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. -
- ignoredmediatypes - - no - - List of target media types to ignore. An event whose target media type - is present in this list will not be published to the endpoint. -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `name` | yes | A human-readable name for the service. | +| `disabled` | no | If `true`, notifications are disabled for the service.| +| `url` | yes | The URL to which events should be published. | +| `headers` | yes | A list of static headers to add to each request. Each header's name is a key beneath `headers`, and each value is a list of payloads for that header name. Values must always be lists. | +| `timeout` | yes | A value for the HTTP timeout. A positive integer and an optional suffix indicating the unit of time, which may be `ns`, `us`, `ms`, `s`, `m`, or `h`. If you omit the unit of time, `ns` is used. | +| `threshold` | yes | An integer specifying how long to wait before backing off a failure. | +| `backoff` | yes | How long the system backs off before retrying after a failure. A positive integer and an optional suffix indicating the unit of time, which may be `ns`, `us`, `ms`, `s`, `m`, or `h`. If you omit the unit of time, `ns` is used. | +| `ignoredmediatypes`|no| A list of target media types to ignore. Events with these target media types are not published to the endpoint. | + +## `redis` + +```none +redis: + addr: localhost:6379 + password: asecret + db: 0 + dialtimeout: 10ms + readtimeout: 10ms + writetimeout: 10ms + pool: + maxidle: 16 + maxactive: 64 + idletimeout: 300s +``` + +Declare parameters for constructing the `redis` connections. Registry instances +may use the Redis instance for several applications. Currently, it caches +information about immutable blobs. Most of the `redis` options control +how the registry connects to the `redis` instance. You can control the pool's +behavior with the [pool](#pool) subsection. + +You should configure Redis with the **allkeys-lru** eviction policy, because the +registry does not set an expiration value on keys. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `addr` | yes | The address (host and port) of the Redis instance. | +| `password`| no | A password used to authenticate to the Redis instance.| +| `db` | no | The name of the database to use for each connection. | +| `dialtimeout` | no | The timeout for connecting to the Redis instance. | +| `readtimeout` | no | The timeout for reading from the Redis instance. | +| `writetimeout` | no | The timeout for writing to the Redis instance. | + +### `pool` + +```none +pool: + maxidle: 16 + maxactive: 64 + idletimeout: 300s +``` + +Use these settings to configure the behavior of the Redis connection pool. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `maxidle` | no | The maximum number of idle connections in the pool. | +| `maxactive`| no | The maximum number of connections which can be open before blocking a connection request. | +| `idletimeout`| no | How long to wait before closing inactive connections. | + +## `health` + +```none +health: + storagedriver: + enabled: true + interval: 10s + threshold: 3 + file: + - file: /path/to/checked/file + interval: 10s + http: + - uri: http://server.to.check/must/return/200 + headers: + Authorization: [Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==] + statuscode: 200 + timeout: 3s + interval: 10s + threshold: 3 + tcp: + - addr: redis-server.domain.com:6379 + timeout: 3s + interval: 10s + threshold: 3 +``` + +The health option is **optional**, and contains preferences for a periodic +health check on the storage driver's backend storage, as well as optional +periodic checks on local files, HTTP URIs, and/or TCP servers. The results of +the health checks are available at the `/debug/health` endpoint on the debug +HTTP server if the debug HTTP server is enabled (see http section). + +### `storagedriver` + +The `storagedriver` structure contains options for a health check on the +configured storage driver's backend storage. The health check is only active +when `enabled` is set to `true`. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `enabled` | yes | Set to `true` to enable storage driver health checks or `false` to disable them. | +| `interval`| no | How long to wait between repetitions of the storage driver health check. A positive integer and an optional suffix indicating the unit of time. The suffix is one of `ns`, `us`, `ms`, `s`, `m`, or `h`. Defaults to `10s` if the value is omitted. If you specify a value but omit the suffix, the value is interpreted as a number of nanoseconds. | +| `threshold`| no | A positive integer which represents the number of times the check must fail before the state is marked as unhealthy. If not specified, a single failure marks the state as unhealthy. | + +### `file` + +The `file` structure includes a list of paths to be periodically checked for the\ +existence of a file. If a file exists at the given path, the health check will +fail. You can use this mechanism to bring a registry out of rotation by creating +a file. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `file` | yes | The path to check for existence of a file. | +| `interval`| no | How long to wait before repeating the check. A positive integer and an optional suffix indicating the unit of time. The suffix is one of `ns`, `us`, `ms`, `s`, `m`, or `h`. Defaults to `10s` if the value is omitted. | + +### `http` + +The `http` structure includes a list of HTTP URIs to periodically check with +`HEAD` requests. If a `HEAD` request does not complete or returns an unexpected +status code, the health check will fail. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `uri` | yes | The URI to check. | +| `headers` | no | Static headers to add to each request. Each header's name is a key beneath `headers`, and each value is a list of payloads for that header name. Values must always be lists. | +| `statuscode` | no | The expected status code from the HTTP URI. Defaults to `200`. | +| `timeout` | no | How long to wait before timing out the HTTP request. A positive integer and an optional suffix indicating the unit of time. The suffix is one of `ns`, `us`, `ms`, `s`, `m`, or `h`. If you specify a value but omit the suffix, the value is interpreted as a number of nanoseconds. | +| `interval`| no | How long to wait before repeating the check. A positive integer and an optional suffix indicating the unit of time. The suffix is one of `ns`, `us`, `ms`, `s`, `m`, or `h`. Defaults to `10s` if the value is omitted. If you specify a value but omit the suffix, the value is interpreted as a number of nanoseconds. | +| `threshold`| no | The number of times the check must fail before the state is marked as unhealthy. If this field is not specified, a single failure marks the state as unhealthy. | + +### `tcp` + +The `tcp` structure includes a list of TCP addresses to periodically check using +TCP connection attempts. Addresses must include port numbers. If a connection +attempt fails, the health check will fail. + +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `addr` | yes | The TCP address and port to connect to. | +| `timeout` | no | How long to wait before timing out the TCP connection. A positive integer and an optional suffix indicating the unit of time. The suffix is one of `ns`, `us`, `ms`, `s`, `m`, or `h`. If you specify a value but omit the suffix, the value is interpreted as a number of nanoseconds. | +| `interval`| no | How long to wait between repetitions of the check. A positive integer and an optional suffix indicating the unit of time. The suffix is one of `ns`, `us`, `ms`, `s`, `m`, or `h`. Defaults to `10s` if the value is omitted. If you specify a value but omit the suffix, the value is interpreted as a number of nanoseconds. | +| `threshold`| no | The number of times the check must fail before the state is marked as unhealthy. If this field is not specified, a single failure marks the state as unhealthy. | -## redis +## `proxy` - redis: - addr: localhost:6379 - password: asecret - db: 0 - dialtimeout: 10ms - readtimeout: 10ms - writetimeout: 10ms - pool: - maxidle: 16 - maxactive: 64 - idletimeout: 300s +``` +proxy: + remoteurl: https://registry-1.docker.io + username: [username] + password: [password] +``` -Declare parameters for constructing the redis connections. Registry instances -may use the Redis instance for several applications. The current purpose is -caching information about immutable blobs. Most of the options below control -how the registry connects to redis. You can control the pool's behavior -with the [pool](#pool) subsection. +The `proxy` structure allows a registry to be configured as a pull-through cache +to Docker Hub. See +[mirror](https://github.com/docker/docker.github.io/tree/master/registry/recipes/mirror.md) +for more information. Pushing to a registry configured as a pull-through cache +is unsupported. -It's advisable to configure Redis itself with the **allkeys-lru** eviction policy -as the registry does not set an expire value on keys. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- addr - - yes - - Address (host and port) of redis instance. -
- password - - no - - A password used to authenticate to the redis instance. -
- db - - no - - Selects the db for each connection. -
- dialtimeout - - no - - Timeout for connecting to a redis instance. -
- readtimeout - - no - - Timeout for reading from redis connections. -
- writetimeout - - no - - Timeout for writing to redis connections. -
+| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `remoteurl`| yes | The URL for the repository on Docker Hub. | +| `username` | no | The username registered with Docker Hub which has access to the repository. | +| `password` | no | The password used to authenticate to Docker Hub using the username specified in `username`. | -### pool +To enable pulling private repositories (e.g. `batman/robin`) specify the +username (such as `batman`) and the password for that username. - pool: - maxidle: 16 - maxactive: 64 - idletimeout: 300s +> **Note**: These private repositories are stored in the proxy cache's storage. +> Take appropriate measures to protect access to the proxy cache. -Configure the behavior of the Redis connection pool. +## `compatibility` - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- maxidle - - no - - Sets the maximum number of idle connections. -
- maxactive - - no - - sets the maximum number of connections that should - be opened before blocking a connection request. -
- idletimeout - - no - - sets the amount time to wait before closing - inactive connections. -
+```none +compatibility: + schema1: + signingkeyfile: /etc/registry/key.json +``` -## health +Use the `compatibility` structure to configure handling of older and deprecated +features. Each subsection defines such a feature with configurable behavior. - health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 - file: - - file: /path/to/checked/file - interval: 10s - http: - - uri: http://server.to.check/must/return/200 - headers: - Authorization: [Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==] - statuscode: 200 - timeout: 3s - interval: 10s - threshold: 3 - tcp: - - addr: redis-server.domain.com:6379 - timeout: 3s - interval: 10s - threshold: 3 +### `schema1` -The health option is **optional**. It may contain preferences for a periodic -health check on the storage driver's backend storage, and optional periodic -checks on local files, HTTP URIs, and/or TCP servers. The results of the health -checks are available at /debug/health on the debug HTTP server if the debug -HTTP server is enabled (see http section). +| Parameter | Required | Description | +|-----------|----------|-------------------------------------------------------| +| `signingkeyfile` | no | The signing private key used to add signatures to `schema1` manifests. If no signing key is provided, a new ECDSA key is generated when the registry starts. | -### storagedriver +## `validation` -storagedriver contains options for a health check on the configured storage -driver's backend storage. enabled must be set to true for this health check to -be active. +```none +validation: + enabled: true + manifests: + urls: + allow: + - ^https?://([^/]+\.)*example\.com/ + deny: + - ^https?://www\.example\.com/ +``` - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- enabled - - yes - -"true" to enable the storage driver health check or "false" to disable it. -
- interval - - no - - The length of time to wait between repetitions of the check. This field - takes a positive integer and an optional suffix indicating the unit of - time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. - The default value is 10 seconds if this field is omitted. -
- threshold - - no - - An integer specifying the number of times the check must fail before the - check triggers an unhealthy state. If this filed is not specified, a - single failure will trigger an unhealthy state. -
- -### file - -file is a list of paths to be periodically checked for the existence of a file. -If a file exists at the given path, the health check will fail. This can be -used as a way of bringing a registry out of rotation by creating a file. - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- file - - yes - -The path to check for the existence of a file. -
- interval - - no - - The length of time to wait between repetitions of the check. This field - takes a positive integer and an optional suffix indicating the unit of - time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. - The default value is 10 seconds if this field is omitted. -
- -### http - -http is a list of HTTP URIs to be periodically checked with HEAD requests. If -a HEAD request doesn't complete or returns an unexpected status code, the -health check will fail. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- uri - - yes - -The URI to check. -
- headers - - no - - Static headers to add to each request. Each header's name should be a key - underneath headers, and each value is a list of payloads for that - header name. Note that values must always be lists. -
- statuscode - - no - -Expected status code from the HTTP URI. Defaults to 200. -
- timeout - - no - - The length of time to wait before timing out the HTTP request. This field - takes a positive integer and an optional suffix indicating the unit of - time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. -
- interval - - no - - The length of time to wait between repetitions of the check. This field - takes a positive integer and an optional suffix indicating the unit of - time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. - The default value is 10 seconds if this field is omitted. -
- threshold - - no - - An integer specifying the number of times the check must fail before the - check triggers an unhealthy state. If this filed is not specified, a - single failure will trigger an unhealthy state. -
- -### tcp - -tcp is a list of TCP addresses to be periodically checked with connection -attempts. The addresses must include port numbers. If a connection attempt -fails, the health check will fail. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- addr - - yes - -The TCP address to connect to, including a port number. -
- timeout - - no - - The length of time to wait before timing out the TCP connection. This - field takes a positive integer and an optional suffix indicating the unit - of time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. -
- interval - - no - - The length of time to wait between repetitions of the check. This field - takes a positive integer and an optional suffix indicating the unit of - time. Possible units are: -
    -
  • ns (nanoseconds)
  • -
  • us (microseconds)
  • -
  • ms (milliseconds)
  • -
  • s (seconds)
  • -
  • m (minutes)
  • -
  • h (hours)
  • -
- If you omit the suffix, the system interprets the value as nanoseconds. - The default value is 10 seconds if this field is omitted. -
- threshold - - no - - An integer specifying the number of times the check must fail before the - check triggers an unhealthy state. If this filed is not specified, a - single failure will trigger an unhealthy state. -
- -## Proxy - - proxy: - remoteurl: https://registry-1.docker.io - username: [username] - password: [password] - -Proxy enables a registry to be configured as a pull through cache to the official Docker Hub. See [mirror](recipes/mirror.md) for more information. Pushing to a registry configured as a pull through cache is currently unsupported. - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- remoteurl - - yes - - The URL of the official Docker Hub -
- username - - no - - The username of the Docker Hub account -
- password - - no - - The password for the official Docker Hub account -
- -To enable pulling private repositories (e.g. `batman/robin`) a username and password for user `batman` must be specified. Note: These private repositories will be stored in the proxy cache's storage and relevant measures should be taken to protect access to this. - -## Compatibility - - compatibility: - schema1: - signingkeyfile: /etc/registry/key.json - -Configure handling of older and deprecated features. Each subsection -defines such a feature with configurable behavior. - -### Schema1 - - - - - - - - - - - - -
ParameterRequiredDescription
- signingkeyfile - - no - - The signing private key used for adding signatures to schema1 manifests. - If no signing key is provided, a new ECDSA key will be generated on - startup. -
- -## Validation - - validation: - enabled: true - manifests: - urls: - allow: - - ^https?://([^/]+\.)*example\.com/ - deny: - - ^https?://www\.example\.com/ - -### Enabled +### `enabled` Use the `enabled` flag to enable the other options in the `validation` section. They are disabled by default. -### Manifests +### `manifests` Use the `manifest` subsection to configure manifest validation. -#### URLs +#### `urls` -The `allow` and `deny` options are both lists of +The `allow` and `deny` options are each a list of [regular expressions](https://godoc.org/regexp/syntax) that restrict the URLs in pushed manifests. -If `allow` is unset, pushing a manifest containing URLs will fail. +If `allow` is unset, pushing a manifest containing URLs fails. -If `allow` is set, pushing a manifest will succeed only if all URLs within match -one of the `allow` regular expressions and one of the following holds: -1. `deny` is unset. -2. `deny` is set but no URLs within the manifest match any of the `deny` regular expressions. +If `allow` is set, pushing a manifest succeeds only if all URLs match +one of the `allow` regular expressions **and** one of the following holds: + +1. `deny` is unset. +2. `deny` is set but no URLs within the manifest match any of the `deny` regular + expressions. ## Example: Development configuration -The following is a simple example you can use for local development: +You can use this simple example for local development: - version: 0.1 - log: - level: debug - storage: - filesystem: - rootdirectory: /var/lib/registry - http: - addr: localhost:5000 - secret: asecretforlocaldevelopment - debug: - addr: localhost:5001 +```none +version: 0.1 +log: + level: debug +storage: + filesystem: + rootdirectory: /var/lib/registry +http: + addr: localhost:5000 + secret: asecretforlocaldevelopment + debug: + addr: localhost:5001 +``` -The above configures the registry instance to run on port `5000`, binding to -`localhost`, with the `debug` server enabled. Registry data storage is in the -`/var/lib/registry` directory. Logging is in `debug` mode, which is the most +This example configures the registry instance to run on port `5000`, binding to +`localhost`, with the `debug` server enabled. Registry data is stored in the +`/var/lib/registry` directory. Logging is set to `debug` mode, which is the most verbose. -A similar simple configuration is available at -[config-example.yml](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml). -Both are generally useful for local development. +See +[config-example.yml](https://github.com/docker/distribution/blob/master/cmd/registry/config-example.yml) +for another simple configuration. Both examples are generally useful for local +development. ## Example: Middleware configuration -This example illustrates how to configure storage middleware in a registry. -Middleware allows the registry to serve layers via a content delivery network -(CDN). This is useful for reducing requests to the storage layer. +This example configures [Amazon Cloudfront](http://aws.amazon.com/cloudfront/) +as the storage middleware in a registry. Middleware allows the registry to serve +layers via a content delivery network (CDN). This reduces requests to the +storage layer. -The registry supports [Amazon -Cloudfront](http://aws.amazon.com/cloudfront/). You can only use Cloudfront in -conjunction with the S3 storage driver. +Cloudfront requires the S3 storage driver. - - - - - - - - - - - - - - - - - -
ParameterDescription
nameThe storage middleware name. Currently cloudfront is an accepted value.
disabledSet to false to easily disable the middleware.
options: - A set of key/value options to configure the middleware. -
    -
  • baseurl: The Cloudfront base URL.
  • -
  • privatekey: The location of your AWS private key on the filesystem.
  • -
  • keypairid: The ID of your Cloudfront keypair.
  • -
  • duration: The duration in minutes for which the URL is valid. Default is 20.
  • -
-
+This is the configuration expressed in YAML: -The following example illustrates these values: +```none +middleware: + storage: + - name: cloudfront + disabled: false + options: + baseurl: http://d111111abcdef8.cloudfront.net + privatekey: /path/to/asecret.pem + keypairid: asecret + duration: 60 +``` - middleware: - storage: - - name: cloudfront - disabled: false - options: - baseurl: http://d111111abcdef8.cloudfront.net - privatekey: /path/to/asecret.pem - keypairid: asecret - duration: 60 +See the configuration reference for [Cloudfront](#cloudfront) for more +information about configuration options. - ->**Note**: Cloudfront keys exist separately to other AWS keys. See ->[the documentation on AWS credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) ->for more information. +> **Note**: Cloudfront keys exist separately from other AWS keys. See +> [the documentation on AWS credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) +> for more information. diff --git a/vendor/github.com/docker/distribution/docs/deploying.md b/vendor/github.com/docker/distribution/docs/deploying.md deleted file mode 100644 index 2e8ce69e2..000000000 --- a/vendor/github.com/docker/distribution/docs/deploying.md +++ /dev/null @@ -1,237 +0,0 @@ - - -# Deploying a registry server - -You need to [install Docker version 1.6.0 or newer](/engine/installation/index.md). - -## Running on localhost - -Start your registry: - - docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -You can now use it with docker. - -Get any image from the hub and tag it to point to your registry: - - docker pull ubuntu && docker tag ubuntu localhost:5000/ubuntu - -... then push it to your registry: - - docker push localhost:5000/ubuntu - -... then pull it back from your registry: - - docker pull localhost:5000/ubuntu - -To stop your registry, you would: - - docker stop registry && docker rm -v registry - -## Storage - -By default, your registry data is persisted as a [docker volume](/engine/tutorials/dockervolumes.md) on the host filesystem. Properly understanding volumes is essential if you want to stick with a local filesystem storage. - -Specifically, you might want to point your volume location to a specific place in order to more easily access your registry data. To do so you can: - - docker run -d -p 5000:5000 --restart=always --name registry \ - -v `pwd`/data:/var/lib/registry \ - registry:2 - -### Alternatives - -You should usually consider using [another storage backend](./storage-drivers/index.md) instead of the local filesystem. Use the [storage configuration options](./configuration.md#storage) to configure an alternate storage backend. - -Using one of these will allow you to more easily scale your registry, and leverage your storage redundancy and availability features. - -## Running a domain registry - -While running on `localhost` has its uses, most people want their registry to be more widely available. To do so, the Docker engine requires you to secure it using TLS, which is conceptually very similar to configuring your web server with SSL. - -### Get a certificate - -Assuming that you own the domain `myregistrydomain.com`, and that its DNS record points to the host where you are running your registry, you first need to get a certificate from a CA. - -Create a `certs` directory: - - mkdir -p certs - -Then move and/or rename your crt file to: `certs/domain.crt`, and your key file to: `certs/domain.key`. - -Make sure you stopped your registry from the previous steps, then start your registry again with TLS enabled: - - docker run -d -p 5000:5000 --restart=always --name registry \ - -v `pwd`/certs:/certs \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - registry:2 - -You should now be able to access your registry from another docker host: - - docker pull ubuntu - docker tag ubuntu myregistrydomain.com:5000/ubuntu - docker push myregistrydomain.com:5000/ubuntu - docker pull myregistrydomain.com:5000/ubuntu - -#### Gotcha - -A certificate issuer may supply you with an *intermediate* certificate. In this case, you must combine your certificate with the intermediate's to form a *certificate bundle*. You can do this using the `cat` command: - - cat domain.crt intermediate-certificates.pem > certs/domain.crt - -### Let's Encrypt - -The registry supports using Let's Encrypt to automatically obtain a browser-trusted certificate. For more -information on Let's Encrypt, see [https://letsencrypt.org/how-it-works/](https://letsencrypt.org/how-it-works/) and the relevant section of the [registry configuration](configuration.md#letsencrypt). - -### Alternatives - -While rarely advisable, you may want to use self-signed certificates instead, or use your registry in an insecure fashion. You will find instructions [here](insecure.md). - -## Load Balancing Considerations - -One may want to use a load balancer to distribute load, terminate TLS or -provide high availability. While a full load balancing setup is outside the -scope of this document, there are a few considerations that can make the process -smoother. - -The most important aspect is that a load balanced cluster of registries must -share the same resources. For the current version of the registry, this means -the following must be the same: - - - Storage Driver - - HTTP Secret - - Redis Cache (if configured) - -If any of these are different, the registry will have trouble serving requests. -As an example, if you're using the filesystem driver, all registry instances -must have access to the same filesystem root, which means they should be in -the same machine. For other drivers, such as s3 or azure, they should be -accessing the same resource, and will likely share an identical configuration. -The _HTTP Secret_ coordinates uploads, so also must be the same across -instances. Configuring different redis instances will work (at the time -of writing), but will not be optimal if the instances are not shared, causing -more requests to be directed to the backend. - -#### Important/Required HTTP-Headers -Getting the headers correct is very important. For all responses to any -request under the "/v2/" url space, the `Docker-Distribution-API-Version` -header should be set to the value "registry/2.0", even for a 4xx response. -This header allows the docker engine to quickly resolve authentication realms -and fallback to version 1 registries, if necessary. Confirming this is setup -correctly can help avoid problems with fallback. - -In the same train of thought, you must make sure you are properly sending the -`X-Forwarded-Proto`, `X-Forwarded-For` and `Host` headers to their "client-side" -values. Failure to do so usually makes the registry issue redirects to internal -hostnames or downgrading from https to http. - -A properly secured registry should return 401 when the "/v2/" endpoint is hit -without credentials. The response should include a `WWW-Authenticate` -challenge, providing guidance on how to authenticate, such as with basic auth -or a token service. If the load balancer has health checks, it is recommended -to configure it to consider a 401 response as healthy and any other as down. -This will secure your registry by ensuring that configuration problems with -authentication don't accidentally expose an unprotected registry. If you're -using a less sophisticated load balancer, such as Amazon's Elastic Load -Balancer, that doesn't allow one to change the healthy response code, health -checks can be directed at "/", which will always return a `200 OK` response. - -## Restricting access - -Except for registries running on secure local networks, registries should always implement access restrictions. - -### Native basic auth - -The simplest way to achieve access restriction is through basic authentication (this is very similar to other web servers' basic authentication mechanism). - -> **Warning**: You **cannot** use authentication with an insecure registry. You have to [configure TLS first](#running-a-domain-registry) for this to work. - -First create a password file with one entry for the user "testuser", with password "testpassword": - - mkdir auth - docker run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/htpasswd - -Make sure you stopped your registry from the previous step, then start it again: - - docker run -d -p 5000:5000 --restart=always --name registry \ - -v `pwd`/auth:/auth \ - -e "REGISTRY_AUTH=htpasswd" \ - -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ - -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ - -v `pwd`/certs:/certs \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - registry:2 - -You should now be able to: - - docker login myregistrydomain.com:5000 - -And then push and pull images as an authenticated user. - -#### Gotcha - -Seeing X509 errors is usually a sign you are trying to use self-signed certificates, and failed to [configure your docker daemon properly](insecure.md). - -### Alternatives - -1. You may want to leverage more advanced basic auth implementations through a proxy design, in front of the registry. You will find examples of such patterns in the [recipes list](recipes/index.md). - -2. Alternatively, the Registry also supports delegated authentication, redirecting users to a specific, trusted token server. That approach requires significantly more investment, and only makes sense if you want to fully configure ACLs and more control over the Registry integration into your global authorization and authentication systems. - -You will find [background information here](spec/auth/token.md), and [configuration information here](configuration.md#auth). - -Beware that you will have to implement your own authentication service for this to work, or leverage a third-party implementation. - -## Managing with Compose - -As your registry configuration grows more complex, dealing with it can quickly become tedious. - -It's highly recommended to use [Docker Compose](/compose/index.md) to facilitate operating your registry. - -Here is a simple `docker-compose.yml` example that condenses everything explained so far: - -``` -registry: - restart: always - image: registry:2 - ports: - - 5000:5000 - environment: - REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt - REGISTRY_HTTP_TLS_KEY: /certs/domain.key - REGISTRY_AUTH: htpasswd - REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd - REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm - volumes: - - /path/data:/var/lib/registry - - /path/certs:/certs - - /path/auth:/auth -``` - -> **Warning**: replace `/path` by whatever directory that holds your `certs` and `auth` folder from above. - -You can then start your registry with a simple - - docker-compose up -d - -## Next - -You will find more specific and advanced informations in the following sections: - - - [Configuration reference](configuration.md) - - [Working with notifications](notifications.md) - - [Advanced "recipes"](recipes/index.md) - - [Registry API](spec/api.md) - - [Storage driver model](storage-drivers/index.md) - - [Token authentication](spec/auth/token.md) diff --git a/vendor/github.com/docker/distribution/docs/deprecated.md b/vendor/github.com/docker/distribution/docs/deprecated.md deleted file mode 100644 index 73bde497f..000000000 --- a/vendor/github.com/docker/distribution/docs/deprecated.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# Docker Registry Deprecation - -This document details functionality or components which are deprecated within -the registry. - -### v2.5.0 - -The signature store has been removed from the registry. Since `v2.4.0` it has -been possible to configure the registry to generate manifest signatures rather -than load them from storage. In this version of the registry this becomes -the default behavior. Signatures which are attached to manifests on put are -not stored in the registry. This does not alter the functional behavior of -the registry. - -Old signatures blobs can be removed from the registry storage by running the -garbage-collect subcommand. diff --git a/vendor/github.com/docker/distribution/docs/garbage-collection.md b/vendor/github.com/docker/distribution/docs/garbage-collection.md deleted file mode 100644 index 2d03e7872..000000000 --- a/vendor/github.com/docker/distribution/docs/garbage-collection.md +++ /dev/null @@ -1,137 +0,0 @@ - - -# Garbage Collection - -As of v2.4.0 a garbage collector command is included within the registry binary. -This document describes what this command does and how and why it should be used. - -## What is Garbage Collection? - -From [wikipedia](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)): - -"In computer science, garbage collection (GC) is a form of automatic memory management. The -garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by -objects that are no longer in use by the program." - -In the context of the Docker registry, garbage collection is the process of -removing blobs from the filesystem which are no longer referenced by a -manifest. Blobs can include both layers and manifests. - - -## Why Garbage Collection? - -Registry data can occupy considerable amounts of disk space and freeing up -this disk space is an oft-requested feature. Additionally for reasons of security it -can be desirable to ensure that certain layers no longer exist on the filesystem. - - -## Garbage Collection in the Registry - -Filesystem layers are stored by their content address in the Registry. This -has many advantages, one of which is that data is stored once and referred to by manifests. -See [here](compatibility.md#content-addressable-storage-cas) for more details. - -Layers are therefore shared amongst manifests; each manifest maintains a reference -to the layer. As long as a layer is referenced by one manifest, it cannot be garbage -collected. - -Manifests and layers can be 'deleted` with the registry API (refer to the API -documentation [here](spec/api.md#deleting-a-layer) and -[here](spec/api.md#deleting-an-image) for details). This API removes references -to the target and makes them eligible for garbage collection. It also makes them -unable to be read via the API. - -If a layer is deleted it will be removed from the filesystem when garbage collection -is run. If a manifest is deleted the layers to which it refers will be removed from -the filesystem if no other manifests refers to them. - - -### Example - -In this example manifest A references two layers: `a` and `b`. Manifest `B` references -layers `a` and `c`. In this state, nothing is eligible for garbage collection: - -``` -A -----> a <----- B - \--> b | - c <--/ -``` - -Manifest B is deleted via the API: - -``` -A -----> a B - \--> b - c -``` - -In this state layer `c` no longer has a reference and is eligible for garbage -collection. Layer `a` had one reference removed but will not be garbage -collected as it is still referenced by manifest `A`. The blob representing -manifest `B` will also be eligible for garbage collection. - -After garbage collection has been run manifest `A` and its blobs remain. - -``` -A -----> a - \--> b -``` - - -## How Garbage Collection works - -Garbage collection runs in two phases. First, in the 'mark' phase, the process -scans all the manifests in the registry. From these manifests, it constructs a -set of content address digests. This set is the 'mark set' and denotes the set -of blobs to *not* delete. Secondly, in the 'sweep' phase, the process scans all -the blobs and if a blob's content address digest is not in the mark set, the -process will delete it. - - -> **NOTE** You should ensure that the registry is in read-only mode or not running at -> all. If you were to upload an image while garbage collection is running, there is the -> risk that the image's layers will be mistakenly deleted, leading to a corrupted image. - -This type of garbage collection is known as stop-the-world garbage collection. In future -registry versions the intention is that garbage collection will be an automated background -action and this manual process will no longer apply. - - - -# Running garbage collection - -Garbage collection can be run as follows - -`bin/registry garbage-collect [--dry-run] /path/to/config.yml` - -The garbage-collect command accepts a `--dry-run` parameter, which will print the progress -of the mark and sweep phases without removing any data. Running with a log leve of `info` -will give a clear indication of what will and will not be deleted. - -_Sample output from a dry run garbage collection with registry log level set to `info`_ - -``` -hello-world -hello-world: marking manifest sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf -hello-world: marking blob sha256:03f4658f8b782e12230c1783426bd3bacce651ce582a4ffb6fbbfa2079428ecb -hello-world: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 -hello-world: marking configuration sha256:690ed74de00f99a7d00a98a5ad855ac4febd66412be132438f9b8dbd300a937d -ubuntu - -4 blobs marked, 5 blobs eligible for deletion -blob eligible for deletion: sha256:28e09fddaacbfc8a13f82871d9d66141a6ed9ca526cb9ed295ef545ab4559b81 -blob eligible for deletion: sha256:7e15ce58ccb2181a8fced7709e9893206f0937cc9543bc0c8178ea1cf4d7e7b5 -blob eligible for deletion: sha256:87192bdbe00f8f2a62527f36bb4c7c7f4eaf9307e4b87e8334fb6abec1765bcb -blob eligible for deletion: sha256:b549a9959a664038fc35c155a95742cf12297672ca0ae35735ec027d55bf4e97 -blob eligible for deletion: sha256:f251d679a7c61455f06d793e43c06786d7766c88b8c24edf242b2c08e3c3f599 -``` - diff --git a/vendor/github.com/docker/distribution/docs/glossary.md b/vendor/github.com/docker/distribution/docs/glossary.md deleted file mode 100644 index 8159b5202..000000000 --- a/vendor/github.com/docker/distribution/docs/glossary.md +++ /dev/null @@ -1,70 +0,0 @@ - - -# Glossary - -This page contains definitions for distribution related terms. - -
-

Blob

-
-
A blob is any kind of content that is stored by a Registry under a content-addressable identifier (a "digest").
-

- Layers are a good example of "blobs". -

-
- -

Image

-
-
An image is a named set of immutable data from which a Docker container can be created.
-

- An image is represented by a json file called a manifest, and is conceptually a set of layers. - - Image names indicate the location where they can be pulled from and pushed to, as they usually start with a registry domain name and port. - -

-
- -

Layer

-
-
A layer is a tar archive bundling partial content from a filesystem.
-

- Layers from an image are usually extracted in order on top of each other to make up a root filesystem from which containers run out. -

-
- -

Manifest

-
A manifest is the JSON representation of an image.
- -

Namespace

-
A namespace is a collection of repositories with a common name prefix.
-

- The namespace with an empty prefix is considered the Global Namespace. -

-
- -

Registry

-
A registry is a service that let you store and deliver images.
-
- -

Repository

-
-
A repository is a set of data containing all versions of a given image.
-
- -

Scope

-
A scope is the portion of a namespace onto which a given authorization token is granted.
- -

Tag

-
A tag is conceptually a "version" of a named image.
-

- Example: `docker pull myimage:latest` instructs docker to pull the image "myimage" in version "latest". -

- -
- - -
diff --git a/vendor/github.com/docker/distribution/docs/help.md b/vendor/github.com/docker/distribution/docs/help.md deleted file mode 100644 index 77ec378f7..000000000 --- a/vendor/github.com/docker/distribution/docs/help.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# Getting help - -If you need help, or just want to chat, you can reach us: - -- on irc: `#docker-distribution` on freenode -- on the [mailing list](https://groups.google.com/a/dockerproject.org/forum/#!forum/distribution) (mail at ) - -If you want to report a bug: - -- be sure to first read about [how to contribute](https://github.com/docker/distribution/blob/master/CONTRIBUTING.md) -- you can then do so on the [GitHub project bugtracker](https://github.com/docker/distribution/issues) - -You can also find out more about the Docker's project [Getting Help resources](/opensource/get-help.md). diff --git a/vendor/github.com/docker/distribution/docs/images/notifications.gliffy b/vendor/github.com/docker/distribution/docs/images/notifications.gliffy deleted file mode 100644 index 5ecf4c3ae..000000000 --- a/vendor/github.com/docker/distribution/docs/images/notifications.gliffy +++ /dev/null @@ -1 +0,0 @@ -{"contentType":"application/gliffy+json","version":"1.3","stage":{"background":"#FFFFFF","width":737,"height":630,"nodeIndex":171,"autoFit":true,"exportBorder":false,"gridOn":true,"snapToGrid":true,"drawingGuidesOn":true,"pageBreaksOn":false,"printGridOn":false,"printPaper":"LETTER","printShrinkToFit":false,"printPortrait":true,"maxWidth":5000,"maxHeight":5000,"themeData":null,"viewportType":"default","fitBB":{"min":{"x":290,"y":83},"max":{"x":736.5,"y":630}},"objects":[{"x":699.0,"y":246.0,"rotation":0.0,"id":166,"width":100.0,"height":100.0,"uid":"com.gliffy.shape.basic.basic_v1.default.line","order":29,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Line","Line":{"strokeWidth":2.0,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","interpolationType":"linear","cornerRadius":10.0,"controlPath":[[-30.0,-12.0],[-30.0,59.5],[33.0,59.5],[33.0,131.0]],"lockSegments":{},"ortho":true}},"linkMap":[]},{"x":632.0,"y":243.0,"rotation":0.0,"id":165,"width":100.0,"height":100.0,"uid":"com.gliffy.shape.basic.basic_v1.default.line","order":28,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Line","Line":{"strokeWidth":2.0,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","interpolationType":"linear","cornerRadius":10.0,"controlPath":[[-25.0,-11.0],[-25.0,64.5],[-88.0,64.5],[-88.0,140.0]],"lockSegments":{},"ortho":true}},"linkMap":[],"children":[]},{"x":512.0,"y":203.0,"rotation":0.0,"id":161,"width":100.0,"height":100.0,"uid":"com.gliffy.shape.basic.basic_v1.default.line","order":27,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Line","Line":{"strokeWidth":2.0,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","interpolationType":"linear","cornerRadius":null,"controlPath":[[-19.0,-3.0],[79.12746812182615,-3.0]],"lockSegments":{},"ortho":false}},"linkMap":[],"children":[]},{"x":589.9999999999999,"y":167.5,"rotation":0.0,"id":143,"width":101.11111111111111,"height":65.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.rectangle","order":2,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":0.0,"shadowY":0.0}},"linkMap":[],"children":[{"x":0.722222222222222,"y":0.0,"rotation":0.0,"id":144,"width":99.66666666666663,"height":16.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":2,"paddingRight":2,"paddingBottom":2,"paddingLeft":2,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Broadcaster

","tid":null,"valign":"middle","vposition":"none","hposition":"none"}}}]},{"x":290.0,"y":105.0,"rotation":0.0,"id":160,"width":210.0,"height":190.0,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":26,"lockAspectRatio":false,"lockShape":false,"children":[{"x":12.92581625076238,"y":17.018834253729665,"rotation":0.0,"id":155,"width":189.57418374923762,"height":151.48116574627034,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":25,"lockAspectRatio":false,"lockShape":false,"children":[{"x":97.57418374923762,"y":58.481165746270335,"rotation":90.0,"id":151,"width":149.0,"height":37.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_bottom","order":21,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":153,"magnitude":1},{"id":154,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":8.0,"rotation":0.0,"id":152,"width":149.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":151,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":8.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":151,"magnitude":1},{"id":154,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":151,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":153,"width":149.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":151,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":10,"paddingBottom":8,"paddingLeft":10,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Listener

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":67.5,"y":1.0,"rotation":0.0,"id":154,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":152,"px":0.5,"py":0.0,"xOffset":-7.0,"yOffset":-7.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_bottom","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":10.074195639419855,"y":17.481165746270335,"rotation":0.0,"id":150,"width":120.0,"height":119.0,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":20,"lockAspectRatio":false,"lockShape":false,"children":[{"x":1.0,"y":80.5,"rotation":0.0,"id":133,"width":117.0,"height":38.5,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_bottom","order":16,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":135,"magnitude":1},{"id":136,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":8.0,"rotation":0.0,"id":134,"width":117.0,"height":30.5,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":133,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":8.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":133,"magnitude":1},{"id":136,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":133,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":135,"width":117.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":133,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":10,"paddingBottom":8,"paddingLeft":10,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

handler

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":51.5,"y":1.0,"rotation":0.0,"id":136,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":134,"px":0.5,"py":0.0,"xOffset":-7.0,"yOffset":-7.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_bottom","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":0.0,"y":39.0,"rotation":0.0,"id":129,"width":120.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":12,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":131,"magnitude":1},{"id":132,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":130,"width":120.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":129,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":129,"magnitude":1},{"id":132,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":129,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":131,"width":120.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":129,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

repository

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":53.0,"y":31.0,"rotation":0.0,"id":132,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":130,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":0.0,"y":0.0,"rotation":0.0,"id":125,"width":120.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":8,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":127,"magnitude":1},{"id":128,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":126,"width":120.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":125,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":125,"magnitude":1},{"id":128,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":125,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":127,"width":120.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":125,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

request

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":53.0,"y":31.0,"rotation":0.0,"id":128,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":126,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]}]},{"x":0.5154455517800614,"y":0.5154455517799761,"rotation":90.39513704250749,"id":145,"width":150.0,"height":150.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_bottom","order":4,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":147,"magnitude":1},{"id":148,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":8.0,"rotation":0.0,"id":146,"width":150.0,"height":142.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":145,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":8.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":145,"magnitude":1},{"id":148,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":145,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":147,"width":150.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":145,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":10,"paddingBottom":8,"paddingLeft":10,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

 

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":68.0,"y":0.9999999999999432,"rotation":0.0,"id":148,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":146,"px":0.5,"py":0.0,"xOffset":-7.0,"yOffset":-7.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_bottom","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]}]},{"x":0.0,"y":0.0,"rotation":0.0,"id":156,"width":210.0,"height":190.0,"uid":"com.gliffy.shape.basic.basic_v1.default.rectangle","order":0,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2.0,"strokeColor":"#434343","fillColor":"#ffffff","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":0.0,"shadowY":0.0}},"linkMap":[],"children":[{"x":2.0,"y":0.0,"rotation":0.0,"id":159,"width":206.0,"height":16.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Registry instance

","tid":null,"valign":"middle","vposition":"above","hposition":"none"}}}]}]},{"x":473.0,"y":525.0,"rotation":0.0,"id":115,"width":100.0,"height":100.0,"uid":"com.gliffy.shape.basic.basic_v1.default.line","order":69,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":68,"py":1.0,"px":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":109,"py":0.0,"px":0.5}}},"graphic":{"type":"Line","Line":{"strokeWidth":2.0,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","interpolationType":"linear","cornerRadius":10.0,"controlPath":[[2.0,4.5],[2.0,11.533649282003012],[2.0,18.567298564006137],[2.0,25.60094784600915]],"lockSegments":{},"ortho":true}},"linkMap":[]},{"x":665.0,"y":530.0,"rotation":0.0,"id":114,"width":100.0,"height":100.0,"uid":"com.gliffy.shape.basic.basic_v1.default.line","order":68,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":100,"py":1.0,"px":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":112,"py":0.0,"px":0.5}}},"graphic":{"type":"Line","Line":{"strokeWidth":2.0,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","interpolationType":"linear","cornerRadius":10.0,"controlPath":[[-2.0,-0.5],[-2.0,6.533649282003012],[-2.0,13.567298564006137],[-2.0,20.60094784600915]],"lockSegments":{},"ortho":true}},"linkMap":[]},{"x":598.0,"y":550.0,"rotation":0.0,"id":112,"width":120.0,"height":80.0,"uid":"com.gliffy.shape.network.network_v3.home.cloud","order":66,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.cloud.network_v3","strokeWidth":2.0,"strokeColor":"#000000","fillColor":"#000000","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":0.0,"shadowY":0.0}},"linkMap":[],"children":[{"x":2.0,"y":0.0,"rotation":0.0,"id":113,"width":116.00000000000001,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":2,"paddingRight":2,"paddingBottom":2,"paddingLeft":2,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Remote

Endpoint_N

","tid":null,"valign":"middle","vposition":"none","hposition":"none"}}}]},{"x":420.0,"y":550.0,"rotation":0.0,"id":109,"width":120.0,"height":80.0,"uid":"com.gliffy.shape.network.network_v3.home.cloud","order":64,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.cloud.network_v3","strokeWidth":2.0,"strokeColor":"#000000","fillColor":"#000000","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":0.0,"shadowY":0.0}},"linkMap":[],"children":[{"x":2.0,"y":0.0,"rotation":0.0,"id":111,"width":116.00000000000001,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":2,"paddingRight":2,"paddingBottom":2,"paddingLeft":2,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Remote

Endpoint_1

","tid":null,"valign":"middle","vposition":"none","hposition":"none"}}}]},{"x":540.0,"y":438.5,"rotation":0.0,"id":104,"width":50.0,"height":16.0,"uid":"com.gliffy.shape.basic.basic_v1.default.text","order":63,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":2,"paddingRight":2,"paddingBottom":2,"paddingLeft":2,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

. . .

","tid":null,"valign":"middle","vposition":"none","hposition":"none"}},"linkMap":[]},{"x":410.0,"y":379.5,"rotation":0.0,"id":103,"width":130.0,"height":150.0,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":62,"lockAspectRatio":false,"lockShape":false,"children":[{"x":15.0,"y":20.0,"rotation":0.0,"id":84,"width":100.0,"height":117.0,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":45,"lockAspectRatio":false,"lockShape":false,"children":[{"x":0.0,"y":78.0,"rotation":0.0,"id":80,"width":100.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":41,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":82,"magnitude":1},{"id":83,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":81,"width":100.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":80,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":80,"magnitude":1},{"id":83,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":80,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":82,"width":100.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":80,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

http

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":43.0,"y":31.0,"rotation":0.0,"id":83,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":81,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":0.0,"y":39.0,"rotation":0.0,"id":76,"width":100.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":37,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":78,"magnitude":1},{"id":79,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":77,"width":100.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":76,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":76,"magnitude":1},{"id":79,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":76,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":78,"width":100.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":76,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

retry

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":43.0,"y":31.0,"rotation":0.0,"id":79,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":77,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":0.0,"y":0.0,"rotation":0.0,"id":72,"width":100.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":33,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":74,"magnitude":1},{"id":75,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":73,"width":100.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":72,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":72,"magnitude":1},{"id":75,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":72,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":74,"width":100.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":72,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

queue

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":43.0,"y":31.0,"rotation":0.0,"id":75,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":73,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]}]},{"x":0.0,"y":0.0,"rotation":0.0,"id":68,"width":130.0,"height":150.0,"uid":"com.gliffy.shape.sitemap.sitemap_v1.default.download","order":31,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.download.sitemap_v1","strokeWidth":2.0,"strokeColor":"#666666","fillColor":"#ffffff","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":0.0,"shadowY":0.0}},"linkMap":[],"children":[{"x":2.0,"y":0.0,"rotation":0.0,"id":71,"width":126.0,"height":14.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":2,"paddingRight":2,"paddingBottom":2,"paddingLeft":2,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Endpoint_1

","tid":null,"valign":"middle","vposition":"above","hposition":"none"}}}]}]},{"x":598.0,"y":379.5,"rotation":0.0,"id":102,"width":130.0,"height":150.0,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":61,"lockAspectRatio":false,"lockShape":false,"children":[{"x":15.0,"y":20.0,"rotation":0.0,"id":87,"width":100.0,"height":117.0,"uid":"com.gliffy.shape.basic.basic_v1.default.group","order":60,"lockAspectRatio":false,"lockShape":false,"children":[{"x":0.0,"y":78.0,"rotation":0.0,"id":88,"width":100.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":56,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":90,"magnitude":1},{"id":91,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":89,"width":100.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":88,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":88,"magnitude":1},{"id":91,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":88,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":90,"width":100.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":88,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

http

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":43.0,"y":31.0,"rotation":0.0,"id":91,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":89,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":0.0,"y":39.0,"rotation":0.0,"id":92,"width":100.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":52,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":94,"magnitude":1},{"id":95,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":93,"width":100.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":92,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":92,"magnitude":1},{"id":95,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":92,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":94,"width":100.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":92,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

retry

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":43.0,"y":31.0,"rotation":0.0,"id":95,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":93,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]},{"x":0.0,"y":0.0,"rotation":0.0,"id":96,"width":100.0,"height":40.0,"uid":"com.gliffy.shape.ui.ui_v3.containers_content.popover_top","order":48,"lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"MinWidthConstraint","MinWidthConstraint":{"width":100}},{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":98,"magnitude":1},{"id":99,"magnitude":1}],"minHeight":0.0,"growParent":false,"padding":0.0}}]},"linkMap":[],"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":97,"width":100.0,"height":32.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":96,"px":0.0,"py":0.0,"xOffset":0.0,"yOffset":0.0}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":96,"magnitude":1},{"id":99,"magnitude":-1}],"minHeight":0.0,"growParent":false,"padding":0.0}},{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":96,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[{"x":0.0,"y":0.0,"rotation":0.0,"id":98,"width":100.0,"height":29.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"WidthConstraint","WidthConstraint":{"isMin":false,"widthInfo":[{"id":96,"magnitude":1}],"minWidth":0.0,"growParent":false,"padding":0.0}}]},"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":8,"paddingRight":8,"paddingBottom":8,"paddingLeft":8,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

queue

","tid":null,"valign":"top","vposition":"none","hposition":"none"}}}]},{"x":43.0,"y":31.0,"rotation":0.0,"id":99,"width":15.0,"height":8.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"constraints":{"constraints":[{"type":"ConstWidthConstraint","ConstWidthConstraint":{"width":15}},{"type":"ConstHeightConstraint","ConstHeightConstraint":{"height":8}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":97,"px":0.5,"py":1.0,"xOffset":-7.0,"yOffset":-1.0}}]},"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ui.ui_v3.containers_content.popover_top","strokeWidth":2.0,"strokeColor":"#BBBBBB","fillColor":"#FFFFFF","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":4.0,"shadowY":4.0}},"children":[]}]}]},{"x":0.0,"y":0.0,"rotation":0.0,"id":100,"width":130.0,"height":150.0,"uid":"com.gliffy.shape.sitemap.sitemap_v1.default.download","order":46,"lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.download.sitemap_v1","strokeWidth":2.0,"strokeColor":"#666666","fillColor":"#ffffff","gradient":false,"dashStyle":null,"dropShadow":false,"state":0,"opacity":1.0,"shadowX":0.0,"shadowY":0.0}},"linkMap":[],"children":[{"x":2.0,"y":0.0,"rotation":0.0,"id":101,"width":126.0,"height":14.0,"uid":null,"order":"auto","lockAspectRatio":false,"lockShape":false,"graphic":{"type":"Text","Text":{"overflow":"none","paddingTop":2,"paddingRight":2,"paddingBottom":2,"paddingLeft":2,"outerPaddingTop":6,"outerPaddingRight":6,"outerPaddingBottom":2,"outerPaddingLeft":6,"type":"fixed","lineTValue":null,"linePerpValue":null,"cardinalityType":null,"html":"

Endpoint_N

","tid":null,"valign":"middle","vposition":"above","hposition":"none"}}}]}]}],"shapeStyles":{"com.gliffy.shape.sitemap.sitemap_v1.default":{"fill":"#ffffff","stroke":"#666666","strokeWidth":2},"com.gliffy.shape.network.network_v3.home":{"fill":"#000000"},"com.gliffy.shape.network.network_v3.business":{"fill":"#003366"},"com.gliffy.shape.basic.basic_v1.default":{"fill":"#FFFFFF","stroke":"#434343","strokeWidth":2}},"lineStyles":{"global":{"endArrow":1}},"textStyles":{"global":{"size":"14px"}}},"metadata":{"title":"untitled","revision":0,"exportBorder":false,"loadPosition":"default","libraries":["com.gliffy.libraries.sitemap.sitemap_v2","com.gliffy.libraries.sitemap.sitemap_v1.default","com.gliffy.libraries.ui.ui_v3.containers_content","com.gliffy.libraries.table.table_v2.default","com.gliffy.libraries.ui.ui_v3.navigation","com.gliffy.libraries.ui.ui_v3.forms_controls","com.gliffy.libraries.ui.ui_v3.icon_symbols","com.gliffy.libraries.ui.ui_v2.forms_components","com.gliffy.libraries.ui.ui_v2.content","com.gliffy.libraries.ui.ui_v2.miscellaneous","com.gliffy.libraries.network.network_v3.home","com.gliffy.libraries.network.network_v3.business","com.gliffy.libraries.network.network_v3.rack","com.gliffy.libraries.uml.uml_v2.class","com.gliffy.libraries.uml.uml_v2.sequence","com.gliffy.libraries.uml.uml_v2.activity","com.gliffy.libraries.uml.uml_v2.state_machine","com.gliffy.libraries.uml.uml_v2.deployment","com.gliffy.libraries.uml.uml_v2.use_case","com.gliffy.libraries.erd.erd_v1.default","com.gliffy.libraries.flowchart.flowchart_v1.default","com.gliffy.libraries.swimlanes.swimlanes_v1.default","com.gliffy.libraries.uml.uml_v2.component","com.gliffy.libraries.basic.basic_v1.default","com.gliffy.libraries.images"]},"embeddedResources":{"index":0,"resources":[]}} \ No newline at end of file diff --git a/vendor/github.com/docker/distribution/docs/images/notifications.png b/vendor/github.com/docker/distribution/docs/images/notifications.png deleted file mode 100644 index 09de8d237..000000000 Binary files a/vendor/github.com/docker/distribution/docs/images/notifications.png and /dev/null differ diff --git a/vendor/github.com/docker/distribution/docs/images/notifications.svg b/vendor/github.com/docker/distribution/docs/images/notifications.svg deleted file mode 100644 index 6c3d680b9..000000000 --- a/vendor/github.com/docker/distribution/docs/images/notifications.svg +++ /dev/null @@ -1 +0,0 @@ -Registry instanceBroadcaster requestrepositoryhandlerListenerEndpoint_1queueretryhttpEndpoint_Nqueueretryhttp. . .RemoteEndpoint_1RemoteEndpoint_N \ No newline at end of file diff --git a/vendor/github.com/docker/distribution/docs/images/v2-registry-auth.png b/vendor/github.com/docker/distribution/docs/images/v2-registry-auth.png deleted file mode 100644 index 7f90c7381..000000000 Binary files a/vendor/github.com/docker/distribution/docs/images/v2-registry-auth.png and /dev/null differ diff --git a/vendor/github.com/docker/distribution/docs/index.md b/vendor/github.com/docker/distribution/docs/index.md deleted file mode 100644 index 21ec7a9a9..000000000 --- a/vendor/github.com/docker/distribution/docs/index.md +++ /dev/null @@ -1,67 +0,0 @@ - - -# Docker Registry - -## What it is - -The Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker images. -The Registry is open-source, under the permissive [Apache license](http://en.wikipedia.org/wiki/Apache_License). - -## Why use it - -You should use the Registry if you want to: - - * tightly control where your images are being stored - * fully own your images distribution pipeline - * integrate image storage and distribution tightly into your in-house development workflow - -## Alternatives - -Users looking for a zero maintenance, ready-to-go solution are encouraged to head-over to the [Docker Hub](https://hub.docker.com), which provides a free-to-use, hosted Registry, plus additional features (organization accounts, automated builds, and more). - -Users looking for a commercially supported version of the Registry should look into [Docker Trusted Registry](https://docs.docker.com/docker-trusted-registry/overview/). - -## Requirements - -The Registry is compatible with Docker engine **version 1.6.0 or higher**. -If you really need to work with older Docker versions, you should look into the [old python registry](https://github.com/docker/docker-registry). - -## TL;DR - -Start your registry - - docker run -d -p 5000:5000 --name registry registry:2 - -Pull (or build) some image from the hub - - docker pull ubuntu - -Tag the image so that it points to your registry - - docker tag ubuntu localhost:5000/myfirstimage - -Push it - - docker push localhost:5000/myfirstimage - -Pull it back - - docker pull localhost:5000/myfirstimage - -Now stop your registry and remove all data - - docker stop registry && docker rm -v registry - -## Next - -You should now read the [detailed introduction about the registry](introduction.md), or jump directly to [deployment instructions](deploying.md). diff --git a/vendor/github.com/docker/distribution/docs/insecure.md b/vendor/github.com/docker/distribution/docs/insecure.md deleted file mode 100644 index 4b7917d2b..000000000 --- a/vendor/github.com/docker/distribution/docs/insecure.md +++ /dev/null @@ -1,116 +0,0 @@ - - -# Insecure Registry - -While it's highly recommended to secure your registry using a TLS certificate -issued by a known CA, you may alternatively decide to use self-signed -certificates, or even use your registry over plain http. - -You have to understand the downsides in doing so, and the extra burden in -configuration. - -## Deploying a plain HTTP registry - -> **Warning**: it's not possible to use an insecure registry with basic authentication. - -This basically tells Docker to entirely disregard security for your registry. -While this is relatively easy to configure the daemon in this way, it is -**very** insecure. It does expose your registry to trivial MITM. Only use this -solution for isolated testing or in a tightly controlled, air-gapped -environment. - -1. Open the `/etc/default/docker` file or `/etc/sysconfig/docker` for editing. - - Depending on your operating system, your Engine daemon start options. - -2. Edit (or add) the `DOCKER_OPTS` line and add the `--insecure-registry` flag. - - This flag takes the URL of your registry, for example. - - `DOCKER_OPTS="--insecure-registry myregistrydomain.com:5000"` - -3. Close and save the configuration file. - -4. Restart your Docker daemon - - The command you use to restart the daemon depends on your operating system. - For example, on Ubuntu, this is usually the `service docker stop` and `service - docker start` command. - -5. Repeat this configuration on every Engine host that wants to access your registry. - - -## Using self-signed certificates - -> **Warning**: using this along with basic authentication requires to **also** trust the certificate into the OS cert store for some versions of docker (see below) - -This is more secure than the insecure registry solution. You must configure every docker daemon that wants to access your registry - -1. Generate your own certificate: - -``` - mkdir -p certs && openssl req \ - -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key \ - -x509 -days 365 -out certs/domain.crt -``` - -2. Be sure to use the name `myregistrydomain.com` as a CN. - -3. Use the result to [start your registry with TLS enabled](./deploying.md#get-a-certificate) - -4. Instruct every docker daemon to trust that certificate. - - This is done by copying the `domain.crt` file to `/etc/docker/certs.d/myregistrydomain.com:5000/ca.crt`. - -5. Don't forget to restart the Engine daemon. - -## Troubleshooting insecure registry - -This sections lists some common failures and how to recover from them. - -### Failing... - -Failing to configure the Engine daemon and trying to pull from a registry that is not using -TLS will results in the following message: - -``` -FATA[0000] Error response from daemon: v1 ping attempt failed with error: -Get https://myregistrydomain.com:5000/v1/_ping: tls: oversized record received with length 20527. -If this private registry supports only HTTP or HTTPS with an unknown CA certificate,please add -`--insecure-registry myregistrydomain.com:5000` to the daemon's arguments. -In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; -simply place the CA certificate at /etc/docker/certs.d/myregistrydomain.com:5000/ca.crt -``` - -### Docker still complains about the certificate when using authentication? - -When using authentication, some versions of docker also require you to trust the certificate at the OS level. Usually, on Ubuntu this is done with: - -```bash -$ cp certs/domain.crt /usr/local/share/ca-certificates/myregistrydomain.com.crt -update-ca-certificates -``` - -... and on Red Hat (and its derivatives) with: - -```bash -cp certs/domain.crt /etc/pki/ca-trust/source/anchors/myregistrydomain.com.crt -update-ca-trust -``` - -... On some distributions, e.g. Oracle Linux 6, the Shared System Certificates feature needs to be manually enabled: - -```bash -$ update-ca-trust enable -``` - -Now restart docker (`service docker stop && service docker start`, or any other way you use to restart docker). diff --git a/vendor/github.com/docker/distribution/docs/introduction.md b/vendor/github.com/docker/distribution/docs/introduction.md deleted file mode 100644 index eceb5ffc1..000000000 --- a/vendor/github.com/docker/distribution/docs/introduction.md +++ /dev/null @@ -1,55 +0,0 @@ - - -# Understanding the Registry - -A registry is a storage and content delivery system, holding named Docker images, available in different tagged versions. - - > Example: the image `distribution/registry`, with tags `2.0` and `2.1`. - -Users interact with a registry by using docker push and pull commands. - - > Example: `docker pull registry-1.docker.io/distribution/registry:2.1`. - -Storage itself is delegated to drivers. The default storage driver is the local posix filesystem, which is suitable for development or small deployments. Additional cloud-based storage drivers like S3, Microsoft Azure, OpenStack Swift and Aliyun OSS are also supported. People looking into using other storage backends may do so by writing their own driver implementing the [Storage API](storage-drivers/index.md). - -Since securing access to your hosted images is paramount, the Registry natively supports TLS and basic authentication. - -The Registry GitHub repository includes additional information about advanced authentication and authorization methods. Only very large or public deployments are expected to extend the Registry in this way. - -Finally, the Registry ships with a robust [notification system](notifications.md), calling webhooks in response to activity, and both extensive logging and reporting, mostly useful for large installations that want to collect metrics. - -## Understanding image naming - -Image names as used in typical docker commands reflect their origin: - - * `docker pull ubuntu` instructs docker to pull an image named `ubuntu` from the official Docker Hub. This is simply a shortcut for the longer `docker pull docker.io/library/ubuntu` command - * `docker pull myregistrydomain:port/foo/bar` instructs docker to contact the registry located at `myregistrydomain:port` to find the image `foo/bar` - -You can find out more about the various Docker commands dealing with images in the [official Docker engine documentation](/engine/reference/commandline/cli.md). - -## Use cases - -Running your own Registry is a great solution to integrate with and complement your CI/CD system. In a typical workflow, a commit to your source revision control system would trigger a build on your CI system, which would then push a new image to your Registry if the build is successful. A notification from the Registry would then trigger a deployment on a staging environment, or notify other systems that a new image is available. - -It's also an essential component if you want to quickly deploy a new image over a large cluster of machines. - -Finally, it's the best way to distribute images inside an isolated network. - -## Requirements - -You absolutely need to be familiar with Docker, specifically with regard to pushing and pulling images. You must understand the difference between the daemon and the cli, and at least grasp basic concepts about networking. - -Also, while just starting a registry is fairly easy, operating it in a production environment requires operational skills, just like any other service. You are expected to be familiar with systems availability and scalability, logging and log processing, systems monitoring, and security 101. Strong understanding of http and overall network communications, plus familiarity with golang are certainly useful as well for advanced operations or hacking. - -## Next - -Dive into [deploying your registry](deploying.md) diff --git a/vendor/github.com/docker/distribution/docs/menu.md b/vendor/github.com/docker/distribution/docs/menu.md deleted file mode 100644 index 7e24a6907..000000000 --- a/vendor/github.com/docker/distribution/docs/menu.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# Overview of Docker Registry Documentation - -The Docker Registry documentation includes the following topics: - -* [Docker Registry Introduction](index.md) -* [Understanding the Registry](introduction.md) -* [Deploying a registry server](deploying.md) -* [Registry Configuration Reference](configuration.md) -* [Notifications](notifications.md) -* [Recipes](recipes/index.md) -* [Getting help](help.md) diff --git a/vendor/github.com/docker/distribution/docs/migration.md b/vendor/github.com/docker/distribution/docs/migration.md deleted file mode 100644 index da0aba91a..000000000 --- a/vendor/github.com/docker/distribution/docs/migration.md +++ /dev/null @@ -1,30 +0,0 @@ - - -# Migrating a 1.0 registry to 2.0 - -TODO: This needs to be revised in light of Olivier's work - -A few thoughts here: - -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. -The image formats are not compatible in any way. One must convert v1 images to v2 images using a docker client or other tool. -One can migrate images from one version to the other by pulling images from the old registry and pushing them to the v2 registry. - ------ - -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: - -1. Configure and test a 2.0 registry image in a sandbox environment. - -2. Back up up your production image storage. - - Your production image storage should reside on a volume or storage backend. - Make sure you have a backup of its contents. - -3. Stop your existing registry service. - -4. Restart your registry with your tested 2.0 image. diff --git a/vendor/github.com/docker/distribution/docs/notifications.md b/vendor/github.com/docker/distribution/docs/notifications.md deleted file mode 100644 index c511eb59e..000000000 --- a/vendor/github.com/docker/distribution/docs/notifications.md +++ /dev/null @@ -1,350 +0,0 @@ - - -# Notifications - -The Registry supports sending webhook notifications in response to events -happening within the registry. Notifications are sent in response to manifest -pushes and pulls and layer pushes and pulls. These actions are serialized into -events. The events are queued into a registry-internal broadcast system which -queues and dispatches events to [_Endpoints_](#endpoints). - -![](images/notifications.png) - -## Endpoints - -Notifications are sent to _endpoints_ via HTTP requests. Each configured -endpoint has isolated queues, retry configuration and http targets within each -instance of a registry. When an action happens within the registry, it is -converted into an event which is dropped into an inmemory queue. When the -event reaches the end of the queue, an http request is made to the endpoint -until the request succeeds. The events are sent serially to each endpoint but -order is not guaranteed. - -## Configuration - -To setup a registry instance to send notifications to endpoints, one must add -them to the configuration. A simple example follows: - - notifications: - endpoints: - - name: alistener - url: https://mylistener.example.com/event - headers: - Authorization: [Bearer ] - timeout: 500ms - threshold: 5 - backoff: 1s - -The above would configure the registry with an endpoint to send events to -`https://mylistener.example.com/event`, with the header "Authorization: Bearer -". The request would timeout after 500 milliseconds. If -5 failures happen consecutively, the registry will backoff for 1 second before -trying again. - -For details on the fields, please see the [configuration documentation](configuration.md#notifications). - -A properly configured endpoint should lead to a log message from the registry -upon startup: - -``` -INFO[0000] configuring endpoint alistener (https://mylistener.example.com/event), timeout=500ms, headers=map[Authorization:[Bearer ]] app.id=812bfeb2-62d6-43cf-b0c6-152f541618a3 environment=development service=registry -``` - -## Events - -Events have a well-defined JSON structure and are sent as the body of -notification requests. One or more events are sent in a structure called an -envelope. Each event has a unique id that can be used to uniquely identify incoming -requests, if required. Along with that, an _action_ is provided with a -_target_, identifying the object mutated during the event. - -The fields available in an `event` are described below. - -Field | Type | Description ------ | ----- | ------------- -id | string |ID provides a unique identifier for the event. -timestamp | Time | Timestamp is the time at which the event occurred. -action | string | Action indicates what action encompasses the provided event. -target | distribution.Descriptor | Target uniquely describes the target of the event. -length | int | Length in bytes of content. Same as Size field in Descriptor. -repository | string | Repository identifies the named repository. -fromRepository | string | FromRepository identifies the named repository which a blob was mounted from if appropriate. -url | string | URL provides a direct link to the content. -tag | string | Tag identifies a tag name in tag events -request | [RequestRecord](https://godoc.org/github.com/docker/distribution/notifications#RequestRecord) | Request covers the request that generated the event. -actor | [ActorRecord](https://godoc.org/github.com/docker/distribution/notifications#ActorRecord). | Actor specifies the agent that initiated the event. For most situations, this could be from the authorization context of the request. -source | [SourceRecord](https://godoc.org/github.com/docker/distribution/notifications#SourceRecord) | Source identifies the registry node that generated the event. Put differently, while the actor "initiates" the event, the source "generates" it. - - - -The following is an example of a JSON event, sent in response to the push of a -manifest: - -```json -{ - "events": [ - { - "id": "320678d8-ca14-430f-8bb6-4ca139cd83f7", - "timestamp": "2016-03-09T14:44:26.402973972-08:00", - "action": "pull", - "target": { - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", - "size": 708, - "digest": "sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf", - "length": 708, - "repository": "hello-world", - "url": "http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf", - "tag": "latest" - }, - "request": { - "id": "6df24a34-0959-4923-81ca-14f09767db19", - "addr": "192.168.64.11:42961", - "host": "192.168.100.227:5000", - "method": "GET", - "useragent": "curl/7.38.0" - }, - "actor": {}, - "source": { - "addr": "xtal.local:5000", - "instanceID": "a53db899-3b4b-4a62-a067-8dd013beaca4" - } - } - ] -} -``` - - -The target struct of events which are sent when manifests and blobs are deleted -will contain a subset of the data contained in Get and Put events. Specifically, -only the digest and repository will be sent. - -```json -"target": { - "digest": "sha256:d89e1bee20d9cb344674e213b581f14fbd8e70274ecf9d10c514bab78a307845", - "repository": "library/test" -}, -``` - -> __NOTE:__ As of version 2.1, the `length` field for event targets -> is being deprecated for the `size` field, bringing the target in line with -> common nomenclature. Both will continue to be set for the foreseeable -> future. Newer code should favor `size` but accept either. - -## Envelope - -The envelope contains one or more events, with the following json structure: - -```json -{ - "events": [ ... ], -} -``` - -While events may be sent in the same envelope, the set of events within that -envelope have no implied relationship. For example, the registry may choose to -group unrelated events and send them in the same envelope to reduce the total -number of requests. - -The full package has the mediatype -"application/vnd.docker.distribution.events.v1+json", which will be set on the -request coming to an endpoint. - -An example of a full event may look as follows: - -```json -GET /callback -Host: application/vnd.docker.distribution.events.v1+json -Authorization: Bearer -Content-Type: application/vnd.docker.distribution.events.v1+json - -{ - "events": [ - { - "id": "asdf-asdf-asdf-asdf-0", - "timestamp": "2006-01-02T15:04:05Z", - "action": "push", - "target": { - "mediaType": "application/vnd.docker.distribution.manifest.v1+json", - "length": 1, - "digest": "sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf", - "repository": "library/test", - "url": "http://example.com/v2/library/test/manifests/sha256:c3b3692957d439ac1928219a83fac91e7bf96c153725526874673ae1f2023f8d5" - }, - "request": { - "id": "asdfasdf", - "addr": "client.local", - "host": "registrycluster.local", - "method": "PUT", - "useragent": "test/0.1" - }, - "actor": { - "name": "test-actor" - }, - "source": { - "addr": "hostname.local:port" - } - }, - { - "id": "asdf-asdf-asdf-asdf-1", - "timestamp": "2006-01-02T15:04:05Z", - "action": "push", - "target": { - "mediaType": "application/vnd.docker.container.image.rootfs.diff+x-gtar", - "length": 2, - "digest": "sha256:c3b3692957d439ac1928219a83fac91e7bf96c153725526874673ae1f2023f8d5", - "repository": "library/test", - "url": "http://example.com/v2/library/test/blobs/sha256:c3b3692957d439ac1928219a83fac91e7bf96c153725526874673ae1f2023f8d5" - }, - "request": { - "id": "asdfasdf", - "addr": "client.local", - "host": "registrycluster.local", - "method": "PUT", - "useragent": "test/0.1" - }, - "actor": { - "name": "test-actor" - }, - "source": { - "addr": "hostname.local:port" - } - }, - { - "id": "asdf-asdf-asdf-asdf-2", - "timestamp": "2006-01-02T15:04:05Z", - "action": "push", - "target": { - "mediaType": "application/vnd.docker.container.image.rootfs.diff+x-gtar", - "length": 3, - "digest": "sha256:c3b3692957d439ac1928219a83fac91e7bf96c153725526874673ae1f2023f8d5", - "repository": "library/test", - "url": "http://example.com/v2/library/test/blobs/sha256:c3b3692957d439ac1928219a83fac91e7bf96c153725526874673ae1f2023f8d5" - }, - "request": { - "id": "asdfasdf", - "addr": "client.local", - "host": "registrycluster.local", - "method": "PUT", - "useragent": "test/0.1" - }, - "actor": { - "name": "test-actor" - }, - "source": { - "addr": "hostname.local:port" - } - } - ] -} -``` - -## Responses - -The registry is fairly accepting of the response codes from endpoints. If an -endpoint responds with any 2xx or 3xx response code (after following -redirects), the message will be considered delivered and discarded. - -In turn, it is recommended that endpoints are accepting of incoming responses, -as well. While the format of event envelopes are standardized by media type, -any "pickyness" about validation may cause the queue to backup on the -registry. - -## Monitoring - -The state of the endpoints are reported via the debug/vars http interface, -usually configured to `http://localhost:5001/debug/vars`. Information such as -configuration and metrics are available by endpoint. - -The following provides an example of a few endpoints that have experienced -several failures and have since recovered: - -```json -"notifications":{ - "endpoints":[ - { - "name":"local-5003", - "url":"http://localhost:5003/callback", - "Headers":{ - "Authorization":[ - "Bearer \u003can example token\u003e" - ] - }, - "Timeout":1000000000, - "Threshold":10, - "Backoff":1000000000, - "Metrics":{ - "Pending":76, - "Events":76, - "Successes":0, - "Failures":0, - "Errors":46, - "Statuses":{ - - } - } - }, - { - "name":"local-8083", - "url":"http://localhost:8083/callback", - "Headers":null, - "Timeout":1000000000, - "Threshold":10, - "Backoff":1000000000, - "Metrics":{ - "Pending":0, - "Events":76, - "Successes":76, - "Failures":0, - "Errors":28, - "Statuses":{ - "202 Accepted":76 - } - } - } - ] -} -``` - -If using notification as part of a larger application, it is _critical_ to -monitor the size ("Pending" above) of the endpoint queues. If failures or -queue sizes are increasing, it can indicate a larger problem. - -The logs are also a valuable resource for monitoring problems. A failing -endpoint will lead to messages similar to the following: - -``` -ERRO[0340] retryingsink: error writing events: httpSink{http://localhost:5003/callback}: error posting: Post http://localhost:5003/callback: dial tcp 127.0.0.1:5003: connection refused, retrying -WARN[0340] httpSink{http://localhost:5003/callback} encountered too many errors, backing off -``` - -The above indicates that several errors have led to a backoff and the registry -will wait before retrying. - -## Considerations - -Currently, the queues are inmemory, so endpoints should be _reasonably -reliable_. They are designed to make a best-effort to send the messages but if -an instance is lost, messages may be dropped. If an endpoint goes down, care -should be taken to ensure that the registry instance is not terminated before -the endpoint comes back up or messages will be lost. - -This can be mitigated by running endpoints in close proximity to the registry -instances. One could run an endpoint that pages to disk and then forwards a -request to provide better durability. - -The notification system is designed around a series of interchangeable _sinks_ -which can be wired up to achieve interesting behavior. If this system doesn't -provide acceptable guarantees, adding a transactional `Sink` to the registry -is a possibility, although it may have an effect on request service time. -Please see the -[godoc](http://godoc.org/github.com/docker/distribution/notifications#Sink) -for more information. diff --git a/vendor/github.com/docker/distribution/docs/recipes/apache.md b/vendor/github.com/docker/distribution/docs/recipes/apache.md deleted file mode 100644 index ac24113b2..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/apache.md +++ /dev/null @@ -1,215 +0,0 @@ - - -# Authenticating proxy with apache - -## Use-case - -People already relying on an apache proxy to authenticate their users to other services might want to leverage it and have Registry communications tunneled through the same pipeline. - -Usually, that includes enterprise setups using LDAP/AD on the backend and a SSO mechanism fronting their internal http portal. - -### Alternatives - -If you just want authentication for your registry, and are happy maintaining users access separately, you should really consider sticking with the native [basic auth registry feature](../deploying.md#native-basic-auth). - -### Solution - -With the method presented here, you implement basic authentication for docker engines in a reverse proxy that sits in front of your registry. - -While we use a simple htpasswd file as an example, any other apache authentication backend should be fairly easy to implement once you are done with the example. - -We also implement push restriction (to a limited user group) for the sake of the example. Again, you should modify this to fit your mileage. - -### Gotchas - -While this model gives you the ability to use whatever authentication backend you want through the secondary authentication mechanism implemented inside your proxy, it also requires that you move TLS termination from the Registry to the proxy itself. - -Furthermore, introducing an extra http layer in your communication pipeline will make it more complex to deploy, maintain, and debug, and will possibly create issues. - -## Setting things up - -Read again [the requirements](index.md#requirements). - -Ready? - -Run the following script: - -``` -mkdir -p auth -mkdir -p data - -# This is the main apache configuration you will use -cat < auth/httpd.conf -LoadModule headers_module modules/mod_headers.so - -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_core_module modules/mod_authn_core.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_core_module modules/mod_authz_core.so -LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule access_compat_module modules/mod_access_compat.so - -LoadModule log_config_module modules/mod_log_config.so - -LoadModule ssl_module modules/mod_ssl.so - -LoadModule proxy_module modules/mod_proxy.so -LoadModule proxy_http_module modules/mod_proxy_http.so - -LoadModule unixd_module modules/mod_unixd.so - - - SSLRandomSeed startup builtin - SSLRandomSeed connect builtin - - - - User daemon - Group daemon - - -ServerAdmin you@example.com - -ErrorLog /proc/self/fd/2 - -LogLevel warn - - - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined - LogFormat "%h %l %u %t \"%r\" %>s %b" common - - - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio - - - CustomLog /proc/self/fd/1 common - - -ServerRoot "/usr/local/apache2" - -Listen 5043 - - - AllowOverride none - Require all denied - - - - - ServerName myregistrydomain.com - - SSLEngine on - SSLCertificateFile /usr/local/apache2/conf/domain.crt - SSLCertificateKeyFile /usr/local/apache2/conf/domain.key - - ## SSL settings recommandation from: https://raymii.org/s/tutorials/Strong_SSL_Security_On_Apache2.html - # Anti CRIME - SSLCompression off - - # POODLE and other stuff - SSLProtocol all -SSLv2 -SSLv3 -TLSv1 - - # Secure cypher suites - SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH - SSLHonorCipherOrder on - - Header always set "Docker-Distribution-Api-Version" "registry/2.0" - Header onsuccess set "Docker-Distribution-Api-Version" "registry/2.0" - RequestHeader set X-Forwarded-Proto "https" - - ProxyRequests off - ProxyPreserveHost on - - # no proxy for /error/ (Apache HTTPd errors messages) - ProxyPass /error/ ! - - ProxyPass /v2 http://registry:5000/v2 - ProxyPassReverse /v2 http://registry:5000/v2 - - - Order deny,allow - Allow from all - AuthName "Registry Authentication" - AuthType basic - AuthUserFile "/usr/local/apache2/conf/httpd.htpasswd" - AuthGroupFile "/usr/local/apache2/conf/httpd.groups" - - # Read access to authentified users - - Require valid-user - - - # Write access to docker-deployer only - - Require group pusher - - - - - -EOF - -# Now, create a password file for "testuser" and "testpassword" -docker run --entrypoint htpasswd httpd:2.4 -Bbn testuser testpassword > auth/httpd.htpasswd -# Create another one for "testuserpush" and "testpasswordpush" -docker run --entrypoint htpasswd httpd:2.4 -Bbn testuserpush testpasswordpush >> auth/httpd.htpasswd - -# Create your group file -echo "pusher: testuserpush" > auth/httpd.groups - -# Copy over your certificate files -cp domain.crt auth -cp domain.key auth - -# Now create your compose file - -cat < docker-compose.yml -apache: - image: "httpd:2.4" - hostname: myregistrydomain.com - ports: - - 5043:5043 - links: - - registry:registry - volumes: - - `pwd`/auth:/usr/local/apache2/conf - -registry: - image: registry:2 - ports: - - 127.0.0.1:5000:5000 - volumes: - - `pwd`/data:/var/lib/registry - -EOF -``` - -## Starting and stopping - -Now, start your stack: - - docker-compose up -d - -Login with a "push" authorized user (using `testuserpush` and `testpasswordpush`), then tag and push your first image: - - docker login myregistrydomain.com:5043 - docker tag ubuntu myregistrydomain.com:5043/test - docker push myregistrydomain.com:5043/test - -Now, login with a "pull-only" user (using `testuser` and `testpassword`), then pull back the image: - - docker login myregistrydomain.com:5043 - docker pull myregistrydomain.com:5043/test - -Verify that the "pull-only" can NOT push: - - docker push myregistrydomain.com:5043/test diff --git a/vendor/github.com/docker/distribution/docs/recipes/index.md b/vendor/github.com/docker/distribution/docs/recipes/index.md deleted file mode 100644 index b4dd63679..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/index.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# Recipes - -You will find here a list of "recipes", end-to-end scenarios for exotic or otherwise advanced use-cases. - -Most users are not expected to have a use for these. - -## Requirements - -You should have followed entirely the basic [deployment guide](../deploying.md). - -If you have not, please take the time to do so. - -At this point, it's assumed that: - - * you understand Docker security requirements, and how to configure your docker engines properly - * you have installed Docker Compose - * it's HIGHLY recommended that you get a certificate from a known CA instead of self-signed certificates - * inside the current directory, you have a X509 `domain.crt` and `domain.key`, for the CN `myregistrydomain.com` - * be sure you have stopped and removed any previously running registry (typically `docker stop registry && docker rm -v registry`) - -## The List - - * [using Apache as an authenticating proxy](apache.md) - * [using Nginx as an authenticating proxy](nginx.md) - * [running a Registry on OS X](osx-setup-guide.md) - * [mirror the Docker Hub](mirror.md) diff --git a/vendor/github.com/docker/distribution/docs/recipes/menu.md b/vendor/github.com/docker/distribution/docs/recipes/menu.md deleted file mode 100644 index b79c1b309..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/menu.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# Recipes - -## The List - - * [using Apache as an authenticating proxy](apache.md) - * [using Nginx as an authenticating proxy](nginx.md) - * [running a Registry on OS X](osx-setup-guide.md) - * [mirror the Docker Hub](mirror.md) diff --git a/vendor/github.com/docker/distribution/docs/recipes/mirror.md b/vendor/github.com/docker/distribution/docs/recipes/mirror.md deleted file mode 100644 index 241e41bd6..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/mirror.md +++ /dev/null @@ -1,74 +0,0 @@ - - -# Registry as a pull through cache - -## Use-case - -If you have multiple instances of Docker running in your environment (e.g., multiple physical or virtual machines, all running the Docker daemon), each time one of them requires an image that it doesn’t have it will go out to the internet and fetch it from the public Docker registry. By running a local registry mirror, you can keep most of the redundant image fetch traffic on your local network. - -### Alternatives - -Alternatively, if the set of images you are using is well delimited, you can simply pull them manually and push them to a simple, local, private registry. - -Furthermore, if your images are all built in-house, not using the Hub at all and relying entirely on your local registry is the simplest scenario. - -### Gotcha - -It's currently not possible to mirror another private registry. Only the central Hub can be mirrored. - -### Solution - -The Registry can be configured as a pull through cache. In this mode a Registry responds to all normal docker pull requests but stores all content locally. - -## How does it work? - -The first time you request an image from your local registry mirror, it pulls the image from the public Docker registry and stores it locally before handing it back to you. On subsequent requests, the local registry mirror is able to serve the image from its own storage. - -### What if the content changes on the Hub? - -When a pull is attempted with a tag, the Registry will check the remote to ensure if it has the latest version of the requested content. If it doesn't it will fetch the latest content and cache it. - -### What about my disk? - -In environments with high churn rates, stale data can build up in the cache. When running as a pull through cache the Registry will periodically remove old content to save disk space. Subsequent requests for removed content will cause a remote fetch and local re-caching. - -To ensure best performance and guarantee correctness the Registry cache should be configured to use the `filesystem` driver for storage. - -## Running a Registry as a pull through cache - -The easiest way to run a registry as a pull through cache is to run the official Registry image. - -Multiple registry caches can be deployed over the same back-end. A single registry cache will ensure that concurrent requests do not pull duplicate data, but this property will not hold true for a registry cache cluster. - -### Configuring the cache - -To configure a Registry to run as a pull through cache, the addition of a `proxy` section is required to the config file. - -In order to access private images on the Docker Hub, a username and password can be supplied. - - proxy: - remoteurl: https://registry-1.docker.io - username: [username] - password: [password] - -> :warn: if you specify a username and password, it's very important to understand that private resources that this user has access to on the Hub will be made available on your mirror. It's thus paramount that you secure your mirror by implementing authentication if you expect these resources to stay private! - -### Configuring the Docker daemon - -You will need to pass the `--registry-mirror` option to your Docker daemon on startup: - - docker --registry-mirror=https:// daemon - -For example, if your mirror is serving on `http://10.0.0.2:5000`, you would run: - - docker --registry-mirror=https://10.0.0.2:5000 daemon - -NOTE: Depending on your local host setup, you may be able to add the `--registry-mirror` option to the `DOCKER_OPTS` variable in `/etc/default/docker`. diff --git a/vendor/github.com/docker/distribution/docs/recipes/nginx.md b/vendor/github.com/docker/distribution/docs/recipes/nginx.md deleted file mode 100644 index f4a676791..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/nginx.md +++ /dev/null @@ -1,190 +0,0 @@ - - -# Authenticating proxy with nginx - - -## Use-case - -People already relying on a nginx proxy to authenticate their users to other services might want to leverage it and have Registry communications tunneled through the same pipeline. - -Usually, that includes enterprise setups using LDAP/AD on the backend and a SSO mechanism fronting their internal http portal. - -### Alternatives - -If you just want authentication for your registry, and are happy maintaining users access separately, you should really consider sticking with the native [basic auth registry feature](../deploying.md#native-basic-auth). - -### Solution - -With the method presented here, you implement basic authentication for docker engines in a reverse proxy that sits in front of your registry. - -While we use a simple htpasswd file as an example, any other nginx authentication backend should be fairly easy to implement once you are done with the example. - -We also implement push restriction (to a limited user group) for the sake of the example. Again, you should modify this to fit your mileage. - -### Gotchas - -While this model gives you the ability to use whatever authentication backend you want through the secondary authentication mechanism implemented inside your proxy, it also requires that you move TLS termination from the Registry to the proxy itself. - -Furthermore, introducing an extra http layer in your communication pipeline will make it more complex to deploy, maintain, and debug, and will possibly create issues. Make sure the extra complexity is required. - -For instance, Amazon's Elastic Load Balancer (ELB) in HTTPS mode already sets the following client header: - -``` -X-Real-IP -X-Forwarded-For -X-Forwarded-Proto -``` - -So if you have an nginx sitting behind it, should remove these lines from the example config below: - -``` -X-Real-IP $remote_addr; # pass on real client's IP -X-Forwarded-For $proxy_add_x_forwarded_for; -X-Forwarded-Proto $scheme; -``` - -Otherwise nginx will reset the ELB's values, and the requests will not be routed properly. For more information, see [#970](https://github.com/docker/distribution/issues/970). - -## Setting things up - -Read again [the requirements](index.md#requirements). - -Ready? - --- - -Create the required directories - -``` -mkdir -p auth -mkdir -p data -``` - -Create the main nginx configuration you will use. - -``` - -cat < auth/nginx.conf -events { - worker_connections 1024; -} - -http { - - upstream docker-registry { - server registry:5000; - } - - ## Set a variable to help us decide if we need to add the - ## 'Docker-Distribution-Api-Version' header. - ## The registry always sets this header. - ## In the case of nginx performing auth, the header will be unset - ## since nginx is auth-ing before proxying. - map \$upstream_http_docker_distribution_api_version \$docker_distribution_api_version { - 'registry/2.0' ''; - default registry/2.0; - } - - server { - listen 443 ssl; - server_name myregistrydomain.com; - - # SSL - ssl_certificate /etc/nginx/conf.d/domain.crt; - ssl_certificate_key /etc/nginx/conf.d/domain.key; - - # Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html - ssl_protocols TLSv1.1 TLSv1.2; - ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; - ssl_prefer_server_ciphers on; - ssl_session_cache shared:SSL:10m; - - # disable any limits to avoid HTTP 413 for large image uploads - client_max_body_size 0; - - # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486) - chunked_transfer_encoding on; - - location /v2/ { - # Do not allow connections from docker 1.5 and earlier - # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents - if (\$http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*\$" ) { - return 404; - } - - # To add basic authentication to v2 use auth_basic setting. - auth_basic "Registry realm"; - auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; - - ## If $docker_distribution_api_version is empty, the header will not be added. - ## See the map directive above where this variable is defined. - add_header 'Docker-Distribution-Api-Version' \$docker_distribution_api_version always; - - proxy_pass http://docker-registry; - proxy_set_header Host \$http_host; # required for docker client's sake - proxy_set_header X-Real-IP \$remote_addr; # pass on real client's IP - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - proxy_read_timeout 900; - } - } -} -EOF -``` - -Now create a password file for "testuser" and "testpassword" - -``` -docker run --rm --entrypoint htpasswd registry:2 -bn testuser testpassword > auth/nginx.htpasswd -``` - -Copy over your certificate files - -``` -cp domain.crt auth -cp domain.key auth -``` - -Now create your compose file - -``` -cat < docker-compose.yml -nginx: - image: "nginx:1.9" - ports: - - 5043:443 - links: - - registry:registry - volumes: - - ./auth:/etc/nginx/conf.d - - ./auth/nginx.conf:/etc/nginx/nginx.conf:ro - -registry: - image: registry:2 - ports: - - 127.0.0.1:5000:5000 - volumes: - - `pwd`./data:/var/lib/registry -EOF -``` - -## Starting and stopping - -Now, start your stack: - - docker-compose up -d - -Login with a "push" authorized user (using `testuser` and `testpassword`), then tag and push your first image: - - docker login -u=testuser -p=testpassword -e=root@example.ch myregistrydomain.com:5043 - docker tag ubuntu myregistrydomain.com:5043/test - docker push myregistrydomain.com:5043/test - docker pull myregistrydomain.com:5043/test diff --git a/vendor/github.com/docker/distribution/docs/recipes/osx-setup-guide.md b/vendor/github.com/docker/distribution/docs/recipes/osx-setup-guide.md deleted file mode 100644 index d47d31c10..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/osx-setup-guide.md +++ /dev/null @@ -1,81 +0,0 @@ - - -# OS X Setup Guide - -## Use-case - -This is useful if you intend to run a registry server natively on OS X. - -### Alternatives - -You can start a VM on OS X, and deploy your registry normally as a container using Docker inside that VM. - -The simplest road to get there is traditionally to use the [docker Toolbox](https://www.docker.com/toolbox), or [docker-machine](/machine/index.md), which usually relies on the [boot2docker](http://boot2docker.io/) iso inside a VirtualBox VM. - -### Solution - -Using the method described here, you install and compile your own from the git repository and run it as an OS X agent. - -### Gotchas - -Production services operation on OS X is out of scope of this document. Be sure you understand well these aspects before considering going to production with this. - -## Setup golang on your machine - -If you know, safely skip to the next section. - -If you don't, the TLDR is: - - bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) - source ~/.gvm/scripts/gvm - gvm install go1.4.2 - gvm use go1.4.2 - -If you want to understand, you should read [How to Write Go Code](https://golang.org/doc/code.html). - -## Checkout the Docker Distribution source tree - - mkdir -p $GOPATH/src/github.com/docker - git clone https://github.com/docker/distribution.git $GOPATH/src/github.com/docker/distribution - cd $GOPATH/src/github.com/docker/distribution - -## Build the binary - - GOPATH=$(PWD)/Godeps/_workspace:$GOPATH make binaries - sudo cp bin/registry /usr/local/libexec/registry - -## Setup - -Copy the registry configuration file in place: - - mkdir /Users/Shared/Registry - cp docs/osx/config.yml /Users/Shared/Registry/config.yml - -## Running the Docker Registry under launchd - -Copy the Docker registry plist into place: - - plutil -lint docs/osx/com.docker.registry.plist - cp docs/osx/com.docker.registry.plist ~/Library/LaunchAgents/ - chmod 644 ~/Library/LaunchAgents/com.docker.registry.plist - -Start the Docker registry: - - launchctl load ~/Library/LaunchAgents/com.docker.registry.plist - -### Restarting the docker registry service - - launchctl stop com.docker.registry - launchctl start com.docker.registry - -### Unloading the docker registry service - - launchctl unload ~/Library/LaunchAgents/com.docker.registry.plist diff --git a/vendor/github.com/docker/distribution/docs/recipes/osx/com.docker.registry.plist b/vendor/github.com/docker/distribution/docs/recipes/osx/com.docker.registry.plist deleted file mode 100644 index 0982349f4..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/osx/com.docker.registry.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Label - com.docker.registry - KeepAlive - - StandardErrorPath - /Users/Shared/Registry/registry.log - StandardOutPath - /Users/Shared/Registry/registry.log - Program - /usr/local/libexec/registry - ProgramArguments - - /usr/local/libexec/registry - /Users/Shared/Registry/config.yml - - Sockets - - http-listen-address - - SockServiceName - 5000 - SockType - dgram - SockFamily - IPv4 - - http-debug-address - - SockServiceName - 5001 - SockType - dgram - SockFamily - IPv4 - - - - diff --git a/vendor/github.com/docker/distribution/docs/recipes/osx/config.yml b/vendor/github.com/docker/distribution/docs/recipes/osx/config.yml deleted file mode 100644 index 63b8f7135..000000000 --- a/vendor/github.com/docker/distribution/docs/recipes/osx/config.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: 0.1 -log: - level: info - fields: - service: registry - environment: macbook-air -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /Users/Shared/Registry -http: - addr: 0.0.0.0:5000 - secret: mytokensecret - debug: - addr: localhost:5001 diff --git a/vendor/github.com/docker/distribution/docs/spec/api.md b/vendor/github.com/docker/distribution/docs/spec/api.md index c4517c0b4..74ac8e24f 100644 --- a/vendor/github.com/docker/distribution/docs/spec/api.md +++ b/vendor/github.com/docker/distribution/docs/spec/api.md @@ -1,12 +1,8 @@ - +--- +title: "HTTP API V2" +description: "Specification for the Registry API." +keywords: ["registry, on-prem, images, tags, repository, distribution, api, advanced"] +--- # Docker Registry HTTP API V2 @@ -248,7 +244,7 @@ enforce this. The rules for a repository name are as follows: must match the regular expression `[a-z0-9]+(?:[._-][a-z0-9]+)*`. 2. If a repository name has two or more path components, they must be separated by a forward slash ("/"). -3. The total length of a repository name, including slashes, must be less the +3. The total length of a repository name, including slashes, must be less than 256 characters. These name requirements _only_ apply to the registry API and should accept a diff --git a/vendor/github.com/docker/distribution/docs/spec/api.md.tmpl b/vendor/github.com/docker/distribution/docs/spec/api.md.tmpl index eeafec1ea..406eda5be 100644 --- a/vendor/github.com/docker/distribution/docs/spec/api.md.tmpl +++ b/vendor/github.com/docker/distribution/docs/spec/api.md.tmpl @@ -1,12 +1,8 @@ - +--- +title: "HTTP API V2" +description: "Specification for the Registry API." +keywords: ["registry, on-prem, images, tags, repository, distribution, api, advanced"] +--- # Docker Registry HTTP API V2 @@ -248,7 +244,7 @@ enforce this. The rules for a repository name are as follows: must match the regular expression `[a-z0-9]+(?:[._-][a-z0-9]+)*`. 2. If a repository name has two or more path components, they must be separated by a forward slash ("/"). -3. The total length of a repository name, including slashes, must be less the +3. The total length of a repository name, including slashes, must be less than 256 characters. These name requirements _only_ apply to the registry API and should accept a diff --git a/vendor/github.com/docker/distribution/docs/spec/auth/index.md b/vendor/github.com/docker/distribution/docs/spec/auth/index.md index f6ee8e1fa..d1aa94225 100644 --- a/vendor/github.com/docker/distribution/docs/spec/auth/index.md +++ b/vendor/github.com/docker/distribution/docs/spec/auth/index.md @@ -1,13 +1,8 @@ - +--- +title: "Docker Registry Token Authentication" +description: "Docker Registry v2 authentication schema" +keywords: ["registry, on-prem, images, tags, repository, distribution, authentication, advanced"] +--- # Docker Registry v2 authentication diff --git a/vendor/github.com/docker/distribution/docs/spec/auth/jwt.md b/vendor/github.com/docker/distribution/docs/spec/auth/jwt.md index c90bd6e86..aa9941b0b 100644 --- a/vendor/github.com/docker/distribution/docs/spec/auth/jwt.md +++ b/vendor/github.com/docker/distribution/docs/spec/auth/jwt.md @@ -1,13 +1,8 @@ - +--- +title: "Token Authentication Implementation" +description: "Describe the reference implementation of the Docker Registry v2 authentication schema" +keywords: ["registry, on-prem, images, tags, repository, distribution, JWT authentication, advanced"] +--- # Docker Registry v2 Bearer token specification diff --git a/vendor/github.com/docker/distribution/docs/spec/auth/oauth.md b/vendor/github.com/docker/distribution/docs/spec/auth/oauth.md index 0f8d35dbb..d946da8a2 100644 --- a/vendor/github.com/docker/distribution/docs/spec/auth/oauth.md +++ b/vendor/github.com/docker/distribution/docs/spec/auth/oauth.md @@ -1,13 +1,8 @@ - +--- +title: "Oauth2 Token Authentication" +description: "Specifies the Docker Registry v2 authentication" +keywords: ["registry, on-prem, images, tags, repository, distribution, oauth2, advanced"] +--- # Docker Registry v2 authentication using OAuth2 @@ -193,4 +188,3 @@ Content-Type: application/json {"refresh_token":"kas9Da81Dfa8","access_token":"eyJhbGciOiJFUzI1NiIsInR5":"expires_in":900,"scope":"repository:samalba/my-app:pull,repository:samalba/my-app:push"} ``` - diff --git a/vendor/github.com/docker/distribution/docs/spec/auth/scope.md b/vendor/github.com/docker/distribution/docs/spec/auth/scope.md index a8f6c0628..6ef61edf1 100644 --- a/vendor/github.com/docker/distribution/docs/spec/auth/scope.md +++ b/vendor/github.com/docker/distribution/docs/spec/auth/scope.md @@ -1,13 +1,8 @@ - +--- +title: "Token Scope Documentation" +description: "Describes the scope and access fields used for registry authorization tokens" +keywords: ["registry, on-prem, images, tags, repository, distribution, advanced, access, scope"] +--- # Docker Registry Token Scope and Access @@ -44,13 +39,23 @@ intended to represent. This type may be specific to a resource provider but must be understood by the authorization server in order to validate the subject is authorized for a specific resource. +#### Resource Class + +The resource type might have a resource class which further classifies the +the resource name within the resource type. A class is not required and +is specific to the resource type. + #### Example Resource Types - `repository` - represents a single repository within a registry. A repository may represent many manifest or content blobs, but the resource type is considered the collections of those items. Actions which may be performed on a `repository` are `pull` for accessing the collection and `push` for adding to -it. +it. By default the `repository` type has the class of `image`. + - `repository(plugin)` - represents a single repository of plugins within a +registry. A plugin repository has the same content and actions as a repository. + - `registry` - represents the entire registry. Used for administrative actions +or lookup operations that span an entire registry. ### Resource Name @@ -83,7 +88,8 @@ scopes. ``` scope := resourcescope [ ' ' resourcescope ]* resourcescope := resourcetype ":" resourcename ":" action [ ',' action ]* -resourcetype := /[a-z]*/ +resourcetype := resourcetypevalue [ '(' resourcetypevalue ')' ] +resourcetypevalue := /[a-z0-9]+/ resourcename := [ hostname '/' ] component [ '/' component ]* hostname := hostcomponent ['.' hostcomponent]* [':' port-number] hostcomponent := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ @@ -140,4 +146,3 @@ done by fetching an access token using the refresh token. Since the refresh token is not scoped to specific resources for an audience, extra care should be taken to only use the refresh token to negotiate new access tokens directly with the authorization server, and never with a resource provider. - diff --git a/vendor/github.com/docker/distribution/docs/spec/auth/token.md b/vendor/github.com/docker/distribution/docs/spec/auth/token.md index 81af53b2e..f8391bd5a 100644 --- a/vendor/github.com/docker/distribution/docs/spec/auth/token.md +++ b/vendor/github.com/docker/distribution/docs/spec/auth/token.md @@ -1,13 +1,8 @@ - +--- +title: "Token Authentication Specification" +description: "Specifies the Docker Registry v2 authentication" +keywords: ["registry, on-prem, images, tags, repository, distribution, Bearer authentication, advanced"] +--- # Docker Registry v2 authentication via central service @@ -25,7 +20,7 @@ This document outlines the v2 Docker registry authentication scheme: 5. The client retries the original request with the Bearer token embedded in the request's Authorization header. 6. The Registry authorizes the client by validating the Bearer token and the - claim set embedded within it and begins the push/pull session as usual. + claim set embedded within it and begins the push/pull session as usual. ## Requirements @@ -161,7 +156,7 @@ Defines getting a bearer and refresh token using the token endpoint. expires_in
- (Optional) The duration in seconds since the token was issued that it + (Optional) The duration in seconds since the token was issued that it will remain valid. When omitted, this defaults to 60 seconds. For compatibility with older clients, a token should never be returned with less than 60 seconds to live. diff --git a/vendor/github.com/docker/distribution/docs/spec/implementations.md b/vendor/github.com/docker/distribution/docs/spec/implementations.md index ec937b647..347465350 100644 --- a/vendor/github.com/docker/distribution/docs/spec/implementations.md +++ b/vendor/github.com/docker/distribution/docs/spec/implementations.md @@ -1,8 +1,6 @@ - +--- +published: false +--- # Distribution API Implementations diff --git a/vendor/github.com/docker/distribution/docs/spec/index.md b/vendor/github.com/docker/distribution/docs/spec/index.md index 474bd455c..952ebabd2 100644 --- a/vendor/github.com/docker/distribution/docs/spec/index.md +++ b/vendor/github.com/docker/distribution/docs/spec/index.md @@ -1,13 +1,8 @@ - +--- +title: "Reference Overview" +description: "Explains registry JSON objects" +keywords: ["registry, service, images, repository, json"] +--- # Docker Registry Reference diff --git a/vendor/github.com/docker/distribution/docs/spec/json.md b/vendor/github.com/docker/distribution/docs/spec/json.md index a8916dccc..825b17ac2 100644 --- a/vendor/github.com/docker/distribution/docs/spec/json.md +++ b/vendor/github.com/docker/distribution/docs/spec/json.md @@ -1,13 +1,9 @@ - +--- +published: false +title: "Docker Distribution JSON Canonicalization" +description: "Explains registry JSON objects" +keywords: ["registry, service, images, repository, json"] +--- diff --git a/vendor/github.com/docker/distribution/docs/spec/manifest-v2-1.md b/vendor/github.com/docker/distribution/docs/spec/manifest-v2-1.md index 056f4bc66..b06c2f2a9 100644 --- a/vendor/github.com/docker/distribution/docs/spec/manifest-v2-1.md +++ b/vendor/github.com/docker/distribution/docs/spec/manifest-v2-1.md @@ -1,12 +1,8 @@ - +--- +title: "Image Manifest V 2, Schema 1 " +description: "image manifest for the Registry." +keywords: ["registry, on-prem, images, tags, repository, distribution, api, advanced, manifest"] +--- # Image Manifest Version 2, Schema 1 diff --git a/vendor/github.com/docker/distribution/docs/spec/manifest-v2-2.md b/vendor/github.com/docker/distribution/docs/spec/manifest-v2-2.md index afc614bcc..4b41bb28c 100644 --- a/vendor/github.com/docker/distribution/docs/spec/manifest-v2-2.md +++ b/vendor/github.com/docker/distribution/docs/spec/manifest-v2-2.md @@ -1,12 +1,8 @@ - +--- +title: "Image Manifest V 2, Schema 2 " +description: "image manifest for the Registry." +keywords: ["registry, on-prem, images, tags, repository, distribution, api, advanced, manifest"] +--- # Image Manifest Version 2, Schema 2 @@ -34,6 +30,7 @@ the resources they reference: - `application/vnd.docker.container.image.v1+json`: Container config JSON - `application/vnd.docker.image.rootfs.diff.tar.gzip`: "Layer", as a gzipped tar - `application/vnd.docker.image.rootfs.foreign.diff.tar.gzip`: "Layer", as a gzipped tar that should never be pushed +- `application/vnd.docker.plugin.v1+json`: Plugin config JSON ## Manifest List diff --git a/vendor/github.com/docker/distribution/docs/spec/menu.md b/vendor/github.com/docker/distribution/docs/spec/menu.md index ebc52327b..9237e3ce8 100644 --- a/vendor/github.com/docker/distribution/docs/spec/menu.md +++ b/vendor/github.com/docker/distribution/docs/spec/menu.md @@ -1,13 +1,7 @@ - - +--- +title: "Reference" +description: "Explains registry JSON objects" +keywords: ["registry, service, images, repository, json"] +type: "menu" +identifier: "smn_registry_ref" +--- diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/azure.md b/vendor/github.com/docker/distribution/docs/storage-drivers/azure.md deleted file mode 100644 index a84888de8..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/azure.md +++ /dev/null @@ -1,78 +0,0 @@ - - - -# Microsoft Azure storage driver - -An implementation of the `storagedriver.StorageDriver` interface which uses [Microsoft Azure Blob Storage](http://azure.microsoft.com/en-us/services/storage/) for object storage. - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- accountname - - yes - - Name of the Azure Storage Account. -
- accountkey - - yes - - Primary or Secondary Key for the Storage Account. -
- container - - yes - - Name of the Azure root storage container in which all registry data will be stored. Must comply the storage container name [requirements][create-container-api]. -
- realm - - no - - Domain name suffix for the Storage Service API endpoint. For example realm for "Azure in China" would be `core.chinacloudapi.cn` and realm for "Azure Government" would be `core.usgovcloudapi.net`. By default, this - is core.windows.net. -
- - -## Related Information - -* To get information about -[azure-blob-storage](http://azure.microsoft.com/en-us/services/storage/) visit -the Microsoft website. -* You can use Microsoft's [Blob Service REST API](https://msdn.microsoft.com/en-us/library/azure/dd135733.aspx) to [create a container] (https://msdn.microsoft.com/en-us/library/azure/dd179468.aspx). diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/filesystem.md b/vendor/github.com/docker/distribution/docs/storage-drivers/filesystem.md deleted file mode 100644 index 8e269cdbc..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/filesystem.md +++ /dev/null @@ -1,24 +0,0 @@ - - - -# Filesystem storage driver - -An implementation of the `storagedriver.StorageDriver` interface which uses the local filesystem. - -## Parameters - -`rootdirectory`: (optional) The absolute path to a root directory tree in which -to store all registry files. The registry stores all its data here so make sure -there is adequate space available. Defaults to `/var/lib/registry`. -`maxthreads`: (optional) The maximum number of simultaneous blocking filesystem -operations permitted within the registry. Each operation spawns a new thread and -may cause thread exhaustion issues if many are done in parallel. Defaults to -`100`, and can be no lower than `25`. diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/gcs.md b/vendor/github.com/docker/distribution/docs/storage-drivers/gcs.md deleted file mode 100644 index 1bc67f9ed..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/gcs.md +++ /dev/null @@ -1,78 +0,0 @@ - - - -# Google Cloud Storage driver - -An implementation of the `storagedriver.StorageDriver` interface which uses Google Cloud for object storage. - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- bucket - - yes - - Storage bucket name. -
- keyfile - - no - - A private service account key file in JSON format. Instead of a key file Google Application Default Credentials can be used. -
- rootdirectory - - no - - This is a prefix that will be applied to all Google Cloud Storage keys to allow you to segment data in your bucket if necessary. -
- chunksize - - no (default 5242880) - - This is the chunk size used for uploading large blobs, must be a multiple of 256*1024. -
- - -`bucket`: The name of your Google Cloud Storage bucket where you wish to store objects (needs to already be created prior to driver initialization). - -`keyfile`: (optional) A private key file in JSON format, used for [Service Account Authentication](https://cloud.google.com/storage/docs/authentication#service_accounts). - -**Note** Instead of a key file you can use [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). - -`rootdirectory`: (optional) The root directory tree in which all registry files will be stored. Defaults to the empty string (bucket root). diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/index.md b/vendor/github.com/docker/distribution/docs/storage-drivers/index.md deleted file mode 100644 index 89635bd37..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/index.md +++ /dev/null @@ -1,66 +0,0 @@ - - - -# Docker Registry Storage Driver - -This document describes the registry storage driver model, implementation, and explains how to contribute new storage drivers. - -## Provided Drivers - -This storage driver package comes bundled with several drivers: - -- [inmemory](inmemory.md): A temporary storage driver using a local inmemory map. This exists solely for reference and testing. -- [filesystem](filesystem.md): A local storage driver configured to use a directory tree in the local filesystem. -- [s3](s3.md): A driver storing objects in an Amazon Simple Storage Solution (S3) bucket. -- [azure](azure.md): A driver storing objects in [Microsoft Azure Blob Storage](http://azure.microsoft.com/en-us/services/storage/). -- [swift](swift.md): A driver storing objects in [Openstack Swift](http://docs.openstack.org/developer/swift/). -- [oss](oss.md): A driver storing objects in [Aliyun OSS](http://www.aliyun.com/product/oss). -- [gcs](gcs.md): A driver storing objects in a [Google Cloud Storage](https://cloud.google.com/storage/) bucket. - -## Storage Driver API - -The storage driver API is designed to model a filesystem-like key/value storage in a manner abstract enough to support a range of drivers from the local filesystem to Amazon S3 or other distributed object storage systems. - -Storage drivers are required to implement the `storagedriver.StorageDriver` interface provided in `storagedriver.go`, which includes methods for reading, writing, and deleting content, as well as listing child objects of a specified prefix key. - -Storage drivers are intended to be written in Go, providing compile-time -validation of the `storagedriver.StorageDriver` interface. - -## Driver Selection and Configuration - -The preferred method of selecting a storage driver is using the `StorageDriverFactory` interface in the `storagedriver/factory` package. These factories provide a common interface for constructing storage drivers with a parameters map. The factory model is based off of the [Register](http://golang.org/pkg/database/sql/#Register) and [Open](http://golang.org/pkg/database/sql/#Open) methods in the builtin [database/sql](http://golang.org/pkg/database/sql) package. - -Storage driver factories may be registered by name using the -`factory.Register` method, and then later invoked by calling `factory.Create` -with a driver name and parameters map. If no such storage driver can be found, -`factory.Create` will return an `InvalidStorageDriverError`. - -## Driver Contribution - -### Writing new storage drivers - -To create a valid storage driver, one must implement the -`storagedriver.StorageDriver` interface and make sure to expose this driver -via the factory system. - -#### Registering - -Storage drivers should call `factory.Register` with their driver name in an `init` method, allowing callers of `factory.New` to construct instances of this driver without requiring modification of imports throughout the codebase. - -## Testing - -Storage driver test suites are provided in -`storagedriver/testsuites/testsuites.go` and may be used for any storage -driver written in Go. Tests can be registered using the `RegisterSuite` -function, which run the same set of tests for any registered drivers. diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/inmemory.md b/vendor/github.com/docker/distribution/docs/storage-drivers/inmemory.md deleted file mode 100644 index 1a14e77a2..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/inmemory.md +++ /dev/null @@ -1,23 +0,0 @@ - - - -# In-memory storage driver (Testing Only) - -For purely tests purposes, you can use the `inmemory` storage driver. This -driver is an implementation of the `storagedriver.StorageDriver` interface which -uses local memory for object storage. If you would like to run a registry from -volatile memory, use the [`filesystem` driver](filesystem.md) on a ramdisk. - -**IMPORTANT**: This storage driver *does not* persist data across runs. This is why it is only suitable for testing. *Never* use this driver in production. - -## Parameters - -None diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/menu.md b/vendor/github.com/docker/distribution/docs/storage-drivers/menu.md deleted file mode 100644 index 3638649fc..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/menu.md +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/oss.md b/vendor/github.com/docker/distribution/docs/storage-drivers/oss.md deleted file mode 100644 index a85e315e2..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/oss.md +++ /dev/null @@ -1,126 +0,0 @@ - - -# Aliyun OSS storage driver - -An implementation of the `storagedriver.StorageDriver` interface which uses [Aliyun OSS](http://www.aliyun.com/product/oss) for object storage. - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- accesskeyid - -yes - -Your access key ID. -
- accesskeysecret - -yes - -Your access key secret. -
- region - -yes - The name of the OSS region in which you would like to store objects (for example `oss-cn-beijing`). For a list of regions, you can look at -
- endpoint - -no - -An endpoint which defaults to `..aliyuncs.com` or `.-internal.aliyuncs.com` (when `internal=true`). You can change the default endpoint by changing this value. -
- internal - -no - An internal endpoint or the public endpoint for OSS access. The default is false. For a list of regions, you can look at -
- bucket - -yes - The name of your OSS bucket where you wish to store objects (needs to already be created prior to driver initialization). -
- encrypt - -no - Specifies whether you would like your data encrypted on the server side. Defaults to false if not specified. -
- secure - -no - Specifies whether to transfer data to the bucket over ssl or not. If you omit this value, `true` is used. -
- chunksize - -no - The default part size for multipart uploads (performed by WriteStream) to OSS. The default is 10 MB. Keep in mind that the minimum part size for OSS is 5MB. You might experience better performance for larger chunk sizes depending on the speed of your connection to OSS. -
- rootdirectory - -no - The root directory tree in which to store all registry files. Defaults to an empty string (bucket root). -
diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/s3.md b/vendor/github.com/docker/distribution/docs/storage-drivers/s3.md deleted file mode 100644 index 30187db47..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/s3.md +++ /dev/null @@ -1,320 +0,0 @@ - - - -# S3 storage driver - -An implementation of the `storagedriver.StorageDriver` interface which uses Amazon S3 or S3 compatible services for object storage. - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- accesskey - - yes - - Your AWS Access Key. -
- secretkey - - yes - - Your AWS Secret Key. -
- region - - yes - - The AWS region in which your bucket exists. For the moment, the Go AWS - library in use does not use the newer DNS based bucket routing. -
- regionendpoint - - no - - Endpoint for S3 compatible storage services (Minio, etc) -
- bucket - - yes - - The bucket name in which you want to store the registry's data. -
- encrypt - - no - - Specifies whether the registry stores the image in encrypted format or - not. A boolean value. The default is false. -
- keyid - - no - - Optional KMS key ID to use for encryption (encrypt must be true, or this - parameter will be ignored). The default is none. -
- secure - - no - - Indicates whether to use HTTPS instead of HTTP. A boolean value. The - default is true. -
- v4auth - - no - - Indicates whether the registry uses Version 4 of AWS's authentication. - Generally, you should set this to true unless you are using an - S3 compatible provider that does not support v4 signature signing. - If you set this to false then the storage driver will use v2 signature signing. - By default, this is true. - You can not use v2 signing if you are using AWS S3. -
- chunksize - - no - - The S3 API requires multipart upload chunks to be at least 5MB. This value - should be a number that is larger than 5*1024*1024. -
- multipartcopychunksize - - no - - Chunk size for all but the last Upload Part - Copy - operation of a copy that uses the multipart upload API. -
- multipartcopymaxconcurrency - - no - - Maximum number of concurrent Upload Part - Copy operations for a - copy that uses the multipart upload API. -
- multipartcopythresholdsize - - no - - Objects above this size will be copied using the multipart upload API. - PUT Object - Copy is used for objects at or below this size. -
- rootdirectory - - no - - This is a prefix that will be applied to all S3 keys to allow you to segment data in your bucket if necessary. -
- storageclass - - no - - The S3 storage class applied to each registry file. The default value is STANDARD. -
- objectacl - - no - - The S3 Canned ACL for objects. The default value is "private". -
- - -`accesskey`: Your aws access key. - -`secretkey`: Your aws secret key. - -**Note** You can provide empty strings for your access and secret keys if you plan on running the driver on an ec2 instance and will handle authentication with the instance's credentials. - -`region`: The name of the aws region in which you would like to store objects (for example `us-east-1`). For a list of regions, you can look at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html - -`regionendpoint`: (optional) Endpoint URL for S3 compatible APIs. This should not be provided when using Amazon S3. - -`bucket`: The name of your S3 bucket where you wish to store objects. The bucket must exist prior to the driver initialization. - -`encrypt`: (optional) Whether you would like your data encrypted on the server side (defaults to false if not specified). - -`keyid`: (optional) Whether you would like your data encrypted with this KMS key ID (defaults to none if not specified, will be ignored if encrypt is not true). - -`secure`: (optional) Whether you would like to transfer data to the bucket over ssl or not. Defaults to true (meaning transferring over ssl) if not specified. Note that while setting this to false will improve performance, it is not recommended due to security concerns. - -`v4auth`: (optional) Whether you would like to use aws signature version 4 with your requests. This defaults to true if not specified (note that the eu-central-1 region does not work with version 2 signatures, so the driver will error out if initialized with this region and v4auth set to false) - -`chunksize`: (optional) The default part size for multipart uploads (performed by WriteStream) to S3. The default is 10 MB. Keep in mind that the minimum part size for S3 is 5MB. Depending on the speed of your connection to S3, a larger chunk size may result in better performance; faster connections will benefit from larger chunk sizes. - -`rootdirectory`: (optional) The root directory tree in which all registry files will be stored. Defaults to the empty string (bucket root). - -`storageclass`: (optional) The storage class applied to each registry file. Defaults to STANDARD. Valid options are NONE, STANDARD and REDUCED_REDUNDANCY. Use NONE if your S3 compatible provider does not support storage classes. - -`objectacl`: (optional) The canned object ACL to be applied to each registry object. Defaults to `private`. If you are using a bucket owned by another AWS account, it is recommended that you set this to `bucket-owner-full-control` so that the bucket owner can access your objects. Other valid options are available in the [AWS S3 documentation](http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl). - -## S3 permission scopes - -The following IAM permissions are required by the registry for push and pull. See [the S3 policy documentation](http://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) for more details. - -``` - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "s3:ListBucket", - "s3:GetBucketLocation", - "s3:ListBucketMultipartUploads" - ], - "Resource": "arn:aws:s3:::mybucket" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject", - "s3:GetObject", - "s3:DeleteObject", - "s3:ListMultipartUploadParts", - "s3:AbortMultipartUpload" - ], - "Resource": "arn:aws:s3:::mybucket/*" - } -] -``` - -# CloudFront as Middleware with S3 backend - -## Use Case - -Adding CloudFront as a middleware for your S3 backed registry can dramatically improve pull times. Your registry will have the ability to retrieve your images from edge servers, rather than the geographically limited location of your S3 bucket. The farther your registry is from your bucket, the more improvements you will see. See [Amazon CloudFront](https://aws.amazon.com/cloudfront/details/). - -## Configuring CloudFront for Distribution - -If you are unfamiliar with creating a CloudFront distribution, see [Getting Started with Cloudfront](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GettingStarted.html). - -Defaults can be kept in most areas except: - -### Origin: - -The CloudFront distribution must be created such that the `Origin Path` is set to the directory level of the root "docker" key in S3. If your registry exists on the root of the bucket, this path should be left blank. - -### Behaviors: - - - Viewer Protocol Policy: HTTPS Only - - Allowed HTTP Methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE - - Cached HTTP Methods: OPTIONS (checked) - - Restrict Viewer Access (Use Signed URLs or Signed Cookies): Yes - - Trusted Signers: Self (Can add other accounts as long as you have access to CloudFront Key Pairs for those additional accounts) - -## Registry configuration - -Here the `middleware` option is used. It is still important to keep the `storage` option as CloudFront will only handle `pull` actions; `push` actions are still directly written to S3. - -The following example shows what you will need at minimum: -``` -... -storage: - s3: - region: us-east-1 - bucket: docker.myregistry.com -middleware: - storage: - - name: cloudfront - options: - baseurl: https://abcdefghijklmn.cloudfront.net/ - privatekey: /etc/docker/cloudfront/pk-ABCEDFGHIJKLMNOPQRST.pem - keypairid: ABCEDFGHIJKLMNOPQRST -... -``` - -## CloudFront Key-Pair - -A CloudFront key-pair is required for all AWS accounts needing access to your CloudFront distribution. For information, please see [Creating CloudFront Key Pairs](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html#private-content-creating-cloudfront-key-pairs). diff --git a/vendor/github.com/docker/distribution/docs/storage-drivers/swift.md b/vendor/github.com/docker/distribution/docs/storage-drivers/swift.md deleted file mode 100644 index 0bbf98c57..000000000 --- a/vendor/github.com/docker/distribution/docs/storage-drivers/swift.md +++ /dev/null @@ -1,268 +0,0 @@ - - - -# OpenStack Swift storage driver - -An implementation of the `storagedriver.StorageDriver` interface that uses [OpenStack Swift](http://docs.openstack.org/developer/swift/) for object storage. - -## Parameters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterRequiredDescription
- authurl - - yes - - URL for obtaining an auth token. https://storage.myprovider.com/v2.0 or https://storage.myprovider.com/v3/auth -
- username - - yes - - Your Openstack user name. -
- password - - yes - - Your Openstack password. -
- region - - no - - The Openstack region in which your container exists. -
- container - - yes - - The name of your Swift container where you wish to store the registry's data. The driver creates the named container during its initialization. -
- tenant - - no - - Your Openstack tenant name. You can either use tenant or tenantid. -
- tenantid - - no - - Your Openstack tenant id. You can either use tenant or tenantid. -
- domain - - no - - Your user's Openstack domain name for Identity v3 API. You can either use domain or domainid. -
- domainid - - no - - Your user's Openstack domain id for Identity v3 API. You can either use domain or domainid. -
- tenantdomain - - no - - Your tenant's Openstack domain name for Identity v3 API. Only necessary if different from the domain. You can either use tenantdomain or tenantdomainid. -
- tenantdomainid - - no - - Your tenant's Openstack domain id for Identity v3 API. Only necessary if different from the domain. You can either use tenantdomain or tenantdomainid. -
- trustid - - no - - Your Openstack trust id for Identity v3 API. -
- insecureskipverify - - no - - true to skip TLS verification, false by default. -
- chunksize - - no - - Size of the data segments for the Swift Dynamic Large Objects. This value should be a number (defaults to 5M). -
- prefix - - no - - This is a prefix that will be applied to all Swift keys to allow you to segment data in your container if necessary. Defaults to the empty string which is the container's root. -
- secretkey - - no - - The secret key used to generate temporary URLs. -
- accesskey - - no - - The access key to generate temporary URLs. It is used by HP Cloud Object Storage in addition to the `secretkey` parameter. -
- authversion - - no - - Specify the OpenStack Auth's version,for example 3. By default the driver will autodetect the auth's version from the AuthURL. -
- endpointtype - - no - - The endpoint type used when connecting to swift. Possible values are `public`, `internal` and `admin`. Default is `public`. -
- -The features supported by the Swift server are queried by requesting the `/info` URL on the server. In case the administrator -disabled that feature, the configuration file can specify the following optional parameters : - - - - - - - - - - -
- tempurlcontainerkey - -

- Specify whether to use container secret key to generate temporary URL when set to true, or the account secret key otherwise.

-

-
- tempurlmethods - -

- Array of HTTP methods that are supported by the TempURL middleware of the Swift server. Example:

- - - tempurlmethods: - - GET - - PUT - - HEAD - - POST - - DELETE - -

-
diff --git a/vendor/github.com/docker/distribution/manifest/schema1/config_builder.go b/vendor/github.com/docker/distribution/manifest/schema1/config_builder.go index 5cdd76796..be0123731 100644 --- a/vendor/github.com/docker/distribution/manifest/schema1/config_builder.go +++ b/vendor/github.com/docker/distribution/manifest/schema1/config_builder.go @@ -9,11 +9,10 @@ import ( "github.com/docker/distribution" "github.com/docker/distribution/context" - "github.com/docker/distribution/reference" - "github.com/docker/libtrust" - "github.com/docker/distribution/digest" "github.com/docker/distribution/manifest" + "github.com/docker/distribution/reference" + "github.com/docker/libtrust" ) type diffID digest.Digest @@ -95,7 +94,7 @@ func (mb *configManifestBuilder) Build(ctx context.Context) (m distribution.Mani } if len(img.RootFS.DiffIDs) != len(mb.descriptors) { - return nil, errors.New("number of descriptors and number of layers in rootfs must match") + return nil, fmt.Errorf("number of descriptors and number of layers in rootfs must match: len(%v) != len(%v)", img.RootFS.DiffIDs, mb.descriptors) } // Generate IDs for each layer diff --git a/vendor/github.com/docker/distribution/manifest/schema2/builder_test.go b/vendor/github.com/docker/distribution/manifest/schema2/builder_test.go index 02ed401bf..851f917cb 100644 --- a/vendor/github.com/docker/distribution/manifest/schema2/builder_test.go +++ b/vendor/github.com/docker/distribution/manifest/schema2/builder_test.go @@ -203,8 +203,8 @@ func TestBuilder(t *testing.T) { } references := manifest.References() - - if !reflect.DeepEqual(references, descriptors) { + expected := append([]distribution.Descriptor{manifest.Target()}, descriptors...) + if !reflect.DeepEqual(references, expected) { t.Fatal("References() does not match the descriptors added") } } diff --git a/vendor/github.com/docker/distribution/manifest/schema2/manifest.go b/vendor/github.com/docker/distribution/manifest/schema2/manifest.go index dd2ed114c..741998d04 100644 --- a/vendor/github.com/docker/distribution/manifest/schema2/manifest.go +++ b/vendor/github.com/docker/distribution/manifest/schema2/manifest.go @@ -18,7 +18,7 @@ const ( MediaTypeConfig = "application/vnd.docker.container.image.v1+json" // MediaTypePluginConfig specifies the mediaType for plugin configuration. - MediaTypePluginConfig = "application/vnd.docker.plugin.image.v0+json" + MediaTypePluginConfig = "application/vnd.docker.plugin.v1+json" // MediaTypeLayer is the mediaType used for layers referenced by the // manifest. @@ -69,7 +69,10 @@ type Manifest struct { // References returnes the descriptors of this manifests references. func (m Manifest) References() []distribution.Descriptor { - return m.Layers + references := make([]distribution.Descriptor, 0, 1+len(m.Layers)) + references = append(references, m.Config) + references = append(references, m.Layers...) + return references } // Target returns the target of this signed manifest. diff --git a/vendor/github.com/docker/distribution/manifest/schema2/manifest_test.go b/vendor/github.com/docker/distribution/manifest/schema2/manifest_test.go index 459d614cd..f0003d18b 100644 --- a/vendor/github.com/docker/distribution/manifest/schema2/manifest_test.go +++ b/vendor/github.com/docker/distribution/manifest/schema2/manifest_test.go @@ -90,16 +90,22 @@ func TestManifest(t *testing.T) { } references := deserialized.References() - if len(references) != 1 { + if len(references) != 2 { t.Fatalf("unexpected number of references: %d", len(references)) } - if references[0].Digest != "sha256:62d8908bee94c202b2d35224a221aaa2058318bfa9879fa541efaecba272331b" { + + if !reflect.DeepEqual(references[0], target) { + t.Fatalf("first reference should be target: %v != %v", references[0], target) + } + + // Test the second reference + if references[1].Digest != "sha256:62d8908bee94c202b2d35224a221aaa2058318bfa9879fa541efaecba272331b" { t.Fatalf("unexpected digest in reference: %s", references[0].Digest.String()) } - if references[0].MediaType != MediaTypeLayer { + if references[1].MediaType != MediaTypeLayer { t.Fatalf("unexpected media type in reference: %s", references[0].MediaType) } - if references[0].Size != 153263 { + if references[1].Size != 153263 { t.Fatalf("unexpected size in reference: %d", references[0].Size) } } diff --git a/vendor/github.com/docker/distribution/manifests.go b/vendor/github.com/docker/distribution/manifests.go index 2ac7c8f21..c4fb63450 100644 --- a/vendor/github.com/docker/distribution/manifests.go +++ b/vendor/github.com/docker/distribution/manifests.go @@ -12,8 +12,13 @@ import ( // references and an optional target type Manifest interface { // References returns a list of objects which make up this manifest. - // The references are strictly ordered from base to head. A reference - // is anything which can be represented by a distribution.Descriptor + // A reference is anything which can be represented by a + // distribution.Descriptor. These can consist of layers, resources or other + // manifests. + // + // While no particular order is required, implementations should return + // them from highest to lowest priority. For example, one might want to + // return the base layer before the top layer. References() []Descriptor // Payload provides the serialized format of the manifest, in addition to @@ -36,6 +41,9 @@ type ManifestBuilder interface { // AppendReference includes the given object in the manifest after any // existing dependencies. If the add fails, such as when adding an // unsupported dependency, an error may be returned. + // + // The destination of the reference is dependent on the manifest type and + // the dependency type. AppendReference(dependency Describable) error } diff --git a/vendor/github.com/docker/distribution/reference/reference.go b/vendor/github.com/docker/distribution/reference/reference.go index 5b3e08ee4..02786628e 100644 --- a/vendor/github.com/docker/distribution/reference/reference.go +++ b/vendor/github.com/docker/distribution/reference/reference.go @@ -24,6 +24,7 @@ package reference import ( "errors" "fmt" + "path" "strings" "github.com/docker/distribution/digest" @@ -138,7 +139,7 @@ type Canonical interface { func SplitHostname(named Named) (string, string) { name := named.Name() match := anchoredNameRegexp.FindStringSubmatch(name) - if match == nil || len(match) != 3 { + if len(match) != 3 { return "", name } return match[1], match[2] @@ -218,6 +219,13 @@ func WithTag(name Named, tag string) (NamedTagged, error) { if !anchoredTagRegexp.MatchString(tag) { return nil, ErrTagInvalidFormat } + if canonical, ok := name.(Canonical); ok { + return reference{ + name: name.Name(), + tag: tag, + digest: canonical.Digest(), + }, nil + } return taggedReference{ name: name.Name(), tag: tag, @@ -230,12 +238,34 @@ func WithDigest(name Named, digest digest.Digest) (Canonical, error) { if !anchoredDigestRegexp.MatchString(digest.String()) { return nil, ErrDigestInvalidFormat } + if tagged, ok := name.(Tagged); ok { + return reference{ + name: name.Name(), + tag: tagged.Tag(), + digest: digest, + }, nil + } return canonicalReference{ name: name.Name(), digest: digest, }, nil } +// Match reports whether ref matches the specified pattern. +// See https://godoc.org/path#Match for supported patterns. +func Match(pattern string, ref Reference) (bool, error) { + matched, err := path.Match(pattern, ref.String()) + if namedRef, isNamed := ref.(Named); isNamed && !matched { + matched, _ = path.Match(pattern, namedRef.Name()) + } + return matched, err +} + +// TrimNamed removes any tag or digest from the named reference. +func TrimNamed(ref Named) Named { + return repository(ref.Name()) +} + func getBestReferenceType(ref reference) Reference { if ref.name == "" { // Allow digest only references diff --git a/vendor/github.com/docker/distribution/reference/reference_test.go b/vendor/github.com/docker/distribution/reference/reference_test.go index f60cf093e..405c47c05 100644 --- a/vendor/github.com/docker/distribution/reference/reference_test.go +++ b/vendor/github.com/docker/distribution/reference/reference_test.go @@ -467,6 +467,7 @@ func TestSerialization(t *testing.T) { func TestWithTag(t *testing.T) { testcases := []struct { name string + digest digest.Digest tag string combined string }{ @@ -490,6 +491,12 @@ func TestWithTag(t *testing.T) { tag: "TAG5", combined: "test.com:8000/foo:TAG5", }, + { + name: "test.com:8000/foo", + digest: "sha256:1234567890098765432112345667890098765", + tag: "TAG5", + combined: "test.com:8000/foo:TAG5@sha256:1234567890098765432112345667890098765", + }, } for _, testcase := range testcases { failf := func(format string, v ...interface{}) { @@ -501,6 +508,14 @@ func TestWithTag(t *testing.T) { if err != nil { failf("error parsing name: %s", err) } + if testcase.digest != "" { + canonical, err := WithDigest(named, testcase.digest) + if err != nil { + failf("error adding digest") + } + named = canonical + } + tagged, err := WithTag(named, testcase.tag) if err != nil { failf("WithTag failed: %s", err) @@ -515,6 +530,7 @@ func TestWithDigest(t *testing.T) { testcases := []struct { name string digest digest.Digest + tag string combined string }{ { @@ -532,6 +548,12 @@ func TestWithDigest(t *testing.T) { digest: "sha256:1234567890098765432112345667890098765", combined: "test.com:8000/foo@sha256:1234567890098765432112345667890098765", }, + { + name: "test.com:8000/foo", + digest: "sha256:1234567890098765432112345667890098765", + tag: "latest", + combined: "test.com:8000/foo:latest@sha256:1234567890098765432112345667890098765", + }, } for _, testcase := range testcases { failf := func(format string, v ...interface{}) { @@ -543,6 +565,13 @@ func TestWithDigest(t *testing.T) { if err != nil { failf("error parsing name: %s", err) } + if testcase.tag != "" { + tagged, err := WithTag(named, testcase.tag) + if err != nil { + failf("error adding tag") + } + named = tagged + } digested, err := WithDigest(named, testcase.digest) if err != nil { failf("WithDigest failed: %s", err) @@ -552,3 +581,81 @@ func TestWithDigest(t *testing.T) { } } } + +func TestMatchError(t *testing.T) { + named, err := Parse("foo") + if err != nil { + t.Fatal(err) + } + _, err = Match("[-x]", named) + if err == nil { + t.Fatalf("expected an error, got nothing") + } +} + +func TestMatch(t *testing.T) { + matchCases := []struct { + reference string + pattern string + expected bool + }{ + { + reference: "foo", + pattern: "foo/**/ba[rz]", + expected: false, + }, + { + reference: "foo/any/bat", + pattern: "foo/**/ba[rz]", + expected: false, + }, + { + reference: "foo/a/bar", + pattern: "foo/**/ba[rz]", + expected: true, + }, + { + reference: "foo/b/baz", + pattern: "foo/**/ba[rz]", + expected: true, + }, + { + reference: "foo/c/baz:tag", + pattern: "foo/**/ba[rz]", + expected: true, + }, + { + reference: "foo/c/baz:tag", + pattern: "foo/*/baz:tag", + expected: true, + }, + { + reference: "foo/c/baz:tag", + pattern: "foo/c/baz:tag", + expected: true, + }, + { + reference: "example.com/foo/c/baz:tag", + pattern: "*/foo/c/baz", + expected: true, + }, + { + reference: "example.com/foo/c/baz:tag", + pattern: "example.com/foo/c/baz", + expected: true, + }, + } + for _, c := range matchCases { + named, err := Parse(c.reference) + if err != nil { + t.Fatal(err) + } + actual, err := Match(c.pattern, named) + if err != nil { + t.Fatal(err) + } + if actual != c.expected { + t.Fatalf("expected %s match %s to be %v, was %v", c.reference, c.pattern, c.expected, actual) + } + } +} diff --git a/vendor/github.com/docker/distribution/registry/api/v2/headerparser.go b/vendor/github.com/docker/distribution/registry/api/v2/headerparser.go new file mode 100644 index 000000000..9bc41a3a6 --- /dev/null +++ b/vendor/github.com/docker/distribution/registry/api/v2/headerparser.go @@ -0,0 +1,161 @@ +package v2 + +import ( + "fmt" + "regexp" + "strings" + "unicode" +) + +var ( + // according to rfc7230 + reToken = regexp.MustCompile(`^[^"(),/:;<=>?@[\]{}[:space:][:cntrl:]]+`) + reQuotedValue = regexp.MustCompile(`^[^\\"]+`) + reEscapedCharacter = regexp.MustCompile(`^[[:blank:][:graph:]]`) +) + +// parseForwardedHeader is a benevolent parser of Forwarded header defined in rfc7239. The header contains +// a comma-separated list of forwarding key-value pairs. Each list element is set by single proxy. The +// function parses only the first element of the list, which is set by the very first proxy. It returns a map +// of corresponding key-value pairs and an unparsed slice of the input string. +// +// Examples of Forwarded header values: +// +// 1. Forwarded: For=192.0.2.43; Proto=https,For="[2001:db8:cafe::17]",For=unknown +// 2. Forwarded: for="192.0.2.43:443"; host="registry.example.org", for="10.10.05.40:80" +// +// The first will be parsed into {"for": "192.0.2.43", "proto": "https"} while the second into +// {"for": "192.0.2.43:443", "host": "registry.example.org"}. +func parseForwardedHeader(forwarded string) (map[string]string, string, error) { + // Following are states of forwarded header parser. Any state could transition to a failure. + const ( + // terminating state; can transition to Parameter + stateElement = iota + // terminating state; can transition to KeyValueDelimiter + stateParameter + // can transition to Value + stateKeyValueDelimiter + // can transition to one of { QuotedValue, PairEnd } + stateValue + // can transition to one of { EscapedCharacter, PairEnd } + stateQuotedValue + // can transition to one of { QuotedValue } + stateEscapedCharacter + // terminating state; can transition to one of { Parameter, Element } + statePairEnd + ) + + var ( + parameter string + value string + parse = forwarded[:] + res = map[string]string{} + state = stateElement + ) + +Loop: + for { + // skip spaces unless in quoted value + if state != stateQuotedValue && state != stateEscapedCharacter { + parse = strings.TrimLeftFunc(parse, unicode.IsSpace) + } + + if len(parse) == 0 { + if state != stateElement && state != statePairEnd && state != stateParameter { + return nil, parse, fmt.Errorf("unexpected end of input") + } + // terminating + break + } + + switch state { + // terminate at list element delimiter + case stateElement: + if parse[0] == ',' { + parse = parse[1:] + break Loop + } + state = stateParameter + + // parse parameter (the key of key-value pair) + case stateParameter: + match := reToken.FindString(parse) + if len(match) == 0 { + return nil, parse, fmt.Errorf("failed to parse token at position %d", len(forwarded)-len(parse)) + } + parameter = strings.ToLower(match) + parse = parse[len(match):] + state = stateKeyValueDelimiter + + // parse '=' + case stateKeyValueDelimiter: + if parse[0] != '=' { + return nil, parse, fmt.Errorf("expected '=', not '%c' at position %d", parse[0], len(forwarded)-len(parse)) + } + parse = parse[1:] + state = stateValue + + // parse value or quoted value + case stateValue: + if parse[0] == '"' { + parse = parse[1:] + state = stateQuotedValue + } else { + value = reToken.FindString(parse) + if len(value) == 0 { + return nil, parse, fmt.Errorf("failed to parse value at position %d", len(forwarded)-len(parse)) + } + if _, exists := res[parameter]; exists { + return nil, parse, fmt.Errorf("duplicate parameter %q at position %d", parameter, len(forwarded)-len(parse)) + } + res[parameter] = value + parse = parse[len(value):] + value = "" + state = statePairEnd + } + + // parse a part of quoted value until the first backslash + case stateQuotedValue: + match := reQuotedValue.FindString(parse) + value += match + parse = parse[len(match):] + switch { + case len(parse) == 0: + return nil, parse, fmt.Errorf("unterminated quoted string") + case parse[0] == '"': + res[parameter] = value + value = "" + parse = parse[1:] + state = statePairEnd + case parse[0] == '\\': + parse = parse[1:] + state = stateEscapedCharacter + } + + // parse escaped character in a quoted string, ignore the backslash + // transition back to QuotedValue state + case stateEscapedCharacter: + c := reEscapedCharacter.FindString(parse) + if len(c) == 0 { + return nil, parse, fmt.Errorf("invalid escape sequence at position %d", len(forwarded)-len(parse)-1) + } + value += c + parse = parse[1:] + state = stateQuotedValue + + // expect either a new key-value pair, new list or end of input + case statePairEnd: + switch parse[0] { + case ';': + parse = parse[1:] + state = stateParameter + case ',': + state = stateElement + default: + return nil, parse, fmt.Errorf("expected ',' or ';', not %c at position %d", parse[0], len(forwarded)-len(parse)) + } + } + } + + return res, parse, nil +} diff --git a/vendor/github.com/docker/distribution/registry/api/v2/headerparser_test.go b/vendor/github.com/docker/distribution/registry/api/v2/headerparser_test.go new file mode 100644 index 000000000..b8c37490d --- /dev/null +++ b/vendor/github.com/docker/distribution/registry/api/v2/headerparser_test.go @@ -0,0 +1,161 @@ +package v2 + +import ( + "testing" +) + +func TestParseForwardedHeader(t *testing.T) { + for _, tc := range []struct { + name string + raw string + expected map[string]string + expectedRest string + expectedError bool + }{ + { + name: "empty", + raw: "", + }, + { + name: "one pair", + raw: " key = value ", + expected: map[string]string{"key": "value"}, + }, + { + name: "two pairs", + raw: " key1 = value1; key2=value2", + expected: map[string]string{"key1": "value1", "key2": "value2"}, + }, + { + name: "uppercase parameter", + raw: "KeY=VaL", + expected: map[string]string{"key": "VaL"}, + }, + { + name: "missing key=value pair - be tolerant", + raw: "key=val;", + expected: map[string]string{"key": "val"}, + }, + { + name: "quoted values", + raw: `key="val";param = "[[ $((1 + 1)) == 3 ]] && echo panic!;" ; p=" abcd "`, + expected: map[string]string{"key": "val", "param": "[[ $((1 + 1)) == 3 ]] && echo panic!;", "p": " abcd "}, + }, + { + name: "empty quoted value", + raw: `key=""`, + expected: map[string]string{"key": ""}, + }, + { + name: "quoted double quotes", + raw: `key="\"value\""`, + expected: map[string]string{"key": `"value"`}, + }, + { + name: "quoted backslash", + raw: `key="\"\\\""`, + expected: map[string]string{"key": `"\"`}, + }, + { + name: "ignore subsequent elements", + raw: "key=a, param= b", + expected: map[string]string{"key": "a"}, + expectedRest: " param= b", + }, + { + name: "empty element - be tolerant", + raw: " , key=val", + expectedRest: " key=val", + }, + { + name: "obscure key", + raw: `ob₷C&r€ = value`, + expected: map[string]string{`ob₷c&r€`: "value"}, + }, + { + name: "duplicate parameter", + raw: "key=a; p=b; key=c", + expectedError: true, + }, + { + name: "empty parameter", + raw: "=value", + expectedError: true, + }, + { + name: "empty value", + raw: "key= ", + expectedError: true, + }, + { + name: "empty value before a new element ", + raw: "key=,", + expectedError: true, + }, + { + name: "empty value before a new pair", + raw: "key=;", + expectedError: true, + }, + { + name: "just parameter", + raw: "key", + expectedError: true, + }, + { + name: "missing key-value", + raw: "a=b;;", + expectedError: true, + }, + { + name: "unclosed quoted value", + raw: `key="value`, + expectedError: true, + }, + { + name: "escaped terminating dquote", + raw: `key="value\"`, + expectedError: true, + }, + { + name: "just a quoted value", + raw: `"key=val"`, + expectedError: true, + }, + { + name: "quoted key", + raw: `"key"=val`, + expectedError: true, + }, + } { + parsed, rest, err := parseForwardedHeader(tc.raw) + if err != nil && !tc.expectedError { + t.Errorf("[%s] got unexpected error: %v", tc.name, err) + } + if err == nil && tc.expectedError { + t.Errorf("[%s] got unexpected non-error", tc.name) + } + if err != nil || tc.expectedError { + continue + } + for key, value := range tc.expected { + v, exists := parsed[key] + if !exists { + t.Errorf("[%s] missing expected parameter %q", tc.name, key) + continue + } + if v != value { + t.Errorf("[%s] got unexpected value for parameter %q: %q != %q", tc.name, key, v, value) + } + } + for key, value := range parsed { + if _, exists := tc.expected[key]; !exists { + t.Errorf("[%s] got unexpected key/value pair: %q=%q", tc.name, key, value) + } + } + + if rest != tc.expectedRest { + t.Errorf("[%s] got unexpected unparsed string: %q != %q", tc.name, rest, tc.expectedRest) + } + } +} diff --git a/vendor/github.com/docker/distribution/registry/api/v2/urls.go b/vendor/github.com/docker/distribution/registry/api/v2/urls.go index a959aaa89..5e24ca9b5 100644 --- a/vendor/github.com/docker/distribution/registry/api/v2/urls.go +++ b/vendor/github.com/docker/distribution/registry/api/v2/urls.go @@ -46,30 +46,42 @@ func NewURLBuilderFromString(root string, relative bool) (*URLBuilder, error) { // NewURLBuilderFromRequest uses information from an *http.Request to // construct the root url. func NewURLBuilderFromRequest(r *http.Request, relative bool) *URLBuilder { - var scheme string - - forwardedProto := r.Header.Get("X-Forwarded-Proto") - - switch { - case len(forwardedProto) > 0: - scheme = forwardedProto - case r.TLS != nil: - scheme = "https" - case len(r.URL.Scheme) > 0: - scheme = r.URL.Scheme - default: + var ( scheme = "http" + host = r.Host + ) + + if r.TLS != nil { + scheme = "https" + } else if len(r.URL.Scheme) > 0 { + scheme = r.URL.Scheme } - host := r.Host - forwardedHost := r.Header.Get("X-Forwarded-Host") - if len(forwardedHost) > 0 { - // According to the Apache mod_proxy docs, X-Forwarded-Host can be a - // comma-separated list of hosts, to which each proxy appends the - // requested host. We want to grab the first from this comma-separated - // list. - hosts := strings.SplitN(forwardedHost, ",", 2) - host = strings.TrimSpace(hosts[0]) + // Handle fowarded headers + // Prefer "Forwarded" header as defined by rfc7239 if given + // see https://tools.ietf.org/html/rfc7239 + if forwarded := r.Header.Get("Forwarded"); len(forwarded) > 0 { + forwardedHeader, _, err := parseForwardedHeader(forwarded) + if err == nil { + if fproto := forwardedHeader["proto"]; len(fproto) > 0 { + scheme = fproto + } + if fhost := forwardedHeader["host"]; len(fhost) > 0 { + host = fhost + } + } + } else { + if forwardedProto := r.Header.Get("X-Forwarded-Proto"); len(forwardedProto) > 0 { + scheme = forwardedProto + } + if forwardedHost := r.Header.Get("X-Forwarded-Host"); len(forwardedHost) > 0 { + // According to the Apache mod_proxy docs, X-Forwarded-Host can be a + // comma-separated list of hosts, to which each proxy appends the + // requested host. We want to grab the first from this comma-separated + // list. + hosts := strings.SplitN(forwardedHost, ",", 2) + host = strings.TrimSpace(hosts[0]) + } } basePath := routeDescriptorsMap[RouteNameBase].Path diff --git a/vendor/github.com/docker/distribution/registry/api/v2/urls_test.go b/vendor/github.com/docker/distribution/registry/api/v2/urls_test.go index 10aadd52e..6d8973fad 100644 --- a/vendor/github.com/docker/distribution/registry/api/v2/urls_test.go +++ b/vendor/github.com/docker/distribution/registry/api/v2/urls_test.go @@ -165,50 +165,213 @@ func TestBuilderFromRequest(t *testing.T) { t.Fatal(err) } - forwardedProtoHeader := make(http.Header, 1) - forwardedProtoHeader.Set("X-Forwarded-Proto", "https") - - forwardedHostHeader1 := make(http.Header, 1) - forwardedHostHeader1.Set("X-Forwarded-Host", "first.example.com") - - forwardedHostHeader2 := make(http.Header, 1) - forwardedHostHeader2.Set("X-Forwarded-Host", "first.example.com, proxy1.example.com") - testRequests := []struct { + name string request *http.Request base string configHost url.URL }{ { + name: "no forwarded header", request: &http.Request{URL: u, Host: u.Host}, base: "http://example.com", }, - { - request: &http.Request{URL: u, Host: u.Host, Header: forwardedProtoHeader}, - base: "http://example.com", + name: "https protocol forwarded with a non-standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Custom-Forwarded-Proto": []string{"https"}, + }}, + base: "http://example.com", }, { - request: &http.Request{URL: u, Host: u.Host, Header: forwardedProtoHeader}, - base: "https://example.com", + name: "forwarded protocol is the same", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{"https"}, + }}, + base: "https://example.com", }, { - request: &http.Request{URL: u, Host: u.Host, Header: forwardedHostHeader1}, - base: "http://first.example.com", + name: "forwarded host with a non-standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"first.example.com"}, + }}, + base: "http://first.example.com", }, { - request: &http.Request{URL: u, Host: u.Host, Header: forwardedHostHeader2}, - base: "http://first.example.com", + name: "forwarded multiple hosts a with non-standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"first.example.com, proxy1.example.com"}, + }}, + base: "http://first.example.com", }, { - request: &http.Request{URL: u, Host: u.Host, Header: forwardedHostHeader2}, - base: "https://third.example.com:5000", + name: "host configured in config file takes priority", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"first.example.com, proxy1.example.com"}, + }}, + base: "https://third.example.com:5000", configHost: url.URL{ Scheme: "https", Host: "third.example.com:5000", }, }, + { + name: "forwarded host and port with just one non-standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"first.example.com:443"}, + }}, + base: "http://first.example.com:443", + }, + { + name: "forwarded port with a non-standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"example.com:5000"}, + "X-Forwarded-Port": []string{"5000"}, + }}, + base: "http://example.com:5000", + }, + { + name: "forwarded multiple ports with a non-standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Port": []string{"443 , 5001"}, + }}, + base: "http://example.com", + }, + { + name: "forwarded standard port with non-standard headers", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{"https"}, + "X-Forwarded-Host": []string{"example.com"}, + "X-Forwarded-Port": []string{"443"}, + }}, + base: "https://example.com", + }, + { + name: "forwarded standard port with non-standard headers and explicit port", + request: &http.Request{URL: u, Host: u.Host + ":443", Header: http.Header{ + "X-Forwarded-Proto": []string{"https"}, + "X-Forwarded-Host": []string{u.Host + ":443"}, + "X-Forwarded-Port": []string{"443"}, + }}, + base: "https://example.com:443", + }, + { + name: "several non-standard headers", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{"https"}, + "X-Forwarded-Host": []string{" first.example.com:12345 "}, + }}, + base: "https://first.example.com:12345", + }, + { + name: "forwarded host with port supplied takes priority", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"first.example.com:5000"}, + "X-Forwarded-Port": []string{"80"}, + }}, + base: "http://first.example.com:5000", + }, + { + name: "malformed forwarded port", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Host": []string{"first.example.com"}, + "X-Forwarded-Port": []string{"abcd"}, + }}, + base: "http://first.example.com", + }, + { + name: "forwarded protocol and addr using standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`proto=https;host="192.168.22.30:80"`}, + }}, + base: "https://192.168.22.30:80", + }, + { + name: "forwarded host takes priority over for", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`host="reg.example.com:5000";for="192.168.22.30"`}, + }}, + base: "http://reg.example.com:5000", + }, + { + name: "forwarded host and protocol using standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`host=reg.example.com;proto=https`}, + }}, + base: "https://reg.example.com", + }, + { + name: "process just the first standard forwarded header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`host="reg.example.com:88";proto=http`, `host=reg.example.com;proto=https`}, + }}, + base: "http://reg.example.com:88", + }, + { + name: "process just the first list element of standard header", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`host="reg.example.com:443";proto=https, host="reg.example.com:80";proto=http`}, + }}, + base: "https://reg.example.com:443", + }, + { + name: "IPv6 address use host", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`for="2607:f0d0:1002:51::4";host="[2607:f0d0:1002:51::4]:5001"`}, + "X-Forwarded-Port": []string{"5002"}, + }}, + base: "http://[2607:f0d0:1002:51::4]:5001", + }, + { + name: "IPv6 address with port", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "Forwarded": []string{`host="[2607:f0d0:1002:51::4]:4000"`}, + "X-Forwarded-Port": []string{"5001"}, + }}, + base: "http://[2607:f0d0:1002:51::4]:4000", + }, + { + name: "non-standard and standard forward headers", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{`https`}, + "X-Forwarded-Host": []string{`first.example.com`}, + "X-Forwarded-Port": []string{``}, + "Forwarded": []string{`host=first.example.com; proto=https`}, + }}, + base: "https://first.example.com", + }, + { + name: "standard header takes precedence over non-standard headers", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{`http`}, + "Forwarded": []string{`host=second.example.com; proto=https`}, + "X-Forwarded-Host": []string{`first.example.com`}, + "X-Forwarded-Port": []string{`4000`}, + }}, + base: "https://second.example.com", + }, + { + name: "incomplete standard header uses default", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{`https`}, + "Forwarded": []string{`for=127.0.0.1`}, + "X-Forwarded-Host": []string{`first.example.com`}, + "X-Forwarded-Port": []string{`4000`}, + }}, + base: "http://" + u.Host, + }, + { + name: "standard with just proto", + request: &http.Request{URL: u, Host: u.Host, Header: http.Header{ + "X-Forwarded-Proto": []string{`https`}, + "Forwarded": []string{`proto=https`}, + "X-Forwarded-Host": []string{`first.example.com`}, + "X-Forwarded-Port": []string{`4000`}, + }}, + base: "https://" + u.Host, + }, } + doTest := func(relative bool) { for _, tr := range testRequests { var builder *URLBuilder @@ -221,34 +384,21 @@ func TestBuilderFromRequest(t *testing.T) { for _, testCase := range makeURLBuilderTestCases(builder) { buildURL, err := testCase.build() if err != nil { - t.Fatalf("%s: error building url: %v", testCase.description, err) + t.Fatalf("[relative=%t, request=%q, case=%q]: error building url: %v", relative, tr.name, testCase.description, err) } - var expectedURL string - proto, ok := tr.request.Header["X-Forwarded-Proto"] - if !ok { - expectedURL = testCase.expectedPath - if !relative { - expectedURL = tr.base + expectedURL - } - } else { - urlBase, err := url.Parse(tr.base) - if err != nil { - t.Fatal(err) - } - urlBase.Scheme = proto[0] - expectedURL = testCase.expectedPath - if !relative { - expectedURL = urlBase.String() + expectedURL - } + expectedURL := testCase.expectedPath + if !relative { + expectedURL = tr.base + expectedURL } if buildURL != expectedURL { - t.Fatalf("%s: %q != %q", testCase.description, buildURL, expectedURL) + t.Errorf("[relative=%t, request=%q, case=%q]: %q != %q", relative, tr.name, testCase.description, buildURL, expectedURL) } } } } + doTest(true) doTest(false) } diff --git a/vendor/github.com/docker/distribution/registry/auth/auth.go b/vendor/github.com/docker/distribution/registry/auth/auth.go index 0cb37235b..1c9af8821 100644 --- a/vendor/github.com/docker/distribution/registry/auth/auth.go +++ b/vendor/github.com/docker/distribution/registry/auth/auth.go @@ -66,8 +66,9 @@ type UserInfo struct { // Resource describes a resource by type and name. type Resource struct { - Type string - Name string + Type string + Class string + Name string } // Access describes a specific action that is @@ -135,6 +136,39 @@ func (uic userInfoContext) Value(key interface{}) interface{} { return uic.Context.Value(key) } +// WithResources returns a context with the authorized resources. +func WithResources(ctx context.Context, resources []Resource) context.Context { + return resourceContext{ + Context: ctx, + resources: resources, + } +} + +type resourceContext struct { + context.Context + resources []Resource +} + +type resourceKey struct{} + +func (rc resourceContext) Value(key interface{}) interface{} { + if key == (resourceKey{}) { + return rc.resources + } + + return rc.Context.Value(key) +} + +// AuthorizedResources returns the list of resources which have +// been authorized for this request. +func AuthorizedResources(ctx context.Context) []Resource { + if resources, ok := ctx.Value(resourceKey{}).([]Resource); ok { + return resources + } + + return nil +} + // InitFunc is the type of an AccessController factory function and is used // to register the constructor for different AccesController backends. type InitFunc func(options map[string]interface{}) (AccessController, error) diff --git a/vendor/github.com/docker/distribution/registry/auth/silly/access_test.go b/vendor/github.com/docker/distribution/registry/auth/silly/access_test.go index a7c14cb9d..0a5103e6c 100644 --- a/vendor/github.com/docker/distribution/registry/auth/silly/access_test.go +++ b/vendor/github.com/docker/distribution/registry/auth/silly/access_test.go @@ -16,7 +16,7 @@ func TestSillyAccessController(t *testing.T) { } server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := context.WithValue(nil, "http.request", r) + ctx := context.WithRequest(context.Background(), r) authCtx, err := ac.Authorized(ctx) if err != nil { switch err := err.(type) { diff --git a/vendor/github.com/docker/distribution/registry/auth/token/accesscontroller.go b/vendor/github.com/docker/distribution/registry/auth/token/accesscontroller.go index 52b7f3692..4e8b7f1ce 100644 --- a/vendor/github.com/docker/distribution/registry/auth/token/accesscontroller.go +++ b/vendor/github.com/docker/distribution/registry/auth/token/accesscontroller.go @@ -261,6 +261,8 @@ func (ac *accessController) Authorized(ctx context.Context, accessItems ...auth. } } + ctx = auth.WithResources(ctx, token.resources()) + return auth.WithUser(ctx, auth.UserInfo{Name: token.Claims.Subject}), nil } diff --git a/vendor/github.com/docker/distribution/registry/auth/token/token.go b/vendor/github.com/docker/distribution/registry/auth/token/token.go index 634eb75b2..850f5813f 100644 --- a/vendor/github.com/docker/distribution/registry/auth/token/token.go +++ b/vendor/github.com/docker/distribution/registry/auth/token/token.go @@ -34,6 +34,7 @@ var ( // ResourceActions stores allowed actions on a named and typed resource. type ResourceActions struct { Type string `json:"type"` + Class string `json:"class,omitempty"` Name string `json:"name"` Actions []string `json:"actions"` } @@ -349,6 +350,29 @@ func (t *Token) accessSet() accessSet { return accessSet } +func (t *Token) resources() []auth.Resource { + if t.Claims == nil { + return nil + } + + resourceSet := map[auth.Resource]struct{}{} + for _, resourceActions := range t.Claims.Access { + resource := auth.Resource{ + Type: resourceActions.Type, + Class: resourceActions.Class, + Name: resourceActions.Name, + } + resourceSet[resource] = struct{}{} + } + + resources := make([]auth.Resource, 0, len(resourceSet)) + for resource := range resourceSet { + resources = append(resources, resource) + } + + return resources +} + func (t *Token) compactRaw() string { return fmt.Sprintf("%s.%s", t.Raw, joseBase64UrlEncode(t.Signature)) } diff --git a/vendor/github.com/docker/distribution/registry/auth/token/token_test.go b/vendor/github.com/docker/distribution/registry/auth/token/token_test.go index 27206f9b4..cbfe2a6b4 100644 --- a/vendor/github.com/docker/distribution/registry/auth/token/token_test.go +++ b/vendor/github.com/docker/distribution/registry/auth/token/token_test.go @@ -354,7 +354,7 @@ func TestAccessController(t *testing.T) { Action: "baz", } - ctx := context.WithValue(nil, "http.request", req) + ctx := context.WithRequest(context.Background(), req) authCtx, err := accessController.Authorized(ctx, testAccess) challenge, ok := err.(auth.Challenge) if !ok { diff --git a/vendor/github.com/docker/distribution/registry/client/auth/addr.go b/vendor/github.com/docker/distribution/registry/client/auth/challenge/addr.go similarity index 97% rename from vendor/github.com/docker/distribution/registry/client/auth/addr.go rename to vendor/github.com/docker/distribution/registry/client/auth/challenge/addr.go index 6e7775288..2c3ebe165 100644 --- a/vendor/github.com/docker/distribution/registry/client/auth/addr.go +++ b/vendor/github.com/docker/distribution/registry/client/auth/challenge/addr.go @@ -1,4 +1,4 @@ -package auth +package challenge import ( "net/url" diff --git a/vendor/github.com/docker/distribution/registry/client/auth/authchallenge.go b/vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge.go similarity index 91% rename from vendor/github.com/docker/distribution/registry/client/auth/authchallenge.go rename to vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge.go index 69d9d6fe0..c9bdfc355 100644 --- a/vendor/github.com/docker/distribution/registry/client/auth/authchallenge.go +++ b/vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge.go @@ -1,4 +1,4 @@ -package auth +package challenge import ( "fmt" @@ -18,12 +18,12 @@ type Challenge struct { Parameters map[string]string } -// ChallengeManager manages the challenges for endpoints. +// Manager manages the challenges for endpoints. // The challenges are pulled out of HTTP responses. Only // responses which expect challenges should be added to // the manager, since a non-unauthorized request will be // viewed as not requiring challenges. -type ChallengeManager interface { +type Manager interface { // GetChallenges returns the challenges for the given // endpoint URL. GetChallenges(endpoint url.URL) ([]Challenge, error) @@ -37,19 +37,19 @@ type ChallengeManager interface { AddResponse(resp *http.Response) error } -// NewSimpleChallengeManager returns an instance of -// ChallengeManger which only maps endpoints to challenges +// NewSimpleManager returns an instance of +// Manger which only maps endpoints to challenges // based on the responses which have been added the // manager. The simple manager will make no attempt to // perform requests on the endpoints or cache the responses // to a backend. -func NewSimpleChallengeManager() ChallengeManager { - return &simpleChallengeManager{ +func NewSimpleManager() Manager { + return &simpleManager{ Challanges: make(map[string][]Challenge), } } -type simpleChallengeManager struct { +type simpleManager struct { sync.RWMutex Challanges map[string][]Challenge } @@ -59,7 +59,7 @@ func normalizeURL(endpoint *url.URL) { endpoint.Host = canonicalAddr(endpoint) } -func (m *simpleChallengeManager) GetChallenges(endpoint url.URL) ([]Challenge, error) { +func (m *simpleManager) GetChallenges(endpoint url.URL) ([]Challenge, error) { normalizeURL(&endpoint) m.RLock() @@ -68,7 +68,7 @@ func (m *simpleChallengeManager) GetChallenges(endpoint url.URL) ([]Challenge, e return challenges, nil } -func (m *simpleChallengeManager) AddResponse(resp *http.Response) error { +func (m *simpleManager) AddResponse(resp *http.Response) error { challenges := ResponseChallenges(resp) if resp.Request == nil { return fmt.Errorf("missing request reference") diff --git a/vendor/github.com/docker/distribution/registry/client/auth/authchallenge_test.go b/vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge_test.go similarity index 97% rename from vendor/github.com/docker/distribution/registry/client/auth/authchallenge_test.go rename to vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge_test.go index 2716fba52..d4986b39e 100644 --- a/vendor/github.com/docker/distribution/registry/client/auth/authchallenge_test.go +++ b/vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge_test.go @@ -1,4 +1,4 @@ -package auth +package challenge import ( "fmt" @@ -50,7 +50,7 @@ func TestAuthChallengeNormalization(t *testing.T) { func testAuthChallengeNormalization(t *testing.T, host string) { - scm := NewSimpleChallengeManager() + scm := NewSimpleManager() url, err := url.Parse(fmt.Sprintf("http://%s/v2/", host)) if err != nil { @@ -86,7 +86,7 @@ func testAuthChallengeNormalization(t *testing.T, host string) { func testAuthChallengeConcurrent(t *testing.T, host string) { - scm := NewSimpleChallengeManager() + scm := NewSimpleManager() url, err := url.Parse(fmt.Sprintf("http://%s/v2/", host)) if err != nil { diff --git a/vendor/github.com/docker/distribution/registry/client/auth/session.go b/vendor/github.com/docker/distribution/registry/client/auth/session.go index d03d8ff0e..d6d884ffd 100644 --- a/vendor/github.com/docker/distribution/registry/client/auth/session.go +++ b/vendor/github.com/docker/distribution/registry/client/auth/session.go @@ -12,6 +12,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/distribution/registry/client" + "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/client/transport" ) @@ -58,7 +59,7 @@ type CredentialStore interface { // schemes. The handlers are tried in order, the higher priority authentication // methods should be first. The challengeMap holds a list of challenges for // a given root API endpoint (for example "https://registry-1.docker.io/v2/"). -func NewAuthorizer(manager ChallengeManager, handlers ...AuthenticationHandler) transport.RequestModifier { +func NewAuthorizer(manager challenge.Manager, handlers ...AuthenticationHandler) transport.RequestModifier { return &endpointAuthorizer{ challenges: manager, handlers: handlers, @@ -66,7 +67,7 @@ func NewAuthorizer(manager ChallengeManager, handlers ...AuthenticationHandler) } type endpointAuthorizer struct { - challenges ChallengeManager + challenges challenge.Manager handlers []AuthenticationHandler transport http.RoundTripper } @@ -94,11 +95,11 @@ func (ea *endpointAuthorizer) ModifyRequest(req *http.Request) error { if len(challenges) > 0 { for _, handler := range ea.handlers { - for _, challenge := range challenges { - if challenge.Scheme != handler.Scheme() { + for _, c := range challenges { + if c.Scheme != handler.Scheme() { continue } - if err := handler.AuthorizeRequest(req, challenge.Parameters); err != nil { + if err := handler.AuthorizeRequest(req, c.Parameters); err != nil { return err } } @@ -146,13 +147,18 @@ type Scope interface { // to a repository. type RepositoryScope struct { Repository string + Class string Actions []string } // String returns the string representation of the repository // using the scope grammar func (rs RepositoryScope) String() string { - return fmt.Sprintf("repository:%s:%s", rs.Repository, strings.Join(rs.Actions, ",")) + repoType := "repository" + if rs.Class != "" { + repoType = fmt.Sprintf("%s(%s)", repoType, rs.Class) + } + return fmt.Sprintf("%s:%s:%s", repoType, rs.Repository, strings.Join(rs.Actions, ",")) } // RegistryScope represents a token scope for access diff --git a/vendor/github.com/docker/distribution/registry/client/auth/session_test.go b/vendor/github.com/docker/distribution/registry/client/auth/session_test.go index cfae4f978..4f54c75cc 100644 --- a/vendor/github.com/docker/distribution/registry/client/auth/session_test.go +++ b/vendor/github.com/docker/distribution/registry/client/auth/session_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/client/transport" "github.com/docker/distribution/testutil" ) @@ -65,7 +66,7 @@ func testServerWithAuth(rrm testutil.RequestResponseMap, authenticate string, au // ping pings the provided endpoint to determine its required authorization challenges. // If a version header is provided, the versions will be returned. -func ping(manager ChallengeManager, endpoint, versionHeader string) ([]APIVersion, error) { +func ping(manager challenge.Manager, endpoint, versionHeader string) ([]APIVersion, error) { resp, err := http.Get(endpoint) if err != nil { return nil, err @@ -149,7 +150,7 @@ func TestEndpointAuthorizeToken(t *testing.T) { e, c := testServerWithAuth(m, authenicate, validCheck) defer c() - challengeManager1 := NewSimpleChallengeManager() + challengeManager1 := challenge.NewSimpleManager() versions, err := ping(challengeManager1, e+"/v2/", "x-api-version") if err != nil { t.Fatal(err) @@ -176,7 +177,7 @@ func TestEndpointAuthorizeToken(t *testing.T) { e2, c2 := testServerWithAuth(m, authenicate, validCheck) defer c2() - challengeManager2 := NewSimpleChallengeManager() + challengeManager2 := challenge.NewSimpleManager() versions, err = ping(challengeManager2, e2+"/v2/", "x-multi-api-version") if err != nil { t.Fatal(err) @@ -273,7 +274,7 @@ func TestEndpointAuthorizeRefreshToken(t *testing.T) { e, c := testServerWithAuth(m, authenicate, validCheck) defer c() - challengeManager1 := NewSimpleChallengeManager() + challengeManager1 := challenge.NewSimpleManager() versions, err := ping(challengeManager1, e+"/v2/", "x-api-version") if err != nil { t.Fatal(err) @@ -306,7 +307,7 @@ func TestEndpointAuthorizeRefreshToken(t *testing.T) { e2, c2 := testServerWithAuth(m, authenicate, validCheck) defer c2() - challengeManager2 := NewSimpleChallengeManager() + challengeManager2 := challenge.NewSimpleManager() versions, err = ping(challengeManager2, e2+"/v2/", "x-api-version") if err != nil { t.Fatal(err) @@ -339,7 +340,7 @@ func TestEndpointAuthorizeRefreshToken(t *testing.T) { e3, c3 := testServerWithAuth(m, authenicate, validCheck) defer c3() - challengeManager3 := NewSimpleChallengeManager() + challengeManager3 := challenge.NewSimpleManager() versions, err = ping(challengeManager3, e3+"/v2/", "x-api-version") if err != nil { t.Fatal(err) @@ -401,7 +402,7 @@ func TestEndpointAuthorizeV2RefreshToken(t *testing.T) { e, c := testServerWithAuth(m, authenicate, validCheck) defer c() - challengeManager1 := NewSimpleChallengeManager() + challengeManager1 := challenge.NewSimpleManager() versions, err := ping(challengeManager1, e+"/v2/", "x-api-version") if err != nil { t.Fatal(err) @@ -496,7 +497,7 @@ func TestEndpointAuthorizeTokenBasic(t *testing.T) { password: password, } - challengeManager := NewSimpleChallengeManager() + challengeManager := challenge.NewSimpleManager() _, err := ping(challengeManager, e+"/v2/", "") if err != nil { t.Fatal(err) @@ -614,7 +615,7 @@ func TestEndpointAuthorizeTokenBasicWithExpiresIn(t *testing.T) { password: password, } - challengeManager := NewSimpleChallengeManager() + challengeManager := challenge.NewSimpleManager() _, err := ping(challengeManager, e+"/v2/", "") if err != nil { t.Fatal(err) @@ -765,7 +766,7 @@ func TestEndpointAuthorizeTokenBasicWithExpiresInAndIssuedAt(t *testing.T) { password: password, } - challengeManager := NewSimpleChallengeManager() + challengeManager := challenge.NewSimpleManager() _, err := ping(challengeManager, e+"/v2/", "") if err != nil { t.Fatal(err) @@ -845,7 +846,7 @@ func TestEndpointAuthorizeBasic(t *testing.T) { password: password, } - challengeManager := NewSimpleChallengeManager() + challengeManager := challenge.NewSimpleManager() _, err := ping(challengeManager, e+"/v2/", "") if err != nil { t.Fatal(err) diff --git a/vendor/github.com/docker/distribution/registry/client/errors.go b/vendor/github.com/docker/distribution/registry/client/errors.go index f73e3c230..52d49d5d2 100644 --- a/vendor/github.com/docker/distribution/registry/client/errors.go +++ b/vendor/github.com/docker/distribution/registry/client/errors.go @@ -9,6 +9,7 @@ import ( "net/http" "github.com/docker/distribution/registry/api/errcode" + "github.com/docker/distribution/registry/client/auth/challenge" ) // ErrNoErrorsInBody is returned when an HTTP response body parses to an empty @@ -82,21 +83,52 @@ func parseHTTPErrorResponse(statusCode int, r io.Reader) error { return errors } +func makeErrorList(err error) []error { + if errL, ok := err.(errcode.Errors); ok { + return []error(errL) + } + return []error{err} +} + +func mergeErrors(err1, err2 error) error { + return errcode.Errors(append(makeErrorList(err1), makeErrorList(err2)...)) +} + // HandleErrorResponse returns error parsed from HTTP response for an // unsuccessful HTTP response code (in the range 400 - 499 inclusive). An // UnexpectedHTTPStatusError returned for response code outside of expected // range. func HandleErrorResponse(resp *http.Response) error { - if resp.StatusCode == 401 { + if resp.StatusCode >= 400 && resp.StatusCode < 500 { + // Check for OAuth errors within the `WWW-Authenticate` header first + // See https://tools.ietf.org/html/rfc6750#section-3 + for _, c := range challenge.ResponseChallenges(resp) { + if c.Scheme == "bearer" { + var err errcode.Error + // codes defined at https://tools.ietf.org/html/rfc6750#section-3.1 + switch c.Parameters["error"] { + case "invalid_token": + err.Code = errcode.ErrorCodeUnauthorized + case "insufficient_scope": + err.Code = errcode.ErrorCodeDenied + default: + continue + } + if description := c.Parameters["error_description"]; description != "" { + err.Message = description + } else { + err.Message = err.Code.Message() + } + + return mergeErrors(err, parseHTTPErrorResponse(resp.StatusCode, resp.Body)) + } + } err := parseHTTPErrorResponse(resp.StatusCode, resp.Body) - if uErr, ok := err.(*UnexpectedHTTPResponseError); ok { + if uErr, ok := err.(*UnexpectedHTTPResponseError); ok && resp.StatusCode == 401 { return errcode.ErrorCodeUnauthorized.WithDetail(uErr.Response) } return err } - if resp.StatusCode >= 400 && resp.StatusCode < 500 { - return parseHTTPErrorResponse(resp.StatusCode, resp.Body) - } return &UnexpectedHTTPStatusError{Status: resp.Status} } diff --git a/vendor/github.com/docker/distribution/registry/client/transport/http_reader.go b/vendor/github.com/docker/distribution/registry/client/transport/http_reader.go index e1b17a03a..e5ff09d75 100644 --- a/vendor/github.com/docker/distribution/registry/client/transport/http_reader.go +++ b/vendor/github.com/docker/distribution/registry/client/transport/http_reader.go @@ -181,6 +181,7 @@ func (hrs *httpReadSeeker) reader() (io.Reader, error) { // context.GetLogger(hrs.context).Infof("Range: %s", req.Header.Get("Range")) } + req.Header.Add("Accept-Encoding", "identity") resp, err := hrs.client.Do(req) if err != nil { return nil, err diff --git a/vendor/github.com/docker/distribution/registry/handlers/app.go b/vendor/github.com/docker/distribution/registry/handlers/app.go index 4df15ae6e..0f30603f0 100644 --- a/vendor/github.com/docker/distribution/registry/handlers/app.go +++ b/vendor/github.com/docker/distribution/registry/handlers/app.go @@ -341,7 +341,7 @@ func (app *App) RegisterHealthChecks(healthRegistries ...*health.Registry) { } storageDriverCheck := func() error { - _, err := app.driver.List(app, "/") // "/" should always exist + _, err := app.driver.Stat(app, "/") // "/" should always exist return err // any error will be treated as failure } @@ -461,6 +461,8 @@ func (app *App) configureEvents(configuration *configuration.Configuration) { } } +type redisStartAtKey struct{} + func (app *App) configureRedis(configuration *configuration.Configuration) { if configuration.Redis.Addr == "" { ctxu.GetLogger(app).Infof("redis not configured") @@ -470,11 +472,11 @@ func (app *App) configureRedis(configuration *configuration.Configuration) { pool := &redis.Pool{ Dial: func() (redis.Conn, error) { // TODO(stevvooe): Yet another use case for contextual timing. - ctx := context.WithValue(app, "redis.connect.startedat", time.Now()) + ctx := context.WithValue(app, redisStartAtKey{}, time.Now()) done := func(err error) { logger := ctxu.GetLoggerWithField(ctx, "redis.connect.duration", - ctxu.Since(ctx, "redis.connect.startedat")) + ctxu.Since(ctx, redisStartAtKey{})) if err != nil { logger.Errorf("redis: error connecting: %v", err) } else { @@ -707,6 +709,18 @@ func (app *App) dispatcher(dispatch dispatchFunc) http.Handler { }) } +type errCodeKey struct{} + +func (errCodeKey) String() string { return "err.code" } + +type errMessageKey struct{} + +func (errMessageKey) String() string { return "err.message" } + +type errDetailKey struct{} + +func (errDetailKey) String() string { return "err.detail" } + func (app *App) logError(context context.Context, errors errcode.Errors) { for _, e1 := range errors { var c ctxu.Context @@ -714,23 +728,23 @@ func (app *App) logError(context context.Context, errors errcode.Errors) { switch e1.(type) { case errcode.Error: e, _ := e1.(errcode.Error) - c = ctxu.WithValue(context, "err.code", e.Code) - c = ctxu.WithValue(c, "err.message", e.Code.Message()) - c = ctxu.WithValue(c, "err.detail", e.Detail) + c = ctxu.WithValue(context, errCodeKey{}, e.Code) + c = ctxu.WithValue(c, errMessageKey{}, e.Code.Message()) + c = ctxu.WithValue(c, errDetailKey{}, e.Detail) case errcode.ErrorCode: e, _ := e1.(errcode.ErrorCode) - c = ctxu.WithValue(context, "err.code", e) - c = ctxu.WithValue(c, "err.message", e.Message()) + c = ctxu.WithValue(context, errCodeKey{}, e) + c = ctxu.WithValue(c, errMessageKey{}, e.Message()) default: // just normal go 'error' - c = ctxu.WithValue(context, "err.code", errcode.ErrorCodeUnknown) - c = ctxu.WithValue(c, "err.message", e1.Error()) + c = ctxu.WithValue(context, errCodeKey{}, errcode.ErrorCodeUnknown) + c = ctxu.WithValue(c, errMessageKey{}, e1.Error()) } c = ctxu.WithLogger(c, ctxu.GetLogger(c, - "err.code", - "err.message", - "err.detail")) + errCodeKey{}, + errMessageKey{}, + errDetailKey{})) ctxu.GetResponseLogger(c).Errorf("response completed with error") } } diff --git a/vendor/github.com/docker/distribution/registry/handlers/images.go b/vendor/github.com/docker/distribution/registry/handlers/images.go index df7f869be..9518f6855 100644 --- a/vendor/github.com/docker/distribution/registry/handlers/images.go +++ b/vendor/github.com/docker/distribution/registry/handlers/images.go @@ -15,6 +15,7 @@ import ( "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/api/errcode" "github.com/docker/distribution/registry/api/v2" + "github.com/docker/distribution/registry/auth" "github.com/gorilla/handlers" ) @@ -205,7 +206,7 @@ func (imh *imageManifestHandler) convertSchema2Manifest(schema2Manifest *schema2 } builder := schema1.NewConfigManifestBuilder(imh.Repository.Blobs(imh), imh.Context.App.trustKey, ref, configJSON) - for _, d := range schema2Manifest.References() { + for _, d := range schema2Manifest.Layers { if err := builder.AppendReference(d); err != nil { imh.Errors = append(imh.Errors, v2.ErrorCodeManifestInvalid.WithDetail(err)) return nil, err @@ -269,6 +270,12 @@ func (imh *imageManifestHandler) PutImageManifest(w http.ResponseWriter, r *http if imh.Tag != "" { options = append(options, distribution.WithTag(imh.Tag)) } + + if err := imh.applyResourcePolicy(manifest); err != nil { + imh.Errors = append(imh.Errors, err) + return + } + _, err = manifests.Put(imh, manifest, options...) if err != nil { // TODO(stevvooe): These error handling switches really need to be @@ -339,6 +346,73 @@ func (imh *imageManifestHandler) PutImageManifest(w http.ResponseWriter, r *http w.WriteHeader(http.StatusCreated) } +// applyResourcePolicy checks whether the resource class matches what has +// been authorized and allowed by the policy configuration. +func (imh *imageManifestHandler) applyResourcePolicy(manifest distribution.Manifest) error { + allowedClasses := imh.App.Config.Policy.Repository.Classes + if len(allowedClasses) == 0 { + return nil + } + + var class string + switch m := manifest.(type) { + case *schema1.SignedManifest: + class = "image" + case *schema2.DeserializedManifest: + switch m.Config.MediaType { + case schema2.MediaTypeConfig: + class = "image" + case schema2.MediaTypePluginConfig: + class = "plugin" + default: + message := fmt.Sprintf("unknown manifest class for %s", m.Config.MediaType) + return errcode.ErrorCodeDenied.WithMessage(message) + } + } + + if class == "" { + return nil + } + + // Check to see if class is allowed in registry + var allowedClass bool + for _, c := range allowedClasses { + if class == c { + allowedClass = true + break + } + } + if !allowedClass { + message := fmt.Sprintf("registry does not allow %s manifest", class) + return errcode.ErrorCodeDenied.WithMessage(message) + } + + resources := auth.AuthorizedResources(imh) + n := imh.Repository.Named().Name() + + var foundResource bool + for _, r := range resources { + if r.Name == n { + if r.Class == "" { + r.Class = "image" + } + if r.Class == class { + return nil + } + foundResource = true + } + } + + // resource was found but no matching class was found + if foundResource { + message := fmt.Sprintf("repository not authorized for %s manifest", class) + return errcode.ErrorCodeDenied.WithMessage(message) + } + + return nil + +} + // DeleteImageManifest removes the manifest with the given digest from the registry. func (imh *imageManifestHandler) DeleteImageManifest(w http.ResponseWriter, r *http.Request) { ctxu.GetLogger(imh).Debug("DeleteImageManifest") diff --git a/vendor/github.com/docker/distribution/registry/proxy/proxyauth.go b/vendor/github.com/docker/distribution/registry/proxy/proxyauth.go index a9cc43a61..7b405afcf 100644 --- a/vendor/github.com/docker/distribution/registry/proxy/proxyauth.go +++ b/vendor/github.com/docker/distribution/registry/proxy/proxyauth.go @@ -3,11 +3,13 @@ package proxy import ( "net/http" "net/url" + "strings" + "github.com/docker/distribution/context" "github.com/docker/distribution/registry/client/auth" + "github.com/docker/distribution/registry/client/auth/challenge" ) -const tokenURL = "https://auth.docker.io/token" const challengeHeader = "Docker-Distribution-Api-Version" type userpass struct { @@ -33,17 +35,44 @@ func (c credentials) SetRefreshToken(u *url.URL, service, token string) { } // configureAuth stores credentials for challenge responses -func configureAuth(username, password string) (auth.CredentialStore, error) { - creds := map[string]userpass{ - tokenURL: { +func configureAuth(username, password, remoteURL string) (auth.CredentialStore, error) { + creds := map[string]userpass{} + + authURLs, err := getAuthURLs(remoteURL) + if err != nil { + return nil, err + } + + for _, url := range authURLs { + context.GetLogger(context.Background()).Infof("Discovered token authentication URL: %s", url) + creds[url] = userpass{ username: username, password: password, - }, + } } + return credentials{creds: creds}, nil } -func ping(manager auth.ChallengeManager, endpoint, versionHeader string) error { +func getAuthURLs(remoteURL string) ([]string, error) { + authURLs := []string{} + + resp, err := http.Get(remoteURL + "/v2/") + if err != nil { + return nil, err + } + defer resp.Body.Close() + + for _, c := range challenge.ResponseChallenges(resp) { + if strings.EqualFold(c.Scheme, "bearer") { + authURLs = append(authURLs, c.Parameters["realm"]) + } + } + + return authURLs, nil +} + +func ping(manager challenge.Manager, endpoint, versionHeader string) error { resp, err := http.Get(endpoint) if err != nil { return err diff --git a/vendor/github.com/docker/distribution/registry/proxy/proxymanifeststore_test.go b/vendor/github.com/docker/distribution/registry/proxy/proxymanifeststore_test.go index 0d6b7171f..067e845a2 100644 --- a/vendor/github.com/docker/distribution/registry/proxy/proxymanifeststore_test.go +++ b/vendor/github.com/docker/distribution/registry/proxy/proxymanifeststore_test.go @@ -12,6 +12,7 @@ import ( "github.com/docker/distribution/manifest/schema1" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/auth" + "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/proxy/scheduler" "github.com/docker/distribution/registry/storage" "github.com/docker/distribution/registry/storage/cache/memory" @@ -77,7 +78,7 @@ func (m *mockChallenger) credentialStore() auth.CredentialStore { return nil } -func (m *mockChallenger) challengeManager() auth.ChallengeManager { +func (m *mockChallenger) challengeManager() challenge.Manager { return nil } @@ -111,7 +112,7 @@ func newManifestStoreTestEnv(t *testing.T, name, tag string) *manifestStoreTestE stats: make(map[string]int), } - manifestDigest, err := populateRepo(t, ctx, truthRepo, name, tag) + manifestDigest, err := populateRepo(ctx, t, truthRepo, name, tag) if err != nil { t.Fatalf(err.Error()) } @@ -148,7 +149,7 @@ func newManifestStoreTestEnv(t *testing.T, name, tag string) *manifestStoreTestE } } -func populateRepo(t *testing.T, ctx context.Context, repository distribution.Repository, name, tag string) (digest.Digest, error) { +func populateRepo(ctx context.Context, t *testing.T, repository distribution.Repository, name, tag string) (digest.Digest, error) { m := schema1.Manifest{ Versioned: manifest.Versioned{ SchemaVersion: 1, diff --git a/vendor/github.com/docker/distribution/registry/proxy/proxyregistry.go b/vendor/github.com/docker/distribution/registry/proxy/proxyregistry.go index c63bc619f..d64dcbb95 100644 --- a/vendor/github.com/docker/distribution/registry/proxy/proxyregistry.go +++ b/vendor/github.com/docker/distribution/registry/proxy/proxyregistry.go @@ -12,6 +12,7 @@ import ( "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client" "github.com/docker/distribution/registry/client/auth" + "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/client/transport" "github.com/docker/distribution/registry/proxy/scheduler" "github.com/docker/distribution/registry/storage" @@ -91,7 +92,7 @@ func NewRegistryPullThroughCache(ctx context.Context, registry distribution.Name return nil, err } - cs, err := configureAuth(config.Username, config.Password) + cs, err := configureAuth(config.Username, config.Password, config.RemoteURL) if err != nil { return nil, err } @@ -102,7 +103,7 @@ func NewRegistryPullThroughCache(ctx context.Context, registry distribution.Name remoteURL: *remoteURL, authChallenger: &remoteAuthChallenger{ remoteURL: *remoteURL, - cm: auth.NewSimpleChallengeManager(), + cm: challenge.NewSimpleManager(), cs: cs, }, }, nil @@ -177,14 +178,14 @@ func (pr *proxyingRegistry) BlobStatter() distribution.BlobStatter { // authChallenger encapsulates a request to the upstream to establish credential challenges type authChallenger interface { tryEstablishChallenges(context.Context) error - challengeManager() auth.ChallengeManager + challengeManager() challenge.Manager credentialStore() auth.CredentialStore } type remoteAuthChallenger struct { remoteURL url.URL sync.Mutex - cm auth.ChallengeManager + cm challenge.Manager cs auth.CredentialStore } @@ -192,7 +193,7 @@ func (r *remoteAuthChallenger) credentialStore() auth.CredentialStore { return r.cs } -func (r *remoteAuthChallenger) challengeManager() auth.ChallengeManager { +func (r *remoteAuthChallenger) challengeManager() challenge.Manager { return r.cm } diff --git a/vendor/github.com/docker/distribution/registry/storage/cache/cachecheck/suite.go b/vendor/github.com/docker/distribution/registry/storage/cache/cachecheck/suite.go index cba5addd3..a563c02a1 100644 --- a/vendor/github.com/docker/distribution/registry/storage/cache/cachecheck/suite.go +++ b/vendor/github.com/docker/distribution/registry/storage/cache/cachecheck/suite.go @@ -16,12 +16,12 @@ import ( func CheckBlobDescriptorCache(t *testing.T, provider cache.BlobDescriptorCacheProvider) { ctx := context.Background() - checkBlobDescriptorCacheEmptyRepository(t, ctx, provider) - checkBlobDescriptorCacheSetAndRead(t, ctx, provider) - checkBlobDescriptorCacheClear(t, ctx, provider) + checkBlobDescriptorCacheEmptyRepository(ctx, t, provider) + checkBlobDescriptorCacheSetAndRead(ctx, t, provider) + checkBlobDescriptorCacheClear(ctx, t, provider) } -func checkBlobDescriptorCacheEmptyRepository(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) { +func checkBlobDescriptorCacheEmptyRepository(ctx context.Context, t *testing.T, provider cache.BlobDescriptorCacheProvider) { if _, err := provider.Stat(ctx, "sha384:abc111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"); err != distribution.ErrBlobUnknown { t.Fatalf("expected unknown blob error with empty store: %v", err) } @@ -59,7 +59,7 @@ func checkBlobDescriptorCacheEmptyRepository(t *testing.T, ctx context.Context, } } -func checkBlobDescriptorCacheSetAndRead(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) { +func checkBlobDescriptorCacheSetAndRead(ctx context.Context, t *testing.T, provider cache.BlobDescriptorCacheProvider) { localDigest := digest.Digest("sha384:abc111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") expected := distribution.Descriptor{ Digest: "sha256:abc1111111111111111111111111111111111111111111111111111111111111", @@ -143,7 +143,7 @@ func checkBlobDescriptorCacheSetAndRead(t *testing.T, ctx context.Context, provi } } -func checkBlobDescriptorCacheClear(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) { +func checkBlobDescriptorCacheClear(ctx context.Context, t *testing.T, provider cache.BlobDescriptorCacheProvider) { localDigest := digest.Digest("sha384:def111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") expected := distribution.Descriptor{ Digest: "sha256:def1111111111111111111111111111111111111111111111111111111111111", diff --git a/vendor/github.com/docker/distribution/registry/storage/catalog_test.go b/vendor/github.com/docker/distribution/registry/storage/catalog_test.go index de96407dd..c69c0cdc1 100644 --- a/vendor/github.com/docker/distribution/registry/storage/catalog_test.go +++ b/vendor/github.com/docker/distribution/registry/storage/catalog_test.go @@ -44,7 +44,7 @@ func setupFS(t *testing.T) *setupEnv { } for _, repo := range repos { - makeRepo(t, ctx, repo, registry) + makeRepo(ctx, t, repo, registry) } expected := []string{ @@ -67,7 +67,7 @@ func setupFS(t *testing.T) *setupEnv { } } -func makeRepo(t *testing.T, ctx context.Context, name string, reg distribution.Namespace) { +func makeRepo(ctx context.Context, t *testing.T, name string, reg distribution.Namespace) { named, err := reference.ParseNamed(name) if err != nil { t.Fatal(err) diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/azure/azure.go b/vendor/github.com/docker/distribution/registry/storage/driver/azure/azure.go index b06b08764..930b76a17 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/azure/azure.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/azure/azure.go @@ -111,12 +111,13 @@ func (d *driver) GetContent(ctx context.Context, path string) ([]byte, error) { return nil, err } + defer blob.Close() return ioutil.ReadAll(blob) } // PutContent stores the []byte content at a location designated by "path". func (d *driver) PutContent(ctx context.Context, path string, contents []byte) error { - if _, err := d.client.DeleteBlobIfExists(d.container, path); err != nil { + if _, err := d.client.DeleteBlobIfExists(d.container, path, nil); err != nil { return err } writer, err := d.Writer(ctx, path, false) @@ -151,7 +152,7 @@ func (d *driver) Reader(ctx context.Context, path string, offset int64) (io.Read } bytesRange := fmt.Sprintf("%v-", offset) - resp, err := d.client.GetBlobRange(d.container, path, bytesRange) + resp, err := d.client.GetBlobRange(d.container, path, bytesRange, nil) if err != nil { return nil, err } @@ -174,7 +175,7 @@ func (d *driver) Writer(ctx context.Context, path string, append bool) (storaged } size = blobProperties.ContentLength } else { - err := d.client.DeleteBlob(d.container, path) + err := d.client.DeleteBlob(d.container, path, nil) if err != nil { return nil, err } @@ -272,12 +273,12 @@ func (d *driver) Move(ctx context.Context, sourcePath string, destPath string) e return err } - return d.client.DeleteBlob(d.container, sourcePath) + return d.client.DeleteBlob(d.container, sourcePath, nil) } // Delete recursively deletes all objects stored at "path" and its subpaths. func (d *driver) Delete(ctx context.Context, path string) error { - ok, err := d.client.DeleteBlobIfExists(d.container, path) + ok, err := d.client.DeleteBlobIfExists(d.container, path, nil) if err != nil { return err } @@ -292,7 +293,7 @@ func (d *driver) Delete(ctx context.Context, path string) error { } for _, b := range blobs { - if err = d.client.DeleteBlob(d.container, b); err != nil { + if err = d.client.DeleteBlob(d.container, b, nil); err != nil { return err } } @@ -442,7 +443,7 @@ func (w *writer) Cancel() error { return fmt.Errorf("already committed") } w.cancelled = true - return w.driver.client.DeleteBlob(w.driver.container, w.path) + return w.driver.client.DeleteBlob(w.driver.container, w.path, nil) } func (w *writer) Commit() error { @@ -470,7 +471,7 @@ func (bw *blockWriter) Write(p []byte) (int, error) { if offset+chunkSize > len(p) { chunkSize = len(p) - offset } - err := bw.client.AppendBlock(bw.container, bw.path, p[offset:offset+chunkSize]) + err := bw.client.AppendBlock(bw.container, bw.path, p[offset:offset+chunkSize], nil) if err != nil { return n, err } diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/base/base.go b/vendor/github.com/docker/distribution/registry/storage/driver/base/base.go index 064bda60f..e14f7edb1 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/base/base.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/base/base.go @@ -137,7 +137,7 @@ func (base *Base) Stat(ctx context.Context, path string) (storagedriver.FileInfo ctx, done := context.WithTrace(ctx) defer done("%s.Stat(%q)", base.Name(), path) - if !storagedriver.PathRegexp.MatchString(path) { + if !storagedriver.PathRegexp.MatchString(path) && path != "/" { return nil, storagedriver.InvalidPathError{Path: path, DriverName: base.StorageDriver.Name()} } diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/oss/oss.go b/vendor/github.com/docker/distribution/registry/storage/driver/oss/oss.go index 7ae703346..4d215928b 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/oss/oss.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/oss/oss.go @@ -389,15 +389,17 @@ func (d *driver) List(ctx context.Context, opath string) ([]string, error) { return append(files, directories...), nil } +const maxConcurrency = 10 + // Move moves an object stored at sourcePath to destPath, removing the original // object. func (d *driver) Move(ctx context.Context, sourcePath string, destPath string) error { logrus.Infof("Move from %s to %s", d.ossPath(sourcePath), d.ossPath(destPath)) - - err := d.Bucket.CopyLargeFile(d.ossPath(sourcePath), d.ossPath(destPath), + err := d.Bucket.CopyLargeFileInParallel(d.ossPath(sourcePath), d.ossPath(destPath), d.getContentType(), getPermissions(), - oss.Options{}) + oss.Options{}, + maxConcurrency) if err != nil { logrus.Errorf("Failed for move from %s to %s: %v", d.ossPath(sourcePath), d.ossPath(destPath), err) return parseError(sourcePath, err) @@ -408,7 +410,8 @@ func (d *driver) Move(ctx context.Context, sourcePath string, destPath string) e // Delete recursively deletes all objects stored at "path" and its subpaths. func (d *driver) Delete(ctx context.Context, path string) error { - listResponse, err := d.Bucket.List(d.ossPath(path), "", "", listMax) + ossPath := d.ossPath(path) + listResponse, err := d.Bucket.List(ossPath, "", "", listMax) if err != nil || len(listResponse.Contents) == 0 { return storagedriver.PathNotFoundError{Path: path} } @@ -416,15 +419,25 @@ func (d *driver) Delete(ctx context.Context, path string) error { ossObjects := make([]oss.Object, listMax) for len(listResponse.Contents) > 0 { + numOssObjects := len(listResponse.Contents) for index, key := range listResponse.Contents { + // Stop if we encounter a key that is not a subpath (so that deleting "/a" does not delete "/ab"). + if len(key.Key) > len(ossPath) && (key.Key)[len(ossPath)] != '/' { + numOssObjects = index + break + } ossObjects[index].Key = key.Key } - err := d.Bucket.DelMulti(oss.Delete{Quiet: false, Objects: ossObjects[0:len(listResponse.Contents)]}) + err := d.Bucket.DelMulti(oss.Delete{Quiet: false, Objects: ossObjects[0:numOssObjects]}) if err != nil { return nil } + if numOssObjects < len(listResponse.Contents) { + return nil + } + listResponse, err = d.Bucket.List(d.ossPath(path), "", "", listMax) if err != nil { return err diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3.go b/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3.go index e808f7606..c9d19c46c 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3.go @@ -76,8 +76,8 @@ const noStorageClass = "NONE" // validRegions maps known s3 region identifiers to region descriptors var validRegions = map[string]struct{}{} -// validObjectAcls contains known s3 object Acls -var validObjectAcls = map[string]struct{}{} +// validObjectACLs contains known s3 object Acls +var validObjectACLs = map[string]struct{}{} //DriverParameters A struct that encapsulates all of the driver parameters after all values have been set type DriverParameters struct { @@ -97,12 +97,13 @@ type DriverParameters struct { RootDirectory string StorageClass string UserAgent string - ObjectAcl string + ObjectACL string } func init() { for _, region := range []string{ "us-east-1", + "us-east-2", "us-west-1", "us-west-2", "eu-west-1", @@ -118,7 +119,7 @@ func init() { validRegions[region] = struct{}{} } - for _, objectAcl := range []string{ + for _, objectACL := range []string{ s3.ObjectCannedACLPrivate, s3.ObjectCannedACLPublicRead, s3.ObjectCannedACLPublicReadWrite, @@ -127,7 +128,7 @@ func init() { s3.ObjectCannedACLBucketOwnerRead, s3.ObjectCannedACLBucketOwnerFullControl, } { - validObjectAcls[objectAcl] = struct{}{} + validObjectACLs[objectACL] = struct{}{} } // Register this as the default s3 driver in addition to s3aws @@ -153,7 +154,7 @@ type driver struct { MultipartCopyThresholdSize int64 RootDirectory string StorageClass string - ObjectAcl string + ObjectACL string } type baseEmbed struct { @@ -313,18 +314,18 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) { userAgent = "" } - objectAcl := s3.ObjectCannedACLPrivate - objectAclParam := parameters["objectacl"] - if objectAclParam != nil { - objectAclString, ok := objectAclParam.(string) + objectACL := s3.ObjectCannedACLPrivate + objectACLParam := parameters["objectacl"] + if objectACLParam != nil { + objectACLString, ok := objectACLParam.(string) if !ok { - return nil, fmt.Errorf("Invalid value for objectacl parameter: %v", objectAclParam) + return nil, fmt.Errorf("Invalid value for objectacl parameter: %v", objectACLParam) } - if _, ok = validObjectAcls[objectAclString]; !ok { - return nil, fmt.Errorf("Invalid value for objectacl parameter: %v", objectAclParam) + if _, ok = validObjectACLs[objectACLString]; !ok { + return nil, fmt.Errorf("Invalid value for objectacl parameter: %v", objectACLParam) } - objectAcl = objectAclString + objectACL = objectACLString } params := DriverParameters{ @@ -344,7 +345,7 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) { fmt.Sprint(rootDirectory), storageClass, fmt.Sprint(userAgent), - objectAcl, + objectACL, } return New(params) @@ -389,29 +390,19 @@ func New(params DriverParameters) (*Driver, error) { } awsConfig := aws.NewConfig() - var creds *credentials.Credentials - if params.RegionEndpoint == "" { - creds = credentials.NewChainCredentials([]credentials.Provider{ - &credentials.StaticProvider{ - Value: credentials.Value{ - AccessKeyID: params.AccessKey, - SecretAccessKey: params.SecretKey, - }, + creds := credentials.NewChainCredentials([]credentials.Provider{ + &credentials.StaticProvider{ + Value: credentials.Value{ + AccessKeyID: params.AccessKey, + SecretAccessKey: params.SecretKey, }, - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{}, - &ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(session.New())}, - }) - } else { - creds = credentials.NewChainCredentials([]credentials.Provider{ - &credentials.StaticProvider{ - Value: credentials.Value{ - AccessKeyID: params.AccessKey, - SecretAccessKey: params.SecretKey, - }, - }, - &credentials.EnvProvider{}, - }) + }, + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{}, + &ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(session.New())}, + }) + + if params.RegionEndpoint != "" { awsConfig.WithS3ForcePathStyle(true) awsConfig.WithEndpoint(params.RegionEndpoint) } @@ -459,7 +450,7 @@ func New(params DriverParameters) (*Driver, error) { MultipartCopyThresholdSize: params.MultipartCopyThresholdSize, RootDirectory: params.RootDirectory, StorageClass: params.StorageClass, - ObjectAcl: params.ObjectAcl, + ObjectACL: params.ObjectACL, } return &Driver{ @@ -784,10 +775,12 @@ func min(a, b int) int { // We must be careful since S3 does not guarantee read after delete consistency func (d *driver) Delete(ctx context.Context, path string) error { s3Objects := make([]*s3.ObjectIdentifier, 0, listMax) + s3Path := d.s3Path(path) listObjectsInput := &s3.ListObjectsInput{ Bucket: aws.String(d.Bucket), - Prefix: aws.String(d.s3Path(path)), + Prefix: aws.String(s3Path), } +ListLoop: for { // list all the objects resp, err := d.S3.ListObjects(listObjectsInput) @@ -800,6 +793,10 @@ func (d *driver) Delete(ctx context.Context, path string) error { } for _, key := range resp.Contents { + // Stop if we encounter a key that is not a subpath (so that deleting "/a" does not delete "/ab"). + if len(*key.Key) > len(s3Path) && (*key.Key)[len(s3Path)] != '/' { + break ListLoop + } s3Objects = append(s3Objects, &s3.ObjectIdentifier{ Key: key.Key, }) @@ -912,7 +909,7 @@ func (d *driver) getContentType() *string { } func (d *driver) getACL() *string { - return aws.String(d.ObjectAcl) + return aws.String(d.ObjectACL) } func (d *driver) getStorageClass() *string { diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_test.go b/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_test.go index 16c579cbb..eb7ee5195 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_test.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_test.go @@ -33,7 +33,7 @@ func init() { secure := os.Getenv("S3_SECURE") v4Auth := os.Getenv("S3_V4_AUTH") region := os.Getenv("AWS_REGION") - objectAcl := os.Getenv("S3_OBJECT_ACL") + objectACL := os.Getenv("S3_OBJECT_ACL") root, err := ioutil.TempDir("", "driver-") regionEndpoint := os.Getenv("REGION_ENDPOINT") if err != nil { @@ -83,7 +83,7 @@ func init() { rootDirectory, storageClass, driverName + "-test", - objectAcl, + objectACL, } return New(parameters) diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_v2_signer.go b/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_v2_signer.go index 6950f1bc1..7cabe07e2 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_v2_signer.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/s3-aws/s3_v2_signer.go @@ -124,6 +124,8 @@ func (v2 *signer) Sign() error { md5, ctype, date, xamz string xamzDate bool sarray []string + smap map[string]string + sharray []string ) headers := v2.Request.Header @@ -136,6 +138,7 @@ func (v2 *signer) Sign() error { v2.Request.Header["Host"] = []string{host} v2.Request.Header["date"] = []string{v2.Time.In(time.UTC).Format(time.RFC1123)} + smap = make(map[string]string) for k, v := range headers { k = strings.ToLower(k) switch k { @@ -150,16 +153,20 @@ func (v2 *signer) Sign() error { default: if strings.HasPrefix(k, "x-amz-") { vall := strings.Join(v, ",") - sarray = append(sarray, k+":"+vall) + smap[k] = k + ":" + vall if k == "x-amz-date" { xamzDate = true date = "" } + sharray = append(sharray, k) } } } - if len(sarray) > 0 { - sort.StringSlice(sarray).Sort() + if len(sharray) > 0 { + sort.StringSlice(sharray).Sort() + for _, h := range sharray { + sarray = append(sarray, smap[h]) + } xamz = strings.Join(sarray, "\n") + "\n" } diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/s3-goamz/s3.go b/vendor/github.com/docker/distribution/registry/storage/driver/s3-goamz/s3.go index aa2d31b71..33751c168 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/s3-goamz/s3.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/s3-goamz/s3.go @@ -479,7 +479,8 @@ func (d *driver) Move(ctx context.Context, sourcePath string, destPath string) e // Delete recursively deletes all objects stored at "path" and its subpaths. func (d *driver) Delete(ctx context.Context, path string) error { - listResponse, err := d.Bucket.List(d.s3Path(path), "", "", listMax) + s3Path := d.s3Path(path) + listResponse, err := d.Bucket.List(s3Path, "", "", listMax) if err != nil || len(listResponse.Contents) == 0 { return storagedriver.PathNotFoundError{Path: path} } @@ -487,15 +488,25 @@ func (d *driver) Delete(ctx context.Context, path string) error { s3Objects := make([]s3.Object, listMax) for len(listResponse.Contents) > 0 { + numS3Objects := len(listResponse.Contents) for index, key := range listResponse.Contents { + // Stop if we encounter a key that is not a subpath (so that deleting "/a" does not delete "/ab"). + if len(key.Key) > len(s3Path) && (key.Key)[len(s3Path)] != '/' { + numS3Objects = index + break + } s3Objects[index].Key = key.Key } - err := d.Bucket.DelMulti(s3.Delete{Quiet: false, Objects: s3Objects[0:len(listResponse.Contents)]}) + err := d.Bucket.DelMulti(s3.Delete{Quiet: false, Objects: s3Objects[0:numS3Objects]}) if err != nil { return nil } + if numS3Objects < len(listResponse.Contents) { + return nil + } + listResponse, err = d.Bucket.List(d.s3Path(path), "", "", listMax) if err != nil { return err diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go b/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go index 242f13102..4b7aa4e9f 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/swift/swift.go @@ -108,7 +108,7 @@ func (factory *swiftDriverFactory) Create(parameters map[string]interface{}) (st } type driver struct { - Conn swift.Connection + Conn *swift.Connection Container string Prefix string BulkDeleteSupport bool @@ -177,7 +177,7 @@ func New(params Parameters) (*Driver, error) { TLSClientConfig: &tls.Config{InsecureSkipVerify: params.InsecureSkipVerify}, } - ct := swift.Connection{ + ct := &swift.Connection{ UserName: params.Username, ApiKey: params.Password, AuthUrl: params.AuthURL, @@ -888,7 +888,7 @@ func (w *writer) waitForSegmentsToShowUp() error { } type segmentWriter struct { - conn swift.Connection + conn *swift.Connection container string segmentsPath string segmentNumber int diff --git a/vendor/github.com/docker/distribution/registry/storage/driver/testsuites/testsuites.go b/vendor/github.com/docker/distribution/registry/storage/driver/testsuites/testsuites.go index 87f9c6ace..d8afe0c85 100644 --- a/vendor/github.com/docker/distribution/registry/storage/driver/testsuites/testsuites.go +++ b/vendor/github.com/docker/distribution/registry/storage/driver/testsuites/testsuites.go @@ -15,9 +15,10 @@ import ( "testing" "time" + "gopkg.in/check.v1" + "github.com/docker/distribution/context" storagedriver "github.com/docker/distribution/registry/storage/driver" - "gopkg.in/check.v1" ) // Test hooks up gocheck into the "go test" runner. @@ -717,6 +718,52 @@ func (suite *DriverSuite) TestDeleteFolder(c *check.C) { c.Assert(strings.Contains(err.Error(), suite.Name()), check.Equals, true) } +// TestDeleteOnlyDeletesSubpaths checks that deleting path A does not +// delete path B when A is a prefix of B but B is not a subpath of A (so that +// deleting "/a" does not delete "/ab"). This matters for services like S3 that +// do not implement directories. +func (suite *DriverSuite) TestDeleteOnlyDeletesSubpaths(c *check.C) { + dirname := randomPath(32) + filename := randomPath(32) + contents := randomContents(32) + + defer suite.deletePath(c, firstPart(dirname)) + + err := suite.StorageDriver.PutContent(suite.ctx, path.Join(dirname, filename), contents) + c.Assert(err, check.IsNil) + + err = suite.StorageDriver.PutContent(suite.ctx, path.Join(dirname, filename+"suffix"), contents) + c.Assert(err, check.IsNil) + + err = suite.StorageDriver.PutContent(suite.ctx, path.Join(dirname, dirname, filename), contents) + c.Assert(err, check.IsNil) + + err = suite.StorageDriver.PutContent(suite.ctx, path.Join(dirname, dirname+"suffix", filename), contents) + c.Assert(err, check.IsNil) + + err = suite.StorageDriver.Delete(suite.ctx, path.Join(dirname, filename)) + c.Assert(err, check.IsNil) + + _, err = suite.StorageDriver.GetContent(suite.ctx, path.Join(dirname, filename)) + c.Assert(err, check.NotNil) + c.Assert(err, check.FitsTypeOf, storagedriver.PathNotFoundError{}) + c.Assert(strings.Contains(err.Error(), suite.Name()), check.Equals, true) + + _, err = suite.StorageDriver.GetContent(suite.ctx, path.Join(dirname, filename+"suffix")) + c.Assert(err, check.IsNil) + + err = suite.StorageDriver.Delete(suite.ctx, path.Join(dirname, dirname)) + c.Assert(err, check.IsNil) + + _, err = suite.StorageDriver.GetContent(suite.ctx, path.Join(dirname, dirname, filename)) + c.Assert(err, check.NotNil) + c.Assert(err, check.FitsTypeOf, storagedriver.PathNotFoundError{}) + c.Assert(strings.Contains(err.Error(), suite.Name()), check.Equals, true) + + _, err = suite.StorageDriver.GetContent(suite.ctx, path.Join(dirname, dirname+"suffix", filename)) + c.Assert(err, check.IsNil) +} + // TestStatCall runs verifies the implementation of the storagedriver's Stat call. func (suite *DriverSuite) TestStatCall(c *check.C) { content := randomContents(4096) diff --git a/vendor/github.com/docker/distribution/registry/storage/garbagecollect.go b/vendor/github.com/docker/distribution/registry/storage/garbagecollect.go index bc3404169..7cf0298e1 100644 --- a/vendor/github.com/docker/distribution/registry/storage/garbagecollect.go +++ b/vendor/github.com/docker/distribution/registry/storage/garbagecollect.go @@ -6,7 +6,6 @@ import ( "github.com/docker/distribution" "github.com/docker/distribution/context" "github.com/docker/distribution/digest" - "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/storage/driver" ) @@ -25,9 +24,7 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis // mark markSet := make(map[digest.Digest]struct{}) err := repositoryEnumerator.Enumerate(ctx, func(repoName string) error { - if dryRun { - emit(repoName) - } + emit(repoName) var err error named, err := reference.ParseNamed(repoName) @@ -51,9 +48,7 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis err = manifestEnumerator.Enumerate(ctx, func(dgst digest.Digest) error { // Mark the manifest's blob - if dryRun { - emit("%s: marking manifest %s ", repoName, dgst) - } + emit("%s: marking manifest %s ", repoName, dgst) markSet[dgst] = struct{}{} manifest, err := manifestService.Get(ctx, dgst) @@ -64,19 +59,7 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis descriptors := manifest.References() for _, descriptor := range descriptors { markSet[descriptor.Digest] = struct{}{} - if dryRun { - emit("%s: marking blob %s", repoName, descriptor.Digest) - } - } - - switch manifest.(type) { - case *schema2.DeserializedManifest: - config := manifest.(*schema2.DeserializedManifest).Config - if dryRun { - emit("%s: marking configuration %s", repoName, config.Digest) - } - markSet[config.Digest] = struct{}{} - break + emit("%s: marking blob %s", repoName, descriptor.Digest) } return nil @@ -97,7 +80,7 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis }) if err != nil { - return fmt.Errorf("failed to mark: %v\n", err) + return fmt.Errorf("failed to mark: %v", err) } // sweep @@ -113,19 +96,17 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis if err != nil { return fmt.Errorf("error enumerating blobs: %v", err) } - if dryRun { - emit("\n%d blobs marked, %d blobs eligible for deletion", len(markSet), len(deleteSet)) - } + emit("\n%d blobs marked, %d blobs eligible for deletion", len(markSet), len(deleteSet)) // Construct vacuum vacuum := NewVacuum(ctx, storageDriver) for dgst := range deleteSet { + emit("blob eligible for deletion: %s", dgst) if dryRun { - emit("blob eligible for deletion: %s", dgst) continue } err = vacuum.RemoveBlob(string(dgst)) if err != nil { - return fmt.Errorf("failed to delete blob %s: %v\n", dgst, err) + return fmt.Errorf("failed to delete blob %s: %v", dgst, err) } } diff --git a/vendor/github.com/docker/distribution/registry/storage/garbagecollect_test.go b/vendor/github.com/docker/distribution/registry/storage/garbagecollect_test.go index 88492d812..925f1a10f 100644 --- a/vendor/github.com/docker/distribution/registry/storage/garbagecollect_test.go +++ b/vendor/github.com/docker/distribution/registry/storage/garbagecollect_test.go @@ -145,7 +145,7 @@ func TestNoDeletionNoEffect(t *testing.T) { ctx := context.Background() inmemoryDriver := inmemory.New() - registry := createRegistry(t, inmemory.New()) + registry := createRegistry(t, inmemoryDriver) repo := makeRepository(t, registry, "palailogos") manifestService, err := repo.Manifests(ctx) diff --git a/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler.go b/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler.go index 1d221410e..9fe71bb4d 100644 --- a/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler.go +++ b/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler.go @@ -9,6 +9,7 @@ import ( "github.com/docker/distribution" "github.com/docker/distribution/context" "github.com/docker/distribution/digest" + "github.com/docker/distribution/manifest/schema1" "github.com/docker/distribution/manifest/schema2" ) @@ -71,53 +72,62 @@ func (ms *schema2ManifestHandler) Put(ctx context.Context, manifest distribution func (ms *schema2ManifestHandler) verifyManifest(ctx context.Context, mnfst schema2.DeserializedManifest, skipDependencyVerification bool) error { var errs distribution.ErrManifestVerification - if !skipDependencyVerification { - target := mnfst.Target() - _, err := ms.repository.Blobs(ctx).Stat(ctx, target.Digest) + if skipDependencyVerification { + return nil + } + + manifestService, err := ms.repository.Manifests(ctx) + if err != nil { + return err + } + + blobsService := ms.repository.Blobs(ctx) + + for _, descriptor := range mnfst.References() { + var err error + + switch descriptor.MediaType { + case schema2.MediaTypeForeignLayer: + // Clients download this layer from an external URL, so do not check for + // its presense. + if len(descriptor.URLs) == 0 { + err = errMissingURL + } + allow := ms.manifestURLs.allow + deny := ms.manifestURLs.deny + for _, u := range descriptor.URLs { + var pu *url.URL + pu, err = url.Parse(u) + if err != nil || (pu.Scheme != "http" && pu.Scheme != "https") || pu.Fragment != "" || (allow != nil && !allow.MatchString(u)) || (deny != nil && deny.MatchString(u)) { + err = errInvalidURL + break + } + } + case schema2.MediaTypeManifest, schema1.MediaTypeManifest: + var exists bool + exists, err = manifestService.Exists(ctx, descriptor.Digest) + if err != nil || !exists { + err = distribution.ErrBlobUnknown // just coerce to unknown. + } + + fallthrough // double check the blob store. + default: + // forward all else to blob storage + if len(descriptor.URLs) == 0 { + _, err = blobsService.Stat(ctx, descriptor.Digest) + } + } + if err != nil { if err != distribution.ErrBlobUnknown { errs = append(errs, err) } // On error here, we always append unknown blob errors. - errs = append(errs, distribution.ErrManifestBlobUnknown{Digest: target.Digest}) - } - - for _, fsLayer := range mnfst.References() { - var err error - if fsLayer.MediaType != schema2.MediaTypeForeignLayer { - if len(fsLayer.URLs) == 0 { - _, err = ms.repository.Blobs(ctx).Stat(ctx, fsLayer.Digest) - } else { - err = errUnexpectedURL - } - } else { - // Clients download this layer from an external URL, so do not check for - // its presense. - if len(fsLayer.URLs) == 0 { - err = errMissingURL - } - allow := ms.manifestURLs.allow - deny := ms.manifestURLs.deny - for _, u := range fsLayer.URLs { - var pu *url.URL - pu, err = url.Parse(u) - if err != nil || (pu.Scheme != "http" && pu.Scheme != "https") || pu.Fragment != "" || (allow != nil && !allow.MatchString(u)) || (deny != nil && deny.MatchString(u)) { - err = errInvalidURL - break - } - } - } - if err != nil { - if err != distribution.ErrBlobUnknown { - errs = append(errs, err) - } - - // On error here, we always append unknown blob errors. - errs = append(errs, distribution.ErrManifestBlobUnknown{Digest: fsLayer.Digest}) - } + errs = append(errs, distribution.ErrManifestBlobUnknown{Digest: descriptor.Digest}) } } + if len(errs) != 0 { return errs } diff --git a/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler_test.go b/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler_test.go index 73a7e336a..5051fa3de 100644 --- a/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler_test.go +++ b/vendor/github.com/docker/distribution/registry/storage/schema2manifesthandler_test.go @@ -57,9 +57,10 @@ func TestVerifyManifestForeignLayer(t *testing.T) { errMissingURL, }, { + // regular layers may have foreign urls layer, []string{"http://foo/bar"}, - errUnexpectedURL, + nil, }, { foreignLayer, diff --git a/vendor/github.com/docker/distribution/version/version.go b/vendor/github.com/docker/distribution/version/version.go index cafe23366..807bb4a2e 100644 --- a/vendor/github.com/docker/distribution/version/version.go +++ b/vendor/github.com/docker/distribution/version/version.go @@ -8,4 +8,4 @@ var Package = "github.com/docker/distribution" // the latest release tag by hand, always suffixed by "+unknown". During // build, it will be replaced by the actual version. The value here will be // used if the registry is run after a go get based install. -var Version = "v2.4.1+unknown" +var Version = "v2.6.0+unknown" diff --git a/vendor/github.com/funcy/functions_go/.gitignore b/vendor/github.com/funcy/functions_go/.gitignore new file mode 100644 index 000000000..4ee67201f --- /dev/null +++ b/vendor/github.com/funcy/functions_go/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof +vendor/ \ No newline at end of file diff --git a/vendor/github.com/funcy/functions_go/.swagger-codegen-ignore b/vendor/github.com/funcy/functions_go/.swagger-codegen-ignore new file mode 100644 index 000000000..c5fa491b4 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/vendor/github.com/funcy/functions_go/.travis.yml b/vendor/github.com/funcy/functions_go/.travis.yml new file mode 100644 index 000000000..f5cb2ce9a --- /dev/null +++ b/vendor/github.com/funcy/functions_go/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/vendor/github.com/funcy/functions_go/LICENSE b/vendor/github.com/funcy/functions_go/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/vendor/github.com/funcy/functions_go/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/funcy/functions_go/README.md b/vendor/github.com/funcy/functions_go/README.md new file mode 100644 index 000000000..c02fb6f21 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/README.md @@ -0,0 +1,62 @@ +# Go API client for functions + +The open source serverless platform. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 0.1.28 +- Package version: 0.1.28 +- Build package: class io.swagger.codegen.languages.GoClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +``` + "./functions" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://127.0.0.1:8080/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AppsApi* | [**AppsAppDelete**](docs/AppsApi.md#appsappdelete) | **Delete** /apps/{app} | Delete an app. +*AppsApi* | [**AppsAppGet**](docs/AppsApi.md#appsappget) | **Get** /apps/{app} | Get information for a app. +*AppsApi* | [**AppsAppPatch**](docs/AppsApi.md#appsapppatch) | **Patch** /apps/{app} | Updates an app. +*AppsApi* | [**AppsGet**](docs/AppsApi.md#appsget) | **Get** /apps | Get all app names. +*AppsApi* | [**AppsPost**](docs/AppsApi.md#appspost) | **Post** /apps | Post new app +*RoutesApi* | [**AppsAppRoutesGet**](docs/RoutesApi.md#appsapproutesget) | **Get** /apps/{app}/routes | Get route list by app name. +*RoutesApi* | [**AppsAppRoutesPost**](docs/RoutesApi.md#appsapproutespost) | **Post** /apps/{app}/routes | Create new Route +*RoutesApi* | [**AppsAppRoutesRouteDelete**](docs/RoutesApi.md#appsapproutesroutedelete) | **Delete** /apps/{app}/routes/{route} | Deletes the route +*RoutesApi* | [**AppsAppRoutesRouteGet**](docs/RoutesApi.md#appsapproutesrouteget) | **Get** /apps/{app}/routes/{route} | Gets route by name +*RoutesApi* | [**AppsAppRoutesRoutePatch**](docs/RoutesApi.md#appsapproutesroutepatch) | **Patch** /apps/{app}/routes/{route} | Update a Route +*TasksApi* | [**TasksGet**](docs/TasksApi.md#tasksget) | **Get** /tasks | Get next task. +*VersionApi* | [**VersionGet**](docs/VersionApi.md#versionget) | **Get** /version | Get daemon version. + + +## Documentation For Models + + - [App](docs/App.md) + - [AppWrapper](docs/AppWrapper.md) + - [AppsWrapper](docs/AppsWrapper.md) + - [ErrorBody](docs/ErrorBody.md) + - [ModelError](docs/ModelError.md) + - [NewTask](docs/NewTask.md) + - [Route](docs/Route.md) + - [RouteWrapper](docs/RouteWrapper.md) + - [RoutesWrapper](docs/RoutesWrapper.md) + - [Task](docs/Task.md) + - [TaskWrapper](docs/TaskWrapper.md) + - [Version](docs/Version.md) + + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + + + diff --git a/vendor/github.com/funcy/functions_go/VERSION b/vendor/github.com/funcy/functions_go/VERSION new file mode 100644 index 000000000..5a1431ca7 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/VERSION @@ -0,0 +1 @@ +0.1.33 \ No newline at end of file diff --git a/vendor/github.com/funcy/functions_go/api_client.go b/vendor/github.com/funcy/functions_go/api_client.go new file mode 100644 index 000000000..60ebf6ca0 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/api_client.go @@ -0,0 +1,151 @@ +package functions + +import ( + "bytes" + "fmt" + "path/filepath" + "reflect" + "strings" + "net/url" + "io/ioutil" + "github.com/go-resty/resty" +) + +type APIClient struct { + config *Configuration +} + +func (c *APIClient) SelectHeaderContentType(contentTypes []string) string { + + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +func (c *APIClient) SelectHeaderAccept(accepts []string) string { + + if len(accepts) == 0 { + return "" + } + if contains(accepts, "application/json") { + return "application/json" + } + return strings.Join(accepts, ",") +} + +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +func (c *APIClient) CallAPI(path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams map[string]string, + fileName string, + fileBytes []byte) (*resty.Response, error) { + + rClient := c.prepareClient() + request := c.prepareRequest(rClient, postBody, headerParams, queryParams, formParams, fileName, fileBytes) + + switch strings.ToUpper(method) { + case "GET": + response, err := request.Get(path) + return response, err + case "POST": + response, err := request.Post(path) + return response, err + case "PUT": + response, err := request.Put(path) + return response, err + case "PATCH": + response, err := request.Patch(path) + return response, err + case "DELETE": + response, err := request.Delete(path) + return response, err + } + + return nil, fmt.Errorf("invalid method %v", method) +} + +func (c *APIClient) ParameterToString(obj interface{},collectionFormat string) string { + if reflect.TypeOf(obj).String() == "[]string" { + switch collectionFormat { + case "pipes": + return strings.Join(obj.([]string), "|") + case "ssv": + return strings.Join(obj.([]string), " ") + case "tsv": + return strings.Join(obj.([]string), "\t") + case "csv" : + return strings.Join(obj.([]string), ",") + } + } + + return fmt.Sprintf("%v", obj) +} + +func (c *APIClient) prepareClient() *resty.Client { + + rClient := resty.New() + + rClient.SetDebug(c.config.Debug) + if c.config.Transport != nil { + rClient.SetTransport(c.config.Transport) + } + + if c.config.Timeout != nil { + rClient.SetTimeout(*c.config.Timeout) + } + rClient.SetLogger(ioutil.Discard) + return rClient +} + +func (c *APIClient) prepareRequest( + rClient *resty.Client, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams map[string]string, + fileName string, + fileBytes []byte) *resty.Request { + + + request := rClient.R() + request.SetBody(postBody) + + if c.config.UserAgent != "" { + request.SetHeader("User-Agent", c.config.UserAgent) + } + + // add header parameter, if any + if len(headerParams) > 0 { + request.SetHeaders(headerParams) + } + + // add query parameter, if any + if len(queryParams) > 0 { + request.SetMultiValueQueryParams(queryParams) + } + + // add form parameter, if any + if len(formParams) > 0 { + request.SetFormData(formParams) + } + + if len(fileBytes) > 0 && fileName != "" { + _, fileNm := filepath.Split(fileName) + request.SetFileReader("file", fileNm, bytes.NewReader(fileBytes)) + } + return request +} diff --git a/vendor/github.com/funcy/functions_go/api_response.go b/vendor/github.com/funcy/functions_go/api_response.go new file mode 100644 index 000000000..564ed43a5 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/api_response.go @@ -0,0 +1,34 @@ +package functions + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/vendor/github.com/funcy/functions_go/app.go b/vendor/github.com/funcy/functions_go/app.go new file mode 100644 index 000000000..58dfbffc6 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/app.go @@ -0,0 +1,10 @@ +package functions + +type App struct { + + // Name of this app. Must be different than the image name. Can ony contain alphanumeric, -, and _. + Name string `json:"name,omitempty"` + + // Application configuration + Config map[string]string `json:"config,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/app_wrapper.go b/vendor/github.com/funcy/functions_go/app_wrapper.go new file mode 100644 index 000000000..c78e60f78 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/app_wrapper.go @@ -0,0 +1,8 @@ +package functions + +type AppWrapper struct { + + App App `json:"app,omitempty"` + + Error_ ErrorBody `json:"error,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/apps_api.go b/vendor/github.com/funcy/functions_go/apps_api.go new file mode 100644 index 000000000..64f17bbda --- /dev/null +++ b/vendor/github.com/funcy/functions_go/apps_api.go @@ -0,0 +1,334 @@ +package functions + +import ( + "net/url" + "strings" + "encoding/json" + "fmt" +) + +type AppsApi struct { + Configuration *Configuration +} + +func NewAppsApi() *AppsApi { + configuration := NewConfiguration() + return &AppsApi{ + Configuration: configuration, + } +} + +func NewAppsApiWithBasePath(basePath string) *AppsApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &AppsApi{ + Configuration: configuration, + } +} + +/** + * Delete an app. + * Delete an app. + * + * @param app Name of the app. + * @return void + */ +func (a AppsApi) AppsAppDelete(app string) (*APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Delete") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppDelete", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return localVarAPIResponse, err + } + return localVarAPIResponse, err +} + +/** + * Get information for a app. + * This gives more details about a app, such as statistics. + * + * @param app name of the app. + * @return *AppWrapper + */ +func (a AppsApi) AppsAppGet(app string) (*AppWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(AppWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppGet", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Updates an app. + * You can set app level settings here. + * + * @param app name of the app. + * @param body App to post. + * @return *AppWrapper + */ +func (a AppsApi) AppsAppPatch(app string, body AppWrapper) (*AppWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Patch") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + var successPayload = new(AppWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppPatch", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Get all app names. + * Get a list of all the apps in the system. + * + * @return *AppsWrapper + */ +func (a AppsApi) AppsGet() (*AppsWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(AppsWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsGet", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Post new app + * Insert a new app + * + * @param body App to post. + * @return *AppWrapper + */ +func (a AppsApi) AppsPost(body AppWrapper) (*AppWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Post") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + var successPayload = new(AppWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsPost", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + diff --git a/vendor/github.com/funcy/functions_go/apps_wrapper.go b/vendor/github.com/funcy/functions_go/apps_wrapper.go new file mode 100644 index 000000000..9b6af73e3 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/apps_wrapper.go @@ -0,0 +1,8 @@ +package functions + +type AppsWrapper struct { + + Apps []App `json:"apps,omitempty"` + + Error_ ErrorBody `json:"error,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/apps_client.go b/vendor/github.com/funcy/functions_go/client/apps/apps_client.go new file mode 100644 index 000000000..2e06a940c --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/apps_client.go @@ -0,0 +1,178 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new apps API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for apps API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +DeleteAppsApp deletes an app + +Delete an app. +*/ +func (a *Client) DeleteAppsApp(params *DeleteAppsAppParams) (*DeleteAppsAppOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAppsAppParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteAppsApp", + Method: "DELETE", + PathPattern: "/apps/{app}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteAppsAppReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DeleteAppsAppOK), nil + +} + +/* +GetApps gets all app names + +Get a list of all the apps in the system. +*/ +func (a *Client) GetApps(params *GetAppsParams) (*GetAppsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAppsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetApps", + Method: "GET", + PathPattern: "/apps", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAppsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetAppsOK), nil + +} + +/* +GetAppsApp gets information for a app + +This gives more details about a app, such as statistics. +*/ +func (a *Client) GetAppsApp(params *GetAppsAppParams) (*GetAppsAppOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAppsAppParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAppsApp", + Method: "GET", + PathPattern: "/apps/{app}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAppsAppReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetAppsAppOK), nil + +} + +/* +PatchAppsApp updates an app + +You can set app level settings here. +*/ +func (a *Client) PatchAppsApp(params *PatchAppsAppParams) (*PatchAppsAppOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPatchAppsAppParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PatchAppsApp", + Method: "PATCH", + PathPattern: "/apps/{app}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &PatchAppsAppReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PatchAppsAppOK), nil + +} + +/* +PostApps posts new app + +Insert a new app +*/ +func (a *Client) PostApps(params *PostAppsParams) (*PostAppsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAppsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostApps", + Method: "POST", + PathPattern: "/apps", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &PostAppsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PostAppsOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/delete_apps_app_parameters.go b/vendor/github.com/funcy/functions_go/client/apps/delete_apps_app_parameters.go new file mode 100644 index 000000000..60aba725e --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/delete_apps_app_parameters.go @@ -0,0 +1,135 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDeleteAppsAppParams creates a new DeleteAppsAppParams object +// with the default values initialized. +func NewDeleteAppsAppParams() *DeleteAppsAppParams { + var () + return &DeleteAppsAppParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAppsAppParamsWithTimeout creates a new DeleteAppsAppParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteAppsAppParamsWithTimeout(timeout time.Duration) *DeleteAppsAppParams { + var () + return &DeleteAppsAppParams{ + + timeout: timeout, + } +} + +// NewDeleteAppsAppParamsWithContext creates a new DeleteAppsAppParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteAppsAppParamsWithContext(ctx context.Context) *DeleteAppsAppParams { + var () + return &DeleteAppsAppParams{ + + Context: ctx, + } +} + +// NewDeleteAppsAppParamsWithHTTPClient creates a new DeleteAppsAppParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteAppsAppParamsWithHTTPClient(client *http.Client) *DeleteAppsAppParams { + var () + return &DeleteAppsAppParams{ + HTTPClient: client, + } +} + +/*DeleteAppsAppParams contains all the parameters to send to the API endpoint +for the delete apps app operation typically these are written to a http.Request +*/ +type DeleteAppsAppParams struct { + + /*App + Name of the app. + + */ + App string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete apps app params +func (o *DeleteAppsAppParams) WithTimeout(timeout time.Duration) *DeleteAppsAppParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete apps app params +func (o *DeleteAppsAppParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete apps app params +func (o *DeleteAppsAppParams) WithContext(ctx context.Context) *DeleteAppsAppParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete apps app params +func (o *DeleteAppsAppParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete apps app params +func (o *DeleteAppsAppParams) WithHTTPClient(client *http.Client) *DeleteAppsAppParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete apps app params +func (o *DeleteAppsAppParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the delete apps app params +func (o *DeleteAppsAppParams) WithApp(app string) *DeleteAppsAppParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the delete apps app params +func (o *DeleteAppsAppParams) SetApp(app string) { + o.App = app +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAppsAppParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/delete_apps_app_responses.go b/vendor/github.com/funcy/functions_go/client/apps/delete_apps_app_responses.go new file mode 100644 index 000000000..bc4d24988 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/delete_apps_app_responses.go @@ -0,0 +1,138 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// DeleteAppsAppReader is a Reader for the DeleteAppsApp structure. +type DeleteAppsAppReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAppsAppReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDeleteAppsAppOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewDeleteAppsAppNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewDeleteAppsAppDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteAppsAppOK creates a DeleteAppsAppOK with default headers values +func NewDeleteAppsAppOK() *DeleteAppsAppOK { + return &DeleteAppsAppOK{} +} + +/*DeleteAppsAppOK handles this case with default header values. + +Apps successfully deleted. +*/ +type DeleteAppsAppOK struct { +} + +func (o *DeleteAppsAppOK) Error() string { + return fmt.Sprintf("[DELETE /apps/{app}][%d] deleteAppsAppOK ", 200) +} + +func (o *DeleteAppsAppOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteAppsAppNotFound creates a DeleteAppsAppNotFound with default headers values +func NewDeleteAppsAppNotFound() *DeleteAppsAppNotFound { + return &DeleteAppsAppNotFound{} +} + +/*DeleteAppsAppNotFound handles this case with default header values. + +App does not exist. +*/ +type DeleteAppsAppNotFound struct { + Payload *models.Error +} + +func (o *DeleteAppsAppNotFound) Error() string { + return fmt.Sprintf("[DELETE /apps/{app}][%d] deleteAppsAppNotFound %+v", 404, o.Payload) +} + +func (o *DeleteAppsAppNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAppsAppDefault creates a DeleteAppsAppDefault with default headers values +func NewDeleteAppsAppDefault(code int) *DeleteAppsAppDefault { + return &DeleteAppsAppDefault{ + _statusCode: code, + } +} + +/*DeleteAppsAppDefault handles this case with default header values. + +Unexpected error +*/ +type DeleteAppsAppDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete apps app default response +func (o *DeleteAppsAppDefault) Code() int { + return o._statusCode +} + +func (o *DeleteAppsAppDefault) Error() string { + return fmt.Sprintf("[DELETE /apps/{app}][%d] DeleteAppsApp default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteAppsAppDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/get_apps_app_parameters.go b/vendor/github.com/funcy/functions_go/client/apps/get_apps_app_parameters.go new file mode 100644 index 000000000..cb1c35684 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/get_apps_app_parameters.go @@ -0,0 +1,135 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetAppsAppParams creates a new GetAppsAppParams object +// with the default values initialized. +func NewGetAppsAppParams() *GetAppsAppParams { + var () + return &GetAppsAppParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAppsAppParamsWithTimeout creates a new GetAppsAppParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAppsAppParamsWithTimeout(timeout time.Duration) *GetAppsAppParams { + var () + return &GetAppsAppParams{ + + timeout: timeout, + } +} + +// NewGetAppsAppParamsWithContext creates a new GetAppsAppParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAppsAppParamsWithContext(ctx context.Context) *GetAppsAppParams { + var () + return &GetAppsAppParams{ + + Context: ctx, + } +} + +// NewGetAppsAppParamsWithHTTPClient creates a new GetAppsAppParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAppsAppParamsWithHTTPClient(client *http.Client) *GetAppsAppParams { + var () + return &GetAppsAppParams{ + HTTPClient: client, + } +} + +/*GetAppsAppParams contains all the parameters to send to the API endpoint +for the get apps app operation typically these are written to a http.Request +*/ +type GetAppsAppParams struct { + + /*App + name of the app. + + */ + App string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get apps app params +func (o *GetAppsAppParams) WithTimeout(timeout time.Duration) *GetAppsAppParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get apps app params +func (o *GetAppsAppParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get apps app params +func (o *GetAppsAppParams) WithContext(ctx context.Context) *GetAppsAppParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get apps app params +func (o *GetAppsAppParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get apps app params +func (o *GetAppsAppParams) WithHTTPClient(client *http.Client) *GetAppsAppParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get apps app params +func (o *GetAppsAppParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the get apps app params +func (o *GetAppsAppParams) WithApp(app string) *GetAppsAppParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the get apps app params +func (o *GetAppsAppParams) SetApp(app string) { + o.App = app +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAppsAppParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/get_apps_app_responses.go b/vendor/github.com/funcy/functions_go/client/apps/get_apps_app_responses.go new file mode 100644 index 000000000..5404dff14 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/get_apps_app_responses.go @@ -0,0 +1,146 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetAppsAppReader is a Reader for the GetAppsApp structure. +type GetAppsAppReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAppsAppReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetAppsAppOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewGetAppsAppNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewGetAppsAppDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetAppsAppOK creates a GetAppsAppOK with default headers values +func NewGetAppsAppOK() *GetAppsAppOK { + return &GetAppsAppOK{} +} + +/*GetAppsAppOK handles this case with default header values. + +App details and stats. +*/ +type GetAppsAppOK struct { + Payload *models.AppWrapper +} + +func (o *GetAppsAppOK) Error() string { + return fmt.Sprintf("[GET /apps/{app}][%d] getAppsAppOK %+v", 200, o.Payload) +} + +func (o *GetAppsAppOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AppWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppNotFound creates a GetAppsAppNotFound with default headers values +func NewGetAppsAppNotFound() *GetAppsAppNotFound { + return &GetAppsAppNotFound{} +} + +/*GetAppsAppNotFound handles this case with default header values. + +App does not exist. +*/ +type GetAppsAppNotFound struct { + Payload *models.Error +} + +func (o *GetAppsAppNotFound) Error() string { + return fmt.Sprintf("[GET /apps/{app}][%d] getAppsAppNotFound %+v", 404, o.Payload) +} + +func (o *GetAppsAppNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppDefault creates a GetAppsAppDefault with default headers values +func NewGetAppsAppDefault(code int) *GetAppsAppDefault { + return &GetAppsAppDefault{ + _statusCode: code, + } +} + +/*GetAppsAppDefault handles this case with default header values. + +Unexpected error +*/ +type GetAppsAppDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get apps app default response +func (o *GetAppsAppDefault) Code() int { + return o._statusCode +} + +func (o *GetAppsAppDefault) Error() string { + return fmt.Sprintf("[GET /apps/{app}][%d] GetAppsApp default %+v", o._statusCode, o.Payload) +} + +func (o *GetAppsAppDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/get_apps_parameters.go b/vendor/github.com/funcy/functions_go/client/apps/get_apps_parameters.go new file mode 100644 index 000000000..d05d36110 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/get_apps_parameters.go @@ -0,0 +1,112 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetAppsParams creates a new GetAppsParams object +// with the default values initialized. +func NewGetAppsParams() *GetAppsParams { + + return &GetAppsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAppsParamsWithTimeout creates a new GetAppsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAppsParamsWithTimeout(timeout time.Duration) *GetAppsParams { + + return &GetAppsParams{ + + timeout: timeout, + } +} + +// NewGetAppsParamsWithContext creates a new GetAppsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAppsParamsWithContext(ctx context.Context) *GetAppsParams { + + return &GetAppsParams{ + + Context: ctx, + } +} + +// NewGetAppsParamsWithHTTPClient creates a new GetAppsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAppsParamsWithHTTPClient(client *http.Client) *GetAppsParams { + + return &GetAppsParams{ + HTTPClient: client, + } +} + +/*GetAppsParams contains all the parameters to send to the API endpoint +for the get apps operation typically these are written to a http.Request +*/ +type GetAppsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get apps params +func (o *GetAppsParams) WithTimeout(timeout time.Duration) *GetAppsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get apps params +func (o *GetAppsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get apps params +func (o *GetAppsParams) WithContext(ctx context.Context) *GetAppsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get apps params +func (o *GetAppsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get apps params +func (o *GetAppsParams) WithHTTPClient(client *http.Client) *GetAppsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get apps params +func (o *GetAppsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAppsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/get_apps_responses.go b/vendor/github.com/funcy/functions_go/client/apps/get_apps_responses.go new file mode 100644 index 000000000..fa4ceecd6 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/get_apps_responses.go @@ -0,0 +1,110 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetAppsReader is a Reader for the GetApps structure. +type GetAppsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAppsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetAppsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewGetAppsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetAppsOK creates a GetAppsOK with default headers values +func NewGetAppsOK() *GetAppsOK { + return &GetAppsOK{} +} + +/*GetAppsOK handles this case with default header values. + +List of apps. +*/ +type GetAppsOK struct { + Payload *models.AppsWrapper +} + +func (o *GetAppsOK) Error() string { + return fmt.Sprintf("[GET /apps][%d] getAppsOK %+v", 200, o.Payload) +} + +func (o *GetAppsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AppsWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsDefault creates a GetAppsDefault with default headers values +func NewGetAppsDefault(code int) *GetAppsDefault { + return &GetAppsDefault{ + _statusCode: code, + } +} + +/*GetAppsDefault handles this case with default header values. + +Unexpected error +*/ +type GetAppsDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get apps default response +func (o *GetAppsDefault) Code() int { + return o._statusCode +} + +func (o *GetAppsDefault) Error() string { + return fmt.Sprintf("[GET /apps][%d] GetApps default %+v", o._statusCode, o.Payload) +} + +func (o *GetAppsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/patch_apps_app_parameters.go b/vendor/github.com/funcy/functions_go/client/apps/patch_apps_app_parameters.go new file mode 100644 index 000000000..09b9318fc --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/patch_apps_app_parameters.go @@ -0,0 +1,161 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// NewPatchAppsAppParams creates a new PatchAppsAppParams object +// with the default values initialized. +func NewPatchAppsAppParams() *PatchAppsAppParams { + var () + return &PatchAppsAppParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPatchAppsAppParamsWithTimeout creates a new PatchAppsAppParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPatchAppsAppParamsWithTimeout(timeout time.Duration) *PatchAppsAppParams { + var () + return &PatchAppsAppParams{ + + timeout: timeout, + } +} + +// NewPatchAppsAppParamsWithContext creates a new PatchAppsAppParams object +// with the default values initialized, and the ability to set a context for a request +func NewPatchAppsAppParamsWithContext(ctx context.Context) *PatchAppsAppParams { + var () + return &PatchAppsAppParams{ + + Context: ctx, + } +} + +// NewPatchAppsAppParamsWithHTTPClient creates a new PatchAppsAppParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPatchAppsAppParamsWithHTTPClient(client *http.Client) *PatchAppsAppParams { + var () + return &PatchAppsAppParams{ + HTTPClient: client, + } +} + +/*PatchAppsAppParams contains all the parameters to send to the API endpoint +for the patch apps app operation typically these are written to a http.Request +*/ +type PatchAppsAppParams struct { + + /*App + name of the app. + + */ + App string + /*Body + App to post. + + */ + Body *models.AppWrapper + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the patch apps app params +func (o *PatchAppsAppParams) WithTimeout(timeout time.Duration) *PatchAppsAppParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the patch apps app params +func (o *PatchAppsAppParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the patch apps app params +func (o *PatchAppsAppParams) WithContext(ctx context.Context) *PatchAppsAppParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the patch apps app params +func (o *PatchAppsAppParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the patch apps app params +func (o *PatchAppsAppParams) WithHTTPClient(client *http.Client) *PatchAppsAppParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the patch apps app params +func (o *PatchAppsAppParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the patch apps app params +func (o *PatchAppsAppParams) WithApp(app string) *PatchAppsAppParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the patch apps app params +func (o *PatchAppsAppParams) SetApp(app string) { + o.App = app +} + +// WithBody adds the body to the patch apps app params +func (o *PatchAppsAppParams) WithBody(body *models.AppWrapper) *PatchAppsAppParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the patch apps app params +func (o *PatchAppsAppParams) SetBody(body *models.AppWrapper) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PatchAppsAppParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if o.Body == nil { + o.Body = new(models.AppWrapper) + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/patch_apps_app_responses.go b/vendor/github.com/funcy/functions_go/client/apps/patch_apps_app_responses.go new file mode 100644 index 000000000..d94b7a5be --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/patch_apps_app_responses.go @@ -0,0 +1,182 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// PatchAppsAppReader is a Reader for the PatchAppsApp structure. +type PatchAppsAppReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchAppsAppReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPatchAppsAppOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPatchAppsAppBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPatchAppsAppNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewPatchAppsAppDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPatchAppsAppOK creates a PatchAppsAppOK with default headers values +func NewPatchAppsAppOK() *PatchAppsAppOK { + return &PatchAppsAppOK{} +} + +/*PatchAppsAppOK handles this case with default header values. + +App details and stats. +*/ +type PatchAppsAppOK struct { + Payload *models.AppWrapper +} + +func (o *PatchAppsAppOK) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}][%d] patchAppsAppOK %+v", 200, o.Payload) +} + +func (o *PatchAppsAppOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AppWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchAppsAppBadRequest creates a PatchAppsAppBadRequest with default headers values +func NewPatchAppsAppBadRequest() *PatchAppsAppBadRequest { + return &PatchAppsAppBadRequest{} +} + +/*PatchAppsAppBadRequest handles this case with default header values. + +Parameters are missing or invalid. +*/ +type PatchAppsAppBadRequest struct { + Payload *models.Error +} + +func (o *PatchAppsAppBadRequest) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}][%d] patchAppsAppBadRequest %+v", 400, o.Payload) +} + +func (o *PatchAppsAppBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchAppsAppNotFound creates a PatchAppsAppNotFound with default headers values +func NewPatchAppsAppNotFound() *PatchAppsAppNotFound { + return &PatchAppsAppNotFound{} +} + +/*PatchAppsAppNotFound handles this case with default header values. + +App does not exist. +*/ +type PatchAppsAppNotFound struct { + Payload *models.Error +} + +func (o *PatchAppsAppNotFound) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}][%d] patchAppsAppNotFound %+v", 404, o.Payload) +} + +func (o *PatchAppsAppNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchAppsAppDefault creates a PatchAppsAppDefault with default headers values +func NewPatchAppsAppDefault(code int) *PatchAppsAppDefault { + return &PatchAppsAppDefault{ + _statusCode: code, + } +} + +/*PatchAppsAppDefault handles this case with default header values. + +Unexpected error +*/ +type PatchAppsAppDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the patch apps app default response +func (o *PatchAppsAppDefault) Code() int { + return o._statusCode +} + +func (o *PatchAppsAppDefault) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}][%d] PatchAppsApp default %+v", o._statusCode, o.Payload) +} + +func (o *PatchAppsAppDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/post_apps_parameters.go b/vendor/github.com/funcy/functions_go/client/apps/post_apps_parameters.go new file mode 100644 index 000000000..baa411d41 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/post_apps_parameters.go @@ -0,0 +1,140 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// NewPostAppsParams creates a new PostAppsParams object +// with the default values initialized. +func NewPostAppsParams() *PostAppsParams { + var () + return &PostAppsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAppsParamsWithTimeout creates a new PostAppsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAppsParamsWithTimeout(timeout time.Duration) *PostAppsParams { + var () + return &PostAppsParams{ + + timeout: timeout, + } +} + +// NewPostAppsParamsWithContext creates a new PostAppsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAppsParamsWithContext(ctx context.Context) *PostAppsParams { + var () + return &PostAppsParams{ + + Context: ctx, + } +} + +// NewPostAppsParamsWithHTTPClient creates a new PostAppsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAppsParamsWithHTTPClient(client *http.Client) *PostAppsParams { + var () + return &PostAppsParams{ + HTTPClient: client, + } +} + +/*PostAppsParams contains all the parameters to send to the API endpoint +for the post apps operation typically these are written to a http.Request +*/ +type PostAppsParams struct { + + /*Body + App to post. + + */ + Body *models.AppWrapper + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post apps params +func (o *PostAppsParams) WithTimeout(timeout time.Duration) *PostAppsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post apps params +func (o *PostAppsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post apps params +func (o *PostAppsParams) WithContext(ctx context.Context) *PostAppsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post apps params +func (o *PostAppsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post apps params +func (o *PostAppsParams) WithHTTPClient(client *http.Client) *PostAppsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post apps params +func (o *PostAppsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the post apps params +func (o *PostAppsParams) WithBody(body *models.AppWrapper) *PostAppsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the post apps params +func (o *PostAppsParams) SetBody(body *models.AppWrapper) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAppsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body == nil { + o.Body = new(models.AppWrapper) + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/post_apps_responses.go b/vendor/github.com/funcy/functions_go/client/apps/post_apps_responses.go new file mode 100644 index 000000000..3207d7b57 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/post_apps_responses.go @@ -0,0 +1,182 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// PostAppsReader is a Reader for the PostApps structure. +type PostAppsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAppsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPostAppsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPostAppsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPostAppsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewPostAppsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPostAppsOK creates a PostAppsOK with default headers values +func NewPostAppsOK() *PostAppsOK { + return &PostAppsOK{} +} + +/*PostAppsOK handles this case with default header values. + +App details and stats. +*/ +type PostAppsOK struct { + Payload *models.AppWrapper +} + +func (o *PostAppsOK) Error() string { + return fmt.Sprintf("[POST /apps][%d] postAppsOK %+v", 200, o.Payload) +} + +func (o *PostAppsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AppWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppsBadRequest creates a PostAppsBadRequest with default headers values +func NewPostAppsBadRequest() *PostAppsBadRequest { + return &PostAppsBadRequest{} +} + +/*PostAppsBadRequest handles this case with default header values. + +Parameters are missing or invalid. +*/ +type PostAppsBadRequest struct { + Payload *models.Error +} + +func (o *PostAppsBadRequest) Error() string { + return fmt.Sprintf("[POST /apps][%d] postAppsBadRequest %+v", 400, o.Payload) +} + +func (o *PostAppsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppsConflict creates a PostAppsConflict with default headers values +func NewPostAppsConflict() *PostAppsConflict { + return &PostAppsConflict{} +} + +/*PostAppsConflict handles this case with default header values. + +App already exists. +*/ +type PostAppsConflict struct { + Payload *models.Error +} + +func (o *PostAppsConflict) Error() string { + return fmt.Sprintf("[POST /apps][%d] postAppsConflict %+v", 409, o.Payload) +} + +func (o *PostAppsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppsDefault creates a PostAppsDefault with default headers values +func NewPostAppsDefault(code int) *PostAppsDefault { + return &PostAppsDefault{ + _statusCode: code, + } +} + +/*PostAppsDefault handles this case with default header values. + +Unexpected error +*/ +type PostAppsDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the post apps default response +func (o *PostAppsDefault) Code() int { + return o._statusCode +} + +func (o *PostAppsDefault) Error() string { + return fmt.Sprintf("[POST /apps][%d] PostApps default %+v", o._statusCode, o.Payload) +} + +func (o *PostAppsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/put_apps_app_parameters.go b/vendor/github.com/funcy/functions_go/client/apps/put_apps_app_parameters.go new file mode 100644 index 000000000..7478c6aad --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/put_apps_app_parameters.go @@ -0,0 +1,137 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// NewPutAppsAppParams creates a new PutAppsAppParams object +// with the default values initialized. +func NewPutAppsAppParams() *PutAppsAppParams { + var () + return &PutAppsAppParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutAppsAppParamsWithTimeout creates a new PutAppsAppParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutAppsAppParamsWithTimeout(timeout time.Duration) *PutAppsAppParams { + var () + return &PutAppsAppParams{ + + timeout: timeout, + } +} + +// NewPutAppsAppParamsWithContext creates a new PutAppsAppParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutAppsAppParamsWithContext(ctx context.Context) *PutAppsAppParams { + var () + return &PutAppsAppParams{ + + Context: ctx, + } +} + +/*PutAppsAppParams contains all the parameters to send to the API endpoint +for the put apps app operation typically these are written to a http.Request +*/ +type PutAppsAppParams struct { + + /*App + name of the app. + + */ + App string + /*Body + App to post. + + */ + Body *models.AppWrapper + + timeout time.Duration + Context context.Context +} + +// WithTimeout adds the timeout to the put apps app params +func (o *PutAppsAppParams) WithTimeout(timeout time.Duration) *PutAppsAppParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put apps app params +func (o *PutAppsAppParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put apps app params +func (o *PutAppsAppParams) WithContext(ctx context.Context) *PutAppsAppParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put apps app params +func (o *PutAppsAppParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithApp adds the app to the put apps app params +func (o *PutAppsAppParams) WithApp(app string) *PutAppsAppParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the put apps app params +func (o *PutAppsAppParams) SetApp(app string) { + o.App = app +} + +// WithBody adds the body to the put apps app params +func (o *PutAppsAppParams) WithBody(body *models.AppWrapper) *PutAppsAppParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the put apps app params +func (o *PutAppsAppParams) SetBody(body *models.AppWrapper) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAppsAppParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + r.SetTimeout(o.timeout) + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if o.Body == nil { + o.Body = new(models.AppWrapper) + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/apps/put_apps_app_responses.go b/vendor/github.com/funcy/functions_go/client/apps/put_apps_app_responses.go new file mode 100644 index 000000000..edfce86f1 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/apps/put_apps_app_responses.go @@ -0,0 +1,179 @@ +package apps + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// PutAppsAppReader is a Reader for the PutAppsApp structure. +type PutAppsAppReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAppsAppReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPutAppsAppOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPutAppsAppBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPutAppsAppInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewPutAppsAppDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + } +} + +// NewPutAppsAppOK creates a PutAppsAppOK with default headers values +func NewPutAppsAppOK() *PutAppsAppOK { + return &PutAppsAppOK{} +} + +/*PutAppsAppOK handles this case with default header values. + +App details and stats. +*/ +type PutAppsAppOK struct { + Payload *models.AppWrapper +} + +func (o *PutAppsAppOK) Error() string { + return fmt.Sprintf("[PUT /apps/{app}][%d] putAppsAppOK %+v", 200, o.Payload) +} + +func (o *PutAppsAppOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AppWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAppsAppBadRequest creates a PutAppsAppBadRequest with default headers values +func NewPutAppsAppBadRequest() *PutAppsAppBadRequest { + return &PutAppsAppBadRequest{} +} + +/*PutAppsAppBadRequest handles this case with default header values. + +Parameters are missing or invalid. +*/ +type PutAppsAppBadRequest struct { + Payload *models.Error +} + +func (o *PutAppsAppBadRequest) Error() string { + return fmt.Sprintf("[PUT /apps/{app}][%d] putAppsAppBadRequest %+v", 400, o.Payload) +} + +func (o *PutAppsAppBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAppsAppInternalServerError creates a PutAppsAppInternalServerError with default headers values +func NewPutAppsAppInternalServerError() *PutAppsAppInternalServerError { + return &PutAppsAppInternalServerError{} +} + +/*PutAppsAppInternalServerError handles this case with default header values. + +Could not accept app due to internal error. +*/ +type PutAppsAppInternalServerError struct { + Payload *models.Error +} + +func (o *PutAppsAppInternalServerError) Error() string { + return fmt.Sprintf("[PUT /apps/{app}][%d] putAppsAppInternalServerError %+v", 500, o.Payload) +} + +func (o *PutAppsAppInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAppsAppDefault creates a PutAppsAppDefault with default headers values +func NewPutAppsAppDefault(code int) *PutAppsAppDefault { + return &PutAppsAppDefault{ + _statusCode: code, + } +} + +/*PutAppsAppDefault handles this case with default header values. + +Unexpected error +*/ +type PutAppsAppDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the put apps app default response +func (o *PutAppsAppDefault) Code() int { + return o._statusCode +} + +func (o *PutAppsAppDefault) Error() string { + return fmt.Sprintf("[PUT /apps/{app}][%d] PutAppsApp default %+v", o._statusCode, o.Payload) +} + +func (o *PutAppsAppDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/call/call_client.go b/vendor/github.com/funcy/functions_go/client/call/call_client.go new file mode 100644 index 000000000..1055bfd81 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/call/call_client.go @@ -0,0 +1,88 @@ +package call + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new call API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for call API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +GetAppsAppCallsRoute gets route bound calls + +Get route-bound calls. +*/ +func (a *Client) GetAppsAppCallsRoute(params *GetAppsAppCallsRouteParams) (*GetAppsAppCallsRouteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAppsAppCallsRouteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAppsAppCallsRoute", + Method: "GET", + PathPattern: "/apps/{app}/calls/{route}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAppsAppCallsRouteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetAppsAppCallsRouteOK), nil + +} + +/* +GetCallsCall gets call information + +Get call information +*/ +func (a *Client) GetCallsCall(params *GetCallsCallParams) (*GetCallsCallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCallsCallParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetCallsCall", + Method: "GET", + PathPattern: "/calls/{call}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetCallsCallReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetCallsCallOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/funcy/functions_go/client/call/get_apps_app_calls_route_parameters.go b/vendor/github.com/funcy/functions_go/client/call/get_apps_app_calls_route_parameters.go new file mode 100644 index 000000000..edba8be3c --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/call/get_apps_app_calls_route_parameters.go @@ -0,0 +1,156 @@ +package call + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetAppsAppCallsRouteParams creates a new GetAppsAppCallsRouteParams object +// with the default values initialized. +func NewGetAppsAppCallsRouteParams() *GetAppsAppCallsRouteParams { + var () + return &GetAppsAppCallsRouteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAppsAppCallsRouteParamsWithTimeout creates a new GetAppsAppCallsRouteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAppsAppCallsRouteParamsWithTimeout(timeout time.Duration) *GetAppsAppCallsRouteParams { + var () + return &GetAppsAppCallsRouteParams{ + + timeout: timeout, + } +} + +// NewGetAppsAppCallsRouteParamsWithContext creates a new GetAppsAppCallsRouteParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAppsAppCallsRouteParamsWithContext(ctx context.Context) *GetAppsAppCallsRouteParams { + var () + return &GetAppsAppCallsRouteParams{ + + Context: ctx, + } +} + +// NewGetAppsAppCallsRouteParamsWithHTTPClient creates a new GetAppsAppCallsRouteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAppsAppCallsRouteParamsWithHTTPClient(client *http.Client) *GetAppsAppCallsRouteParams { + var () + return &GetAppsAppCallsRouteParams{ + HTTPClient: client, + } +} + +/*GetAppsAppCallsRouteParams contains all the parameters to send to the API endpoint +for the get apps app calls route operation typically these are written to a http.Request +*/ +type GetAppsAppCallsRouteParams struct { + + /*App + App name. + + */ + App string + /*Route + App route. + + */ + Route string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) WithTimeout(timeout time.Duration) *GetAppsAppCallsRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) WithContext(ctx context.Context) *GetAppsAppCallsRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) WithHTTPClient(client *http.Client) *GetAppsAppCallsRouteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) WithApp(app string) *GetAppsAppCallsRouteParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) SetApp(app string) { + o.App = app +} + +// WithRoute adds the route to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) WithRoute(route string) *GetAppsAppCallsRouteParams { + o.SetRoute(route) + return o +} + +// SetRoute adds the route to the get apps app calls route params +func (o *GetAppsAppCallsRouteParams) SetRoute(route string) { + o.Route = route +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAppsAppCallsRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + // path param route + if err := r.SetPathParam("route", o.Route); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/call/get_apps_app_calls_route_responses.go b/vendor/github.com/funcy/functions_go/client/call/get_apps_app_calls_route_responses.go new file mode 100644 index 000000000..8240f791f --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/call/get_apps_app_calls_route_responses.go @@ -0,0 +1,101 @@ +package call + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetAppsAppCallsRouteReader is a Reader for the GetAppsAppCallsRoute structure. +type GetAppsAppCallsRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAppsAppCallsRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetAppsAppCallsRouteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewGetAppsAppCallsRouteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAppsAppCallsRouteOK creates a GetAppsAppCallsRouteOK with default headers values +func NewGetAppsAppCallsRouteOK() *GetAppsAppCallsRouteOK { + return &GetAppsAppCallsRouteOK{} +} + +/*GetAppsAppCallsRouteOK handles this case with default header values. + +Calls found +*/ +type GetAppsAppCallsRouteOK struct { + Payload *models.CallsWrapper +} + +func (o *GetAppsAppCallsRouteOK) Error() string { + return fmt.Sprintf("[GET /apps/{app}/calls/{route}][%d] getAppsAppCallsRouteOK %+v", 200, o.Payload) +} + +func (o *GetAppsAppCallsRouteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CallsWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppCallsRouteNotFound creates a GetAppsAppCallsRouteNotFound with default headers values +func NewGetAppsAppCallsRouteNotFound() *GetAppsAppCallsRouteNotFound { + return &GetAppsAppCallsRouteNotFound{} +} + +/*GetAppsAppCallsRouteNotFound handles this case with default header values. + +Calls not found. +*/ +type GetAppsAppCallsRouteNotFound struct { + Payload *models.Error +} + +func (o *GetAppsAppCallsRouteNotFound) Error() string { + return fmt.Sprintf("[GET /apps/{app}/calls/{route}][%d] getAppsAppCallsRouteNotFound %+v", 404, o.Payload) +} + +func (o *GetAppsAppCallsRouteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/call/get_calls_call_parameters.go b/vendor/github.com/funcy/functions_go/client/call/get_calls_call_parameters.go new file mode 100644 index 000000000..80ce52fdb --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/call/get_calls_call_parameters.go @@ -0,0 +1,135 @@ +package call + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetCallsCallParams creates a new GetCallsCallParams object +// with the default values initialized. +func NewGetCallsCallParams() *GetCallsCallParams { + var () + return &GetCallsCallParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCallsCallParamsWithTimeout creates a new GetCallsCallParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCallsCallParamsWithTimeout(timeout time.Duration) *GetCallsCallParams { + var () + return &GetCallsCallParams{ + + timeout: timeout, + } +} + +// NewGetCallsCallParamsWithContext creates a new GetCallsCallParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCallsCallParamsWithContext(ctx context.Context) *GetCallsCallParams { + var () + return &GetCallsCallParams{ + + Context: ctx, + } +} + +// NewGetCallsCallParamsWithHTTPClient creates a new GetCallsCallParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCallsCallParamsWithHTTPClient(client *http.Client) *GetCallsCallParams { + var () + return &GetCallsCallParams{ + HTTPClient: client, + } +} + +/*GetCallsCallParams contains all the parameters to send to the API endpoint +for the get calls call operation typically these are written to a http.Request +*/ +type GetCallsCallParams struct { + + /*Call + Call ID. + + */ + Call string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get calls call params +func (o *GetCallsCallParams) WithTimeout(timeout time.Duration) *GetCallsCallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get calls call params +func (o *GetCallsCallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get calls call params +func (o *GetCallsCallParams) WithContext(ctx context.Context) *GetCallsCallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get calls call params +func (o *GetCallsCallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get calls call params +func (o *GetCallsCallParams) WithHTTPClient(client *http.Client) *GetCallsCallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get calls call params +func (o *GetCallsCallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCall adds the call to the get calls call params +func (o *GetCallsCallParams) WithCall(call string) *GetCallsCallParams { + o.SetCall(call) + return o +} + +// SetCall adds the call to the get calls call params +func (o *GetCallsCallParams) SetCall(call string) { + o.Call = call +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCallsCallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param call + if err := r.SetPathParam("call", o.Call); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/call/get_calls_call_responses.go b/vendor/github.com/funcy/functions_go/client/call/get_calls_call_responses.go new file mode 100644 index 000000000..73bdf3f35 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/call/get_calls_call_responses.go @@ -0,0 +1,101 @@ +package call + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetCallsCallReader is a Reader for the GetCallsCall structure. +type GetCallsCallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCallsCallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetCallsCallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewGetCallsCallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCallsCallOK creates a GetCallsCallOK with default headers values +func NewGetCallsCallOK() *GetCallsCallOK { + return &GetCallsCallOK{} +} + +/*GetCallsCallOK handles this case with default header values. + +Call found +*/ +type GetCallsCallOK struct { + Payload *models.CallWrapper +} + +func (o *GetCallsCallOK) Error() string { + return fmt.Sprintf("[GET /calls/{call}][%d] getCallsCallOK %+v", 200, o.Payload) +} + +func (o *GetCallsCallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CallWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCallsCallNotFound creates a GetCallsCallNotFound with default headers values +func NewGetCallsCallNotFound() *GetCallsCallNotFound { + return &GetCallsCallNotFound{} +} + +/*GetCallsCallNotFound handles this case with default header values. + +Call not found. +*/ +type GetCallsCallNotFound struct { + Payload *models.Error +} + +func (o *GetCallsCallNotFound) Error() string { + return fmt.Sprintf("[GET /calls/{call}][%d] getCallsCallNotFound %+v", 404, o.Payload) +} + +func (o *GetCallsCallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/functions_client.go b/vendor/github.com/funcy/functions_go/client/functions_client.go new file mode 100644 index 000000000..813901b29 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/functions_client.go @@ -0,0 +1,148 @@ +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/client/apps" + "github.com/funcy/functions_go/client/call" + "github.com/funcy/functions_go/client/operations" + "github.com/funcy/functions_go/client/routes" + "github.com/funcy/functions_go/client/tasks" + "github.com/funcy/functions_go/client/version" +) + +// Default functions HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "127.0.0.1:8080" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http", "https"} + +// NewHTTPClient creates a new functions HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Functions { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new functions HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Functions { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new functions client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Functions { + cli := new(Functions) + cli.Transport = transport + + cli.Apps = apps.New(transport, formats) + + cli.Call = call.New(transport, formats) + + cli.Operations = operations.New(transport, formats) + + cli.Routes = routes.New(transport, formats) + + cli.Tasks = tasks.New(transport, formats) + + cli.Version = version.New(transport, formats) + + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Functions is a client for functions +type Functions struct { + Apps *apps.Client + + Call *call.Client + + Operations *operations.Client + + Routes *routes.Client + + Tasks *tasks.Client + + Version *version.Client + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Functions) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + + c.Apps.SetTransport(transport) + + c.Call.SetTransport(transport) + + c.Operations.SetTransport(transport) + + c.Routes.SetTransport(transport) + + c.Tasks.SetTransport(transport) + + c.Version.SetTransport(transport) + +} diff --git a/vendor/github.com/funcy/functions_go/client/operations/delete_calls_call_log_parameters.go b/vendor/github.com/funcy/functions_go/client/operations/delete_calls_call_log_parameters.go new file mode 100644 index 000000000..7746e5872 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/operations/delete_calls_call_log_parameters.go @@ -0,0 +1,135 @@ +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDeleteCallsCallLogParams creates a new DeleteCallsCallLogParams object +// with the default values initialized. +func NewDeleteCallsCallLogParams() *DeleteCallsCallLogParams { + var () + return &DeleteCallsCallLogParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCallsCallLogParamsWithTimeout creates a new DeleteCallsCallLogParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteCallsCallLogParamsWithTimeout(timeout time.Duration) *DeleteCallsCallLogParams { + var () + return &DeleteCallsCallLogParams{ + + timeout: timeout, + } +} + +// NewDeleteCallsCallLogParamsWithContext creates a new DeleteCallsCallLogParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteCallsCallLogParamsWithContext(ctx context.Context) *DeleteCallsCallLogParams { + var () + return &DeleteCallsCallLogParams{ + + Context: ctx, + } +} + +// NewDeleteCallsCallLogParamsWithHTTPClient creates a new DeleteCallsCallLogParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteCallsCallLogParamsWithHTTPClient(client *http.Client) *DeleteCallsCallLogParams { + var () + return &DeleteCallsCallLogParams{ + HTTPClient: client, + } +} + +/*DeleteCallsCallLogParams contains all the parameters to send to the API endpoint +for the delete calls call log operation typically these are written to a http.Request +*/ +type DeleteCallsCallLogParams struct { + + /*Call + Call ID. + + */ + Call string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete calls call log params +func (o *DeleteCallsCallLogParams) WithTimeout(timeout time.Duration) *DeleteCallsCallLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete calls call log params +func (o *DeleteCallsCallLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete calls call log params +func (o *DeleteCallsCallLogParams) WithContext(ctx context.Context) *DeleteCallsCallLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete calls call log params +func (o *DeleteCallsCallLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete calls call log params +func (o *DeleteCallsCallLogParams) WithHTTPClient(client *http.Client) *DeleteCallsCallLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete calls call log params +func (o *DeleteCallsCallLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCall adds the call to the delete calls call log params +func (o *DeleteCallsCallLogParams) WithCall(call string) *DeleteCallsCallLogParams { + o.SetCall(call) + return o +} + +// SetCall adds the call to the delete calls call log params +func (o *DeleteCallsCallLogParams) SetCall(call string) { + o.Call = call +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCallsCallLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param call + if err := r.SetPathParam("call", o.Call); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/operations/delete_calls_call_log_responses.go b/vendor/github.com/funcy/functions_go/client/operations/delete_calls_call_log_responses.go new file mode 100644 index 000000000..c7e62949b --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/operations/delete_calls_call_log_responses.go @@ -0,0 +1,138 @@ +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// DeleteCallsCallLogReader is a Reader for the DeleteCallsCallLog structure. +type DeleteCallsCallLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCallsCallLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 202: + result := NewDeleteCallsCallLogAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewDeleteCallsCallLogNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewDeleteCallsCallLogDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteCallsCallLogAccepted creates a DeleteCallsCallLogAccepted with default headers values +func NewDeleteCallsCallLogAccepted() *DeleteCallsCallLogAccepted { + return &DeleteCallsCallLogAccepted{} +} + +/*DeleteCallsCallLogAccepted handles this case with default header values. + +Log delete request accepted +*/ +type DeleteCallsCallLogAccepted struct { +} + +func (o *DeleteCallsCallLogAccepted) Error() string { + return fmt.Sprintf("[DELETE /calls/{call}/log][%d] deleteCallsCallLogAccepted ", 202) +} + +func (o *DeleteCallsCallLogAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteCallsCallLogNotFound creates a DeleteCallsCallLogNotFound with default headers values +func NewDeleteCallsCallLogNotFound() *DeleteCallsCallLogNotFound { + return &DeleteCallsCallLogNotFound{} +} + +/*DeleteCallsCallLogNotFound handles this case with default header values. + +Does not exist. +*/ +type DeleteCallsCallLogNotFound struct { + Payload *models.Error +} + +func (o *DeleteCallsCallLogNotFound) Error() string { + return fmt.Sprintf("[DELETE /calls/{call}/log][%d] deleteCallsCallLogNotFound %+v", 404, o.Payload) +} + +func (o *DeleteCallsCallLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCallsCallLogDefault creates a DeleteCallsCallLogDefault with default headers values +func NewDeleteCallsCallLogDefault(code int) *DeleteCallsCallLogDefault { + return &DeleteCallsCallLogDefault{ + _statusCode: code, + } +} + +/*DeleteCallsCallLogDefault handles this case with default header values. + +Unexpected error +*/ +type DeleteCallsCallLogDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete calls call log default response +func (o *DeleteCallsCallLogDefault) Code() int { + return o._statusCode +} + +func (o *DeleteCallsCallLogDefault) Error() string { + return fmt.Sprintf("[DELETE /calls/{call}/log][%d] DeleteCallsCallLog default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteCallsCallLogDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/operations/get_calls_call_log_parameters.go b/vendor/github.com/funcy/functions_go/client/operations/get_calls_call_log_parameters.go new file mode 100644 index 000000000..f8b08fea7 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/operations/get_calls_call_log_parameters.go @@ -0,0 +1,135 @@ +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetCallsCallLogParams creates a new GetCallsCallLogParams object +// with the default values initialized. +func NewGetCallsCallLogParams() *GetCallsCallLogParams { + var () + return &GetCallsCallLogParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCallsCallLogParamsWithTimeout creates a new GetCallsCallLogParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCallsCallLogParamsWithTimeout(timeout time.Duration) *GetCallsCallLogParams { + var () + return &GetCallsCallLogParams{ + + timeout: timeout, + } +} + +// NewGetCallsCallLogParamsWithContext creates a new GetCallsCallLogParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCallsCallLogParamsWithContext(ctx context.Context) *GetCallsCallLogParams { + var () + return &GetCallsCallLogParams{ + + Context: ctx, + } +} + +// NewGetCallsCallLogParamsWithHTTPClient creates a new GetCallsCallLogParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCallsCallLogParamsWithHTTPClient(client *http.Client) *GetCallsCallLogParams { + var () + return &GetCallsCallLogParams{ + HTTPClient: client, + } +} + +/*GetCallsCallLogParams contains all the parameters to send to the API endpoint +for the get calls call log operation typically these are written to a http.Request +*/ +type GetCallsCallLogParams struct { + + /*Call + Call ID. + + */ + Call string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get calls call log params +func (o *GetCallsCallLogParams) WithTimeout(timeout time.Duration) *GetCallsCallLogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get calls call log params +func (o *GetCallsCallLogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get calls call log params +func (o *GetCallsCallLogParams) WithContext(ctx context.Context) *GetCallsCallLogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get calls call log params +func (o *GetCallsCallLogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get calls call log params +func (o *GetCallsCallLogParams) WithHTTPClient(client *http.Client) *GetCallsCallLogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get calls call log params +func (o *GetCallsCallLogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCall adds the call to the get calls call log params +func (o *GetCallsCallLogParams) WithCall(call string) *GetCallsCallLogParams { + o.SetCall(call) + return o +} + +// SetCall adds the call to the get calls call log params +func (o *GetCallsCallLogParams) SetCall(call string) { + o.Call = call +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCallsCallLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param call + if err := r.SetPathParam("call", o.Call); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/operations/get_calls_call_log_responses.go b/vendor/github.com/funcy/functions_go/client/operations/get_calls_call_log_responses.go new file mode 100644 index 000000000..08de49ccf --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/operations/get_calls_call_log_responses.go @@ -0,0 +1,101 @@ +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetCallsCallLogReader is a Reader for the GetCallsCallLog structure. +type GetCallsCallLogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCallsCallLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetCallsCallLogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewGetCallsCallLogNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCallsCallLogOK creates a GetCallsCallLogOK with default headers values +func NewGetCallsCallLogOK() *GetCallsCallLogOK { + return &GetCallsCallLogOK{} +} + +/*GetCallsCallLogOK handles this case with default header values. + +Log found +*/ +type GetCallsCallLogOK struct { + Payload *models.LogWrapper +} + +func (o *GetCallsCallLogOK) Error() string { + return fmt.Sprintf("[GET /calls/{call}/log][%d] getCallsCallLogOK %+v", 200, o.Payload) +} + +func (o *GetCallsCallLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LogWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCallsCallLogNotFound creates a GetCallsCallLogNotFound with default headers values +func NewGetCallsCallLogNotFound() *GetCallsCallLogNotFound { + return &GetCallsCallLogNotFound{} +} + +/*GetCallsCallLogNotFound handles this case with default header values. + +Log not found. +*/ +type GetCallsCallLogNotFound struct { + Payload *models.Error +} + +func (o *GetCallsCallLogNotFound) Error() string { + return fmt.Sprintf("[GET /calls/{call}/log][%d] getCallsCallLogNotFound %+v", 404, o.Payload) +} + +func (o *GetCallsCallLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/operations/operations_client.go b/vendor/github.com/funcy/functions_go/client/operations/operations_client.go new file mode 100644 index 000000000..e2d306ba5 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/operations/operations_client.go @@ -0,0 +1,88 @@ +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new operations API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for operations API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +DeleteCallsCallLog deletes call log entry + +Delete call log entry +*/ +func (a *Client) DeleteCallsCallLog(params *DeleteCallsCallLogParams) (*DeleteCallsCallLogAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteCallsCallLogParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteCallsCallLog", + Method: "DELETE", + PathPattern: "/calls/{call}/log", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteCallsCallLogReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DeleteCallsCallLogAccepted), nil + +} + +/* +GetCallsCallLog gets call logs + +Get call logs +*/ +func (a *Client) GetCallsCallLog(params *GetCallsCallLogParams) (*GetCallsCallLogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCallsCallLogParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetCallsCallLog", + Method: "GET", + PathPattern: "/calls/{call}/log", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetCallsCallLogReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetCallsCallLogOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/delete_apps_app_routes_route_parameters.go b/vendor/github.com/funcy/functions_go/client/routes/delete_apps_app_routes_route_parameters.go new file mode 100644 index 000000000..c23c4076b --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/delete_apps_app_routes_route_parameters.go @@ -0,0 +1,156 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDeleteAppsAppRoutesRouteParams creates a new DeleteAppsAppRoutesRouteParams object +// with the default values initialized. +func NewDeleteAppsAppRoutesRouteParams() *DeleteAppsAppRoutesRouteParams { + var () + return &DeleteAppsAppRoutesRouteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAppsAppRoutesRouteParamsWithTimeout creates a new DeleteAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteAppsAppRoutesRouteParamsWithTimeout(timeout time.Duration) *DeleteAppsAppRoutesRouteParams { + var () + return &DeleteAppsAppRoutesRouteParams{ + + timeout: timeout, + } +} + +// NewDeleteAppsAppRoutesRouteParamsWithContext creates a new DeleteAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteAppsAppRoutesRouteParamsWithContext(ctx context.Context) *DeleteAppsAppRoutesRouteParams { + var () + return &DeleteAppsAppRoutesRouteParams{ + + Context: ctx, + } +} + +// NewDeleteAppsAppRoutesRouteParamsWithHTTPClient creates a new DeleteAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteAppsAppRoutesRouteParamsWithHTTPClient(client *http.Client) *DeleteAppsAppRoutesRouteParams { + var () + return &DeleteAppsAppRoutesRouteParams{ + HTTPClient: client, + } +} + +/*DeleteAppsAppRoutesRouteParams contains all the parameters to send to the API endpoint +for the delete apps app routes route operation typically these are written to a http.Request +*/ +type DeleteAppsAppRoutesRouteParams struct { + + /*App + Name of app for this set of routes. + + */ + App string + /*Route + Route name + + */ + Route string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *DeleteAppsAppRoutesRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) WithContext(ctx context.Context) *DeleteAppsAppRoutesRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *DeleteAppsAppRoutesRouteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) WithApp(app string) *DeleteAppsAppRoutesRouteParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) SetApp(app string) { + o.App = app +} + +// WithRoute adds the route to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) WithRoute(route string) *DeleteAppsAppRoutesRouteParams { + o.SetRoute(route) + return o +} + +// SetRoute adds the route to the delete apps app routes route params +func (o *DeleteAppsAppRoutesRouteParams) SetRoute(route string) { + o.Route = route +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAppsAppRoutesRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + // path param route + if err := r.SetPathParam("route", o.Route); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/delete_apps_app_routes_route_responses.go b/vendor/github.com/funcy/functions_go/client/routes/delete_apps_app_routes_route_responses.go new file mode 100644 index 000000000..fdc9ba8b0 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/delete_apps_app_routes_route_responses.go @@ -0,0 +1,138 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// DeleteAppsAppRoutesRouteReader is a Reader for the DeleteAppsAppRoutesRoute structure. +type DeleteAppsAppRoutesRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAppsAppRoutesRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDeleteAppsAppRoutesRouteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewDeleteAppsAppRoutesRouteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewDeleteAppsAppRoutesRouteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteAppsAppRoutesRouteOK creates a DeleteAppsAppRoutesRouteOK with default headers values +func NewDeleteAppsAppRoutesRouteOK() *DeleteAppsAppRoutesRouteOK { + return &DeleteAppsAppRoutesRouteOK{} +} + +/*DeleteAppsAppRoutesRouteOK handles this case with default header values. + +Route successfully deleted. +*/ +type DeleteAppsAppRoutesRouteOK struct { +} + +func (o *DeleteAppsAppRoutesRouteOK) Error() string { + return fmt.Sprintf("[DELETE /apps/{app}/routes/{route}][%d] deleteAppsAppRoutesRouteOK ", 200) +} + +func (o *DeleteAppsAppRoutesRouteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteAppsAppRoutesRouteNotFound creates a DeleteAppsAppRoutesRouteNotFound with default headers values +func NewDeleteAppsAppRoutesRouteNotFound() *DeleteAppsAppRoutesRouteNotFound { + return &DeleteAppsAppRoutesRouteNotFound{} +} + +/*DeleteAppsAppRoutesRouteNotFound handles this case with default header values. + +Route does not exist. +*/ +type DeleteAppsAppRoutesRouteNotFound struct { + Payload *models.Error +} + +func (o *DeleteAppsAppRoutesRouteNotFound) Error() string { + return fmt.Sprintf("[DELETE /apps/{app}/routes/{route}][%d] deleteAppsAppRoutesRouteNotFound %+v", 404, o.Payload) +} + +func (o *DeleteAppsAppRoutesRouteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAppsAppRoutesRouteDefault creates a DeleteAppsAppRoutesRouteDefault with default headers values +func NewDeleteAppsAppRoutesRouteDefault(code int) *DeleteAppsAppRoutesRouteDefault { + return &DeleteAppsAppRoutesRouteDefault{ + _statusCode: code, + } +} + +/*DeleteAppsAppRoutesRouteDefault handles this case with default header values. + +Unexpected error +*/ +type DeleteAppsAppRoutesRouteDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the delete apps app routes route default response +func (o *DeleteAppsAppRoutesRouteDefault) Code() int { + return o._statusCode +} + +func (o *DeleteAppsAppRoutesRouteDefault) Error() string { + return fmt.Sprintf("[DELETE /apps/{app}/routes/{route}][%d] DeleteAppsAppRoutesRoute default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteAppsAppRoutesRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_parameters.go b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_parameters.go new file mode 100644 index 000000000..b1b46da96 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_parameters.go @@ -0,0 +1,135 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetAppsAppRoutesParams creates a new GetAppsAppRoutesParams object +// with the default values initialized. +func NewGetAppsAppRoutesParams() *GetAppsAppRoutesParams { + var () + return &GetAppsAppRoutesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAppsAppRoutesParamsWithTimeout creates a new GetAppsAppRoutesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAppsAppRoutesParamsWithTimeout(timeout time.Duration) *GetAppsAppRoutesParams { + var () + return &GetAppsAppRoutesParams{ + + timeout: timeout, + } +} + +// NewGetAppsAppRoutesParamsWithContext creates a new GetAppsAppRoutesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAppsAppRoutesParamsWithContext(ctx context.Context) *GetAppsAppRoutesParams { + var () + return &GetAppsAppRoutesParams{ + + Context: ctx, + } +} + +// NewGetAppsAppRoutesParamsWithHTTPClient creates a new GetAppsAppRoutesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAppsAppRoutesParamsWithHTTPClient(client *http.Client) *GetAppsAppRoutesParams { + var () + return &GetAppsAppRoutesParams{ + HTTPClient: client, + } +} + +/*GetAppsAppRoutesParams contains all the parameters to send to the API endpoint +for the get apps app routes operation typically these are written to a http.Request +*/ +type GetAppsAppRoutesParams struct { + + /*App + Name of app for this set of routes. + + */ + App string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get apps app routes params +func (o *GetAppsAppRoutesParams) WithTimeout(timeout time.Duration) *GetAppsAppRoutesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get apps app routes params +func (o *GetAppsAppRoutesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get apps app routes params +func (o *GetAppsAppRoutesParams) WithContext(ctx context.Context) *GetAppsAppRoutesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get apps app routes params +func (o *GetAppsAppRoutesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get apps app routes params +func (o *GetAppsAppRoutesParams) WithHTTPClient(client *http.Client) *GetAppsAppRoutesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get apps app routes params +func (o *GetAppsAppRoutesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the get apps app routes params +func (o *GetAppsAppRoutesParams) WithApp(app string) *GetAppsAppRoutesParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the get apps app routes params +func (o *GetAppsAppRoutesParams) SetApp(app string) { + o.App = app +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAppsAppRoutesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_responses.go b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_responses.go new file mode 100644 index 000000000..63ceabb10 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_responses.go @@ -0,0 +1,146 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetAppsAppRoutesReader is a Reader for the GetAppsAppRoutes structure. +type GetAppsAppRoutesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAppsAppRoutesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetAppsAppRoutesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewGetAppsAppRoutesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewGetAppsAppRoutesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetAppsAppRoutesOK creates a GetAppsAppRoutesOK with default headers values +func NewGetAppsAppRoutesOK() *GetAppsAppRoutesOK { + return &GetAppsAppRoutesOK{} +} + +/*GetAppsAppRoutesOK handles this case with default header values. + +Route information +*/ +type GetAppsAppRoutesOK struct { + Payload *models.RoutesWrapper +} + +func (o *GetAppsAppRoutesOK) Error() string { + return fmt.Sprintf("[GET /apps/{app}/routes][%d] getAppsAppRoutesOK %+v", 200, o.Payload) +} + +func (o *GetAppsAppRoutesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RoutesWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppRoutesNotFound creates a GetAppsAppRoutesNotFound with default headers values +func NewGetAppsAppRoutesNotFound() *GetAppsAppRoutesNotFound { + return &GetAppsAppRoutesNotFound{} +} + +/*GetAppsAppRoutesNotFound handles this case with default header values. + +App does not exist. +*/ +type GetAppsAppRoutesNotFound struct { + Payload *models.Error +} + +func (o *GetAppsAppRoutesNotFound) Error() string { + return fmt.Sprintf("[GET /apps/{app}/routes][%d] getAppsAppRoutesNotFound %+v", 404, o.Payload) +} + +func (o *GetAppsAppRoutesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppRoutesDefault creates a GetAppsAppRoutesDefault with default headers values +func NewGetAppsAppRoutesDefault(code int) *GetAppsAppRoutesDefault { + return &GetAppsAppRoutesDefault{ + _statusCode: code, + } +} + +/*GetAppsAppRoutesDefault handles this case with default header values. + +Unexpected error +*/ +type GetAppsAppRoutesDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get apps app routes default response +func (o *GetAppsAppRoutesDefault) Code() int { + return o._statusCode +} + +func (o *GetAppsAppRoutesDefault) Error() string { + return fmt.Sprintf("[GET /apps/{app}/routes][%d] GetAppsAppRoutes default %+v", o._statusCode, o.Payload) +} + +func (o *GetAppsAppRoutesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_route_parameters.go b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_route_parameters.go new file mode 100644 index 000000000..6b752bb8b --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_route_parameters.go @@ -0,0 +1,156 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetAppsAppRoutesRouteParams creates a new GetAppsAppRoutesRouteParams object +// with the default values initialized. +func NewGetAppsAppRoutesRouteParams() *GetAppsAppRoutesRouteParams { + var () + return &GetAppsAppRoutesRouteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAppsAppRoutesRouteParamsWithTimeout creates a new GetAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAppsAppRoutesRouteParamsWithTimeout(timeout time.Duration) *GetAppsAppRoutesRouteParams { + var () + return &GetAppsAppRoutesRouteParams{ + + timeout: timeout, + } +} + +// NewGetAppsAppRoutesRouteParamsWithContext creates a new GetAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAppsAppRoutesRouteParamsWithContext(ctx context.Context) *GetAppsAppRoutesRouteParams { + var () + return &GetAppsAppRoutesRouteParams{ + + Context: ctx, + } +} + +// NewGetAppsAppRoutesRouteParamsWithHTTPClient creates a new GetAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAppsAppRoutesRouteParamsWithHTTPClient(client *http.Client) *GetAppsAppRoutesRouteParams { + var () + return &GetAppsAppRoutesRouteParams{ + HTTPClient: client, + } +} + +/*GetAppsAppRoutesRouteParams contains all the parameters to send to the API endpoint +for the get apps app routes route operation typically these are written to a http.Request +*/ +type GetAppsAppRoutesRouteParams struct { + + /*App + Name of app for this set of routes. + + */ + App string + /*Route + Route name + + */ + Route string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *GetAppsAppRoutesRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) WithContext(ctx context.Context) *GetAppsAppRoutesRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *GetAppsAppRoutesRouteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) WithApp(app string) *GetAppsAppRoutesRouteParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) SetApp(app string) { + o.App = app +} + +// WithRoute adds the route to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) WithRoute(route string) *GetAppsAppRoutesRouteParams { + o.SetRoute(route) + return o +} + +// SetRoute adds the route to the get apps app routes route params +func (o *GetAppsAppRoutesRouteParams) SetRoute(route string) { + o.Route = route +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAppsAppRoutesRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + // path param route + if err := r.SetPathParam("route", o.Route); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_route_responses.go b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_route_responses.go new file mode 100644 index 000000000..cd43ee1ed --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/get_apps_app_routes_route_responses.go @@ -0,0 +1,146 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetAppsAppRoutesRouteReader is a Reader for the GetAppsAppRoutesRoute structure. +type GetAppsAppRoutesRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAppsAppRoutesRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetAppsAppRoutesRouteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 404: + result := NewGetAppsAppRoutesRouteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewGetAppsAppRoutesRouteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetAppsAppRoutesRouteOK creates a GetAppsAppRoutesRouteOK with default headers values +func NewGetAppsAppRoutesRouteOK() *GetAppsAppRoutesRouteOK { + return &GetAppsAppRoutesRouteOK{} +} + +/*GetAppsAppRoutesRouteOK handles this case with default header values. + +Route information +*/ +type GetAppsAppRoutesRouteOK struct { + Payload *models.RouteWrapper +} + +func (o *GetAppsAppRoutesRouteOK) Error() string { + return fmt.Sprintf("[GET /apps/{app}/routes/{route}][%d] getAppsAppRoutesRouteOK %+v", 200, o.Payload) +} + +func (o *GetAppsAppRoutesRouteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RouteWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppRoutesRouteNotFound creates a GetAppsAppRoutesRouteNotFound with default headers values +func NewGetAppsAppRoutesRouteNotFound() *GetAppsAppRoutesRouteNotFound { + return &GetAppsAppRoutesRouteNotFound{} +} + +/*GetAppsAppRoutesRouteNotFound handles this case with default header values. + +Route does not exist. +*/ +type GetAppsAppRoutesRouteNotFound struct { + Payload *models.Error +} + +func (o *GetAppsAppRoutesRouteNotFound) Error() string { + return fmt.Sprintf("[GET /apps/{app}/routes/{route}][%d] getAppsAppRoutesRouteNotFound %+v", 404, o.Payload) +} + +func (o *GetAppsAppRoutesRouteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAppsAppRoutesRouteDefault creates a GetAppsAppRoutesRouteDefault with default headers values +func NewGetAppsAppRoutesRouteDefault(code int) *GetAppsAppRoutesRouteDefault { + return &GetAppsAppRoutesRouteDefault{ + _statusCode: code, + } +} + +/*GetAppsAppRoutesRouteDefault handles this case with default header values. + +Unexpected error +*/ +type GetAppsAppRoutesRouteDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get apps app routes route default response +func (o *GetAppsAppRoutesRouteDefault) Code() int { + return o._statusCode +} + +func (o *GetAppsAppRoutesRouteDefault) Error() string { + return fmt.Sprintf("[GET /apps/{app}/routes/{route}][%d] GetAppsAppRoutesRoute default %+v", o._statusCode, o.Payload) +} + +func (o *GetAppsAppRoutesRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/patch_apps_app_routes_route_parameters.go b/vendor/github.com/funcy/functions_go/client/routes/patch_apps_app_routes_route_parameters.go new file mode 100644 index 000000000..533af4a25 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/patch_apps_app_routes_route_parameters.go @@ -0,0 +1,182 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// NewPatchAppsAppRoutesRouteParams creates a new PatchAppsAppRoutesRouteParams object +// with the default values initialized. +func NewPatchAppsAppRoutesRouteParams() *PatchAppsAppRoutesRouteParams { + var () + return &PatchAppsAppRoutesRouteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPatchAppsAppRoutesRouteParamsWithTimeout creates a new PatchAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPatchAppsAppRoutesRouteParamsWithTimeout(timeout time.Duration) *PatchAppsAppRoutesRouteParams { + var () + return &PatchAppsAppRoutesRouteParams{ + + timeout: timeout, + } +} + +// NewPatchAppsAppRoutesRouteParamsWithContext creates a new PatchAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a context for a request +func NewPatchAppsAppRoutesRouteParamsWithContext(ctx context.Context) *PatchAppsAppRoutesRouteParams { + var () + return &PatchAppsAppRoutesRouteParams{ + + Context: ctx, + } +} + +// NewPatchAppsAppRoutesRouteParamsWithHTTPClient creates a new PatchAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPatchAppsAppRoutesRouteParamsWithHTTPClient(client *http.Client) *PatchAppsAppRoutesRouteParams { + var () + return &PatchAppsAppRoutesRouteParams{ + HTTPClient: client, + } +} + +/*PatchAppsAppRoutesRouteParams contains all the parameters to send to the API endpoint +for the patch apps app routes route operation typically these are written to a http.Request +*/ +type PatchAppsAppRoutesRouteParams struct { + + /*App + name of the app. + + */ + App string + /*Body + One route to post. + + */ + Body *models.RouteWrapper + /*Route + route path. + + */ + Route string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *PatchAppsAppRoutesRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) WithContext(ctx context.Context) *PatchAppsAppRoutesRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *PatchAppsAppRoutesRouteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) WithApp(app string) *PatchAppsAppRoutesRouteParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) SetApp(app string) { + o.App = app +} + +// WithBody adds the body to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) WithBody(body *models.RouteWrapper) *PatchAppsAppRoutesRouteParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) SetBody(body *models.RouteWrapper) { + o.Body = body +} + +// WithRoute adds the route to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) WithRoute(route string) *PatchAppsAppRoutesRouteParams { + o.SetRoute(route) + return o +} + +// SetRoute adds the route to the patch apps app routes route params +func (o *PatchAppsAppRoutesRouteParams) SetRoute(route string) { + o.Route = route +} + +// WriteToRequest writes these params to a swagger request +func (o *PatchAppsAppRoutesRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if o.Body == nil { + o.Body = new(models.RouteWrapper) + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param route + if err := r.SetPathParam("route", o.Route); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/patch_apps_app_routes_route_responses.go b/vendor/github.com/funcy/functions_go/client/routes/patch_apps_app_routes_route_responses.go new file mode 100644 index 000000000..c8a057dff --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/patch_apps_app_routes_route_responses.go @@ -0,0 +1,182 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// PatchAppsAppRoutesRouteReader is a Reader for the PatchAppsAppRoutesRoute structure. +type PatchAppsAppRoutesRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchAppsAppRoutesRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPatchAppsAppRoutesRouteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPatchAppsAppRoutesRouteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewPatchAppsAppRoutesRouteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewPatchAppsAppRoutesRouteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPatchAppsAppRoutesRouteOK creates a PatchAppsAppRoutesRouteOK with default headers values +func NewPatchAppsAppRoutesRouteOK() *PatchAppsAppRoutesRouteOK { + return &PatchAppsAppRoutesRouteOK{} +} + +/*PatchAppsAppRoutesRouteOK handles this case with default header values. + +Route updated +*/ +type PatchAppsAppRoutesRouteOK struct { + Payload *models.RouteWrapper +} + +func (o *PatchAppsAppRoutesRouteOK) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}/routes/{route}][%d] patchAppsAppRoutesRouteOK %+v", 200, o.Payload) +} + +func (o *PatchAppsAppRoutesRouteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RouteWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchAppsAppRoutesRouteBadRequest creates a PatchAppsAppRoutesRouteBadRequest with default headers values +func NewPatchAppsAppRoutesRouteBadRequest() *PatchAppsAppRoutesRouteBadRequest { + return &PatchAppsAppRoutesRouteBadRequest{} +} + +/*PatchAppsAppRoutesRouteBadRequest handles this case with default header values. + +Invalid route due to parameters being missing or invalid. +*/ +type PatchAppsAppRoutesRouteBadRequest struct { + Payload *models.Error +} + +func (o *PatchAppsAppRoutesRouteBadRequest) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}/routes/{route}][%d] patchAppsAppRoutesRouteBadRequest %+v", 400, o.Payload) +} + +func (o *PatchAppsAppRoutesRouteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchAppsAppRoutesRouteNotFound creates a PatchAppsAppRoutesRouteNotFound with default headers values +func NewPatchAppsAppRoutesRouteNotFound() *PatchAppsAppRoutesRouteNotFound { + return &PatchAppsAppRoutesRouteNotFound{} +} + +/*PatchAppsAppRoutesRouteNotFound handles this case with default header values. + +App does not exist. +*/ +type PatchAppsAppRoutesRouteNotFound struct { + Payload *models.Error +} + +func (o *PatchAppsAppRoutesRouteNotFound) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}/routes/{route}][%d] patchAppsAppRoutesRouteNotFound %+v", 404, o.Payload) +} + +func (o *PatchAppsAppRoutesRouteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchAppsAppRoutesRouteDefault creates a PatchAppsAppRoutesRouteDefault with default headers values +func NewPatchAppsAppRoutesRouteDefault(code int) *PatchAppsAppRoutesRouteDefault { + return &PatchAppsAppRoutesRouteDefault{ + _statusCode: code, + } +} + +/*PatchAppsAppRoutesRouteDefault handles this case with default header values. + +Unexpected error +*/ +type PatchAppsAppRoutesRouteDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the patch apps app routes route default response +func (o *PatchAppsAppRoutesRouteDefault) Code() int { + return o._statusCode +} + +func (o *PatchAppsAppRoutesRouteDefault) Error() string { + return fmt.Sprintf("[PATCH /apps/{app}/routes/{route}][%d] PatchAppsAppRoutesRoute default %+v", o._statusCode, o.Payload) +} + +func (o *PatchAppsAppRoutesRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/post_apps_app_routes_parameters.go b/vendor/github.com/funcy/functions_go/client/routes/post_apps_app_routes_parameters.go new file mode 100644 index 000000000..a1c11e224 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/post_apps_app_routes_parameters.go @@ -0,0 +1,161 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// NewPostAppsAppRoutesParams creates a new PostAppsAppRoutesParams object +// with the default values initialized. +func NewPostAppsAppRoutesParams() *PostAppsAppRoutesParams { + var () + return &PostAppsAppRoutesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAppsAppRoutesParamsWithTimeout creates a new PostAppsAppRoutesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAppsAppRoutesParamsWithTimeout(timeout time.Duration) *PostAppsAppRoutesParams { + var () + return &PostAppsAppRoutesParams{ + + timeout: timeout, + } +} + +// NewPostAppsAppRoutesParamsWithContext creates a new PostAppsAppRoutesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAppsAppRoutesParamsWithContext(ctx context.Context) *PostAppsAppRoutesParams { + var () + return &PostAppsAppRoutesParams{ + + Context: ctx, + } +} + +// NewPostAppsAppRoutesParamsWithHTTPClient creates a new PostAppsAppRoutesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAppsAppRoutesParamsWithHTTPClient(client *http.Client) *PostAppsAppRoutesParams { + var () + return &PostAppsAppRoutesParams{ + HTTPClient: client, + } +} + +/*PostAppsAppRoutesParams contains all the parameters to send to the API endpoint +for the post apps app routes operation typically these are written to a http.Request +*/ +type PostAppsAppRoutesParams struct { + + /*App + name of the app. + + */ + App string + /*Body + One route to post. + + */ + Body *models.RouteWrapper + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post apps app routes params +func (o *PostAppsAppRoutesParams) WithTimeout(timeout time.Duration) *PostAppsAppRoutesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post apps app routes params +func (o *PostAppsAppRoutesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post apps app routes params +func (o *PostAppsAppRoutesParams) WithContext(ctx context.Context) *PostAppsAppRoutesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post apps app routes params +func (o *PostAppsAppRoutesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post apps app routes params +func (o *PostAppsAppRoutesParams) WithHTTPClient(client *http.Client) *PostAppsAppRoutesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post apps app routes params +func (o *PostAppsAppRoutesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithApp adds the app to the post apps app routes params +func (o *PostAppsAppRoutesParams) WithApp(app string) *PostAppsAppRoutesParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the post apps app routes params +func (o *PostAppsAppRoutesParams) SetApp(app string) { + o.App = app +} + +// WithBody adds the body to the post apps app routes params +func (o *PostAppsAppRoutesParams) WithBody(body *models.RouteWrapper) *PostAppsAppRoutesParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the post apps app routes params +func (o *PostAppsAppRoutesParams) SetBody(body *models.RouteWrapper) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAppsAppRoutesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if o.Body == nil { + o.Body = new(models.RouteWrapper) + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/post_apps_app_routes_responses.go b/vendor/github.com/funcy/functions_go/client/routes/post_apps_app_routes_responses.go new file mode 100644 index 000000000..c6f94f376 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/post_apps_app_routes_responses.go @@ -0,0 +1,182 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// PostAppsAppRoutesReader is a Reader for the PostAppsAppRoutes structure. +type PostAppsAppRoutesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAppsAppRoutesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPostAppsAppRoutesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPostAppsAppRoutesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPostAppsAppRoutesConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewPostAppsAppRoutesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPostAppsAppRoutesOK creates a PostAppsAppRoutesOK with default headers values +func NewPostAppsAppRoutesOK() *PostAppsAppRoutesOK { + return &PostAppsAppRoutesOK{} +} + +/*PostAppsAppRoutesOK handles this case with default header values. + +Route created +*/ +type PostAppsAppRoutesOK struct { + Payload *models.RouteWrapper +} + +func (o *PostAppsAppRoutesOK) Error() string { + return fmt.Sprintf("[POST /apps/{app}/routes][%d] postAppsAppRoutesOK %+v", 200, o.Payload) +} + +func (o *PostAppsAppRoutesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RouteWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppsAppRoutesBadRequest creates a PostAppsAppRoutesBadRequest with default headers values +func NewPostAppsAppRoutesBadRequest() *PostAppsAppRoutesBadRequest { + return &PostAppsAppRoutesBadRequest{} +} + +/*PostAppsAppRoutesBadRequest handles this case with default header values. + +Invalid route due to parameters being missing or invalid. +*/ +type PostAppsAppRoutesBadRequest struct { + Payload *models.Error +} + +func (o *PostAppsAppRoutesBadRequest) Error() string { + return fmt.Sprintf("[POST /apps/{app}/routes][%d] postAppsAppRoutesBadRequest %+v", 400, o.Payload) +} + +func (o *PostAppsAppRoutesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppsAppRoutesConflict creates a PostAppsAppRoutesConflict with default headers values +func NewPostAppsAppRoutesConflict() *PostAppsAppRoutesConflict { + return &PostAppsAppRoutesConflict{} +} + +/*PostAppsAppRoutesConflict handles this case with default header values. + +Route already exists. +*/ +type PostAppsAppRoutesConflict struct { + Payload *models.Error +} + +func (o *PostAppsAppRoutesConflict) Error() string { + return fmt.Sprintf("[POST /apps/{app}/routes][%d] postAppsAppRoutesConflict %+v", 409, o.Payload) +} + +func (o *PostAppsAppRoutesConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAppsAppRoutesDefault creates a PostAppsAppRoutesDefault with default headers values +func NewPostAppsAppRoutesDefault(code int) *PostAppsAppRoutesDefault { + return &PostAppsAppRoutesDefault{ + _statusCode: code, + } +} + +/*PostAppsAppRoutesDefault handles this case with default header values. + +Unexpected error +*/ +type PostAppsAppRoutesDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the post apps app routes default response +func (o *PostAppsAppRoutesDefault) Code() int { + return o._statusCode +} + +func (o *PostAppsAppRoutesDefault) Error() string { + return fmt.Sprintf("[POST /apps/{app}/routes][%d] PostAppsAppRoutes default %+v", o._statusCode, o.Payload) +} + +func (o *PostAppsAppRoutesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/put_apps_app_routes_route_parameters.go b/vendor/github.com/funcy/functions_go/client/routes/put_apps_app_routes_route_parameters.go new file mode 100644 index 000000000..a1026bb73 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/put_apps_app_routes_route_parameters.go @@ -0,0 +1,158 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// NewPutAppsAppRoutesRouteParams creates a new PutAppsAppRoutesRouteParams object +// with the default values initialized. +func NewPutAppsAppRoutesRouteParams() *PutAppsAppRoutesRouteParams { + var () + return &PutAppsAppRoutesRouteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutAppsAppRoutesRouteParamsWithTimeout creates a new PutAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutAppsAppRoutesRouteParamsWithTimeout(timeout time.Duration) *PutAppsAppRoutesRouteParams { + var () + return &PutAppsAppRoutesRouteParams{ + + timeout: timeout, + } +} + +// NewPutAppsAppRoutesRouteParamsWithContext creates a new PutAppsAppRoutesRouteParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutAppsAppRoutesRouteParamsWithContext(ctx context.Context) *PutAppsAppRoutesRouteParams { + var () + return &PutAppsAppRoutesRouteParams{ + + Context: ctx, + } +} + +/*PutAppsAppRoutesRouteParams contains all the parameters to send to the API endpoint +for the put apps app routes route operation typically these are written to a http.Request +*/ +type PutAppsAppRoutesRouteParams struct { + + /*App + name of the app. + + */ + App string + /*Body + One route to post. + + */ + Body *models.RouteWrapper + /*Route + route path. + + */ + Route string + + timeout time.Duration + Context context.Context +} + +// WithTimeout adds the timeout to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *PutAppsAppRoutesRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) WithContext(ctx context.Context) *PutAppsAppRoutesRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithApp adds the app to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) WithApp(app string) *PutAppsAppRoutesRouteParams { + o.SetApp(app) + return o +} + +// SetApp adds the app to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) SetApp(app string) { + o.App = app +} + +// WithBody adds the body to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) WithBody(body *models.RouteWrapper) *PutAppsAppRoutesRouteParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) SetBody(body *models.RouteWrapper) { + o.Body = body +} + +// WithRoute adds the route to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) WithRoute(route string) *PutAppsAppRoutesRouteParams { + o.SetRoute(route) + return o +} + +// SetRoute adds the route to the put apps app routes route params +func (o *PutAppsAppRoutesRouteParams) SetRoute(route string) { + o.Route = route +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAppsAppRoutesRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + r.SetTimeout(o.timeout) + var res []error + + // path param app + if err := r.SetPathParam("app", o.App); err != nil { + return err + } + + if o.Body == nil { + o.Body = new(models.RouteWrapper) + } + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param route + if err := r.SetPathParam("route", o.Route); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/put_apps_app_routes_route_responses.go b/vendor/github.com/funcy/functions_go/client/routes/put_apps_app_routes_route_responses.go new file mode 100644 index 000000000..1ce8721b2 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/put_apps_app_routes_route_responses.go @@ -0,0 +1,179 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// PutAppsAppRoutesRouteReader is a Reader for the PutAppsAppRoutesRoute structure. +type PutAppsAppRoutesRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAppsAppRoutesRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewPutAppsAppRoutesRouteCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPutAppsAppRoutesRouteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPutAppsAppRoutesRouteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + result := NewPutAppsAppRoutesRouteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + } +} + +// NewPutAppsAppRoutesRouteCreated creates a PutAppsAppRoutesRouteCreated with default headers values +func NewPutAppsAppRoutesRouteCreated() *PutAppsAppRoutesRouteCreated { + return &PutAppsAppRoutesRouteCreated{} +} + +/*PutAppsAppRoutesRouteCreated handles this case with default header values. + +Route updated +*/ +type PutAppsAppRoutesRouteCreated struct { + Payload *models.RouteWrapper +} + +func (o *PutAppsAppRoutesRouteCreated) Error() string { + return fmt.Sprintf("[PUT /apps/{app}/routes/{route}][%d] putAppsAppRoutesRouteCreated %+v", 201, o.Payload) +} + +func (o *PutAppsAppRoutesRouteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RouteWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAppsAppRoutesRouteBadRequest creates a PutAppsAppRoutesRouteBadRequest with default headers values +func NewPutAppsAppRoutesRouteBadRequest() *PutAppsAppRoutesRouteBadRequest { + return &PutAppsAppRoutesRouteBadRequest{} +} + +/*PutAppsAppRoutesRouteBadRequest handles this case with default header values. + +One or more of the routes were invalid due to parameters being missing or invalid. +*/ +type PutAppsAppRoutesRouteBadRequest struct { + Payload *models.Error +} + +func (o *PutAppsAppRoutesRouteBadRequest) Error() string { + return fmt.Sprintf("[PUT /apps/{app}/routes/{route}][%d] putAppsAppRoutesRouteBadRequest %+v", 400, o.Payload) +} + +func (o *PutAppsAppRoutesRouteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAppsAppRoutesRouteInternalServerError creates a PutAppsAppRoutesRouteInternalServerError with default headers values +func NewPutAppsAppRoutesRouteInternalServerError() *PutAppsAppRoutesRouteInternalServerError { + return &PutAppsAppRoutesRouteInternalServerError{} +} + +/*PutAppsAppRoutesRouteInternalServerError handles this case with default header values. + +Could not accept routes due to internal error. +*/ +type PutAppsAppRoutesRouteInternalServerError struct { + Payload *models.Error +} + +func (o *PutAppsAppRoutesRouteInternalServerError) Error() string { + return fmt.Sprintf("[PUT /apps/{app}/routes/{route}][%d] putAppsAppRoutesRouteInternalServerError %+v", 500, o.Payload) +} + +func (o *PutAppsAppRoutesRouteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAppsAppRoutesRouteDefault creates a PutAppsAppRoutesRouteDefault with default headers values +func NewPutAppsAppRoutesRouteDefault(code int) *PutAppsAppRoutesRouteDefault { + return &PutAppsAppRoutesRouteDefault{ + _statusCode: code, + } +} + +/*PutAppsAppRoutesRouteDefault handles this case with default header values. + +Unexpected error +*/ +type PutAppsAppRoutesRouteDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the put apps app routes route default response +func (o *PutAppsAppRoutesRouteDefault) Code() int { + return o._statusCode +} + +func (o *PutAppsAppRoutesRouteDefault) Error() string { + return fmt.Sprintf("[PUT /apps/{app}/routes/{route}][%d] PutAppsAppRoutesRoute default %+v", o._statusCode, o.Payload) +} + +func (o *PutAppsAppRoutesRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/routes/routes_client.go b/vendor/github.com/funcy/functions_go/client/routes/routes_client.go new file mode 100644 index 000000000..df645680f --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/routes/routes_client.go @@ -0,0 +1,178 @@ +package routes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new routes API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for routes API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +DeleteAppsAppRoutesRoute deletes the route + +Deletes the route. +*/ +func (a *Client) DeleteAppsAppRoutesRoute(params *DeleteAppsAppRoutesRouteParams) (*DeleteAppsAppRoutesRouteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAppsAppRoutesRouteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteAppsAppRoutesRoute", + Method: "DELETE", + PathPattern: "/apps/{app}/routes/{route}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteAppsAppRoutesRouteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DeleteAppsAppRoutesRouteOK), nil + +} + +/* +GetAppsAppRoutes gets route list by app name + +This will list routes for a particular app. +*/ +func (a *Client) GetAppsAppRoutes(params *GetAppsAppRoutesParams) (*GetAppsAppRoutesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAppsAppRoutesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAppsAppRoutes", + Method: "GET", + PathPattern: "/apps/{app}/routes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAppsAppRoutesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetAppsAppRoutesOK), nil + +} + +/* +GetAppsAppRoutesRoute gets route by name + +Gets a route by name. +*/ +func (a *Client) GetAppsAppRoutesRoute(params *GetAppsAppRoutesRouteParams) (*GetAppsAppRoutesRouteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAppsAppRoutesRouteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAppsAppRoutesRoute", + Method: "GET", + PathPattern: "/apps/{app}/routes/{route}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAppsAppRoutesRouteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetAppsAppRoutesRouteOK), nil + +} + +/* +PatchAppsAppRoutesRoute updates a route + +Update a route +*/ +func (a *Client) PatchAppsAppRoutesRoute(params *PatchAppsAppRoutesRouteParams) (*PatchAppsAppRoutesRouteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPatchAppsAppRoutesRouteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PatchAppsAppRoutesRoute", + Method: "PATCH", + PathPattern: "/apps/{app}/routes/{route}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &PatchAppsAppRoutesRouteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PatchAppsAppRoutesRouteOK), nil + +} + +/* +PostAppsAppRoutes creates new route + +Create a new route in an app, if app doesn't exists, it creates the app +*/ +func (a *Client) PostAppsAppRoutes(params *PostAppsAppRoutesParams) (*PostAppsAppRoutesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAppsAppRoutesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostAppsAppRoutes", + Method: "POST", + PathPattern: "/apps/{app}/routes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &PostAppsAppRoutesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PostAppsAppRoutesOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/funcy/functions_go/client/tasks/get_tasks_parameters.go b/vendor/github.com/funcy/functions_go/client/tasks/get_tasks_parameters.go new file mode 100644 index 000000000..4a393a3c7 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/tasks/get_tasks_parameters.go @@ -0,0 +1,112 @@ +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetTasksParams creates a new GetTasksParams object +// with the default values initialized. +func NewGetTasksParams() *GetTasksParams { + + return &GetTasksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTasksParamsWithTimeout creates a new GetTasksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTasksParamsWithTimeout(timeout time.Duration) *GetTasksParams { + + return &GetTasksParams{ + + timeout: timeout, + } +} + +// NewGetTasksParamsWithContext creates a new GetTasksParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTasksParamsWithContext(ctx context.Context) *GetTasksParams { + + return &GetTasksParams{ + + Context: ctx, + } +} + +// NewGetTasksParamsWithHTTPClient creates a new GetTasksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTasksParamsWithHTTPClient(client *http.Client) *GetTasksParams { + + return &GetTasksParams{ + HTTPClient: client, + } +} + +/*GetTasksParams contains all the parameters to send to the API endpoint +for the get tasks operation typically these are written to a http.Request +*/ +type GetTasksParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tasks params +func (o *GetTasksParams) WithTimeout(timeout time.Duration) *GetTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tasks params +func (o *GetTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tasks params +func (o *GetTasksParams) WithContext(ctx context.Context) *GetTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tasks params +func (o *GetTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tasks params +func (o *GetTasksParams) WithHTTPClient(client *http.Client) *GetTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tasks params +func (o *GetTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/tasks/get_tasks_responses.go b/vendor/github.com/funcy/functions_go/client/tasks/get_tasks_responses.go new file mode 100644 index 000000000..e809faa6f --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/tasks/get_tasks_responses.go @@ -0,0 +1,110 @@ +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetTasksReader is a Reader for the GetTasks structure. +type GetTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + result := NewGetTasksDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetTasksOK creates a GetTasksOK with default headers values +func NewGetTasksOK() *GetTasksOK { + return &GetTasksOK{} +} + +/*GetTasksOK handles this case with default header values. + +Task information +*/ +type GetTasksOK struct { + Payload *models.TaskWrapper +} + +func (o *GetTasksOK) Error() string { + return fmt.Sprintf("[GET /tasks][%d] getTasksOK %+v", 200, o.Payload) +} + +func (o *GetTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskWrapper) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTasksDefault creates a GetTasksDefault with default headers values +func NewGetTasksDefault(code int) *GetTasksDefault { + return &GetTasksDefault{ + _statusCode: code, + } +} + +/*GetTasksDefault handles this case with default header values. + +Unexpected error +*/ +type GetTasksDefault struct { + _statusCode int + + Payload *models.Error +} + +// Code gets the status code for the get tasks default response +func (o *GetTasksDefault) Code() int { + return o._statusCode +} + +func (o *GetTasksDefault) Error() string { + return fmt.Sprintf("[GET /tasks][%d] GetTasks default %+v", o._statusCode, o.Payload) +} + +func (o *GetTasksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/tasks/tasks_client.go b/vendor/github.com/funcy/functions_go/client/tasks/tasks_client.go new file mode 100644 index 000000000..71526e283 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/tasks/tasks_client.go @@ -0,0 +1,58 @@ +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new tasks API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tasks API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +GetTasks gets next task + +Gets the next task in the queue, ready for processing. Consumers should start processing tasks in order. No other consumer can retrieve this task. +*/ +func (a *Client) GetTasks(params *GetTasksParams) (*GetTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTasksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetTasks", + Method: "GET", + PathPattern: "/tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetTasksReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetTasksOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/funcy/functions_go/client/version/get_version_parameters.go b/vendor/github.com/funcy/functions_go/client/version/get_version_parameters.go new file mode 100644 index 000000000..602d6f755 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/version/get_version_parameters.go @@ -0,0 +1,112 @@ +package version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetVersionParams creates a new GetVersionParams object +// with the default values initialized. +func NewGetVersionParams() *GetVersionParams { + + return &GetVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetVersionParamsWithTimeout creates a new GetVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams { + + return &GetVersionParams{ + + timeout: timeout, + } +} + +// NewGetVersionParamsWithContext creates a new GetVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams { + + return &GetVersionParams{ + + Context: ctx, + } +} + +// NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams { + + return &GetVersionParams{ + HTTPClient: client, + } +} + +/*GetVersionParams contains all the parameters to send to the API endpoint +for the get version operation typically these are written to a http.Request +*/ +type GetVersionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get version params +func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get version params +func (o *GetVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get version params +func (o *GetVersionParams) WithContext(ctx context.Context) *GetVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get version params +func (o *GetVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get version params +func (o *GetVersionParams) WithHTTPClient(client *http.Client) *GetVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get version params +func (o *GetVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/version/get_version_responses.go b/vendor/github.com/funcy/functions_go/client/version/get_version_responses.go new file mode 100644 index 000000000..c917160f5 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/version/get_version_responses.go @@ -0,0 +1,65 @@ +package version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/funcy/functions_go/models" +) + +// GetVersionReader is a Reader for the GetVersion structure. +type GetVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetVersionOK creates a GetVersionOK with default headers values +func NewGetVersionOK() *GetVersionOK { + return &GetVersionOK{} +} + +/*GetVersionOK handles this case with default header values. + +Daemon version. +*/ +type GetVersionOK struct { + Payload *models.Version +} + +func (o *GetVersionOK) Error() string { + return fmt.Sprintf("[GET /version][%d] getVersionOK %+v", 200, o.Payload) +} + +func (o *GetVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Version) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/funcy/functions_go/client/version/version_client.go b/vendor/github.com/funcy/functions_go/client/version/version_client.go new file mode 100644 index 000000000..30a9256d7 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/client/version/version_client.go @@ -0,0 +1,56 @@ +package version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new version API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for version API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +GetVersion gets daemon version +*/ +func (a *Client) GetVersion(params *GetVersionParams) (*GetVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetVersion", + Method: "GET", + PathPattern: "/version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetVersionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetVersionOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/funcy/functions_go/configuration.go b/vendor/github.com/funcy/functions_go/configuration.go new file mode 100644 index 000000000..b9ae04857 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/configuration.go @@ -0,0 +1,57 @@ +package functions + +import ( + "encoding/base64" + "net/http" + "time" +) + + +type Configuration struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` + APIKeyPrefix map[string]string `json:"APIKeyPrefix,omitempty"` + APIKey map[string]string `json:"APIKey,omitempty"` + Debug bool `json:"debug,omitempty"` + DebugFile string `json:"debugFile,omitempty"` + OAuthToken string `json:"oAuthToken,omitempty"` + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + AccessToken string `json:"accessToken,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + APIClient *APIClient + Transport *http.Transport + Timeout *time.Duration `json:"timeout,omitempty"` +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://127.0.0.1:8080/v1", + DefaultHeader: make(map[string]string), + APIKey: make(map[string]string), + APIKeyPrefix: make(map[string]string), + UserAgent: "Swagger-Codegen/0.1.28/go", + APIClient: &APIClient{}, + } + + cfg.APIClient.config = cfg + return cfg +} + +func (c *Configuration) GetBasicAuthEncodedString() string { + return base64.StdEncoding.EncodeToString([]byte(c.UserName + ":" + c.Password)) +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string { + if c.APIKeyPrefix[APIKeyIdentifier] != "" { + return c.APIKeyPrefix[APIKeyIdentifier] + " " + c.APIKey[APIKeyIdentifier] + } + + return c.APIKey[APIKeyIdentifier] +} diff --git a/vendor/github.com/funcy/functions_go/docs/App.md b/vendor/github.com/funcy/functions_go/docs/App.md new file mode 100644 index 000000000..c71afc8e3 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/App.md @@ -0,0 +1,11 @@ +# App + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of this app. Must be different than the image name. Can ony contain alphanumeric, -, and _. | [optional] [default to null] +**Config** | **map[string]string** | Application configuration | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/AppWrapper.md b/vendor/github.com/funcy/functions_go/docs/AppWrapper.md new file mode 100644 index 000000000..719aff3ab --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/AppWrapper.md @@ -0,0 +1,11 @@ +# AppWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**App** | [**App**](App.md) | | [default to null] +**Error_** | [**ErrorBody**](ErrorBody.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/AppsApi.md b/vendor/github.com/funcy/functions_go/docs/AppsApi.md new file mode 100644 index 000000000..e4ae0bc5e --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/AppsApi.md @@ -0,0 +1,156 @@ +# \AppsApi + +All URIs are relative to *https://127.0.0.1:8080/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AppsAppDelete**](AppsApi.md#AppsAppDelete) | **Delete** /apps/{app} | Delete an app. +[**AppsAppGet**](AppsApi.md#AppsAppGet) | **Get** /apps/{app} | Get information for a app. +[**AppsAppPatch**](AppsApi.md#AppsAppPatch) | **Patch** /apps/{app} | Updates an app. +[**AppsGet**](AppsApi.md#AppsGet) | **Get** /apps | Get all app names. +[**AppsPost**](AppsApi.md#AppsPost) | **Post** /apps | Post new app + + +# **AppsAppDelete** +> AppsAppDelete($app) + +Delete an app. + +Delete an app. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| Name of the app. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsAppGet** +> AppWrapper AppsAppGet($app) + +Get information for a app. + +This gives more details about a app, such as statistics. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| name of the app. | + +### Return type + +[**AppWrapper**](AppWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsAppPatch** +> AppWrapper AppsAppPatch($app, $body) + +Updates an app. + +You can set app level settings here. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| name of the app. | + **body** | [**AppWrapper**](AppWrapper.md)| App to post. | + +### Return type + +[**AppWrapper**](AppWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsGet** +> AppsWrapper AppsGet() + +Get all app names. + +Get a list of all the apps in the system. + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AppsWrapper**](AppsWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsPost** +> AppWrapper AppsPost($body) + +Post new app + +Insert a new app + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AppWrapper**](AppWrapper.md)| App to post. | + +### Return type + +[**AppWrapper**](AppWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/github.com/funcy/functions_go/docs/AppsWrapper.md b/vendor/github.com/funcy/functions_go/docs/AppsWrapper.md new file mode 100644 index 000000000..e6c4dee99 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/AppsWrapper.md @@ -0,0 +1,11 @@ +# AppsWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Apps** | [**[]App**](App.md) | | [default to null] +**Error_** | [**ErrorBody**](ErrorBody.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/ErrorBody.md b/vendor/github.com/funcy/functions_go/docs/ErrorBody.md new file mode 100644 index 000000000..6c9f191c5 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/ErrorBody.md @@ -0,0 +1,11 @@ +# ErrorBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | [optional] [default to null] +**Fields** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/ModelError.md b/vendor/github.com/funcy/functions_go/docs/ModelError.md new file mode 100644 index 000000000..5009b2c08 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/ModelError.md @@ -0,0 +1,10 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error_** | [**ErrorBody**](ErrorBody.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/NewTask.md b/vendor/github.com/funcy/functions_go/docs/NewTask.md new file mode 100644 index 000000000..c2f3819a6 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/NewTask.md @@ -0,0 +1,11 @@ +# NewTask + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Image** | **string** | Name of Docker image to use. This is optional and can be used to override the image defined at the group level. | [default to null] +**Payload** | **string** | Payload for the task. This is what you pass into each task to make it do something. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/NewTasksWrapper.md b/vendor/github.com/funcy/functions_go/docs/NewTasksWrapper.md new file mode 100644 index 000000000..47b0d1c27 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/NewTasksWrapper.md @@ -0,0 +1,10 @@ +# NewTasksWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Tasks** | [**[]NewTask**](NewTask.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/Route.md b/vendor/github.com/funcy/functions_go/docs/Route.md new file mode 100644 index 000000000..7f2eaa550 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/Route.md @@ -0,0 +1,18 @@ +# Route + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Path** | **string** | URL path that will be matched to this route | [optional] [default to null] +**Image** | **string** | Name of Docker image to use in this route. You should include the image tag, which should be a version number, to be more accurate. Can be overridden on a per route basis with route.image. | [optional] [default to null] +**Headers** | [**map[string][]string**](array.md) | Map of http headers that will be sent with the response | [optional] [default to null] +**Memory** | **int64** | Max usable memory for this route (MiB). | [optional] [default to null] +**Type_** | **string** | Route type | [optional] [default to null] +**Format** | **string** | Payload format sent into function. | [optional] [default to null] +**MaxConcurrency** | **int32** | Maximum number of hot containers concurrency | [optional] [default to null] +**Config** | **map[string]string** | Route configuration - overrides application configuration | [optional] [default to null] +**Timeout** | **int32** | Timeout for executions of this route. Value in Seconds | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/RouteWrapper.md b/vendor/github.com/funcy/functions_go/docs/RouteWrapper.md new file mode 100644 index 000000000..665c54517 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/RouteWrapper.md @@ -0,0 +1,12 @@ +# RouteWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | [optional] [default to null] +**Error_** | [**ErrorBody**](ErrorBody.md) | | [optional] [default to null] +**Route** | [**Route**](Route.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/RoutesApi.md b/vendor/github.com/funcy/functions_go/docs/RoutesApi.md new file mode 100644 index 000000000..d0bb56e8b --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/RoutesApi.md @@ -0,0 +1,163 @@ +# \RoutesApi + +All URIs are relative to *https://127.0.0.1:8080/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AppsAppRoutesGet**](RoutesApi.md#AppsAppRoutesGet) | **Get** /apps/{app}/routes | Get route list by app name. +[**AppsAppRoutesPost**](RoutesApi.md#AppsAppRoutesPost) | **Post** /apps/{app}/routes | Create new Route +[**AppsAppRoutesRouteDelete**](RoutesApi.md#AppsAppRoutesRouteDelete) | **Delete** /apps/{app}/routes/{route} | Deletes the route +[**AppsAppRoutesRouteGet**](RoutesApi.md#AppsAppRoutesRouteGet) | **Get** /apps/{app}/routes/{route} | Gets route by name +[**AppsAppRoutesRoutePatch**](RoutesApi.md#AppsAppRoutesRoutePatch) | **Patch** /apps/{app}/routes/{route} | Update a Route + + +# **AppsAppRoutesGet** +> RoutesWrapper AppsAppRoutesGet($app) + +Get route list by app name. + +This will list routes for a particular app. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| Name of app for this set of routes. | + +### Return type + +[**RoutesWrapper**](RoutesWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsAppRoutesPost** +> RouteWrapper AppsAppRoutesPost($app, $body) + +Create new Route + +Create a new route in an app, if app doesn't exists, it creates the app + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| name of the app. | + **body** | [**RouteWrapper**](RouteWrapper.md)| One route to post. | + +### Return type + +[**RouteWrapper**](RouteWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsAppRoutesRouteDelete** +> AppsAppRoutesRouteDelete($app, $route) + +Deletes the route + +Deletes the route. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| Name of app for this set of routes. | + **route** | **string**| Route name | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsAppRoutesRouteGet** +> RouteWrapper AppsAppRoutesRouteGet($app, $route) + +Gets route by name + +Gets a route by name. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| Name of app for this set of routes. | + **route** | **string**| Route name | + +### Return type + +[**RouteWrapper**](RouteWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AppsAppRoutesRoutePatch** +> RouteWrapper AppsAppRoutesRoutePatch($app, $route, $body) + +Update a Route + +Update a route + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| name of the app. | + **route** | **string**| route path. | + **body** | [**RouteWrapper**](RouteWrapper.md)| One route to post. | + +### Return type + +[**RouteWrapper**](RouteWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/github.com/funcy/functions_go/docs/RoutesWrapper.md b/vendor/github.com/funcy/functions_go/docs/RoutesWrapper.md new file mode 100644 index 000000000..fbb928aa4 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/RoutesWrapper.md @@ -0,0 +1,11 @@ +# RoutesWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Routes** | [**[]Route**](Route.md) | | [default to null] +**Error_** | [**ErrorBody**](ErrorBody.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/Task.md b/vendor/github.com/funcy/functions_go/docs/Task.md new file mode 100644 index 000000000..8ef88a2b3 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/Task.md @@ -0,0 +1,20 @@ +# Task + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Image** | **string** | Name of Docker image to use. This is optional and can be used to override the image defined at the group level. | [default to null] +**Payload** | **string** | Payload for the task. This is what you pass into each task to make it do something. | [optional] [default to null] +**GroupName** | **string** | Group this task belongs to. | [optional] [default to null] +**Error_** | **string** | The error message, if status is 'error'. This is errors due to things outside the task itself. Errors from user code will be found in the log. | [optional] [default to null] +**Reason** | **string** | Machine usable reason for task being in this state. Valid values for error status are `timeout | killed | bad_exit`. Valid values for cancelled status are `client_request`. For everything else, this is undefined. | [optional] [default to null] +**CreatedAt** | [**time.Time**](time.Time.md) | Time when task was submitted. Always in UTC. | [optional] [default to null] +**StartedAt** | [**time.Time**](time.Time.md) | Time when task started execution. Always in UTC. | [optional] [default to null] +**CompletedAt** | [**time.Time**](time.Time.md) | Time when task completed, whether it was successul or failed. Always in UTC. | [optional] [default to null] +**RetryOf** | **string** | If this field is set, then this task is a retry of the ID in this field. | [optional] [default to null] +**RetryAt** | **string** | If this field is set, then this task was retried by the task referenced in this field. | [optional] [default to null] +**EnvVars** | **map[string]string** | Env vars for the task. Comes from the ones set on the Group. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/TaskWrapper.md b/vendor/github.com/funcy/functions_go/docs/TaskWrapper.md new file mode 100644 index 000000000..2e749ec25 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/TaskWrapper.md @@ -0,0 +1,10 @@ +# TaskWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Task** | [**Task**](Task.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/TasksApi.md b/vendor/github.com/funcy/functions_go/docs/TasksApi.md new file mode 100644 index 000000000..311cc7cc4 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/TasksApi.md @@ -0,0 +1,35 @@ +# \TasksApi + +All URIs are relative to *https://127.0.0.1:8080/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TasksGet**](TasksApi.md#TasksGet) | **Get** /tasks | Get next task. + + +# **TasksGet** +> TaskWrapper TasksGet() + +Get next task. + +Gets the next task in the queue, ready for processing. Consumers should start processing tasks in order. No other consumer can retrieve this task. + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**TaskWrapper**](TaskWrapper.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/github.com/funcy/functions_go/docs/TasksWrapper.md b/vendor/github.com/funcy/functions_go/docs/TasksWrapper.md new file mode 100644 index 000000000..90a36a26b --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/TasksWrapper.md @@ -0,0 +1,12 @@ +# TasksWrapper + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Tasks** | [**[]Task**](Task.md) | | [default to null] +**Cursor** | **string** | Used to paginate results. If this is returned, pass it into the same query again to get more results. | [optional] [default to null] +**Error_** | [**ErrorBody**](ErrorBody.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/Version.md b/vendor/github.com/funcy/functions_go/docs/Version.md new file mode 100644 index 000000000..fb09e432a --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/Version.md @@ -0,0 +1,10 @@ +# Version + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/github.com/funcy/functions_go/docs/VersionApi.md b/vendor/github.com/funcy/functions_go/docs/VersionApi.md new file mode 100644 index 000000000..47b6d56e4 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/docs/VersionApi.md @@ -0,0 +1,33 @@ +# \VersionApi + +All URIs are relative to *https://127.0.0.1:8080/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**VersionGet**](VersionApi.md#VersionGet) | **Get** /version | Get daemon version. + + +# **VersionGet** +> Version VersionGet() + +Get daemon version. + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Version**](Version.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/github.com/funcy/functions_go/error_body.go b/vendor/github.com/funcy/functions_go/error_body.go new file mode 100644 index 000000000..e73e440b6 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/error_body.go @@ -0,0 +1,8 @@ +package functions + +type ErrorBody struct { + + Message string `json:"message,omitempty"` + + Fields string `json:"fields,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/git_push.sh b/vendor/github.com/funcy/functions_go/git_push.sh new file mode 100644 index 000000000..6ca091b49 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/vendor/github.com/funcy/functions_go/glide.lock b/vendor/github.com/funcy/functions_go/glide.lock new file mode 100644 index 000000000..c8a9dd35d --- /dev/null +++ b/vendor/github.com/funcy/functions_go/glide.lock @@ -0,0 +1,55 @@ +hash: fcf8f59eab23c579286280cd18a5b0a32b6136a896e07aad6a0002499d3d900a +updated: 2016-12-07T08:51:17.664202292-08:00 +imports: +- name: github.com/asaskevich/govalidator + version: 7b3beb6df3c42abd3509abfc3bcacc0fbfb7c877 +- name: github.com/go-openapi/analysis + version: 7222828b8ce19afee3c595aef6643b9e42150120 +- name: github.com/go-openapi/errors + version: 49fe8b3a0e0d32a617d8d50c67f856ad6e45b28b +- name: github.com/go-openapi/jsonpointer + version: 8d96a2dc61536b690bd36b2e9df0b3c0b62825b2 +- name: github.com/go-openapi/jsonreference + version: 36d33bfe519efae5632669801b180bf1a245da3b +- name: github.com/go-openapi/loads + version: 315567415dfd74b651f7a62cabfc82a57ed7b9ad +- name: github.com/go-openapi/runtime + version: 14b161b40ece9dac8e244ab2fde2d209e108c6f5 + subpackages: + - client +- name: github.com/go-openapi/spec + version: f7ae86df5bc115a2744343016c789a89f065a4bd +- name: github.com/go-openapi/strfmt + version: 34fc3ba7c0f5fb615fda47a2b4fbd4c641b215f2 +- name: github.com/go-openapi/swag + version: 3b6d86cd965820f968760d5d419cb4add096bdd7 +- name: github.com/go-openapi/validate + version: 027696d4b54399770f1cdcc6c6daa56975f9e14e +- name: github.com/go-resty/resty + version: 24dc7ba4bc1ef9215048b28e7248f99c42901db5 +- name: github.com/mailru/easyjson + version: 159cdb893c982e3d1bc6450322fedd514f9c9de3 + subpackages: + - buffer + - jlexer + - jwriter +- name: github.com/mitchellh/mapstructure + version: f3009df150dadf309fdee4a54ed65c124afad715 +- name: github.com/PuerkitoBio/purell + version: 0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4 +- name: github.com/PuerkitoBio/urlesc + version: 5bd2802263f21d8788851d5305584c82a5c75d7e +- name: golang.org/x/net + version: f315505cf3349909cdf013ea56690da34e96a451 + subpackages: + - context + - context/ctxhttp + - idna + - publicsuffix +- name: golang.org/x/text + version: 5c6cf4f9a2357d38515014cea8c488ed22bdab90 + subpackages: + - transform + - unicode/norm + - width +testImports: [] diff --git a/vendor/github.com/funcy/functions_go/glide.yaml b/vendor/github.com/funcy/functions_go/glide.yaml new file mode 100644 index 000000000..26d31b822 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/glide.yaml @@ -0,0 +1,13 @@ +package: github.com/funcy/functions_go +import: +- package: github.com/go-openapi/errors +- package: github.com/go-openapi/runtime + subpackages: + - client +- package: github.com/go-openapi/strfmt +- package: github.com/go-openapi/swag +- package: github.com/go-openapi/validate +- package: github.com/go-resty/resty +- package: golang.org/x/net + subpackages: + - context diff --git a/vendor/github.com/funcy/functions_go/model_error.go b/vendor/github.com/funcy/functions_go/model_error.go new file mode 100644 index 000000000..3abb3fa1f --- /dev/null +++ b/vendor/github.com/funcy/functions_go/model_error.go @@ -0,0 +1,6 @@ +package functions + +type ModelError struct { + + Error_ ErrorBody `json:"error,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/models/app.go b/vendor/github.com/funcy/functions_go/models/app.go new file mode 100644 index 000000000..f38528ca8 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/app.go @@ -0,0 +1,51 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// App app +// swagger:model App +type App struct { + + // Application configuration + Config map[string]string `json:"config,omitempty"` + + // Name of this app. Must be different than the image name. Can ony contain alphanumeric, -, and _. + // Read Only: true + Name string `json:"name,omitempty"` +} + +// Validate validates this app +func (m *App) Validate(formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *App) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *App) UnmarshalBinary(b []byte) error { + var res App + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/app_wrapper.go b/vendor/github.com/funcy/functions_go/models/app_wrapper.go new file mode 100644 index 000000000..51a4e5eee --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/app_wrapper.go @@ -0,0 +1,100 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AppWrapper app wrapper +// swagger:model AppWrapper +type AppWrapper struct { + + // app + // Required: true + App *App `json:"app"` + + // error + Error *ErrorBody `json:"error,omitempty"` +} + +// Validate validates this app wrapper +func (m *AppWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApp(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateError(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AppWrapper) validateApp(formats strfmt.Registry) error { + + if err := validate.Required("app", "body", m.App); err != nil { + return err + } + + if m.App != nil { + + if err := m.App.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("app") + } + return err + } + } + + return nil +} + +func (m *AppWrapper) validateError(formats strfmt.Registry) error { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AppWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AppWrapper) UnmarshalBinary(b []byte) error { + var res AppWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/apps_wrapper.go b/vendor/github.com/funcy/functions_go/models/apps_wrapper.go new file mode 100644 index 000000000..1c767e8ce --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/apps_wrapper.go @@ -0,0 +1,110 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AppsWrapper apps wrapper +// swagger:model AppsWrapper +type AppsWrapper struct { + + // apps + // Required: true + Apps []*App `json:"apps"` + + // error + Error *ErrorBody `json:"error,omitempty"` +} + +// Validate validates this apps wrapper +func (m *AppsWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApps(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateError(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AppsWrapper) validateApps(formats strfmt.Registry) error { + + if err := validate.Required("apps", "body", m.Apps); err != nil { + return err + } + + for i := 0; i < len(m.Apps); i++ { + + if swag.IsZero(m.Apps[i]) { // not required + continue + } + + if m.Apps[i] != nil { + + if err := m.Apps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("apps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AppsWrapper) validateError(formats strfmt.Registry) error { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AppsWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AppsWrapper) UnmarshalBinary(b []byte) error { + var res AppsWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/call.go b/vendor/github.com/funcy/functions_go/models/call.go new file mode 100644 index 000000000..6cb8cbd10 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/call.go @@ -0,0 +1,72 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// Call call +// swagger:model Call +type Call struct { + + // App name that is assigned to a route that is being executed. + // Read Only: true + AppName string `json:"app_name,omitempty"` + + // Time when call completed, whether it was successul or failed. Always in UTC. + // Read Only: true + CompletedAt strfmt.DateTime `json:"completed_at,omitempty"` + + // Time when call was submitted. Always in UTC. + // Read Only: true + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Call UUID ID. + // Read Only: true + ID string `json:"id,omitempty"` + + // App route that is being executed. + // Read Only: true + Path string `json:"path,omitempty"` + + // Time when call started execution. Always in UTC. + // Read Only: true + StartedAt strfmt.DateTime `json:"started_at,omitempty"` + + // Call execution status. + // Read Only: true + Status string `json:"status,omitempty"` +} + +// Validate validates this call +func (m *Call) Validate(formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *Call) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Call) UnmarshalBinary(b []byte) error { + var res Call + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/call_wrapper.go b/vendor/github.com/funcy/functions_go/models/call_wrapper.go new file mode 100644 index 000000000..86cd0c346 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/call_wrapper.go @@ -0,0 +1,73 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CallWrapper call wrapper +// swagger:model CallWrapper +type CallWrapper struct { + + // Call object. + // Required: true + Call *Call `json:"call"` +} + +// Validate validates this call wrapper +func (m *CallWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCall(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CallWrapper) validateCall(formats strfmt.Registry) error { + + if err := validate.Required("call", "body", m.Call); err != nil { + return err + } + + if m.Call != nil { + + if err := m.Call.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("call") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CallWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CallWrapper) UnmarshalBinary(b []byte) error { + var res CallWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/calls_wrapper.go b/vendor/github.com/funcy/functions_go/models/calls_wrapper.go new file mode 100644 index 000000000..c5fbe46ea --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/calls_wrapper.go @@ -0,0 +1,110 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CallsWrapper calls wrapper +// swagger:model CallsWrapper +type CallsWrapper struct { + + // calls + // Required: true + Calls []*Call `json:"calls"` + + // error + Error *ErrorBody `json:"error,omitempty"` +} + +// Validate validates this calls wrapper +func (m *CallsWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCalls(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateError(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CallsWrapper) validateCalls(formats strfmt.Registry) error { + + if err := validate.Required("calls", "body", m.Calls); err != nil { + return err + } + + for i := 0; i < len(m.Calls); i++ { + + if swag.IsZero(m.Calls[i]) { // not required + continue + } + + if m.Calls[i] != nil { + + if err := m.Calls[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("calls" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CallsWrapper) validateError(formats strfmt.Registry) error { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CallsWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CallsWrapper) UnmarshalBinary(b []byte) error { + var res CallsWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/error.go b/vendor/github.com/funcy/functions_go/models/error.go new file mode 100644 index 000000000..703068aeb --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/error.go @@ -0,0 +1,71 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// Error error +// swagger:model Error +type Error struct { + + // error + Error *ErrorBody `json:"error,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateError(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateError(formats strfmt.Registry) error { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/error_body.go b/vendor/github.com/funcy/functions_go/models/error_body.go new file mode 100644 index 000000000..0f6001bb0 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/error_body.go @@ -0,0 +1,52 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ErrorBody error body +// swagger:model ErrorBody +type ErrorBody struct { + + // fields + // Read Only: true + Fields string `json:"fields,omitempty"` + + // message + // Read Only: true + Message string `json:"message,omitempty"` +} + +// Validate validates this error body +func (m *ErrorBody) Validate(formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ErrorBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ErrorBody) UnmarshalBinary(b []byte) error { + var res ErrorBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/log.go b/vendor/github.com/funcy/functions_go/models/log.go new file mode 100644 index 000000000..a7b5a12ce --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/log.go @@ -0,0 +1,50 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// Log log +// swagger:model Log +type Log struct { + + // Call UUID ID + CallID string `json:"call_id,omitempty"` + + // log + Log string `json:"log,omitempty"` +} + +// Validate validates this log +func (m *Log) Validate(formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *Log) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Log) UnmarshalBinary(b []byte) error { + var res Log + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/log_wrapper.go b/vendor/github.com/funcy/functions_go/models/log_wrapper.go new file mode 100644 index 000000000..2973ceb9e --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/log_wrapper.go @@ -0,0 +1,73 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LogWrapper log wrapper +// swagger:model LogWrapper +type LogWrapper struct { + + // Call log entry. + // Required: true + Log *Log `json:"log"` +} + +// Validate validates this log wrapper +func (m *LogWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLog(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LogWrapper) validateLog(formats strfmt.Registry) error { + + if err := validate.Required("log", "body", m.Log); err != nil { + return err + } + + if m.Log != nil { + + if err := m.Log.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("log") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LogWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LogWrapper) UnmarshalBinary(b []byte) error { + var res LogWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/new_task.go b/vendor/github.com/funcy/functions_go/models/new_task.go new file mode 100644 index 000000000..85469a4a5 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/new_task.go @@ -0,0 +1,66 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewTask new task +// swagger:model NewTask +type NewTask struct { + + // Name of Docker image to use. This is optional and can be used to override the image defined at the group level. + // Required: true + Image *string `json:"image"` + + // Payload for the task. This is what you pass into each task to make it do something. + Payload string `json:"payload,omitempty"` +} + +// Validate validates this new task +func (m *NewTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImage(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NewTask) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", m.Image); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewTask) UnmarshalBinary(b []byte) error { + var res NewTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/route.go b/vendor/github.com/funcy/functions_go/models/route.go new file mode 100644 index 000000000..cd53c815f --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/route.go @@ -0,0 +1,187 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Route route +// swagger:model Route +type Route struct { + + // Route configuration - overrides application configuration + Config map[string]string `json:"config,omitempty"` + + // Payload format sent into function. + Format string `json:"format,omitempty"` + + // Map of http headers that will be sent with the response + Headers map[string][]string `json:"headers,omitempty"` + + // Hot functions idle timeout before termination. Value in Seconds + IDLETimeout *int32 `json:"idle_timeout,omitempty"` + + // Name of Docker image to use in this route. You should include the image tag, which should be a version number, to be more accurate. Can be overridden on a per route basis with route.image. + Image string `json:"image,omitempty"` + + // Max usable memory for this route (MiB). + Memory int64 `json:"memory,omitempty"` + + // URL path that will be matched to this route + // Read Only: true + Path string `json:"path,omitempty"` + + // Timeout for executions of this route. Value in Seconds + Timeout *int32 `json:"timeout,omitempty"` + + // Route type + Type string `json:"type,omitempty"` +} + +// Validate validates this route +func (m *Route) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFormat(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateHeaders(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var routeTypeFormatPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["default","http","json"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeTypeFormatPropEnum = append(routeTypeFormatPropEnum, v) + } +} + +const ( + // RouteFormatDefault captures enum value "default" + RouteFormatDefault string = "default" + // RouteFormatHTTP captures enum value "http" + RouteFormatHTTP string = "http" + // RouteFormatJSON captures enum value "json" + RouteFormatJSON string = "json" +) + +// prop value enum +func (m *Route) validateFormatEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, routeTypeFormatPropEnum); err != nil { + return err + } + return nil +} + +func (m *Route) validateFormat(formats strfmt.Registry) error { + + if swag.IsZero(m.Format) { // not required + return nil + } + + // value enum + if err := m.validateFormatEnum("format", "body", m.Format); err != nil { + return err + } + + return nil +} + +func (m *Route) validateHeaders(formats strfmt.Registry) error { + + if swag.IsZero(m.Headers) { // not required + return nil + } + + if swag.IsZero(m.Headers) { // not required + return nil + } + + return nil +} + +var routeTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["sync","async"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeTypeTypePropEnum = append(routeTypeTypePropEnum, v) + } +} + +const ( + // RouteTypeSync captures enum value "sync" + RouteTypeSync string = "sync" + // RouteTypeAsync captures enum value "async" + RouteTypeAsync string = "async" +) + +// prop value enum +func (m *Route) validateTypeEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, routeTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *Route) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Route) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Route) UnmarshalBinary(b []byte) error { + var res Route + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/route_wrapper.go b/vendor/github.com/funcy/functions_go/models/route_wrapper.go new file mode 100644 index 000000000..42adbdb24 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/route_wrapper.go @@ -0,0 +1,103 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RouteWrapper route wrapper +// swagger:model RouteWrapper +type RouteWrapper struct { + + // error + Error *ErrorBody `json:"error,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // route + // Required: true + Route *Route `json:"route"` +} + +// Validate validates this route wrapper +func (m *RouteWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateError(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRoute(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RouteWrapper) validateError(formats strfmt.Registry) error { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } + return err + } + } + + return nil +} + +func (m *RouteWrapper) validateRoute(formats strfmt.Registry) error { + + if err := validate.Required("route", "body", m.Route); err != nil { + return err + } + + if m.Route != nil { + + if err := m.Route.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("route") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RouteWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RouteWrapper) UnmarshalBinary(b []byte) error { + var res RouteWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/routes_wrapper.go b/vendor/github.com/funcy/functions_go/models/routes_wrapper.go new file mode 100644 index 000000000..864c7a574 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/routes_wrapper.go @@ -0,0 +1,110 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RoutesWrapper routes wrapper +// swagger:model RoutesWrapper +type RoutesWrapper struct { + + // error + Error *ErrorBody `json:"error,omitempty"` + + // routes + // Required: true + Routes []*Route `json:"routes"` +} + +// Validate validates this routes wrapper +func (m *RoutesWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateError(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRoutes(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoutesWrapper) validateError(formats strfmt.Registry) error { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } + return err + } + } + + return nil +} + +func (m *RoutesWrapper) validateRoutes(formats strfmt.Registry) error { + + if err := validate.Required("routes", "body", m.Routes); err != nil { + return err + } + + for i := 0; i < len(m.Routes); i++ { + + if swag.IsZero(m.Routes[i]) { // not required + continue + } + + if m.Routes[i] != nil { + + if err := m.Routes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RoutesWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoutesWrapper) UnmarshalBinary(b []byte) error { + var res RoutesWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/task.go b/vendor/github.com/funcy/functions_go/models/task.go new file mode 100644 index 000000000..1247fc71a --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/task.go @@ -0,0 +1,153 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Task task +// swagger:model Task +type Task struct { + + // Time when task completed, whether it was successul or failed. Always in UTC. + CompletedAt strfmt.DateTime `json:"completed_at,omitempty"` + + // Time when task was submitted. Always in UTC. + // Read Only: true + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Env vars for the task. Comes from the ones set on the Group. + EnvVars map[string]string `json:"env_vars,omitempty"` + + // The error message, if status is 'error'. This is errors due to things outside the task itself. Errors from user code will be found in the log. + Error string `json:"error,omitempty"` + + // Group this task belongs to. + // Read Only: true + GroupName string `json:"group_name,omitempty"` + + // Name of Docker image to use. This is optional and can be used to override the image defined at the group level. + // Required: true + Image *string `json:"image"` + + // Payload for the task. This is what you pass into each task to make it do something. + Payload string `json:"payload,omitempty"` + + // Machine usable reason for task being in this state. + // Valid values for error status are `timeout | killed | bad_exit`. + // Valid values for cancelled status are `client_request`. + // For everything else, this is undefined. + // + Reason string `json:"reason,omitempty"` + + // If this field is set, then this task was retried by the task referenced in this field. + // Read Only: true + RetryAt string `json:"retry_at,omitempty"` + + // If this field is set, then this task is a retry of the ID in this field. + // Read Only: true + RetryOf string `json:"retry_of,omitempty"` + + // Time when task started execution. Always in UTC. + StartedAt strfmt.DateTime `json:"started_at,omitempty"` +} + +// Validate validates this task +func (m *Task) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImage(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Task) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", m.Image); err != nil { + return err + } + + return nil +} + +var taskTypeReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["timeout","killed","bad_exit","client_request"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + taskTypeReasonPropEnum = append(taskTypeReasonPropEnum, v) + } +} + +const ( + // TaskReasonTimeout captures enum value "timeout" + TaskReasonTimeout string = "timeout" + // TaskReasonKilled captures enum value "killed" + TaskReasonKilled string = "killed" + // TaskReasonBadExit captures enum value "bad_exit" + TaskReasonBadExit string = "bad_exit" + // TaskReasonClientRequest captures enum value "client_request" + TaskReasonClientRequest string = "client_request" +) + +// prop value enum +func (m *Task) validateReasonEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, taskTypeReasonPropEnum); err != nil { + return err + } + return nil +} + +func (m *Task) validateReason(formats strfmt.Registry) error { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + // value enum + if err := m.validateReasonEnum("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Task) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Task) UnmarshalBinary(b []byte) error { + var res Task + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/task_wrapper.go b/vendor/github.com/funcy/functions_go/models/task_wrapper.go new file mode 100644 index 000000000..781008b90 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/task_wrapper.go @@ -0,0 +1,73 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TaskWrapper task wrapper +// swagger:model TaskWrapper +type TaskWrapper struct { + + // task + // Required: true + Task *Task `json:"task"` +} + +// Validate validates this task wrapper +func (m *TaskWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTask(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskWrapper) validateTask(formats strfmt.Registry) error { + + if err := validate.Required("task", "body", m.Task); err != nil { + return err + } + + if m.Task != nil { + + if err := m.Task.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskWrapper) UnmarshalBinary(b []byte) error { + var res TaskWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/models/version.go b/vendor/github.com/funcy/functions_go/models/version.go new file mode 100644 index 000000000..20fa15b4a --- /dev/null +++ b/vendor/github.com/funcy/functions_go/models/version.go @@ -0,0 +1,48 @@ +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// Version version +// swagger:model Version +type Version struct { + + // version + // Read Only: true + Version string `json:"version,omitempty"` +} + +// Validate validates this version +func (m *Version) Validate(formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *Version) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Version) UnmarshalBinary(b []byte) error { + var res Version + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/funcy/functions_go/new_task.go b/vendor/github.com/funcy/functions_go/new_task.go new file mode 100644 index 000000000..b31c11083 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/new_task.go @@ -0,0 +1,10 @@ +package functions + +type NewTask struct { + + // Name of Docker image to use. This is optional and can be used to override the image defined at the group level. + Image string `json:"image,omitempty"` + + // Payload for the task. This is what you pass into each task to make it do something. + Payload string `json:"payload,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/new_tasks_wrapper.go b/vendor/github.com/funcy/functions_go/new_tasks_wrapper.go new file mode 100644 index 000000000..7132344d3 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/new_tasks_wrapper.go @@ -0,0 +1,6 @@ +package functions + +type NewTasksWrapper struct { + + Tasks []NewTask `json:"tasks,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/pom.xml b/vendor/github.com/funcy/functions_go/pom.xml new file mode 100644 index 000000000..029480f5d --- /dev/null +++ b/vendor/github.com/funcy/functions_go/pom.xml @@ -0,0 +1,75 @@ + + 4.0.0 + com.wordnik + Gofunctions + pom + 0.1.0 + Gofunctions + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + go-get-testify + pre-integration-test + + exec + + + go + + get + github.com/stretchr/testify/assert + + + + + go-get-sling + pre-integration-test + + exec + + + go + + get + github.com/dghubble/sling + + + + + go-test + integration-test + + exec + + + go + + test + -v + + + + + + + + \ No newline at end of file diff --git a/vendor/github.com/funcy/functions_go/route.go b/vendor/github.com/funcy/functions_go/route.go new file mode 100644 index 000000000..2b1af02b8 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/route.go @@ -0,0 +1,31 @@ +package functions + +type Route struct { + + // URL path that will be matched to this route + Path string `json:"path,omitempty"` + + // Name of Docker image to use in this route. You should include the image tag, which should be a version number, to be more accurate. Can be overridden on a per route basis with route.image. + Image string `json:"image,omitempty"` + + // Map of http headers that will be sent with the response + Headers map[string][]string `json:"headers,omitempty"` + + // Max usable memory for this route (MiB). + Memory int64 `json:"memory,omitempty"` + + // Route type + Type_ string `json:"type,omitempty"` + + // Payload format sent into function. + Format string `json:"format,omitempty"` + + // Maximum number of hot containers concurrency + MaxConcurrency int32 `json:"max_concurrency,omitempty"` + + // Route configuration - overrides application configuration + Config map[string]string `json:"config,omitempty"` + + // Timeout for executions of this route. Value in Seconds + Timeout int32 `json:"timeout,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/route_wrapper.go b/vendor/github.com/funcy/functions_go/route_wrapper.go new file mode 100644 index 000000000..3763bab49 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/route_wrapper.go @@ -0,0 +1,10 @@ +package functions + +type RouteWrapper struct { + + Message string `json:"message,omitempty"` + + Error_ ErrorBody `json:"error,omitempty"` + + Route Route `json:"route,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/routes_api.go b/vendor/github.com/funcy/functions_go/routes_api.go new file mode 100644 index 000000000..f9b3b0018 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/routes_api.go @@ -0,0 +1,344 @@ +package functions + +import ( + "net/url" + "strings" + "encoding/json" + "fmt" +) + +type RoutesApi struct { + Configuration *Configuration +} + +func NewRoutesApi() *RoutesApi { + configuration := NewConfiguration() + return &RoutesApi{ + Configuration: configuration, + } +} + +func NewRoutesApiWithBasePath(basePath string) *RoutesApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &RoutesApi{ + Configuration: configuration, + } +} + +/** + * Get route list by app name. + * This will list routes for a particular app. + * + * @param app Name of app for this set of routes. + * @return *RoutesWrapper + */ +func (a RoutesApi) AppsAppRoutesGet(app string) (*RoutesWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(RoutesWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppRoutesGet", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Create new Route + * Create a new route in an app, if app doesn't exists, it creates the app + * + * @param app name of the app. + * @param body One route to post. + * @return *RouteWrapper + */ +func (a RoutesApi) AppsAppRoutesPost(app string, body RouteWrapper) (*RouteWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Post") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + var successPayload = new(RouteWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppRoutesPost", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Deletes the route + * Deletes the route. + * + * @param app Name of app for this set of routes. + * @param route Route name + * @return void + */ +func (a RoutesApi) AppsAppRoutesRouteDelete(app string, route string) (*APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Delete") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}/routes/{route}" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + localVarPath = strings.Replace(localVarPath, "{"+"route"+"}", fmt.Sprintf("%v", route), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppRoutesRouteDelete", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return localVarAPIResponse, err + } + return localVarAPIResponse, err +} + +/** + * Gets route by name + * Gets a route by name. + * + * @param app Name of app for this set of routes. + * @param route Route name + * @return *RouteWrapper + */ +func (a RoutesApi) AppsAppRoutesRouteGet(app string, route string) (*RouteWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}/routes/{route}" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + localVarPath = strings.Replace(localVarPath, "{"+"route"+"}", fmt.Sprintf("%v", route), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(RouteWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppRoutesRouteGet", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Update a Route + * Update a route + * + * @param app name of the app. + * @param route route path. + * @param body One route to post. + * @return *RouteWrapper + */ +func (a RoutesApi) AppsAppRoutesRoutePatch(app string, route string, body RouteWrapper) (*RouteWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Patch") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/apps/{app}/routes/{route}" + localVarPath = strings.Replace(localVarPath, "{"+"app"+"}", fmt.Sprintf("%v", app), -1) + localVarPath = strings.Replace(localVarPath, "{"+"route"+"}", fmt.Sprintf("%v", route), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + var successPayload = new(RouteWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "AppsAppRoutesRoutePatch", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + diff --git a/vendor/github.com/funcy/functions_go/routes_wrapper.go b/vendor/github.com/funcy/functions_go/routes_wrapper.go new file mode 100644 index 000000000..222bd81ab --- /dev/null +++ b/vendor/github.com/funcy/functions_go/routes_wrapper.go @@ -0,0 +1,8 @@ +package functions + +type RoutesWrapper struct { + + Routes []Route `json:"routes,omitempty"` + + Error_ ErrorBody `json:"error,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/task.go b/vendor/github.com/funcy/functions_go/task.go new file mode 100644 index 000000000..998a6428e --- /dev/null +++ b/vendor/github.com/funcy/functions_go/task.go @@ -0,0 +1,41 @@ +package functions + +import ( + "time" +) + +type Task struct { + + // Name of Docker image to use. This is optional and can be used to override the image defined at the group level. + Image string `json:"image,omitempty"` + + // Payload for the task. This is what you pass into each task to make it do something. + Payload string `json:"payload,omitempty"` + + // Group this task belongs to. + GroupName string `json:"group_name,omitempty"` + + // The error message, if status is 'error'. This is errors due to things outside the task itself. Errors from user code will be found in the log. + Error_ string `json:"error,omitempty"` + + // Machine usable reason for task being in this state. Valid values for error status are `timeout | killed | bad_exit`. Valid values for cancelled status are `client_request`. For everything else, this is undefined. + Reason string `json:"reason,omitempty"` + + // Time when task was submitted. Always in UTC. + CreatedAt time.Time `json:"created_at,omitempty"` + + // Time when task started execution. Always in UTC. + StartedAt time.Time `json:"started_at,omitempty"` + + // Time when task completed, whether it was successul or failed. Always in UTC. + CompletedAt time.Time `json:"completed_at,omitempty"` + + // If this field is set, then this task is a retry of the ID in this field. + RetryOf string `json:"retry_of,omitempty"` + + // If this field is set, then this task was retried by the task referenced in this field. + RetryAt string `json:"retry_at,omitempty"` + + // Env vars for the task. Comes from the ones set on the Group. + EnvVars map[string]string `json:"env_vars,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/task_wrapper.go b/vendor/github.com/funcy/functions_go/task_wrapper.go new file mode 100644 index 000000000..b7928623d --- /dev/null +++ b/vendor/github.com/funcy/functions_go/task_wrapper.go @@ -0,0 +1,6 @@ +package functions + +type TaskWrapper struct { + + Task Task `json:"task,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/tasks_api.go b/vendor/github.com/funcy/functions_go/tasks_api.go new file mode 100644 index 000000000..dda5407ff --- /dev/null +++ b/vendor/github.com/funcy/functions_go/tasks_api.go @@ -0,0 +1,87 @@ +package functions + +import ( + "net/url" + "strings" + "encoding/json" +) + +type TasksApi struct { + Configuration *Configuration +} + +func NewTasksApi() *TasksApi { + configuration := NewConfiguration() + return &TasksApi{ + Configuration: configuration, + } +} + +func NewTasksApiWithBasePath(basePath string) *TasksApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &TasksApi{ + Configuration: configuration, + } +} + +/** + * Get next task. + * Gets the next task in the queue, ready for processing. Consumers should start processing tasks in order. No other consumer can retrieve this task. + * + * @return *TaskWrapper + */ +func (a TasksApi) TasksGet() (*TaskWrapper, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/tasks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(TaskWrapper) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "TasksGet", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + diff --git a/vendor/github.com/funcy/functions_go/tasks_wrapper.go b/vendor/github.com/funcy/functions_go/tasks_wrapper.go new file mode 100644 index 000000000..ee6468f16 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/tasks_wrapper.go @@ -0,0 +1,11 @@ +package functions + +type TasksWrapper struct { + + Tasks []Task `json:"tasks,omitempty"` + + // Used to paginate results. If this is returned, pass it into the same query again to get more results. + Cursor string `json:"cursor,omitempty"` + + Error_ ErrorBody `json:"error,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/version.go b/vendor/github.com/funcy/functions_go/version.go new file mode 100644 index 000000000..8ad946ce2 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/version.go @@ -0,0 +1,6 @@ +package functions + +type Version struct { + + Version string `json:"version,omitempty"` +} diff --git a/vendor/github.com/funcy/functions_go/version_api.go b/vendor/github.com/funcy/functions_go/version_api.go new file mode 100644 index 000000000..adec797b3 --- /dev/null +++ b/vendor/github.com/funcy/functions_go/version_api.go @@ -0,0 +1,86 @@ +package functions + +import ( + "net/url" + "strings" + "encoding/json" +) + +type VersionApi struct { + Configuration *Configuration +} + +func NewVersionApi() *VersionApi { + configuration := NewConfiguration() + return &VersionApi{ + Configuration: configuration, + } +} + +func NewVersionApiWithBasePath(basePath string) *VersionApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &VersionApi{ + Configuration: configuration, + } +} + +/** + * Get daemon version. + * + * @return *Version + */ +func (a VersionApi) VersionGet() (*Version, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(Version) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "VersionGet", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + diff --git a/vendor/github.com/satori/go.uuid/.travis.yml b/vendor/github.com/satori/go.uuid/.travis.yml deleted file mode 100644 index fdf960e86..000000000 --- a/vendor/github.com/satori/go.uuid/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: go -sudo: false -go: - - 1.2 - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - 1.7 - - 1.8 - - tip -matrix: - allow_failures: - - go: tip - fast_finish: true -before_install: - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover -script: - - $HOME/gopath/bin/goveralls -service=travis-ci -notifications: - email: false diff --git a/vendor/github.com/satori/go.uuid/LICENSE b/vendor/github.com/satori/go.uuid/LICENSE deleted file mode 100644 index 488357b8a..000000000 --- a/vendor/github.com/satori/go.uuid/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) 2013-2016 by Maxim Bublis - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/satori/go.uuid/README.md b/vendor/github.com/satori/go.uuid/README.md deleted file mode 100644 index b6aad1c81..000000000 --- a/vendor/github.com/satori/go.uuid/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# UUID package for Go language - -[![Build Status](https://travis-ci.org/satori/go.uuid.png?branch=master)](https://travis-ci.org/satori/go.uuid) -[![Coverage Status](https://coveralls.io/repos/github/satori/go.uuid/badge.svg?branch=master)](https://coveralls.io/github/satori/go.uuid) -[![GoDoc](http://godoc.org/github.com/satori/go.uuid?status.png)](http://godoc.org/github.com/satori/go.uuid) - -This package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing of UUIDs. - -With 100% test coverage and benchmarks out of box. - -Supported versions: -* Version 1, based on timestamp and MAC address (RFC 4122) -* Version 2, based on timestamp, MAC address and POSIX UID/GID (DCE 1.1) -* Version 3, based on MD5 hashing (RFC 4122) -* Version 4, based on random numbers (RFC 4122) -* Version 5, based on SHA-1 hashing (RFC 4122) - -## Installation - -Use the `go` command: - - $ go get github.com/satori/go.uuid - -## Requirements - -UUID package requires Go >= 1.2. - -## Example - -```go -package main - -import ( - "fmt" - "github.com/satori/go.uuid" -) - -func main() { - // Creating UUID Version 4 - u1 := uuid.NewV4() - fmt.Printf("UUIDv4: %s\n", u1) - - // Parsing UUID from string input - u2, err := uuid.FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - if err != nil { - fmt.Printf("Something gone wrong: %s", err) - } - fmt.Printf("Successfully parsed: %s", u2) -} -``` - -## Documentation - -[Documentation](http://godoc.org/github.com/satori/go.uuid) is hosted at GoDoc project. - -## Links -* [RFC 4122](http://tools.ietf.org/html/rfc4122) -* [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01) - -## Copyright - -Copyright (C) 2013-2016 by Maxim Bublis . - -UUID package released under MIT License. -See [LICENSE](https://github.com/satori/go.uuid/blob/master/LICENSE) for details. diff --git a/vendor/github.com/satori/go.uuid/benchmarks_test.go b/vendor/github.com/satori/go.uuid/benchmarks_test.go deleted file mode 100644 index c3baeab8b..000000000 --- a/vendor/github.com/satori/go.uuid/benchmarks_test.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (C) 2013-2015 by Maxim Bublis -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -package uuid - -import ( - "testing" -) - -func BenchmarkFromBytes(b *testing.B) { - bytes := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - for i := 0; i < b.N; i++ { - FromBytes(bytes) - } -} - -func BenchmarkFromString(b *testing.B) { - s := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" - for i := 0; i < b.N; i++ { - FromString(s) - } -} - -func BenchmarkFromStringUrn(b *testing.B) { - s := "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" - for i := 0; i < b.N; i++ { - FromString(s) - } -} - -func BenchmarkFromStringWithBrackets(b *testing.B) { - s := "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}" - for i := 0; i < b.N; i++ { - FromString(s) - } -} - -func BenchmarkNewV1(b *testing.B) { - for i := 0; i < b.N; i++ { - NewV1() - } -} - -func BenchmarkNewV2(b *testing.B) { - for i := 0; i < b.N; i++ { - NewV2(DomainPerson) - } -} - -func BenchmarkNewV3(b *testing.B) { - for i := 0; i < b.N; i++ { - NewV3(NamespaceDNS, "www.example.com") - } -} - -func BenchmarkNewV4(b *testing.B) { - for i := 0; i < b.N; i++ { - NewV4() - } -} - -func BenchmarkNewV5(b *testing.B) { - for i := 0; i < b.N; i++ { - NewV5(NamespaceDNS, "www.example.com") - } -} - -func BenchmarkMarshalBinary(b *testing.B) { - u := NewV4() - for i := 0; i < b.N; i++ { - u.MarshalBinary() - } -} - -func BenchmarkMarshalText(b *testing.B) { - u := NewV4() - for i := 0; i < b.N; i++ { - u.MarshalText() - } -} - -func BenchmarkUnmarshalBinary(b *testing.B) { - bytes := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - u := UUID{} - for i := 0; i < b.N; i++ { - u.UnmarshalBinary(bytes) - } -} - -func BenchmarkUnmarshalText(b *testing.B) { - bytes := []byte("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - u := UUID{} - for i := 0; i < b.N; i++ { - u.UnmarshalText(bytes) - } -} - -var sink string - -func BenchmarkMarshalToString(b *testing.B) { - u := NewV4() - for i := 0; i < b.N; i++ { - sink = u.String() - } -} diff --git a/vendor/github.com/satori/go.uuid/uuid.go b/vendor/github.com/satori/go.uuid/uuid.go deleted file mode 100644 index 295f3fc2c..000000000 --- a/vendor/github.com/satori/go.uuid/uuid.go +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright (C) 2013-2015 by Maxim Bublis -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -// Package uuid provides implementation of Universally Unique Identifier (UUID). -// Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and -// version 2 (as specified in DCE 1.1). -package uuid - -import ( - "bytes" - "crypto/md5" - "crypto/rand" - "crypto/sha1" - "database/sql/driver" - "encoding/binary" - "encoding/hex" - "fmt" - "hash" - "net" - "os" - "sync" - "time" -) - -// UUID layout variants. -const ( - VariantNCS = iota - VariantRFC4122 - VariantMicrosoft - VariantFuture -) - -// UUID DCE domains. -const ( - DomainPerson = iota - DomainGroup - DomainOrg -) - -// Difference in 100-nanosecond intervals between -// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). -const epochStart = 122192928000000000 - -// Used in string method conversion -const dash byte = '-' - -// UUID v1/v2 storage. -var ( - storageMutex sync.Mutex - storageOnce sync.Once - epochFunc = unixTimeFunc - clockSequence uint16 - lastTime uint64 - hardwareAddr [6]byte - posixUID = uint32(os.Getuid()) - posixGID = uint32(os.Getgid()) -) - -// String parse helpers. -var ( - urnPrefix = []byte("urn:uuid:") - byteGroups = []int{8, 4, 4, 4, 12} -) - -func initClockSequence() { - buf := make([]byte, 2) - safeRandom(buf) - clockSequence = binary.BigEndian.Uint16(buf) -} - -func initHardwareAddr() { - interfaces, err := net.Interfaces() - if err == nil { - for _, iface := range interfaces { - if len(iface.HardwareAddr) >= 6 { - copy(hardwareAddr[:], iface.HardwareAddr) - return - } - } - } - - // Initialize hardwareAddr randomly in case - // of real network interfaces absence - safeRandom(hardwareAddr[:]) - - // Set multicast bit as recommended in RFC 4122 - hardwareAddr[0] |= 0x01 -} - -func initStorage() { - initClockSequence() - initHardwareAddr() -} - -func safeRandom(dest []byte) { - if _, err := rand.Read(dest); err != nil { - panic(err) - } -} - -// Returns difference in 100-nanosecond intervals between -// UUID epoch (October 15, 1582) and current time. -// This is default epoch calculation function. -func unixTimeFunc() uint64 { - return epochStart + uint64(time.Now().UnixNano()/100) -} - -// UUID representation compliant with specification -// described in RFC 4122. -type UUID [16]byte - -// NullUUID can be used with the standard sql package to represent a -// UUID value that can be NULL in the database -type NullUUID struct { - UUID UUID - Valid bool -} - -// The nil UUID is special form of UUID that is specified to have all -// 128 bits set to zero. -var Nil = UUID{} - -// Predefined namespace UUIDs. -var ( - NamespaceDNS, _ = FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - NamespaceURL, _ = FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8") - NamespaceOID, _ = FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8") - NamespaceX500, _ = FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8") -) - -// And returns result of binary AND of two UUIDs. -func And(u1 UUID, u2 UUID) UUID { - u := UUID{} - for i := 0; i < 16; i++ { - u[i] = u1[i] & u2[i] - } - return u -} - -// Or returns result of binary OR of two UUIDs. -func Or(u1 UUID, u2 UUID) UUID { - u := UUID{} - for i := 0; i < 16; i++ { - u[i] = u1[i] | u2[i] - } - return u -} - -// Equal returns true if u1 and u2 equals, otherwise returns false. -func Equal(u1 UUID, u2 UUID) bool { - return bytes.Equal(u1[:], u2[:]) -} - -// Version returns algorithm version used to generate UUID. -func (u UUID) Version() uint { - return uint(u[6] >> 4) -} - -// Variant returns UUID layout variant. -func (u UUID) Variant() uint { - switch { - case (u[8] & 0x80) == 0x00: - return VariantNCS - case (u[8]&0xc0)|0x80 == 0x80: - return VariantRFC4122 - case (u[8]&0xe0)|0xc0 == 0xc0: - return VariantMicrosoft - } - return VariantFuture -} - -// Bytes returns bytes slice representation of UUID. -func (u UUID) Bytes() []byte { - return u[:] -} - -// Returns canonical string representation of UUID: -// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. -func (u UUID) String() string { - buf := make([]byte, 36) - - hex.Encode(buf[0:8], u[0:4]) - buf[8] = dash - hex.Encode(buf[9:13], u[4:6]) - buf[13] = dash - hex.Encode(buf[14:18], u[6:8]) - buf[18] = dash - hex.Encode(buf[19:23], u[8:10]) - buf[23] = dash - hex.Encode(buf[24:], u[10:]) - - return string(buf) -} - -// SetVersion sets version bits. -func (u *UUID) SetVersion(v byte) { - u[6] = (u[6] & 0x0f) | (v << 4) -} - -// SetVariant sets variant bits as described in RFC 4122. -func (u *UUID) SetVariant() { - u[8] = (u[8] & 0xbf) | 0x80 -} - -// MarshalText implements the encoding.TextMarshaler interface. -// The encoding is the same as returned by String. -func (u UUID) MarshalText() (text []byte, err error) { - text = []byte(u.String()) - return -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -// Following formats are supported: -// "6ba7b810-9dad-11d1-80b4-00c04fd430c8", -// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", -// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" -func (u *UUID) UnmarshalText(text []byte) (err error) { - if len(text) < 32 { - err = fmt.Errorf("uuid: UUID string too short: %s", text) - return - } - - t := text[:] - braced := false - - if bytes.Equal(t[:9], urnPrefix) { - t = t[9:] - } else if t[0] == '{' { - braced = true - t = t[1:] - } - - b := u[:] - - for i, byteGroup := range byteGroups { - if i > 0 { - if t[0] != '-' { - err = fmt.Errorf("uuid: invalid string format") - return - } - t = t[1:] - } - - if len(t) < byteGroup { - err = fmt.Errorf("uuid: UUID string too short: %s", text) - return - } - - if i == 4 && len(t) > byteGroup && - ((braced && t[byteGroup] != '}') || len(t[byteGroup:]) > 1 || !braced) { - err = fmt.Errorf("uuid: UUID string too long: %s", text) - return - } - - _, err = hex.Decode(b[:byteGroup/2], t[:byteGroup]) - if err != nil { - return - } - - t = t[byteGroup:] - b = b[byteGroup/2:] - } - - return -} - -// MarshalBinary implements the encoding.BinaryMarshaler interface. -func (u UUID) MarshalBinary() (data []byte, err error) { - data = u.Bytes() - return -} - -// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. -// It will return error if the slice isn't 16 bytes long. -func (u *UUID) UnmarshalBinary(data []byte) (err error) { - if len(data) != 16 { - err = fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data)) - return - } - copy(u[:], data) - - return -} - -// Value implements the driver.Valuer interface. -func (u UUID) Value() (driver.Value, error) { - return u.String(), nil -} - -// Scan implements the sql.Scanner interface. -// A 16-byte slice is handled by UnmarshalBinary, while -// a longer byte slice or a string is handled by UnmarshalText. -func (u *UUID) Scan(src interface{}) error { - switch src := src.(type) { - case []byte: - if len(src) == 16 { - return u.UnmarshalBinary(src) - } - return u.UnmarshalText(src) - - case string: - return u.UnmarshalText([]byte(src)) - } - - return fmt.Errorf("uuid: cannot convert %T to UUID", src) -} - -// Value implements the driver.Valuer interface. -func (u NullUUID) Value() (driver.Value, error) { - if !u.Valid { - return nil, nil - } - // Delegate to UUID Value function - return u.UUID.Value() -} - -// Scan implements the sql.Scanner interface. -func (u *NullUUID) Scan(src interface{}) error { - if src == nil { - u.UUID, u.Valid = Nil, false - return nil - } - - // Delegate to UUID Scan function - u.Valid = true - return u.UUID.Scan(src) -} - -// FromBytes returns UUID converted from raw byte slice input. -// It will return error if the slice isn't 16 bytes long. -func FromBytes(input []byte) (u UUID, err error) { - err = u.UnmarshalBinary(input) - return -} - -// FromBytesOrNil returns UUID converted from raw byte slice input. -// Same behavior as FromBytes, but returns a Nil UUID on error. -func FromBytesOrNil(input []byte) UUID { - uuid, err := FromBytes(input) - if err != nil { - return Nil - } - return uuid -} - -// FromString returns UUID parsed from string input. -// Input is expected in a form accepted by UnmarshalText. -func FromString(input string) (u UUID, err error) { - err = u.UnmarshalText([]byte(input)) - return -} - -// FromStringOrNil returns UUID parsed from string input. -// Same behavior as FromString, but returns a Nil UUID on error. -func FromStringOrNil(input string) UUID { - uuid, err := FromString(input) - if err != nil { - return Nil - } - return uuid -} - -// Returns UUID v1/v2 storage state. -// Returns epoch timestamp, clock sequence, and hardware address. -func getStorage() (uint64, uint16, []byte) { - storageOnce.Do(initStorage) - - storageMutex.Lock() - defer storageMutex.Unlock() - - timeNow := epochFunc() - // Clock changed backwards since last UUID generation. - // Should increase clock sequence. - if timeNow <= lastTime { - clockSequence++ - } - lastTime = timeNow - - return timeNow, clockSequence, hardwareAddr[:] -} - -// NewV1 returns UUID based on current timestamp and MAC address. -func NewV1() UUID { - u := UUID{} - - timeNow, clockSeq, hardwareAddr := getStorage() - - binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) - binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) - binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) - binary.BigEndian.PutUint16(u[8:], clockSeq) - - copy(u[10:], hardwareAddr) - - u.SetVersion(1) - u.SetVariant() - - return u -} - -// NewV2 returns DCE Security UUID based on POSIX UID/GID. -func NewV2(domain byte) UUID { - u := UUID{} - - timeNow, clockSeq, hardwareAddr := getStorage() - - switch domain { - case DomainPerson: - binary.BigEndian.PutUint32(u[0:], posixUID) - case DomainGroup: - binary.BigEndian.PutUint32(u[0:], posixGID) - } - - binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) - binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) - binary.BigEndian.PutUint16(u[8:], clockSeq) - u[9] = domain - - copy(u[10:], hardwareAddr) - - u.SetVersion(2) - u.SetVariant() - - return u -} - -// NewV3 returns UUID based on MD5 hash of namespace UUID and name. -func NewV3(ns UUID, name string) UUID { - u := newFromHash(md5.New(), ns, name) - u.SetVersion(3) - u.SetVariant() - - return u -} - -// NewV4 returns random generated UUID. -func NewV4() UUID { - u := UUID{} - safeRandom(u[:]) - u.SetVersion(4) - u.SetVariant() - - return u -} - -// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. -func NewV5(ns UUID, name string) UUID { - u := newFromHash(sha1.New(), ns, name) - u.SetVersion(5) - u.SetVariant() - - return u -} - -// Returns UUID based on hashing of namespace UUID and name. -func newFromHash(h hash.Hash, ns UUID, name string) UUID { - u := UUID{} - h.Write(ns[:]) - h.Write([]byte(name)) - copy(u[:], h.Sum(nil)) - - return u -} diff --git a/vendor/github.com/satori/go.uuid/uuid_test.go b/vendor/github.com/satori/go.uuid/uuid_test.go deleted file mode 100644 index 56504808f..000000000 --- a/vendor/github.com/satori/go.uuid/uuid_test.go +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright (C) 2013, 2015 by Maxim Bublis -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -package uuid - -import ( - "bytes" - "testing" -) - -func TestBytes(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - bytes1 := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - if !bytes.Equal(u.Bytes(), bytes1) { - t.Errorf("Incorrect bytes representation for UUID: %s", u) - } -} - -func TestString(t *testing.T) { - if NamespaceDNS.String() != "6ba7b810-9dad-11d1-80b4-00c04fd430c8" { - t.Errorf("Incorrect string representation for UUID: %s", NamespaceDNS.String()) - } -} - -func TestEqual(t *testing.T) { - if !Equal(NamespaceDNS, NamespaceDNS) { - t.Errorf("Incorrect comparison of %s and %s", NamespaceDNS, NamespaceDNS) - } - - if Equal(NamespaceDNS, NamespaceURL) { - t.Errorf("Incorrect comparison of %s and %s", NamespaceDNS, NamespaceURL) - } -} - -func TestOr(t *testing.T) { - u1 := UUID{0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff} - u2 := UUID{0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00} - - u := UUID{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} - - if !Equal(u, Or(u1, u2)) { - t.Errorf("Incorrect bitwise OR result %s", Or(u1, u2)) - } -} - -func TestAnd(t *testing.T) { - u1 := UUID{0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff} - u2 := UUID{0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00} - - u := UUID{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - - if !Equal(u, And(u1, u2)) { - t.Errorf("Incorrect bitwise AND result %s", And(u1, u2)) - } -} - -func TestVersion(t *testing.T) { - u := UUID{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - - if u.Version() != 1 { - t.Errorf("Incorrect version for UUID: %d", u.Version()) - } -} - -func TestSetVersion(t *testing.T) { - u := UUID{} - u.SetVersion(4) - - if u.Version() != 4 { - t.Errorf("Incorrect version for UUID after u.setVersion(4): %d", u.Version()) - } -} - -func TestVariant(t *testing.T) { - u1 := UUID{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - - if u1.Variant() != VariantNCS { - t.Errorf("Incorrect variant for UUID variant %d: %d", VariantNCS, u1.Variant()) - } - - u2 := UUID{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - - if u2.Variant() != VariantRFC4122 { - t.Errorf("Incorrect variant for UUID variant %d: %d", VariantRFC4122, u2.Variant()) - } - - u3 := UUID{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - - if u3.Variant() != VariantMicrosoft { - t.Errorf("Incorrect variant for UUID variant %d: %d", VariantMicrosoft, u3.Variant()) - } - - u4 := UUID{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - - if u4.Variant() != VariantFuture { - t.Errorf("Incorrect variant for UUID variant %d: %d", VariantFuture, u4.Variant()) - } -} - -func TestSetVariant(t *testing.T) { - u := new(UUID) - u.SetVariant() - - if u.Variant() != VariantRFC4122 { - t.Errorf("Incorrect variant for UUID after u.setVariant(): %d", u.Variant()) - } -} - -func TestFromBytes(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - u1, err := FromBytes(b1) - if err != nil { - t.Errorf("Error parsing UUID from bytes: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - b2 := []byte{} - - _, err = FromBytes(b2) - if err == nil { - t.Errorf("Should return error parsing from empty byte slice, got %s", err) - } -} - -func TestMarshalBinary(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - b2, err := u.MarshalBinary() - if err != nil { - t.Errorf("Error marshaling UUID: %s", err) - } - - if !bytes.Equal(b1, b2) { - t.Errorf("Marshaled UUID should be %s, got %s", b1, b2) - } -} - -func TestUnmarshalBinary(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - u1 := UUID{} - err := u1.UnmarshalBinary(b1) - if err != nil { - t.Errorf("Error unmarshaling UUID: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - b2 := []byte{} - u2 := UUID{} - - err = u2.UnmarshalBinary(b2) - if err == nil { - t.Errorf("Should return error unmarshalling from empty byte slice, got %s", err) - } -} - -func TestFromString(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - s1 := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" - s2 := "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}" - s3 := "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" - - _, err := FromString("") - if err == nil { - t.Errorf("Should return error trying to parse empty string, got %s", err) - } - - u1, err := FromString(s1) - if err != nil { - t.Errorf("Error parsing UUID from string: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - u2, err := FromString(s2) - if err != nil { - t.Errorf("Error parsing UUID from string: %s", err) - } - - if !Equal(u, u2) { - t.Errorf("UUIDs should be equal: %s and %s", u, u2) - } - - u3, err := FromString(s3) - if err != nil { - t.Errorf("Error parsing UUID from string: %s", err) - } - - if !Equal(u, u3) { - t.Errorf("UUIDs should be equal: %s and %s", u, u3) - } -} - -func TestFromStringShort(t *testing.T) { - // Invalid 35-character UUID string - s1 := "6ba7b810-9dad-11d1-80b4-00c04fd430c" - - for i := len(s1); i >= 0; i-- { - _, err := FromString(s1[:i]) - if err == nil { - t.Errorf("Should return error trying to parse too short string, got %s", err) - } - } -} - -func TestFromStringLong(t *testing.T) { - // Invalid 37+ character UUID string - s := []string{ - "6ba7b810-9dad-11d1-80b4-00c04fd430c8=", - "6ba7b810-9dad-11d1-80b4-00c04fd430c8}", - "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}f", - "6ba7b810-9dad-11d1-80b4-00c04fd430c800c04fd430c8", - } - - for _, str := range s { - _, err := FromString(str) - if err == nil { - t.Errorf("Should return error trying to parse too long string, passed %s", str) - } - } -} - -func TestFromStringInvalid(t *testing.T) { - // Invalid UUID string formats - s := []string{ - "6ba7b8109dad11d180b400c04fd430c8", - "6ba7b8109dad11d180b400c04fd430c86ba7b8109dad11d180b400c04fd430c8", - "urn:uuid:{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", - "6ba7b8109-dad-11d1-80b4-00c04fd430c8", - "6ba7b810-9dad1-1d1-80b4-00c04fd430c8", - "6ba7b810-9dad-11d18-0b4-00c04fd430c8", - "6ba7b810-9dad-11d1-80b40-0c04fd430c8", - "6ba7b810+9dad+11d1+80b4+00c04fd430c8", - "6ba7b810-9dad11d180b400c04fd430c8", - "6ba7b8109dad-11d180b400c04fd430c8", - "6ba7b8109dad11d1-80b400c04fd430c8", - "6ba7b8109dad11d180b4-00c04fd430c8", - } - - for _, str := range s { - _, err := FromString(str) - if err == nil { - t.Errorf("Should return error trying to parse invalid string, passed %s", str) - } - } -} - -func TestFromStringOrNil(t *testing.T) { - u := FromStringOrNil("") - if u != Nil { - t.Errorf("Should return Nil UUID on parse failure, got %s", u) - } -} - -func TestFromBytesOrNil(t *testing.T) { - b := []byte{} - u := FromBytesOrNil(b) - if u != Nil { - t.Errorf("Should return Nil UUID on parse failure, got %s", u) - } -} - -func TestMarshalText(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - - b2, err := u.MarshalText() - if err != nil { - t.Errorf("Error marshaling UUID: %s", err) - } - - if !bytes.Equal(b1, b2) { - t.Errorf("Marshaled UUID should be %s, got %s", b1, b2) - } -} - -func TestUnmarshalText(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - - u1 := UUID{} - err := u1.UnmarshalText(b1) - if err != nil { - t.Errorf("Error unmarshaling UUID: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - b2 := []byte("") - u2 := UUID{} - - err = u2.UnmarshalText(b2) - if err == nil { - t.Errorf("Should return error trying to unmarshal from empty string") - } -} - -func TestValue(t *testing.T) { - u, err := FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - if err != nil { - t.Errorf("Error parsing UUID from string: %s", err) - } - - val, err := u.Value() - if err != nil { - t.Errorf("Error getting UUID value: %s", err) - } - - if val != u.String() { - t.Errorf("Wrong value returned, should be equal: %s and %s", val, u) - } -} - -func TestValueNil(t *testing.T) { - u := UUID{} - - val, err := u.Value() - if err != nil { - t.Errorf("Error getting UUID value: %s", err) - } - - if val != Nil.String() { - t.Errorf("Wrong value returned, should be equal to UUID.Nil: %s", val) - } -} - -func TestNullUUIDValueNil(t *testing.T) { - u := NullUUID{} - - val, err := u.Value() - if err != nil { - t.Errorf("Error getting UUID value: %s", err) - } - - if val != nil { - t.Errorf("Wrong value returned, should be nil: %s", val) - } -} - -func TestScanBinary(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - u1 := UUID{} - err := u1.Scan(b1) - if err != nil { - t.Errorf("Error unmarshaling UUID: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - b2 := []byte{} - u2 := UUID{} - - err = u2.Scan(b2) - if err == nil { - t.Errorf("Should return error unmarshalling from empty byte slice, got %s", err) - } -} - -func TestScanString(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - s1 := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" - - u1 := UUID{} - err := u1.Scan(s1) - if err != nil { - t.Errorf("Error unmarshaling UUID: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - s2 := "" - u2 := UUID{} - - err = u2.Scan(s2) - if err == nil { - t.Errorf("Should return error trying to unmarshal from empty string") - } -} - -func TestScanText(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - b1 := []byte("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - - u1 := UUID{} - err := u1.Scan(b1) - if err != nil { - t.Errorf("Error unmarshaling UUID: %s", err) - } - - if !Equal(u, u1) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1) - } - - b2 := []byte("") - u2 := UUID{} - - err = u2.Scan(b2) - if err == nil { - t.Errorf("Should return error trying to unmarshal from empty string") - } -} - -func TestScanUnsupported(t *testing.T) { - u := UUID{} - - err := u.Scan(true) - if err == nil { - t.Errorf("Should return error trying to unmarshal from bool") - } -} - -func TestScanNil(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - - err := u.Scan(nil) - if err == nil { - t.Errorf("Error UUID shouldn't allow unmarshalling from nil") - } -} - -func TestNullUUIDScanValid(t *testing.T) { - u := UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8} - s1 := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" - - u1 := NullUUID{} - err := u1.Scan(s1) - if err != nil { - t.Errorf("Error unmarshaling NullUUID: %s", err) - } - - if !u1.Valid { - t.Errorf("NullUUID should be valid") - } - - if !Equal(u, u1.UUID) { - t.Errorf("UUIDs should be equal: %s and %s", u, u1.UUID) - } -} - -func TestNullUUIDScanNil(t *testing.T) { - u := NullUUID{UUID{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}, true} - - err := u.Scan(nil) - if err != nil { - t.Errorf("Error unmarshaling NullUUID: %s", err) - } - - if u.Valid { - t.Errorf("NullUUID should not be valid") - } - - if !Equal(u.UUID, Nil) { - t.Errorf("NullUUID value should be equal to Nil: %v", u) - } -} - -func TestNewV1(t *testing.T) { - u := NewV1() - - if u.Version() != 1 { - t.Errorf("UUIDv1 generated with incorrect version: %d", u.Version()) - } - - if u.Variant() != VariantRFC4122 { - t.Errorf("UUIDv1 generated with incorrect variant: %d", u.Variant()) - } - - u1 := NewV1() - u2 := NewV1() - - if Equal(u1, u2) { - t.Errorf("UUIDv1 generated two equal UUIDs: %s and %s", u1, u2) - } - - oldFunc := epochFunc - epochFunc = func() uint64 { return 0 } - - u3 := NewV1() - u4 := NewV1() - - if Equal(u3, u4) { - t.Errorf("UUIDv1 generated two equal UUIDs: %s and %s", u3, u4) - } - - epochFunc = oldFunc -} - -func TestNewV2(t *testing.T) { - u1 := NewV2(DomainPerson) - - if u1.Version() != 2 { - t.Errorf("UUIDv2 generated with incorrect version: %d", u1.Version()) - } - - if u1.Variant() != VariantRFC4122 { - t.Errorf("UUIDv2 generated with incorrect variant: %d", u1.Variant()) - } - - u2 := NewV2(DomainGroup) - - if u2.Version() != 2 { - t.Errorf("UUIDv2 generated with incorrect version: %d", u2.Version()) - } - - if u2.Variant() != VariantRFC4122 { - t.Errorf("UUIDv2 generated with incorrect variant: %d", u2.Variant()) - } -} - -func TestNewV3(t *testing.T) { - u := NewV3(NamespaceDNS, "www.example.com") - - if u.Version() != 3 { - t.Errorf("UUIDv3 generated with incorrect version: %d", u.Version()) - } - - if u.Variant() != VariantRFC4122 { - t.Errorf("UUIDv3 generated with incorrect variant: %d", u.Variant()) - } - - if u.String() != "5df41881-3aed-3515-88a7-2f4a814cf09e" { - t.Errorf("UUIDv3 generated incorrectly: %s", u.String()) - } - - u = NewV3(NamespaceDNS, "python.org") - - if u.String() != "6fa459ea-ee8a-3ca4-894e-db77e160355e" { - t.Errorf("UUIDv3 generated incorrectly: %s", u.String()) - } - - u1 := NewV3(NamespaceDNS, "golang.org") - u2 := NewV3(NamespaceDNS, "golang.org") - if !Equal(u1, u2) { - t.Errorf("UUIDv3 generated different UUIDs for same namespace and name: %s and %s", u1, u2) - } - - u3 := NewV3(NamespaceDNS, "example.com") - if Equal(u1, u3) { - t.Errorf("UUIDv3 generated same UUIDs for different names in same namespace: %s and %s", u1, u2) - } - - u4 := NewV3(NamespaceURL, "golang.org") - if Equal(u1, u4) { - t.Errorf("UUIDv3 generated same UUIDs for sane names in different namespaces: %s and %s", u1, u4) - } -} - -func TestNewV4(t *testing.T) { - u := NewV4() - - if u.Version() != 4 { - t.Errorf("UUIDv4 generated with incorrect version: %d", u.Version()) - } - - if u.Variant() != VariantRFC4122 { - t.Errorf("UUIDv4 generated with incorrect variant: %d", u.Variant()) - } -} - -func TestNewV5(t *testing.T) { - u := NewV5(NamespaceDNS, "www.example.com") - - if u.Version() != 5 { - t.Errorf("UUIDv5 generated with incorrect version: %d", u.Version()) - } - - if u.Variant() != VariantRFC4122 { - t.Errorf("UUIDv5 generated with incorrect variant: %d", u.Variant()) - } - - u = NewV5(NamespaceDNS, "python.org") - - if u.String() != "886313e1-3b8a-5372-9b90-0c9aee199e5d" { - t.Errorf("UUIDv5 generated incorrectly: %s", u.String()) - } - - u1 := NewV5(NamespaceDNS, "golang.org") - u2 := NewV5(NamespaceDNS, "golang.org") - if !Equal(u1, u2) { - t.Errorf("UUIDv5 generated different UUIDs for same namespace and name: %s and %s", u1, u2) - } - - u3 := NewV5(NamespaceDNS, "example.com") - if Equal(u1, u3) { - t.Errorf("UUIDv5 generated same UUIDs for different names in same namespace: %s and %s", u1, u2) - } - - u4 := NewV5(NamespaceURL, "golang.org") - if Equal(u1, u4) { - t.Errorf("UUIDv3 generated same UUIDs for sane names in different namespaces: %s and %s", u1, u4) - } -}