diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 903e8c5f7..30497a741 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -2,98 +2,7 @@ "ImportPath": "github.com/hashicorp/terraform", "GoVersion": "go1.5", "Packages": [ - "github.com/hashicorp/terraform", - "github.com/hashicorp/terraform/builtin/bins/provider-atlas", - "github.com/hashicorp/terraform/builtin/bins/provider-aws", - "github.com/hashicorp/terraform/builtin/bins/provider-azure", - "github.com/hashicorp/terraform/builtin/bins/provider-azurerm", - "github.com/hashicorp/terraform/builtin/bins/provider-chef", - "github.com/hashicorp/terraform/builtin/bins/provider-cloudflare", - "github.com/hashicorp/terraform/builtin/bins/provider-cloudstack", - "github.com/hashicorp/terraform/builtin/bins/provider-consul", - "github.com/hashicorp/terraform/builtin/bins/provider-digitalocean", - "github.com/hashicorp/terraform/builtin/bins/provider-dme", - "github.com/hashicorp/terraform/builtin/bins/provider-dnsimple", - "github.com/hashicorp/terraform/builtin/bins/provider-docker", - "github.com/hashicorp/terraform/builtin/bins/provider-dyn", - "github.com/hashicorp/terraform/builtin/bins/provider-google", - "github.com/hashicorp/terraform/builtin/bins/provider-heroku", - "github.com/hashicorp/terraform/builtin/bins/provider-mailgun", - "github.com/hashicorp/terraform/builtin/bins/provider-mysql", - "github.com/hashicorp/terraform/builtin/bins/provider-null", - "github.com/hashicorp/terraform/builtin/bins/provider-openstack", - "github.com/hashicorp/terraform/builtin/bins/provider-packet", - "github.com/hashicorp/terraform/builtin/bins/provider-postgresql", - "github.com/hashicorp/terraform/builtin/bins/provider-powerdns", - "github.com/hashicorp/terraform/builtin/bins/provider-rundeck", - "github.com/hashicorp/terraform/builtin/bins/provider-statuscake", - "github.com/hashicorp/terraform/builtin/bins/provider-template", - "github.com/hashicorp/terraform/builtin/bins/provider-terraform", - "github.com/hashicorp/terraform/builtin/bins/provider-tls", - "github.com/hashicorp/terraform/builtin/bins/provider-vcd", - "github.com/hashicorp/terraform/builtin/bins/provider-vsphere", - "github.com/hashicorp/terraform/builtin/bins/provisioner-chef", - "github.com/hashicorp/terraform/builtin/bins/provisioner-file", - "github.com/hashicorp/terraform/builtin/bins/provisioner-local-exec", - "github.com/hashicorp/terraform/builtin/bins/provisioner-remote-exec", - "github.com/hashicorp/terraform/builtin/providers/atlas", - "github.com/hashicorp/terraform/builtin/providers/aws", - "github.com/hashicorp/terraform/builtin/providers/azure", - "github.com/hashicorp/terraform/builtin/providers/azurerm", - "github.com/hashicorp/terraform/builtin/providers/chef", - "github.com/hashicorp/terraform/builtin/providers/cloudflare", - "github.com/hashicorp/terraform/builtin/providers/cloudstack", - "github.com/hashicorp/terraform/builtin/providers/consul", - "github.com/hashicorp/terraform/builtin/providers/digitalocean", - "github.com/hashicorp/terraform/builtin/providers/dme", - "github.com/hashicorp/terraform/builtin/providers/dnsimple", - "github.com/hashicorp/terraform/builtin/providers/docker", - "github.com/hashicorp/terraform/builtin/providers/dyn", - "github.com/hashicorp/terraform/builtin/providers/google", - "github.com/hashicorp/terraform/builtin/providers/heroku", - "github.com/hashicorp/terraform/builtin/providers/mailgun", - "github.com/hashicorp/terraform/builtin/providers/mysql", - "github.com/hashicorp/terraform/builtin/providers/null", - "github.com/hashicorp/terraform/builtin/providers/openstack", - "github.com/hashicorp/terraform/builtin/providers/packet", - "github.com/hashicorp/terraform/builtin/providers/postgresql", - "github.com/hashicorp/terraform/builtin/providers/powerdns", - "github.com/hashicorp/terraform/builtin/providers/rundeck", - "github.com/hashicorp/terraform/builtin/providers/statuscake", - "github.com/hashicorp/terraform/builtin/providers/template", - "github.com/hashicorp/terraform/builtin/providers/terraform", - "github.com/hashicorp/terraform/builtin/providers/tls", - "github.com/hashicorp/terraform/builtin/providers/vcd", - "github.com/hashicorp/terraform/builtin/providers/vsphere", - "github.com/hashicorp/terraform/builtin/provisioners/chef", - "github.com/hashicorp/terraform/builtin/provisioners/file", - "github.com/hashicorp/terraform/builtin/provisioners/local-exec", - "github.com/hashicorp/terraform/builtin/provisioners/remote-exec", - "github.com/hashicorp/terraform/command", - "github.com/hashicorp/terraform/communicator", - "github.com/hashicorp/terraform/communicator/remote", - "github.com/hashicorp/terraform/communicator/ssh", - "github.com/hashicorp/terraform/communicator/winrm", - "github.com/hashicorp/terraform/config", - "github.com/hashicorp/terraform/config/module", - "github.com/hashicorp/terraform/dag", - "github.com/hashicorp/terraform/digraph", - "github.com/hashicorp/terraform/dot", - "github.com/hashicorp/terraform/flatmap", - "github.com/hashicorp/terraform/helper/acctest", - "github.com/hashicorp/terraform/helper/config", - "github.com/hashicorp/terraform/helper/diff", - "github.com/hashicorp/terraform/helper/hashcode", - "github.com/hashicorp/terraform/helper/logging", - "github.com/hashicorp/terraform/helper/mutexkv", - "github.com/hashicorp/terraform/helper/pathorcontents", - "github.com/hashicorp/terraform/helper/resource", - "github.com/hashicorp/terraform/helper/schema", - "github.com/hashicorp/terraform/plugin", - "github.com/hashicorp/terraform/rpc", - "github.com/hashicorp/terraform/state", - "github.com/hashicorp/terraform/state/remote", - "github.com/hashicorp/terraform/terraform" + "./..." ], "Deps": [ { @@ -101,6 +10,21 @@ "Comment": "v1.2-315-g1cb9dff", "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go", "Comment": "v1.2-315-g1cb9dff", @@ -111,6 +35,11 @@ "Comment": "v1.2-315-g1cb9dff", "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/pkcs12/internal/rc2", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/cdn", "Comment": "v1.2-315-g1cb9dff", @@ -156,6 +85,66 @@ "Comment": "v1.2-315-g1cb9dff", "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/affinitygroup", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/hostedservice", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/location", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/networksecuritygroup", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/osimage", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/sql", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/storageservice", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualmachine", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualmachinedisk", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualmachineimage", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualnetwork", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/vmutils", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/storage", "Comment": "v1.2-315-g1cb9dff", @@ -187,6 +176,61 @@ "Comment": "v1.1.2", "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/awserr", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/client", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/credentials", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/defaults", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/request", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/session", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, { "ImportPath": "github.com/aws/aws-sdk-go/private/endpoints", "Comment": "v1.1.2", @@ -217,6 +261,11 @@ "Comment": "v1.1.2", "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", + "Comment": "v1.1.2", + "Rev": "8041be5461786460d86b4358305fbdf32d37cfb2" + }, { "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest", "Comment": "v1.1.2", @@ -442,6 +491,74 @@ "ImportPath": "github.com/fsouza/go-dockerclient", "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/go-units", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/net/context", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix", + "Rev": "02a8beb401b20e112cff3ea740545960b667eab1" + }, { "ImportPath": "github.com/go-chef/chef", "Comment": "0.0.1-42-gea19666", @@ -491,6 +608,10 @@ "ImportPath": "github.com/hashicorp/go-getter", "Rev": "848242c76c346ef0aeb34787753b068f5f6f92fe" }, + { + "ImportPath": "github.com/hashicorp/go-getter/helper/url", + "Rev": "848242c76c346ef0aeb34787753b068f5f6f92fe" + }, { "ImportPath": "github.com/hashicorp/go-multierror", "Rev": "d30f09973e19c1dfcd120b2d9c4f168e68d6b5d5" @@ -507,10 +628,46 @@ "ImportPath": "github.com/hashicorp/hcl", "Rev": "578dd9746824a54637686b51a41bad457a56bcef" }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/ast", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/parser", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/scanner", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/strconv", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/token", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/json/parser", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/json/scanner", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, + { + "ImportPath": "github.com/hashicorp/hcl/json/token", + "Rev": "578dd9746824a54637686b51a41bad457a56bcef" + }, { "ImportPath": "github.com/hashicorp/hil", "Rev": "42518c6f01625b5e6948a6a0e6a0792df126c548" }, + { + "ImportPath": "github.com/hashicorp/hil/ast", + "Rev": "42518c6f01625b5e6948a6a0e6a0792df126c548" + }, { "ImportPath": "github.com/hashicorp/logutils", "Rev": "0dc08b1671f34c4250ce212759ebd880f743d883" @@ -529,6 +686,11 @@ "Comment": "v0.0.2-37-g5cd82f0", "Rev": "5cd82f01aa1c97afa9b23ef6f4f42a60f3106003" }, + { + "ImportPath": "github.com/hmrc/vmware-govcd/types/v56", + "Comment": "v0.0.2-37-g5cd82f0", + "Rev": "5cd82f01aa1c97afa9b23ef6f4f42a60f3106003" + }, { "ImportPath": "github.com/imdario/mergo", "Comment": "0.2.1-3-gb1859b1", @@ -560,6 +722,11 @@ "Comment": "go1.0-cutoff-74-g8ad2b29", "Rev": "8ad2b298cadd691a77015666a5372eae5dbfac8f" }, + { + "ImportPath": "github.com/lib/pq/oid", + "Comment": "go1.0-cutoff-74-g8ad2b29", + "Rev": "8ad2b298cadd691a77015666a5372eae5dbfac8f" + }, { "ImportPath": "github.com/lusis/go-artifactory/src/artifactory.v401", "Rev": "7e4ce345df825841661d1b3ffbb1327083d4a22f" @@ -667,6 +834,181 @@ "Comment": "v1.0.0-803-g6769c3b", "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/flavors", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/images", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/servers", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v2/tenants", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v2/tokens", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v3/tokens", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/floatingips", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/members", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/monitors", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/vips", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/networks", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/ports", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/subnets", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/utils", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/pagination", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/testhelper", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/testhelper/client", + "Comment": "v1.0.0-803-g6769c3b", + "Rev": "6769c3b3e54a5cf1b0bdb10ea5b25f5cff0a3134" + }, { "ImportPath": "github.com/satori/go.uuid", "Rev": "d41af8bb6a7704f00bc3b7cba9355ae6a5a80048" @@ -689,6 +1031,76 @@ "Comment": "v0.3.0-18-g3b66976", "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" }, + { + "ImportPath": "github.com/vmware/govmomi/find", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/list", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/object", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/property", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/session", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/task", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/debug", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/methods", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/mo", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/progress", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/soap", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/types", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/xml", + "Comment": "v0.3.0-18-g3b66976", + "Rev": "3b669760f460befb135048aea80d2f5fa13885ca" + }, { "ImportPath": "github.com/xanzy/go-cloudstack/cloudstack", "Comment": "v1.2.0-61-g252eb1b", @@ -721,14 +1133,38 @@ "ImportPath": "golang.org/x/crypto/ssh", "Rev": "1f22c0103821b9390939b6776727195525381532" }, + { + "ImportPath": "golang.org/x/crypto/ssh/agent", + "Rev": "1f22c0103821b9390939b6776727195525381532" + }, { "ImportPath": "golang.org/x/net/context", "Rev": "04b9de9b512f58addf28c9853d50ebef61c3953e" }, + { + "ImportPath": "golang.org/x/net/context/ctxhttp", + "Rev": "04b9de9b512f58addf28c9853d50ebef61c3953e" + }, { "ImportPath": "golang.org/x/oauth2", "Rev": "8a57ed94ffd43444c0879fe75701732a38afc985" }, + { + "ImportPath": "golang.org/x/oauth2/google", + "Rev": "8a57ed94ffd43444c0879fe75701732a38afc985" + }, + { + "ImportPath": "golang.org/x/oauth2/internal", + "Rev": "8a57ed94ffd43444c0879fe75701732a38afc985" + }, + { + "ImportPath": "golang.org/x/oauth2/jws", + "Rev": "8a57ed94ffd43444c0879fe75701732a38afc985" + }, + { + "ImportPath": "golang.org/x/oauth2/jwt", + "Rev": "8a57ed94ffd43444c0879fe75701732a38afc985" + }, { "ImportPath": "golang.org/x/sys/unix", "Rev": "c65f27ffe69a43ae814a5e64c2fabb6c6312a4af" @@ -753,6 +1189,10 @@ "ImportPath": "google.golang.org/api/googleapi", "Rev": "f6ba98773d96b877b246f3a9266493dfc11e276b" }, + { + "ImportPath": "google.golang.org/api/googleapi/internal/uritemplates", + "Rev": "f6ba98773d96b877b246f3a9266493dfc11e276b" + }, { "ImportPath": "google.golang.org/api/pubsub/v1", "Rev": "f6ba98773d96b877b246f3a9266493dfc11e276b" @@ -769,6 +1209,34 @@ "ImportPath": "google.golang.org/appengine", "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" }, + { + "ImportPath": "google.golang.org/appengine/internal", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/app_identity", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/base", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/datastore", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/log", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/modules", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/remote_api", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, { "ImportPath": "google.golang.org/cloud/compute/metadata", "Rev": "fb10e8da373d97f6ba5e648299a10b3b91f14cd5" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/LICENSE b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/LICENSE deleted file mode 100644 index b9d6a27ea..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - 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 - - Copyright 2015 Microsoft Corporation - - 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/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure/example/README.md b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure/example/README.md deleted file mode 100644 index 49909718b..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure/example/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# autorest azure example - -## Usage - -This example covers how to make an authenticated call to the Azure Resource Manager APIs, using certificate-based authentication. - -0. Export some required variables - - ``` - export SUBSCRIPTION_ID="aff271ee-e9be-4441-b9bb-42f5af4cbaeb" - export TENANT_ID="13de0a15-b5db-44b9-b682-b4ba82afbd29" - export RESOURCE_GROUP="someresourcegroup" - ``` - - * replace both values with your own - -1. Create a private key - - ``` - openssl genrsa -out "example.key" 2048 - ``` - - - -2. Create the certificate - - ``` - openssl req -new -key "example.key" -subj "/CN=example" -out "example.csr" - - openssl x509 -req -in "example.csr" -signkey "example.key" -out "example.crt" -days 10000 - ``` - - - -3. Create the PKCS12 version of the certificate (with no password) - - ``` - openssl pkcs12 -export -out "example.pfx" -inkey "example.key" -in "example.crt" -passout pass: - ``` - - - -4. Register a new Azure AD Application with the certificate contents - - ``` - certificateContents="$(tail -n+2 "example.key" | head -n-1)" - - azure ad app create \ - --name "example-azuread-app" \ - --home-page="http://example-azuread-app/home" \ - --identifier-uris "http://example-azuread-app/app" \ - --key-usage "Verify" \ - --end-date "2020-01-01" \ - --key-value "${certificateContents}" - ``` - - - -5. Create a new service principal using the "Application Id" from the previous step - - ``` - azure ad sp create "APPLICATION_ID" - ``` - - * Replace APPLICATION_ID with the "Application Id" returned in step 4 - - - -6. Grant your service principal necessary permissions - - ``` - azure role assignment create \ - --resource-group "${RESOURCE_GROUP}" \ - --roleName "Contributor" \ - --subscription "${SUBSCRIPTION_ID}" \ - --spn "http://example-azuread-app/app" - ``` - - * Replace SUBSCRIPTION_ID with your subscription id - * Replace RESOURCE_GROUP with the resource group for the assignment - * Ensure that the `spn` parameter matches an `identifier-url` from Step 4 - - - -7. Run this example app to see your resource groups - - ``` - go run main.go \ - --tenantId="${TENANT_ID}" \ - --subscriptionId="${SUBSCRIPTION_ID}" \ - --applicationId="http://example-azuread-app/app" \ - --certificatePath="certificate.pfx" - ``` - - -You should see something like this as output: - -``` -2015/11/08 18:28:39 Using these settings: -2015/11/08 18:28:39 * certificatePath: certificate.pfx -2015/11/08 18:28:39 * applicationID: http://example-azuread-app/app -2015/11/08 18:28:39 * tenantID: 13de0a15-b5db-44b9-b682-b4ba82afbd29 -2015/11/08 18:28:39 * subscriptionID: aff271ee-e9be-4441-b9bb-42f5af4cbaeb -2015/11/08 18:28:39 loading certificate... -2015/11/08 18:28:39 retrieve oauth token... -2015/11/08 18:28:39 querying the list of resource groups... -2015/11/08 18:28:50 -2015/11/08 18:28:50 Groups: {"value":[{"id":"/subscriptions/aff271ee-e9be-4441-b9bb-42f5af4cbaeb/resourceGroups/kube-66f30810","name":"kube-66f30810","location":"westus","tags":{},"properties":{"provisioningState":"Succeeded"}}]} -``` - - - -## Notes - -You may need to wait sometime between executing step 4, step 5 and step 6. If you issue those requests too quickly, you might hit an AD server that is not consistent with the server where the resource was created. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure/example/main.go b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure/example/main.go deleted file mode 100644 index f2b71b299..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure/example/main.go +++ /dev/null @@ -1,130 +0,0 @@ -package main - -import ( - "crypto/rsa" - "crypto/x509" - "flag" - "fmt" - "io/ioutil" - "log" - "net/http" - "strings" - - "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest" - "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/pkcs12" -) - -const resourceGroupURLTemplate = "https://management.azure.com/subscriptions/{subscription-id}/resourcegroups" -const apiVersion = "2015-01-01" - -var ( - certificatePath string - applicationID string - tenantID string - subscriptionID string -) - -func init() { - flag.StringVar(&certificatePath, "certificatePath", "", "path to pk12/pfx certificate") - flag.StringVar(&applicationID, "applicationId", "", "application id") - flag.StringVar(&tenantID, "tenantId", "", "tenant id") - flag.StringVar(&subscriptionID, "subscriptionId", "", "subscription id") - flag.Parse() - - log.Println("Using these settings:") - log.Println("* certificatePath:", certificatePath) - log.Println("* applicationID:", applicationID) - log.Println("* tenantID:", tenantID) - log.Println("* subscriptionID:", subscriptionID) - - if strings.Trim(certificatePath, " ") == "" || - strings.Trim(applicationID, " ") == "" || - strings.Trim(tenantID, " ") == "" || - strings.Trim(subscriptionID, " ") == "" { - log.Fatalln("Bad usage. Please specify all four parameters") - } -} - -func main() { - log.Println("loading certificate... ") - certData, err := ioutil.ReadFile(certificatePath) - if err != nil { - log.Fatalln("failed", err) - } - - certificate, rsaPrivateKey, err := decodePkcs12(certData, "") - if err != nil { - log.Fatalln("failed", err) - } - - log.Println("retrieve oauth token... ") - spt, err := azure.NewServicePrincipalTokenFromCertificate( - applicationID, - certificate, - rsaPrivateKey, - tenantID, - azure.AzureResourceManagerScope) - if err != nil { - log.Fatalln("failed", err) - panic(err) - } - - client := &autorest.Client{} - client.Authorizer = spt - - log.Println("querying the list of resource groups... ") - groupsAsString, err := getResourceGroups(client) - if err != nil { - log.Fatalln("failed", err) - } - - log.Println("") - log.Println("Groups:", *groupsAsString) -} - -func getResourceGroups(client *autorest.Client) (*string, error) { - var p map[string]interface{} - var req *http.Request - p = map[string]interface{}{ - "subscription-id": subscriptionID, - } - q := map[string]interface{}{ - "api-version": apiVersion, - } - - req, _ = autorest.Prepare(&http.Request{}, - autorest.AsGet(), - autorest.WithBaseURL(resourceGroupURLTemplate), - autorest.WithPathParameters(p), - autorest.WithQueryParameters(q)) - - resp, err := client.Send(req, http.StatusOK) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - contents, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - contentsString := string(contents) - - return &contentsString, nil -} - -func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.PrivateKey, error) { - privateKey, certificate, err := pkcs12.Decode(pkcs, password) - if err != nil { - return nil, nil, err - } - - rsaPrivateKey, isRsaKey := privateKey.(*rsa.PrivateKey) - if !isRsaKey { - return nil, nil, fmt.Errorf("PKCS#12 certificate must contain an RSA private key") - } - - return certificate, rsaPrivateKey, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/mocks/helpers.go b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/mocks/helpers.go deleted file mode 100644 index 57d6df871..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/mocks/helpers.go +++ /dev/null @@ -1,104 +0,0 @@ -package mocks - -import ( - "fmt" - "net/http" - "time" -) - -const ( - // TestDelay is the Retry-After delay used in tests. - TestDelay = 0 * time.Second - - // TestHeader is the header used in tests. - TestHeader = "x-test-header" - - // TestURL is the URL used in tests. - TestURL = "https://microsoft.com/a/b/c/" -) - -const ( - headerLocation = "Location" - headerRetryAfter = "Retry-After" -) - -// NewRequest instantiates a new request. -func NewRequest() *http.Request { - return NewRequestWithContent("") -} - -// NewRequestWithContent instantiates a new request using the passed string for the body content. -func NewRequestWithContent(c string) *http.Request { - r, _ := http.NewRequest("GET", "https://microsoft.com/a/b/c/", NewBody(c)) - return r -} - -// NewRequestForURL instantiates a new request using the passed URL. -func NewRequestForURL(u string) *http.Request { - r, err := http.NewRequest("GET", u, NewBody("")) - if err != nil { - panic(fmt.Sprintf("mocks: ERROR (%v) parsing testing URL %s", err, u)) - } - return r -} - -// NewResponse instantiates a new response. -func NewResponse() *http.Response { - return NewResponseWithContent("") -} - -// NewResponseWithContent instantiates a new response with the passed string as the body content. -func NewResponseWithContent(c string) *http.Response { - return &http.Response{ - Status: "200 OK", - StatusCode: 200, - Proto: "HTTP/1.0", - ProtoMajor: 1, - ProtoMinor: 0, - Body: NewBody(c), - Request: NewRequest(), - } -} - -// NewResponseWithStatus instantiates a new response using the passed string and integer as the -// status and status code. -func NewResponseWithStatus(s string, c int) *http.Response { - resp := NewResponse() - resp.Status = s - resp.StatusCode = c - return resp -} - -// SetResponseHeader adds a header to the passed response. -func SetResponseHeader(resp *http.Response, h string, v string) { - if resp.Header == nil { - resp.Header = make(http.Header) - } - resp.Header.Set(h, v) -} - -// SetResponseHeaderValues adds a header containing all the passed string values. -func SetResponseHeaderValues(resp *http.Response, h string, values []string) { - if resp.Header == nil { - resp.Header = make(http.Header) - } - for _, v := range values { - resp.Header.Add(h, v) - } -} - -// SetAcceptedHeaders adds the headers usually associated with a 202 Accepted response. -func SetAcceptedHeaders(resp *http.Response) { - SetLocationHeader(resp, TestURL) - SetRetryHeader(resp, TestDelay) -} - -// SetLocationHeader adds the Location header. -func SetLocationHeader(resp *http.Response, location string) { - SetResponseHeader(resp, http.CanonicalHeaderKey(headerLocation), location) -} - -// SetRetryHeader adds the Retry-After header. -func SetRetryHeader(resp *http.Response, delay time.Duration) { - SetResponseHeader(resp, http.CanonicalHeaderKey(headerRetryAfter), fmt.Sprintf("%v", delay.Seconds())) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/mocks/mocks.go b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/mocks/mocks.go deleted file mode 100644 index b20243fc1..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/mocks/mocks.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Package mocks provides mocks and helpers used in testing. -*/ -package mocks - -import ( - "fmt" - "io" - "net/http" -) - -// Body implements acceptable body over a string. -type Body struct { - s string - b []byte - isOpen bool - closeAttempts int -} - -// NewBody creates a new instance of Body. -func NewBody(s string) *Body { - return (&Body{s: s}).reset() -} - -// Read reads into the passed byte slice and returns the bytes read. -func (body *Body) Read(b []byte) (n int, err error) { - if !body.IsOpen() { - return 0, fmt.Errorf("ERROR: Body has been closed\n") - } - if len(body.b) == 0 { - return 0, io.EOF - } - n = copy(b, body.b) - body.b = body.b[n:] - return n, nil -} - -// Close closes the body. -func (body *Body) Close() error { - if body.isOpen { - body.isOpen = false - body.closeAttempts++ - } - return nil -} - -// CloseAttempts returns the number of times Close was called. -func (body *Body) CloseAttempts() int { - return body.closeAttempts -} - -// IsOpen returns true if the Body has not been closed, false otherwise. -func (body *Body) IsOpen() bool { - return body.isOpen -} - -func (body *Body) reset() *Body { - body.isOpen = true - body.b = []byte(body.s) - return body -} - -// Sender implements a simple null sender. -type Sender struct { - attempts int - pollAttempts int - content string - reuseResponse bool - resp *http.Response - status string - statusCode int - emitErrors int - err error -} - -// NewSender creates a new instance of Sender. -func NewSender() *Sender { - return &Sender{status: "200 OK", statusCode: 200} -} - -// Do accepts the passed request and, based on settings, emits a response and possible error. -func (c *Sender) Do(r *http.Request) (*http.Response, error) { - c.attempts++ - - if !c.reuseResponse || c.resp == nil { - resp := NewResponse() - resp.Request = r - resp.Body = NewBody(c.content) - resp.Status = c.status - resp.StatusCode = c.statusCode - c.resp = resp - } else { - c.resp.Body.(*Body).reset() - } - - if c.pollAttempts > 0 { - c.pollAttempts-- - c.resp.Status = "Accepted" - c.resp.StatusCode = http.StatusAccepted - SetAcceptedHeaders(c.resp) - } - - if c.emitErrors > 0 || c.emitErrors < 0 { - c.emitErrors-- - if c.err == nil { - return c.resp, fmt.Errorf("Faux Error") - } - return c.resp, c.err - } - return c.resp, nil -} - -// Attempts returns the number of times Do was called. -func (c *Sender) Attempts() int { - return c.attempts -} - -// EmitErrors sets the number times Do should emit an error. -func (c *Sender) EmitErrors(emit int) { - c.emitErrors = emit -} - -// SetError sets the error Do should return. -func (c *Sender) SetError(err error) { - c.err = err -} - -// ClearError clears the error Do emits. -func (c *Sender) ClearError() { - c.SetError(nil) -} - -// EmitContent sets the content to be returned by Do in the response body. -func (c *Sender) EmitContent(s string) { - c.content = s -} - -// EmitStatus sets the status of the response Do emits. -func (c *Sender) EmitStatus(status string, code int) { - c.status = status - c.statusCode = code -} - -// SetPollAttempts sets the number of times the returned response emits the default polling -// status code (i.e., 202 Accepted). -func (c *Sender) SetPollAttempts(pa int) { - c.pollAttempts = pa -} - -// ReuseResponse sets if the just one response object should be reused by all calls to Do. -func (c *Sender) ReuseResponse(reuseResponse bool) { - c.reuseResponse = reuseResponse -} - -// SetResponse sets the response from Do. -func (c *Sender) SetResponse(resp *http.Response) { - c.resp = resp - c.reuseResponse = true -} - -// T is a simple testing struct. -type T struct { - Name string `json:"name" xml:"Name"` - Age int `json:"age" xml:"Age"` -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/cmd/jwt/app.go b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/cmd/jwt/app.go deleted file mode 100644 index 9b9536124..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/cmd/jwt/app.go +++ /dev/null @@ -1,210 +0,0 @@ -// A useful example app. You can use this to debug your tokens on the command line. -// This is also a great place to look at how you might use this library. -// -// Example usage: -// The following will create and sign a token, then verify it and output the original claims. -// echo {\"foo\":\"bar\"} | bin/jwt -key test/sample_key -alg RS256 -sign - | bin/jwt -key test/sample_key.pub -verify - -package main - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "io/ioutil" - "os" - "regexp" - "strings" - - "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go" -) - -var ( - // Options - flagAlg = flag.String("alg", "", "signing algorithm identifier") - flagKey = flag.String("key", "", "path to key file or '-' to read from stdin") - flagCompact = flag.Bool("compact", false, "output compact JSON") - flagDebug = flag.Bool("debug", false, "print out all kinds of debug data") - - // Modes - exactly one of these is required - flagSign = flag.String("sign", "", "path to claims object to sign or '-' to read from stdin") - flagVerify = flag.String("verify", "", "path to JWT token to verify or '-' to read from stdin") -) - -func main() { - // Usage message if you ask for -help or if you mess up inputs. - flag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " One of the following flags is required: sign, verify\n") - flag.PrintDefaults() - } - - // Parse command line options - flag.Parse() - - // Do the thing. If something goes wrong, print error to stderr - // and exit with a non-zero status code - if err := start(); err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - os.Exit(1) - } -} - -// Figure out which thing to do and then do that -func start() error { - if *flagSign != "" { - return signToken() - } else if *flagVerify != "" { - return verifyToken() - } else { - flag.Usage() - return fmt.Errorf("None of the required flags are present. What do you want me to do?") - } -} - -// Helper func: Read input from specified file or stdin -func loadData(p string) ([]byte, error) { - if p == "" { - return nil, fmt.Errorf("No path specified") - } - - var rdr io.Reader - if p == "-" { - rdr = os.Stdin - } else { - if f, err := os.Open(p); err == nil { - rdr = f - defer f.Close() - } else { - return nil, err - } - } - return ioutil.ReadAll(rdr) -} - -// Print a json object in accordance with the prophecy (or the command line options) -func printJSON(j interface{}) error { - var out []byte - var err error - - if *flagCompact == false { - out, err = json.MarshalIndent(j, "", " ") - } else { - out, err = json.Marshal(j) - } - - if err == nil { - fmt.Println(string(out)) - } - - return err -} - -// Verify a token and output the claims. This is a great example -// of how to verify and view a token. -func verifyToken() error { - // get the token - tokData, err := loadData(*flagVerify) - if err != nil { - return fmt.Errorf("Couldn't read token: %v", err) - } - - // trim possible whitespace from token - tokData = regexp.MustCompile(`\s*$`).ReplaceAll(tokData, []byte{}) - if *flagDebug { - fmt.Fprintf(os.Stderr, "Token len: %v bytes\n", len(tokData)) - } - - // Parse the token. Load the key from command line option - token, err := jwt.Parse(string(tokData), func(t *jwt.Token) (interface{}, error) { - data, err := loadData(*flagKey) - if err != nil { - return nil, err - } - if isEs() { - return jwt.ParseECPublicKeyFromPEM(data) - } - return data, nil - }) - - // Print some debug data - if *flagDebug && token != nil { - fmt.Fprintf(os.Stderr, "Header:\n%v\n", token.Header) - fmt.Fprintf(os.Stderr, "Claims:\n%v\n", token.Claims) - } - - // Print an error if we can't parse for some reason - if err != nil { - return fmt.Errorf("Couldn't parse token: %v", err) - } - - // Is token invalid? - if !token.Valid { - return fmt.Errorf("Token is invalid") - } - - // Print the token details - if err := printJSON(token.Claims); err != nil { - return fmt.Errorf("Failed to output claims: %v", err) - } - - return nil -} - -// Create, sign, and output a token. This is a great, simple example of -// how to use this library to create and sign a token. -func signToken() error { - // get the token data from command line arguments - tokData, err := loadData(*flagSign) - if err != nil { - return fmt.Errorf("Couldn't read token: %v", err) - } else if *flagDebug { - fmt.Fprintf(os.Stderr, "Token: %v bytes", len(tokData)) - } - - // parse the JSON of the claims - var claims map[string]interface{} - if err := json.Unmarshal(tokData, &claims); err != nil { - return fmt.Errorf("Couldn't parse claims JSON: %v", err) - } - - // get the key - var key interface{} - key, err = loadData(*flagKey) - if err != nil { - return fmt.Errorf("Couldn't read key: %v", err) - } - - // get the signing alg - alg := jwt.GetSigningMethod(*flagAlg) - if alg == nil { - return fmt.Errorf("Couldn't find signing method: %v", *flagAlg) - } - - // create a new token - token := jwt.New(alg) - token.Claims = claims - - if isEs() { - if k, ok := key.([]byte); !ok { - return fmt.Errorf("Couldn't convert key data to key") - } else { - key, err = jwt.ParseECPrivateKeyFromPEM(k) - if err != nil { - return err - } - } - } - - if out, err := token.SignedString(key); err == nil { - fmt.Println(out) - } else { - return fmt.Errorf("Error signing token: %v", err) - } - - return nil -} - -func isEs() bool { - return strings.HasPrefix(*flagAlg, "ES") -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec256-private.pem b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec256-private.pem deleted file mode 100644 index a6882b3e5..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec256-private.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHcCAQEEIAh5qA3rmqQQuu0vbKV/+zouz/y/Iy2pLpIcWUSyImSwoAoGCCqGSM49 -AwEHoUQDQgAEYD54V/vp+54P9DXarYqx4MPcm+HKRIQzNasYSoRQHQ/6S6Ps8tpM -cT+KvIIC8W/e9k0W7Cm72M1P9jU7SLf/vg== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec256-public.pem b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec256-public.pem deleted file mode 100644 index 7191361e7..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec256-public.pem +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYD54V/vp+54P9DXarYqx4MPcm+HK -RIQzNasYSoRQHQ/6S6Ps8tpMcT+KvIIC8W/e9k0W7Cm72M1P9jU7SLf/vg== ------END PUBLIC KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec384-private.pem b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec384-private.pem deleted file mode 100644 index a86c823e5..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec384-private.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MIGkAgEBBDCaCvMHKhcG/qT7xsNLYnDT7sE/D+TtWIol1ROdaK1a564vx5pHbsRy -SEKcIxISi1igBwYFK4EEACKhZANiAATYa7rJaU7feLMqrAx6adZFNQOpaUH/Uylb -ZLriOLON5YFVwtVUpO1FfEXZUIQpptRPtc5ixIPY658yhBSb6irfIJUSP9aYTflJ -GKk/mDkK4t8mWBzhiD5B6jg9cEGhGgA= ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec384-public.pem b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec384-public.pem deleted file mode 100644 index e80d00564..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec384-public.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PUBLIC KEY----- -MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2Gu6yWlO33izKqwMemnWRTUDqWlB/1Mp -W2S64jizjeWBVcLVVKTtRXxF2VCEKabUT7XOYsSD2OufMoQUm+oq3yCVEj/WmE35 -SRipP5g5CuLfJlgc4Yg+Qeo4PXBBoRoA ------END PUBLIC KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec512-private.pem b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec512-private.pem deleted file mode 100644 index 213afaf13..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec512-private.pem +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MIHcAgEBBEIB0pE4uFaWRx7t03BsYlYvF1YvKaBGyvoakxnodm9ou0R9wC+sJAjH -QZZJikOg4SwNqgQ/hyrOuDK2oAVHhgVGcYmgBwYFK4EEACOhgYkDgYYABAAJXIuw -12MUzpHggia9POBFYXSxaOGKGbMjIyDI+6q7wi7LMw3HgbaOmgIqFG72o8JBQwYN -4IbXHf+f86CRY1AA2wHzbHvt6IhkCXTNxBEffa1yMUgu8n9cKKF2iLgyQKcKqW33 -8fGOw/n3Rm2Yd/EB56u2rnD29qS+nOM9eGS+gy39OQ== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec512-public.pem b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec512-public.pem deleted file mode 100644 index 02ea02203..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/ec512-public.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQACVyLsNdjFM6R4IImvTzgRWF0sWjh -ihmzIyMgyPuqu8IuyzMNx4G2jpoCKhRu9qPCQUMGDeCG1x3/n/OgkWNQANsB82x7 -7eiIZAl0zcQRH32tcjFILvJ/XCihdoi4MkCnCqlt9/HxjsP590ZtmHfxAeertq5w -9vakvpzjPXhkvoMt/Tk= ------END PUBLIC KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/hmacTestKey b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/hmacTestKey deleted file mode 100644 index 435b8ddb3..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/hmacTestKey +++ /dev/null @@ -1 +0,0 @@ -#5K+¥¼ƒ~ew{¦Z³(æðTÉ(©„²ÒP.¿ÓûZ’ÒGï–Š´Ãwb="=.!r.OÀÍšõgЀ£ \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/sample_key b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/sample_key deleted file mode 100644 index abdbade31..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/sample_key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA4f5wg5l2hKsTeNem/V41fGnJm6gOdrj8ym3rFkEU/wT8RDtn -SgFEZOQpHEgQ7JL38xUfU0Y3g6aYw9QT0hJ7mCpz9Er5qLaMXJwZxzHzAahlfA0i -cqabvJOMvQtzD6uQv6wPEyZtDTWiQi9AXwBpHssPnpYGIn20ZZuNlX2BrClciHhC -PUIIZOQn/MmqTD31jSyjoQoV7MhhMTATKJx2XrHhR+1DcKJzQBSTAGnpYVaqpsAR -ap+nwRipr3nUTuxyGohBTSmjJ2usSeQXHI3bODIRe1AuTyHceAbewn8b462yEWKA -Rdpd9AjQW5SIVPfdsz5B6GlYQ5LdYKtznTuy7wIDAQABAoIBAQCwia1k7+2oZ2d3 -n6agCAbqIE1QXfCmh41ZqJHbOY3oRQG3X1wpcGH4Gk+O+zDVTV2JszdcOt7E5dAy -MaomETAhRxB7hlIOnEN7WKm+dGNrKRvV0wDU5ReFMRHg31/Lnu8c+5BvGjZX+ky9 -POIhFFYJqwCRlopGSUIxmVj5rSgtzk3iWOQXr+ah1bjEXvlxDOWkHN6YfpV5ThdE -KdBIPGEVqa63r9n2h+qazKrtiRqJqGnOrHzOECYbRFYhexsNFz7YT02xdfSHn7gM -IvabDDP/Qp0PjE1jdouiMaFHYnLBbgvlnZW9yuVf/rpXTUq/njxIXMmvmEyyvSDn -FcFikB8pAoGBAPF77hK4m3/rdGT7X8a/gwvZ2R121aBcdPwEaUhvj/36dx596zvY -mEOjrWfZhF083/nYWE2kVquj2wjs+otCLfifEEgXcVPTnEOPO9Zg3uNSL0nNQghj -FuD3iGLTUBCtM66oTe0jLSslHe8gLGEQqyMzHOzYxNqibxcOZIe8Qt0NAoGBAO+U -I5+XWjWEgDmvyC3TrOSf/KCGjtu0TSv30ipv27bDLMrpvPmD/5lpptTFwcxvVhCs -2b+chCjlghFSWFbBULBrfci2FtliClOVMYrlNBdUSJhf3aYSG2Doe6Bgt1n2CpNn -/iu37Y3NfemZBJA7hNl4dYe+f+uzM87cdQ214+jrAoGAXA0XxX8ll2+ToOLJsaNT -OvNB9h9Uc5qK5X5w+7G7O998BN2PC/MWp8H+2fVqpXgNENpNXttkRm1hk1dych86 -EunfdPuqsX+as44oCyJGFHVBnWpm33eWQw9YqANRI+pCJzP08I5WK3osnPiwshd+ -hR54yjgfYhBFNI7B95PmEQkCgYBzFSz7h1+s34Ycr8SvxsOBWxymG5zaCsUbPsL0 -4aCgLScCHb9J+E86aVbbVFdglYa5Id7DPTL61ixhl7WZjujspeXZGSbmq0Kcnckb -mDgqkLECiOJW2NHP/j0McAkDLL4tysF8TLDO8gvuvzNC+WQ6drO2ThrypLVZQ+ry -eBIPmwKBgEZxhqa0gVvHQG/7Od69KWj4eJP28kq13RhKay8JOoN0vPmspXJo1HY3 -CKuHRG+AP579dncdUnOMvfXOtkdM4vk0+hWASBQzM9xzVcztCa+koAugjVaLS9A+ -9uQoqEeVNTckxx0S2bYevRy7hGQmUJTyQm3j1zEUR5jpdbL83Fbq ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/sample_key.pub b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/sample_key.pub deleted file mode 100644 index 03dc982ac..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go/test/sample_key.pub +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4f5wg5l2hKsTeNem/V41 -fGnJm6gOdrj8ym3rFkEU/wT8RDtnSgFEZOQpHEgQ7JL38xUfU0Y3g6aYw9QT0hJ7 -mCpz9Er5qLaMXJwZxzHzAahlfA0icqabvJOMvQtzD6uQv6wPEyZtDTWiQi9AXwBp -HssPnpYGIn20ZZuNlX2BrClciHhCPUIIZOQn/MmqTD31jSyjoQoV7MhhMTATKJx2 -XrHhR+1DcKJzQBSTAGnpYVaqpsARap+nwRipr3nUTuxyGohBTSmjJ2usSeQXHI3b -ODIRe1AuTyHceAbewn8b462yEWKARdpd9AjQW5SIVPfdsz5B6GlYQ5LdYKtznTuy -7wIDAQAB ------END PUBLIC KEY----- diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/LICENSE b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/LICENSE deleted file mode 100644 index 6a66aea5e..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/PATENTS b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/PATENTS deleted file mode 100644 index 733099041..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google 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, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/gopkg.in/check.v1/LICENSE b/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/gopkg.in/check.v1/LICENSE deleted file mode 100644 index 545cf2d33..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/gopkg.in/check.v1/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Gocheck - A rich testing framework for Go - -Copyright (c) 2010-2013 Gustavo Niemeyer - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go deleted file mode 100644 index 45fc2e57c..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file implements CGI from the perspective of a child -// process. - -package cgi - -import ( - "bufio" - "crypto/tls" - "errors" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "strconv" - "strings" -) - -// Request returns the HTTP request as represented in the current -// environment. This assumes the current program is being run -// by a web server in a CGI environment. -// The returned Request's Body is populated, if applicable. -func Request() (*http.Request, error) { - r, err := RequestFromMap(envMap(os.Environ())) - if err != nil { - return nil, err - } - if r.ContentLength > 0 { - r.Body = ioutil.NopCloser(io.LimitReader(os.Stdin, r.ContentLength)) - } - return r, nil -} - -func envMap(env []string) map[string]string { - m := make(map[string]string) - for _, kv := range env { - if idx := strings.Index(kv, "="); idx != -1 { - m[kv[:idx]] = kv[idx+1:] - } - } - return m -} - -// RequestFromMap creates an http.Request from CGI variables. -// The returned Request's Body field is not populated. -func RequestFromMap(params map[string]string) (*http.Request, error) { - r := new(http.Request) - r.Method = params["REQUEST_METHOD"] - if r.Method == "" { - return nil, errors.New("cgi: no REQUEST_METHOD in environment") - } - - r.Proto = params["SERVER_PROTOCOL"] - var ok bool - r.ProtoMajor, r.ProtoMinor, ok = http.ParseHTTPVersion(r.Proto) - if !ok { - return nil, errors.New("cgi: invalid SERVER_PROTOCOL version") - } - - r.Close = true - r.Trailer = http.Header{} - r.Header = http.Header{} - - r.Host = params["HTTP_HOST"] - - if lenstr := params["CONTENT_LENGTH"]; lenstr != "" { - clen, err := strconv.ParseInt(lenstr, 10, 64) - if err != nil { - return nil, errors.New("cgi: bad CONTENT_LENGTH in environment: " + lenstr) - } - r.ContentLength = clen - } - - if ct := params["CONTENT_TYPE"]; ct != "" { - r.Header.Set("Content-Type", ct) - } - - // Copy "HTTP_FOO_BAR" variables to "Foo-Bar" Headers - for k, v := range params { - if !strings.HasPrefix(k, "HTTP_") || k == "HTTP_HOST" { - continue - } - r.Header.Add(strings.Replace(k[5:], "_", "-", -1), v) - } - - // TODO: cookies. parsing them isn't exported, though. - - uriStr := params["REQUEST_URI"] - if uriStr == "" { - // Fallback to SCRIPT_NAME, PATH_INFO and QUERY_STRING. - uriStr = params["SCRIPT_NAME"] + params["PATH_INFO"] - s := params["QUERY_STRING"] - if s != "" { - uriStr += "?" + s - } - } - - // There's apparently a de-facto standard for this. - // http://docstore.mik.ua/orelly/linux/cgi/ch03_02.htm#ch03-35636 - if s := params["HTTPS"]; s == "on" || s == "ON" || s == "1" { - r.TLS = &tls.ConnectionState{HandshakeComplete: true} - } - - if r.Host != "" { - // Hostname is provided, so we can reasonably construct a URL. - rawurl := r.Host + uriStr - if r.TLS == nil { - rawurl = "http://" + rawurl - } else { - rawurl = "https://" + rawurl - } - url, err := url.Parse(rawurl) - if err != nil { - return nil, errors.New("cgi: failed to parse host and REQUEST_URI into a URL: " + rawurl) - } - r.URL = url - } - // Fallback logic if we don't have a Host header or the URL - // failed to parse - if r.URL == nil { - url, err := url.Parse(uriStr) - if err != nil { - return nil, errors.New("cgi: failed to parse REQUEST_URI into a URL: " + uriStr) - } - r.URL = url - } - - // Request.RemoteAddr has its port set by Go's standard http - // server, so we do here too. We don't have one, though, so we - // use a dummy one. - r.RemoteAddr = net.JoinHostPort(params["REMOTE_ADDR"], "0") - - return r, nil -} - -// Serve executes the provided Handler on the currently active CGI -// request, if any. If there's no current CGI environment -// an error is returned. The provided handler may be nil to use -// http.DefaultServeMux. -func Serve(handler http.Handler) error { - req, err := Request() - if err != nil { - return err - } - if handler == nil { - handler = http.DefaultServeMux - } - rw := &response{ - req: req, - header: make(http.Header), - bufw: bufio.NewWriter(os.Stdout), - } - handler.ServeHTTP(rw, req) - rw.Write(nil) // make sure a response is sent - if err = rw.bufw.Flush(); err != nil { - return err - } - return nil -} - -type response struct { - req *http.Request - header http.Header - bufw *bufio.Writer - headerSent bool -} - -func (r *response) Flush() { - r.bufw.Flush() -} - -func (r *response) Header() http.Header { - return r.header -} - -func (r *response) Write(p []byte) (n int, err error) { - if !r.headerSent { - r.WriteHeader(http.StatusOK) - } - return r.bufw.Write(p) -} - -func (r *response) WriteHeader(code int) { - if r.headerSent { - // Note: explicitly using Stderr, as Stdout is our HTTP output. - fmt.Fprintf(os.Stderr, "CGI attempted to write header twice on request for %s", r.req.URL) - return - } - r.headerSent = true - fmt.Fprintf(r.bufw, "Status: %d %s\r\n", code, http.StatusText(code)) - - // Set a default Content-Type - if _, hasType := r.header["Content-Type"]; !hasType { - r.header.Add("Content-Type", "text/html; charset=utf-8") - } - - r.header.Write(r.bufw) - r.bufw.WriteString("\r\n") - r.bufw.Flush() -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go deleted file mode 100644 index ec95a972c..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file implements the host side of CGI (being the webserver -// parent process). - -// Package cgi implements CGI (Common Gateway Interface) as specified -// in RFC 3875. -// -// Note that using CGI means starting a new process to handle each -// request, which is typically less efficient than using a -// long-running server. This package is intended primarily for -// compatibility with existing systems. -package cgi - -import ( - "bufio" - "fmt" - "io" - "log" - "net/http" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" -) - -var trailingPort = regexp.MustCompile(`:([0-9]+)$`) - -var osDefaultInheritEnv = map[string][]string{ - "darwin": {"DYLD_LIBRARY_PATH"}, - "freebsd": {"LD_LIBRARY_PATH"}, - "hpux": {"LD_LIBRARY_PATH", "SHLIB_PATH"}, - "irix": {"LD_LIBRARY_PATH", "LD_LIBRARYN32_PATH", "LD_LIBRARY64_PATH"}, - "linux": {"LD_LIBRARY_PATH"}, - "openbsd": {"LD_LIBRARY_PATH"}, - "solaris": {"LD_LIBRARY_PATH", "LD_LIBRARY_PATH_32", "LD_LIBRARY_PATH_64"}, - "windows": {"SystemRoot", "COMSPEC", "PATHEXT", "WINDIR"}, -} - -// Handler runs an executable in a subprocess with a CGI environment. -type Handler struct { - Path string // path to the CGI executable - Root string // root URI prefix of handler or empty for "/" - - // Dir specifies the CGI executable's working directory. - // If Dir is empty, the base directory of Path is used. - // If Path has no base directory, the current working - // directory is used. - Dir string - - Env []string // extra environment variables to set, if any, as "key=value" - InheritEnv []string // environment variables to inherit from host, as "key" - Logger *log.Logger // optional log for errors or nil to use log.Print - Args []string // optional arguments to pass to child process - - // PathLocationHandler specifies the root http Handler that - // should handle internal redirects when the CGI process - // returns a Location header value starting with a "/", as - // specified in RFC 3875 § 6.3.2. This will likely be - // http.DefaultServeMux. - // - // If nil, a CGI response with a local URI path is instead sent - // back to the client and not redirected internally. - PathLocationHandler http.Handler -} - -// removeLeadingDuplicates remove leading duplicate in environments. -// It's possible to override environment like following. -// cgi.Handler{ -// ... -// Env: []string{"SCRIPT_FILENAME=foo.php"}, -// } -func removeLeadingDuplicates(env []string) (ret []string) { - n := len(env) - for i := 0; i < n; i++ { - e := env[i] - s := strings.SplitN(e, "=", 2)[0] - found := false - for j := i + 1; j < n; j++ { - if s == strings.SplitN(env[j], "=", 2)[0] { - found = true - break - } - } - if !found { - ret = append(ret, e) - } - } - return -} - -func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { - root := h.Root - if root == "" { - root = "/" - } - - if len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == "chunked" { - rw.WriteHeader(http.StatusBadRequest) - rw.Write([]byte("Chunked request bodies are not supported by CGI.")) - return - } - - pathInfo := req.URL.Path - if root != "/" && strings.HasPrefix(pathInfo, root) { - pathInfo = pathInfo[len(root):] - } - - port := "80" - if matches := trailingPort.FindStringSubmatch(req.Host); len(matches) != 0 { - port = matches[1] - } - - env := []string{ - "SERVER_SOFTWARE=go", - "SERVER_NAME=" + req.Host, - "SERVER_PROTOCOL=HTTP/1.1", - "HTTP_HOST=" + req.Host, - "GATEWAY_INTERFACE=CGI/1.1", - "REQUEST_METHOD=" + req.Method, - "QUERY_STRING=" + req.URL.RawQuery, - "REQUEST_URI=" + req.URL.RequestURI(), - "PATH_INFO=" + pathInfo, - "SCRIPT_NAME=" + root, - "SCRIPT_FILENAME=" + h.Path, - "REMOTE_ADDR=" + req.RemoteAddr, - "REMOTE_HOST=" + req.RemoteAddr, - "SERVER_PORT=" + port, - } - - if req.TLS != nil { - env = append(env, "HTTPS=on") - } - - for k, v := range req.Header { - k = strings.Map(upperCaseAndUnderscore, k) - joinStr := ", " - if k == "COOKIE" { - joinStr = "; " - } - env = append(env, "HTTP_"+k+"="+strings.Join(v, joinStr)) - } - - if req.ContentLength > 0 { - env = append(env, fmt.Sprintf("CONTENT_LENGTH=%d", req.ContentLength)) - } - if ctype := req.Header.Get("Content-Type"); ctype != "" { - env = append(env, "CONTENT_TYPE="+ctype) - } - - if h.Env != nil { - env = append(env, h.Env...) - } - - envPath := os.Getenv("PATH") - if envPath == "" { - envPath = "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin" - } - env = append(env, "PATH="+envPath) - - for _, e := range h.InheritEnv { - if v := os.Getenv(e); v != "" { - env = append(env, e+"="+v) - } - } - - for _, e := range osDefaultInheritEnv[runtime.GOOS] { - if v := os.Getenv(e); v != "" { - env = append(env, e+"="+v) - } - } - - env = removeLeadingDuplicates(env) - - var cwd, path string - if h.Dir != "" { - path = h.Path - cwd = h.Dir - } else { - cwd, path = filepath.Split(h.Path) - } - if cwd == "" { - cwd = "." - } - - internalError := func(err error) { - rw.WriteHeader(http.StatusInternalServerError) - h.printf("CGI error: %v", err) - } - - cmd := &exec.Cmd{ - Path: path, - Args: append([]string{h.Path}, h.Args...), - Dir: cwd, - Env: env, - Stderr: os.Stderr, // for now - } - if req.ContentLength != 0 { - cmd.Stdin = req.Body - } - stdoutRead, err := cmd.StdoutPipe() - if err != nil { - internalError(err) - return - } - - err = cmd.Start() - if err != nil { - internalError(err) - return - } - if hook := testHookStartProcess; hook != nil { - hook(cmd.Process) - } - defer cmd.Wait() - defer stdoutRead.Close() - - linebody := bufio.NewReaderSize(stdoutRead, 1024) - headers := make(http.Header) - statusCode := 0 - headerLines := 0 - sawBlankLine := false - for { - line, isPrefix, err := linebody.ReadLine() - if isPrefix { - rw.WriteHeader(http.StatusInternalServerError) - h.printf("cgi: long header line from subprocess.") - return - } - if err == io.EOF { - break - } - if err != nil { - rw.WriteHeader(http.StatusInternalServerError) - h.printf("cgi: error reading headers: %v", err) - return - } - if len(line) == 0 { - sawBlankLine = true - break - } - headerLines++ - parts := strings.SplitN(string(line), ":", 2) - if len(parts) < 2 { - h.printf("cgi: bogus header line: %s", string(line)) - continue - } - header, val := parts[0], parts[1] - header = strings.TrimSpace(header) - val = strings.TrimSpace(val) - switch { - case header == "Status": - if len(val) < 3 { - h.printf("cgi: bogus status (short): %q", val) - return - } - code, err := strconv.Atoi(val[0:3]) - if err != nil { - h.printf("cgi: bogus status: %q", val) - h.printf("cgi: line was %q", line) - return - } - statusCode = code - default: - headers.Add(header, val) - } - } - if headerLines == 0 || !sawBlankLine { - rw.WriteHeader(http.StatusInternalServerError) - h.printf("cgi: no headers") - return - } - - if loc := headers.Get("Location"); loc != "" { - if strings.HasPrefix(loc, "/") && h.PathLocationHandler != nil { - h.handleInternalRedirect(rw, req, loc) - return - } - if statusCode == 0 { - statusCode = http.StatusFound - } - } - - if statusCode == 0 && headers.Get("Content-Type") == "" { - rw.WriteHeader(http.StatusInternalServerError) - h.printf("cgi: missing required Content-Type in headers") - return - } - - if statusCode == 0 { - statusCode = http.StatusOK - } - - // Copy headers to rw's headers, after we've decided not to - // go into handleInternalRedirect, which won't want its rw - // headers to have been touched. - for k, vv := range headers { - for _, v := range vv { - rw.Header().Add(k, v) - } - } - - rw.WriteHeader(statusCode) - - _, err = io.Copy(rw, linebody) - if err != nil { - h.printf("cgi: copy error: %v", err) - // And kill the child CGI process so we don't hang on - // the deferred cmd.Wait above if the error was just - // the client (rw) going away. If it was a read error - // (because the child died itself), then the extra - // kill of an already-dead process is harmless (the PID - // won't be reused until the Wait above). - cmd.Process.Kill() - } -} - -func (h *Handler) printf(format string, v ...interface{}) { - if h.Logger != nil { - h.Logger.Printf(format, v...) - } else { - log.Printf(format, v...) - } -} - -func (h *Handler) handleInternalRedirect(rw http.ResponseWriter, req *http.Request, path string) { - url, err := req.URL.Parse(path) - if err != nil { - rw.WriteHeader(http.StatusInternalServerError) - h.printf("cgi: error resolving local URI path %q: %v", path, err) - return - } - // TODO: RFC 3875 isn't clear if only GET is supported, but it - // suggests so: "Note that any message-body attached to the - // request (such as for a POST request) may not be available - // to the resource that is the target of the redirect." We - // should do some tests against Apache to see how it handles - // POST, HEAD, etc. Does the internal redirect get the same - // method or just GET? What about incoming headers? - // (e.g. Cookies) Which headers, if any, are copied into the - // second request? - newReq := &http.Request{ - Method: "GET", - URL: url, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: make(http.Header), - Host: url.Host, - RemoteAddr: req.RemoteAddr, - TLS: req.TLS, - } - h.PathLocationHandler.ServeHTTP(rw, newReq) -} - -func upperCaseAndUnderscore(r rune) rune { - switch { - case r >= 'a' && r <= 'z': - return r - ('a' - 'A') - case r == '-': - return '_' - case r == '=': - // Maybe not part of the CGI 'spec' but would mess up - // the environment in any case, as Go represents the - // environment as a slice of "key=value" strings. - return '_' - } - // TODO: other transformations in spec or practice? - return r -} - -var testHookStartProcess func(*os.Process) // nil except for some tests diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go deleted file mode 100644 index 389ab58e4..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar. -package cookiejar - -import ( - "errors" - "fmt" - "net" - "net/http" - "net/url" - "sort" - "strings" - "sync" - "time" -) - -// PublicSuffixList provides the public suffix of a domain. For example: -// - the public suffix of "example.com" is "com", -// - the public suffix of "foo1.foo2.foo3.co.uk" is "co.uk", and -// - the public suffix of "bar.pvt.k12.ma.us" is "pvt.k12.ma.us". -// -// Implementations of PublicSuffixList must be safe for concurrent use by -// multiple goroutines. -// -// An implementation that always returns "" is valid and may be useful for -// testing but it is not secure: it means that the HTTP server for foo.com can -// set a cookie for bar.com. -// -// A public suffix list implementation is in the package -// code.google.com/p/go.net/publicsuffix. -type PublicSuffixList interface { - // PublicSuffix returns the public suffix of domain. - // - // TODO: specify which of the caller and callee is responsible for IP - // addresses, for leading and trailing dots, for case sensitivity, and - // for IDN/Punycode. - PublicSuffix(domain string) string - - // String returns a description of the source of this public suffix - // list. The description will typically contain something like a time - // stamp or version number. - String() string -} - -// Options are the options for creating a new Jar. -type Options struct { - // PublicSuffixList is the public suffix list that determines whether - // an HTTP server can set a cookie for a domain. - // - // A nil value is valid and may be useful for testing but it is not - // secure: it means that the HTTP server for foo.co.uk can set a cookie - // for bar.co.uk. - PublicSuffixList PublicSuffixList -} - -// Jar implements the http.CookieJar interface from the net/http package. -type Jar struct { - psList PublicSuffixList - - // mu locks the remaining fields. - mu sync.Mutex - - // entries is a set of entries, keyed by their eTLD+1 and subkeyed by - // their name/domain/path. - entries map[string]map[string]entry - - // nextSeqNum is the next sequence number assigned to a new cookie - // created SetCookies. - nextSeqNum uint64 -} - -// New returns a new cookie jar. A nil *Options is equivalent to a zero -// Options. -func New(o *Options) (*Jar, error) { - jar := &Jar{ - entries: make(map[string]map[string]entry), - } - if o != nil { - jar.psList = o.PublicSuffixList - } - return jar, nil -} - -// entry is the internal representation of a cookie. -// -// This struct type is not used outside of this package per se, but the exported -// fields are those of RFC 6265. -type entry struct { - Name string - Value string - Domain string - Path string - Secure bool - HttpOnly bool - Persistent bool - HostOnly bool - Expires time.Time - Creation time.Time - LastAccess time.Time - - // seqNum is a sequence number so that Cookies returns cookies in a - // deterministic order, even for cookies that have equal Path length and - // equal Creation time. This simplifies testing. - seqNum uint64 -} - -// Id returns the domain;path;name triple of e as an id. -func (e *entry) id() string { - return fmt.Sprintf("%s;%s;%s", e.Domain, e.Path, e.Name) -} - -// shouldSend determines whether e's cookie qualifies to be included in a -// request to host/path. It is the caller's responsibility to check if the -// cookie is expired. -func (e *entry) shouldSend(https bool, host, path string) bool { - return e.domainMatch(host) && e.pathMatch(path) && (https || !e.Secure) -} - -// domainMatch implements "domain-match" of RFC 6265 section 5.1.3. -func (e *entry) domainMatch(host string) bool { - if e.Domain == host { - return true - } - return !e.HostOnly && hasDotSuffix(host, e.Domain) -} - -// pathMatch implements "path-match" according to RFC 6265 section 5.1.4. -func (e *entry) pathMatch(requestPath string) bool { - if requestPath == e.Path { - return true - } - if strings.HasPrefix(requestPath, e.Path) { - if e.Path[len(e.Path)-1] == '/' { - return true // The "/any/" matches "/any/path" case. - } else if requestPath[len(e.Path)] == '/' { - return true // The "/any" matches "/any/path" case. - } - } - return false -} - -// hasDotSuffix reports whether s ends in "."+suffix. -func hasDotSuffix(s, suffix string) bool { - return len(s) > len(suffix) && s[len(s)-len(suffix)-1] == '.' && s[len(s)-len(suffix):] == suffix -} - -// byPathLength is a []entry sort.Interface that sorts according to RFC 6265 -// section 5.4 point 2: by longest path and then by earliest creation time. -type byPathLength []entry - -func (s byPathLength) Len() int { return len(s) } - -func (s byPathLength) Less(i, j int) bool { - if len(s[i].Path) != len(s[j].Path) { - return len(s[i].Path) > len(s[j].Path) - } - if !s[i].Creation.Equal(s[j].Creation) { - return s[i].Creation.Before(s[j].Creation) - } - return s[i].seqNum < s[j].seqNum -} - -func (s byPathLength) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// Cookies implements the Cookies method of the http.CookieJar interface. -// -// It returns an empty slice if the URL's scheme is not HTTP or HTTPS. -func (j *Jar) Cookies(u *url.URL) (cookies []*http.Cookie) { - return j.cookies(u, time.Now()) -} - -// cookies is like Cookies but takes the current time as a parameter. -func (j *Jar) cookies(u *url.URL, now time.Time) (cookies []*http.Cookie) { - if u.Scheme != "http" && u.Scheme != "https" { - return cookies - } - host, err := canonicalHost(u.Host) - if err != nil { - return cookies - } - key := jarKey(host, j.psList) - - j.mu.Lock() - defer j.mu.Unlock() - - submap := j.entries[key] - if submap == nil { - return cookies - } - - https := u.Scheme == "https" - path := u.Path - if path == "" { - path = "/" - } - - modified := false - var selected []entry - for id, e := range submap { - if e.Persistent && !e.Expires.After(now) { - delete(submap, id) - modified = true - continue - } - if !e.shouldSend(https, host, path) { - continue - } - e.LastAccess = now - submap[id] = e - selected = append(selected, e) - modified = true - } - if modified { - if len(submap) == 0 { - delete(j.entries, key) - } else { - j.entries[key] = submap - } - } - - sort.Sort(byPathLength(selected)) - for _, e := range selected { - cookies = append(cookies, &http.Cookie{Name: e.Name, Value: e.Value}) - } - - return cookies -} - -// SetCookies implements the SetCookies method of the http.CookieJar interface. -// -// It does nothing if the URL's scheme is not HTTP or HTTPS. -func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie) { - j.setCookies(u, cookies, time.Now()) -} - -// setCookies is like SetCookies but takes the current time as parameter. -func (j *Jar) setCookies(u *url.URL, cookies []*http.Cookie, now time.Time) { - if len(cookies) == 0 { - return - } - if u.Scheme != "http" && u.Scheme != "https" { - return - } - host, err := canonicalHost(u.Host) - if err != nil { - return - } - key := jarKey(host, j.psList) - defPath := defaultPath(u.Path) - - j.mu.Lock() - defer j.mu.Unlock() - - submap := j.entries[key] - - modified := false - for _, cookie := range cookies { - e, remove, err := j.newEntry(cookie, now, defPath, host) - if err != nil { - continue - } - id := e.id() - if remove { - if submap != nil { - if _, ok := submap[id]; ok { - delete(submap, id) - modified = true - } - } - continue - } - if submap == nil { - submap = make(map[string]entry) - } - - if old, ok := submap[id]; ok { - e.Creation = old.Creation - e.seqNum = old.seqNum - } else { - e.Creation = now - e.seqNum = j.nextSeqNum - j.nextSeqNum++ - } - e.LastAccess = now - submap[id] = e - modified = true - } - - if modified { - if len(submap) == 0 { - delete(j.entries, key) - } else { - j.entries[key] = submap - } - } -} - -// canonicalHost strips port from host if present and returns the canonicalized -// host name. -func canonicalHost(host string) (string, error) { - var err error - host = strings.ToLower(host) - if hasPort(host) { - host, _, err = net.SplitHostPort(host) - if err != nil { - return "", err - } - } - if strings.HasSuffix(host, ".") { - // Strip trailing dot from fully qualified domain names. - host = host[:len(host)-1] - } - return toASCII(host) -} - -// hasPort reports whether host contains a port number. host may be a host -// name, an IPv4 or an IPv6 address. -func hasPort(host string) bool { - colons := strings.Count(host, ":") - if colons == 0 { - return false - } - if colons == 1 { - return true - } - return host[0] == '[' && strings.Contains(host, "]:") -} - -// jarKey returns the key to use for a jar. -func jarKey(host string, psl PublicSuffixList) string { - if isIP(host) { - return host - } - - var i int - if psl == nil { - i = strings.LastIndex(host, ".") - if i == -1 { - return host - } - } else { - suffix := psl.PublicSuffix(host) - if suffix == host { - return host - } - i = len(host) - len(suffix) - if i <= 0 || host[i-1] != '.' { - // The provided public suffix list psl is broken. - // Storing cookies under host is a safe stopgap. - return host - } - } - prevDot := strings.LastIndex(host[:i-1], ".") - return host[prevDot+1:] -} - -// isIP reports whether host is an IP address. -func isIP(host string) bool { - return net.ParseIP(host) != nil -} - -// defaultPath returns the directory part of an URL's path according to -// RFC 6265 section 5.1.4. -func defaultPath(path string) string { - if len(path) == 0 || path[0] != '/' { - return "/" // Path is empty or malformed. - } - - i := strings.LastIndex(path, "/") // Path starts with "/", so i != -1. - if i == 0 { - return "/" // Path has the form "/abc". - } - return path[:i] // Path is either of form "/abc/xyz" or "/abc/xyz/". -} - -// newEntry creates an entry from a http.Cookie c. now is the current time and -// is compared to c.Expires to determine deletion of c. defPath and host are the -// default-path and the canonical host name of the URL c was received from. -// -// remove records whether the jar should delete this cookie, as it has already -// expired with respect to now. In this case, e may be incomplete, but it will -// be valid to call e.id (which depends on e's Name, Domain and Path). -// -// A malformed c.Domain will result in an error. -func (j *Jar) newEntry(c *http.Cookie, now time.Time, defPath, host string) (e entry, remove bool, err error) { - e.Name = c.Name - - if c.Path == "" || c.Path[0] != '/' { - e.Path = defPath - } else { - e.Path = c.Path - } - - e.Domain, e.HostOnly, err = j.domainAndType(host, c.Domain) - if err != nil { - return e, false, err - } - - // MaxAge takes precedence over Expires. - if c.MaxAge < 0 { - return e, true, nil - } else if c.MaxAge > 0 { - e.Expires = now.Add(time.Duration(c.MaxAge) * time.Second) - e.Persistent = true - } else { - if c.Expires.IsZero() { - e.Expires = endOfTime - e.Persistent = false - } else { - if !c.Expires.After(now) { - return e, true, nil - } - e.Expires = c.Expires - e.Persistent = true - } - } - - e.Value = c.Value - e.Secure = c.Secure - e.HttpOnly = c.HttpOnly - - return e, false, nil -} - -var ( - errIllegalDomain = errors.New("cookiejar: illegal cookie domain attribute") - errMalformedDomain = errors.New("cookiejar: malformed cookie domain attribute") - errNoHostname = errors.New("cookiejar: no host name available (IP only)") -) - -// endOfTime is the time when session (non-persistent) cookies expire. -// This instant is representable in most date/time formats (not just -// Go's time.Time) and should be far enough in the future. -var endOfTime = time.Date(9999, 12, 31, 23, 59, 59, 0, time.UTC) - -// domainAndType determines the cookie's domain and hostOnly attribute. -func (j *Jar) domainAndType(host, domain string) (string, bool, error) { - if domain == "" { - // No domain attribute in the SetCookie header indicates a - // host cookie. - return host, true, nil - } - - if isIP(host) { - // According to RFC 6265 domain-matching includes not being - // an IP address. - // TODO: This might be relaxed as in common browsers. - return "", false, errNoHostname - } - - // From here on: If the cookie is valid, it is a domain cookie (with - // the one exception of a public suffix below). - // See RFC 6265 section 5.2.3. - if domain[0] == '.' { - domain = domain[1:] - } - - if len(domain) == 0 || domain[0] == '.' { - // Received either "Domain=." or "Domain=..some.thing", - // both are illegal. - return "", false, errMalformedDomain - } - domain = strings.ToLower(domain) - - if domain[len(domain)-1] == '.' { - // We received stuff like "Domain=www.example.com.". - // Browsers do handle such stuff (actually differently) but - // RFC 6265 seems to be clear here (e.g. section 4.1.2.3) in - // requiring a reject. 4.1.2.3 is not normative, but - // "Domain Matching" (5.1.3) and "Canonicalized Host Names" - // (5.1.2) are. - return "", false, errMalformedDomain - } - - // See RFC 6265 section 5.3 #5. - if j.psList != nil { - if ps := j.psList.PublicSuffix(domain); ps != "" && !hasDotSuffix(domain, ps) { - if host == domain { - // This is the one exception in which a cookie - // with a domain attribute is a host cookie. - return host, true, nil - } - return "", false, errIllegalDomain - } - } - - // The domain must domain-match host: www.mycompany.com cannot - // set cookies for .ourcompetitors.com. - if host != domain && !hasDotSuffix(host, domain) { - return "", false, errIllegalDomain - } - - return domain, false, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go deleted file mode 100644 index ea7ceb5ef..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cookiejar - -// This file implements the Punycode algorithm from RFC 3492. - -import ( - "fmt" - "strings" - "unicode/utf8" -) - -// These parameter values are specified in section 5. -// -// All computation is done with int32s, so that overflow behavior is identical -// regardless of whether int is 32-bit or 64-bit. -const ( - base int32 = 36 - damp int32 = 700 - initialBias int32 = 72 - initialN int32 = 128 - skew int32 = 38 - tmax int32 = 26 - tmin int32 = 1 -) - -// encode encodes a string as specified in section 6.3 and prepends prefix to -// the result. -// -// The "while h < length(input)" line in the specification becomes "for -// remaining != 0" in the Go code, because len(s) in Go is in bytes, not runes. -func encode(prefix, s string) (string, error) { - output := make([]byte, len(prefix), len(prefix)+1+2*len(s)) - copy(output, prefix) - delta, n, bias := int32(0), initialN, initialBias - b, remaining := int32(0), int32(0) - for _, r := range s { - if r < 0x80 { - b++ - output = append(output, byte(r)) - } else { - remaining++ - } - } - h := b - if b > 0 { - output = append(output, '-') - } - for remaining != 0 { - m := int32(0x7fffffff) - for _, r := range s { - if m > r && r >= n { - m = r - } - } - delta += (m - n) * (h + 1) - if delta < 0 { - return "", fmt.Errorf("cookiejar: invalid label %q", s) - } - n = m - for _, r := range s { - if r < n { - delta++ - if delta < 0 { - return "", fmt.Errorf("cookiejar: invalid label %q", s) - } - continue - } - if r > n { - continue - } - q := delta - for k := base; ; k += base { - t := k - bias - if t < tmin { - t = tmin - } else if t > tmax { - t = tmax - } - if q < t { - break - } - output = append(output, encodeDigit(t+(q-t)%(base-t))) - q = (q - t) / (base - t) - } - output = append(output, encodeDigit(q)) - bias = adapt(delta, h+1, h == b) - delta = 0 - h++ - remaining-- - } - delta++ - n++ - } - return string(output), nil -} - -func encodeDigit(digit int32) byte { - switch { - case 0 <= digit && digit < 26: - return byte(digit + 'a') - case 26 <= digit && digit < 36: - return byte(digit + ('0' - 26)) - } - panic("cookiejar: internal error in punycode encoding") -} - -// adapt is the bias adaptation function specified in section 6.1. -func adapt(delta, numPoints int32, firstTime bool) int32 { - if firstTime { - delta /= damp - } else { - delta /= 2 - } - delta += delta / numPoints - k := int32(0) - for delta > ((base-tmin)*tmax)/2 { - delta /= base - tmin - k += base - } - return k + (base-tmin+1)*delta/(delta+skew) -} - -// Strictly speaking, the remaining code below deals with IDNA (RFC 5890 and -// friends) and not Punycode (RFC 3492) per se. - -// acePrefix is the ASCII Compatible Encoding prefix. -const acePrefix = "xn--" - -// toASCII converts a domain or domain label to its ASCII form. For example, -// toASCII("bücher.example.com") is "xn--bcher-kva.example.com", and -// toASCII("golang") is "golang". -func toASCII(s string) (string, error) { - if ascii(s) { - return s, nil - } - labels := strings.Split(s, ".") - for i, label := range labels { - if !ascii(label) { - a, err := encode(acePrefix, label) - if err != nil { - return "", err - } - labels[i] = a - } - } - return strings.Join(labels, "."), nil -} - -func ascii(s string) bool { - for i := 0; i < len(s); i++ { - if s[i] >= utf8.RuneSelf { - return false - } - } - return true -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go deleted file mode 100644 index a3beaa33a..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package fcgi - -// This file implements FastCGI from the perspective of a child process. - -import ( - "errors" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/http/cgi" - "os" - "strings" - "sync" - "time" -) - -// request holds the state for an in-progress request. As soon as it's complete, -// it's converted to an http.Request. -type request struct { - pw *io.PipeWriter - reqId uint16 - params map[string]string - buf [1024]byte - rawParams []byte - keepConn bool -} - -func newRequest(reqId uint16, flags uint8) *request { - r := &request{ - reqId: reqId, - params: map[string]string{}, - keepConn: flags&flagKeepConn != 0, - } - r.rawParams = r.buf[:0] - return r -} - -// parseParams reads an encoded []byte into Params. -func (r *request) parseParams() { - text := r.rawParams - r.rawParams = nil - for len(text) > 0 { - keyLen, n := readSize(text) - if n == 0 { - return - } - text = text[n:] - valLen, n := readSize(text) - if n == 0 { - return - } - text = text[n:] - key := readString(text, keyLen) - text = text[keyLen:] - val := readString(text, valLen) - text = text[valLen:] - r.params[key] = val - } -} - -// response implements http.ResponseWriter. -type response struct { - req *request - header http.Header - w *bufWriter - wroteHeader bool -} - -func newResponse(c *child, req *request) *response { - return &response{ - req: req, - header: http.Header{}, - w: newWriter(c.conn, typeStdout, req.reqId), - } -} - -func (r *response) Header() http.Header { - return r.header -} - -func (r *response) Write(data []byte) (int, error) { - if !r.wroteHeader { - r.WriteHeader(http.StatusOK) - } - return r.w.Write(data) -} - -func (r *response) WriteHeader(code int) { - if r.wroteHeader { - return - } - r.wroteHeader = true - if code == http.StatusNotModified { - // Must not have body. - r.header.Del("Content-Type") - r.header.Del("Content-Length") - r.header.Del("Transfer-Encoding") - } else if r.header.Get("Content-Type") == "" { - r.header.Set("Content-Type", "text/html; charset=utf-8") - } - - if r.header.Get("Date") == "" { - r.header.Set("Date", time.Now().UTC().Format(http.TimeFormat)) - } - - fmt.Fprintf(r.w, "Status: %d %s\r\n", code, http.StatusText(code)) - r.header.Write(r.w) - r.w.WriteString("\r\n") -} - -func (r *response) Flush() { - if !r.wroteHeader { - r.WriteHeader(http.StatusOK) - } - r.w.Flush() -} - -func (r *response) Close() error { - r.Flush() - return r.w.Close() -} - -type child struct { - conn *conn - handler http.Handler - - mu sync.Mutex // protects requests: - requests map[uint16]*request // keyed by request ID -} - -func newChild(rwc io.ReadWriteCloser, handler http.Handler) *child { - return &child{ - conn: newConn(rwc), - handler: handler, - requests: make(map[uint16]*request), - } -} - -func (c *child) serve() { - defer c.conn.Close() - var rec record - for { - if err := rec.read(c.conn.rwc); err != nil { - return - } - if err := c.handleRecord(&rec); err != nil { - return - } - } -} - -var errCloseConn = errors.New("fcgi: connection should be closed") - -var emptyBody = ioutil.NopCloser(strings.NewReader("")) - -func (c *child) handleRecord(rec *record) error { - c.mu.Lock() - req, ok := c.requests[rec.h.Id] - c.mu.Unlock() - if !ok && rec.h.Type != typeBeginRequest && rec.h.Type != typeGetValues { - // The spec says to ignore unknown request IDs. - return nil - } - - switch rec.h.Type { - case typeBeginRequest: - if req != nil { - // The server is trying to begin a request with the same ID - // as an in-progress request. This is an error. - return errors.New("fcgi: received ID that is already in-flight") - } - - var br beginRequest - if err := br.read(rec.content()); err != nil { - return err - } - if br.role != roleResponder { - c.conn.writeEndRequest(rec.h.Id, 0, statusUnknownRole) - return nil - } - req = newRequest(rec.h.Id, br.flags) - c.mu.Lock() - c.requests[rec.h.Id] = req - c.mu.Unlock() - return nil - case typeParams: - // NOTE(eds): Technically a key-value pair can straddle the boundary - // between two packets. We buffer until we've received all parameters. - if len(rec.content()) > 0 { - req.rawParams = append(req.rawParams, rec.content()...) - return nil - } - req.parseParams() - return nil - case typeStdin: - content := rec.content() - if req.pw == nil { - var body io.ReadCloser - if len(content) > 0 { - // body could be an io.LimitReader, but it shouldn't matter - // as long as both sides are behaving. - body, req.pw = io.Pipe() - } else { - body = emptyBody - } - go c.serveRequest(req, body) - } - if len(content) > 0 { - // TODO(eds): This blocks until the handler reads from the pipe. - // If the handler takes a long time, it might be a problem. - req.pw.Write(content) - } else if req.pw != nil { - req.pw.Close() - } - return nil - case typeGetValues: - values := map[string]string{"FCGI_MPXS_CONNS": "1"} - c.conn.writePairs(typeGetValuesResult, 0, values) - return nil - case typeData: - // If the filter role is implemented, read the data stream here. - return nil - case typeAbortRequest: - println("abort") - c.mu.Lock() - delete(c.requests, rec.h.Id) - c.mu.Unlock() - c.conn.writeEndRequest(rec.h.Id, 0, statusRequestComplete) - if !req.keepConn { - // connection will close upon return - return errCloseConn - } - return nil - default: - b := make([]byte, 8) - b[0] = byte(rec.h.Type) - c.conn.writeRecord(typeUnknownType, 0, b) - return nil - } -} - -func (c *child) serveRequest(req *request, body io.ReadCloser) { - r := newResponse(c, req) - httpReq, err := cgi.RequestFromMap(req.params) - if err != nil { - // there was an error reading the request - r.WriteHeader(http.StatusInternalServerError) - c.conn.writeRecord(typeStderr, req.reqId, []byte(err.Error())) - } else { - httpReq.Body = body - c.handler.ServeHTTP(r, httpReq) - } - r.Close() - c.mu.Lock() - delete(c.requests, req.reqId) - c.mu.Unlock() - c.conn.writeEndRequest(req.reqId, 0, statusRequestComplete) - - // Consume the entire body, so the host isn't still writing to - // us when we close the socket below in the !keepConn case, - // otherwise we'd send a RST. (golang.org/issue/4183) - // TODO(bradfitz): also bound this copy in time. Or send - // some sort of abort request to the host, so the host - // can properly cut off the client sending all the data. - // For now just bound it a little and - io.CopyN(ioutil.Discard, body, 100<<20) - body.Close() - - if !req.keepConn { - c.conn.Close() - } -} - -// Serve accepts incoming FastCGI connections on the listener l, creating a new -// goroutine for each. The goroutine reads requests and then calls handler -// to reply to them. -// If l is nil, Serve accepts connections from os.Stdin. -// If handler is nil, http.DefaultServeMux is used. -func Serve(l net.Listener, handler http.Handler) error { - if l == nil { - var err error - l, err = net.FileListener(os.Stdin) - if err != nil { - return err - } - defer l.Close() - } - if handler == nil { - handler = http.DefaultServeMux - } - for { - rw, err := l.Accept() - if err != nil { - return err - } - c := newChild(rw, handler) - go c.serve() - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go deleted file mode 100644 index 06bba0488..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package fcgi implements the FastCGI protocol. -// Currently only the responder role is supported. -// The protocol is defined at http://www.fastcgi.com/drupal/node/6?q=node/22 -package fcgi - -// This file defines the raw protocol and some utilities used by the child and -// the host. - -import ( - "bufio" - "bytes" - "encoding/binary" - "errors" - "io" - "sync" -) - -// recType is a record type, as defined by -// http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S8 -type recType uint8 - -const ( - typeBeginRequest recType = 1 - typeAbortRequest recType = 2 - typeEndRequest recType = 3 - typeParams recType = 4 - typeStdin recType = 5 - typeStdout recType = 6 - typeStderr recType = 7 - typeData recType = 8 - typeGetValues recType = 9 - typeGetValuesResult recType = 10 - typeUnknownType recType = 11 -) - -// keep the connection between web-server and responder open after request -const flagKeepConn = 1 - -const ( - maxWrite = 65535 // maximum record body - maxPad = 255 -) - -const ( - roleResponder = iota + 1 // only Responders are implemented. - roleAuthorizer - roleFilter -) - -const ( - statusRequestComplete = iota - statusCantMultiplex - statusOverloaded - statusUnknownRole -) - -const headerLen = 8 - -type header struct { - Version uint8 - Type recType - Id uint16 - ContentLength uint16 - PaddingLength uint8 - Reserved uint8 -} - -type beginRequest struct { - role uint16 - flags uint8 - reserved [5]uint8 -} - -func (br *beginRequest) read(content []byte) error { - if len(content) != 8 { - return errors.New("fcgi: invalid begin request record") - } - br.role = binary.BigEndian.Uint16(content) - br.flags = content[2] - return nil -} - -// for padding so we don't have to allocate all the time -// not synchronized because we don't care what the contents are -var pad [maxPad]byte - -func (h *header) init(recType recType, reqId uint16, contentLength int) { - h.Version = 1 - h.Type = recType - h.Id = reqId - h.ContentLength = uint16(contentLength) - h.PaddingLength = uint8(-contentLength & 7) -} - -// conn sends records over rwc -type conn struct { - mutex sync.Mutex - rwc io.ReadWriteCloser - - // to avoid allocations - buf bytes.Buffer - h header -} - -func newConn(rwc io.ReadWriteCloser) *conn { - return &conn{rwc: rwc} -} - -func (c *conn) Close() error { - c.mutex.Lock() - defer c.mutex.Unlock() - return c.rwc.Close() -} - -type record struct { - h header - buf [maxWrite + maxPad]byte -} - -func (rec *record) read(r io.Reader) (err error) { - if err = binary.Read(r, binary.BigEndian, &rec.h); err != nil { - return err - } - if rec.h.Version != 1 { - return errors.New("fcgi: invalid header version") - } - n := int(rec.h.ContentLength) + int(rec.h.PaddingLength) - if _, err = io.ReadFull(r, rec.buf[:n]); err != nil { - return err - } - return nil -} - -func (r *record) content() []byte { - return r.buf[:r.h.ContentLength] -} - -// writeRecord writes and sends a single record. -func (c *conn) writeRecord(recType recType, reqId uint16, b []byte) error { - c.mutex.Lock() - defer c.mutex.Unlock() - c.buf.Reset() - c.h.init(recType, reqId, len(b)) - if err := binary.Write(&c.buf, binary.BigEndian, c.h); err != nil { - return err - } - if _, err := c.buf.Write(b); err != nil { - return err - } - if _, err := c.buf.Write(pad[:c.h.PaddingLength]); err != nil { - return err - } - _, err := c.rwc.Write(c.buf.Bytes()) - return err -} - -func (c *conn) writeBeginRequest(reqId uint16, role uint16, flags uint8) error { - b := [8]byte{byte(role >> 8), byte(role), flags} - return c.writeRecord(typeBeginRequest, reqId, b[:]) -} - -func (c *conn) writeEndRequest(reqId uint16, appStatus int, protocolStatus uint8) error { - b := make([]byte, 8) - binary.BigEndian.PutUint32(b, uint32(appStatus)) - b[4] = protocolStatus - return c.writeRecord(typeEndRequest, reqId, b) -} - -func (c *conn) writePairs(recType recType, reqId uint16, pairs map[string]string) error { - w := newWriter(c, recType, reqId) - b := make([]byte, 8) - for k, v := range pairs { - n := encodeSize(b, uint32(len(k))) - n += encodeSize(b[n:], uint32(len(v))) - if _, err := w.Write(b[:n]); err != nil { - return err - } - if _, err := w.WriteString(k); err != nil { - return err - } - if _, err := w.WriteString(v); err != nil { - return err - } - } - w.Close() - return nil -} - -func readSize(s []byte) (uint32, int) { - if len(s) == 0 { - return 0, 0 - } - size, n := uint32(s[0]), 1 - if size&(1<<7) != 0 { - if len(s) < 4 { - return 0, 0 - } - n = 4 - size = binary.BigEndian.Uint32(s) - size &^= 1 << 31 - } - return size, n -} - -func readString(s []byte, size uint32) string { - if size > uint32(len(s)) { - return "" - } - return string(s[:size]) -} - -func encodeSize(b []byte, size uint32) int { - if size > 127 { - size |= 1 << 31 - binary.BigEndian.PutUint32(b, size) - return 4 - } - b[0] = byte(size) - return 1 -} - -// bufWriter encapsulates bufio.Writer but also closes the underlying stream when -// Closed. -type bufWriter struct { - closer io.Closer - *bufio.Writer -} - -func (w *bufWriter) Close() error { - if err := w.Writer.Flush(); err != nil { - w.closer.Close() - return err - } - return w.closer.Close() -} - -func newWriter(c *conn, recType recType, reqId uint16) *bufWriter { - s := &streamWriter{c: c, recType: recType, reqId: reqId} - w := bufio.NewWriterSize(s, maxWrite) - return &bufWriter{s, w} -} - -// streamWriter abstracts out the separation of a stream into discrete records. -// It only writes maxWrite bytes at a time. -type streamWriter struct { - c *conn - recType recType - reqId uint16 -} - -func (w *streamWriter) Write(p []byte) (int, error) { - nn := 0 - for len(p) > 0 { - n := len(p) - if n > maxWrite { - n = maxWrite - } - if err := w.c.writeRecord(w.recType, w.reqId, p[:n]); err != nil { - return nn, err - } - nn += n - p = p[n:] - } - return nn, nil -} - -func (w *streamWriter) Close() error { - // send empty record to close the stream - return w.c.writeRecord(w.recType, w.reqId, nil) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go deleted file mode 100644 index 5451f5423..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package httptest provides utilities for HTTP testing. -package httptest - -import ( - "bytes" - "net/http" -) - -// ResponseRecorder is an implementation of http.ResponseWriter that -// records its mutations for later inspection in tests. -type ResponseRecorder struct { - Code int // the HTTP response code from WriteHeader - HeaderMap http.Header // the HTTP response headers - Body *bytes.Buffer // if non-nil, the bytes.Buffer to append written data to - Flushed bool - - wroteHeader bool -} - -// NewRecorder returns an initialized ResponseRecorder. -func NewRecorder() *ResponseRecorder { - return &ResponseRecorder{ - HeaderMap: make(http.Header), - Body: new(bytes.Buffer), - Code: 200, - } -} - -// DefaultRemoteAddr is the default remote address to return in RemoteAddr if -// an explicit DefaultRemoteAddr isn't set on ResponseRecorder. -const DefaultRemoteAddr = "1.2.3.4" - -// Header returns the response headers. -func (rw *ResponseRecorder) Header() http.Header { - m := rw.HeaderMap - if m == nil { - m = make(http.Header) - rw.HeaderMap = m - } - return m -} - -// Write always succeeds and writes to rw.Body, if not nil. -func (rw *ResponseRecorder) Write(buf []byte) (int, error) { - if !rw.wroteHeader { - rw.WriteHeader(200) - } - if rw.Body != nil { - rw.Body.Write(buf) - } - return len(buf), nil -} - -// WriteHeader sets rw.Code. -func (rw *ResponseRecorder) WriteHeader(code int) { - if !rw.wroteHeader { - rw.Code = code - } - rw.wroteHeader = true -} - -// Flush sets rw.Flushed to true. -func (rw *ResponseRecorder) Flush() { - if !rw.wroteHeader { - rw.WriteHeader(200) - } - rw.Flushed = true -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go deleted file mode 100644 index 7f265552f..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Implementation of Server - -package httptest - -import ( - "crypto/tls" - "flag" - "fmt" - "net" - "net/http" - "os" - "sync" -) - -// A Server is an HTTP server listening on a system-chosen port on the -// local loopback interface, for use in end-to-end HTTP tests. -type Server struct { - URL string // base URL of form http://ipaddr:port with no trailing slash - Listener net.Listener - - // TLS is the optional TLS configuration, populated with a new config - // after TLS is started. If set on an unstarted server before StartTLS - // is called, existing fields are copied into the new config. - TLS *tls.Config - - // Config may be changed after calling NewUnstartedServer and - // before Start or StartTLS. - Config *http.Server - - // wg counts the number of outstanding HTTP requests on this server. - // Close blocks until all requests are finished. - wg sync.WaitGroup -} - -// historyListener keeps track of all connections that it's ever -// accepted. -type historyListener struct { - net.Listener - sync.Mutex // protects history - history []net.Conn -} - -func (hs *historyListener) Accept() (c net.Conn, err error) { - c, err = hs.Listener.Accept() - if err == nil { - hs.Lock() - hs.history = append(hs.history, c) - hs.Unlock() - } - return -} - -func newLocalListener() net.Listener { - if *serve != "" { - l, err := net.Listen("tcp", *serve) - if err != nil { - panic(fmt.Sprintf("httptest: failed to listen on %v: %v", *serve, err)) - } - return l - } - l, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - if l, err = net.Listen("tcp6", "[::1]:0"); err != nil { - panic(fmt.Sprintf("httptest: failed to listen on a port: %v", err)) - } - } - return l -} - -// When debugging a particular http server-based test, -// this flag lets you run -// go test -run=BrokenTest -httptest.serve=127.0.0.1:8000 -// to start the broken server so you can interact with it manually. -var serve = flag.String("httptest.serve", "", "if non-empty, httptest.NewServer serves on this address and blocks") - -// NewServer starts and returns a new Server. -// The caller should call Close when finished, to shut it down. -func NewServer(handler http.Handler) *Server { - ts := NewUnstartedServer(handler) - ts.Start() - return ts -} - -// NewUnstartedServer returns a new Server but doesn't start it. -// -// After changing its configuration, the caller should call Start or -// StartTLS. -// -// The caller should call Close when finished, to shut it down. -func NewUnstartedServer(handler http.Handler) *Server { - return &Server{ - Listener: newLocalListener(), - Config: &http.Server{Handler: handler}, - } -} - -// Start starts a server from NewUnstartedServer. -func (s *Server) Start() { - if s.URL != "" { - panic("Server already started") - } - s.Listener = &historyListener{Listener: s.Listener} - s.URL = "http://" + s.Listener.Addr().String() - s.wrapHandler() - go s.Config.Serve(s.Listener) - if *serve != "" { - fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL) - select {} - } -} - -// StartTLS starts TLS on a server from NewUnstartedServer. -func (s *Server) StartTLS() { - if s.URL != "" { - panic("Server already started") - } - cert, err := tls.X509KeyPair(localhostCert, localhostKey) - if err != nil { - panic(fmt.Sprintf("httptest: NewTLSServer: %v", err)) - } - - existingConfig := s.TLS - s.TLS = new(tls.Config) - if existingConfig != nil { - *s.TLS = *existingConfig - } - if s.TLS.NextProtos == nil { - s.TLS.NextProtos = []string{"http/1.1"} - } - if len(s.TLS.Certificates) == 0 { - s.TLS.Certificates = []tls.Certificate{cert} - } - tlsListener := tls.NewListener(s.Listener, s.TLS) - - s.Listener = &historyListener{Listener: tlsListener} - s.URL = "https://" + s.Listener.Addr().String() - s.wrapHandler() - go s.Config.Serve(s.Listener) -} - -func (s *Server) wrapHandler() { - h := s.Config.Handler - if h == nil { - h = http.DefaultServeMux - } - s.Config.Handler = &waitGroupHandler{ - s: s, - h: h, - } -} - -// NewTLSServer starts and returns a new Server using TLS. -// The caller should call Close when finished, to shut it down. -func NewTLSServer(handler http.Handler) *Server { - ts := NewUnstartedServer(handler) - ts.StartTLS() - return ts -} - -// Close shuts down the server and blocks until all outstanding -// requests on this server have completed. -func (s *Server) Close() { - s.Listener.Close() - s.wg.Wait() - s.CloseClientConnections() - if t, ok := http.DefaultTransport.(*http.Transport); ok { - t.CloseIdleConnections() - } -} - -// CloseClientConnections closes any currently open HTTP connections -// to the test Server. -func (s *Server) CloseClientConnections() { - hl, ok := s.Listener.(*historyListener) - if !ok { - return - } - hl.Lock() - for _, conn := range hl.history { - conn.Close() - } - hl.Unlock() -} - -// waitGroupHandler wraps a handler, incrementing and decrementing a -// sync.WaitGroup on each request, to enable Server.Close to block -// until outstanding requests are finished. -type waitGroupHandler struct { - s *Server - h http.Handler // non-nil -} - -func (h *waitGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - h.s.wg.Add(1) - defer h.s.wg.Done() // a defer, in case ServeHTTP below panics - h.h.ServeHTTP(w, r) -} - -// localhostCert is a PEM-encoded TLS cert with SAN IPs -// "127.0.0.1" and "[::1]", expiring at the last second of 2049 (the end -// of ASN.1 time). -// generated from src/pkg/crypto/tls: -// go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h -var localhostCert = []byte(`-----BEGIN CERTIFICATE----- -MIIBdzCCASOgAwIBAgIBADALBgkqhkiG9w0BAQUwEjEQMA4GA1UEChMHQWNtZSBD -bzAeFw03MDAxMDEwMDAwMDBaFw00OTEyMzEyMzU5NTlaMBIxEDAOBgNVBAoTB0Fj -bWUgQ28wWjALBgkqhkiG9w0BAQEDSwAwSAJBAN55NcYKZeInyTuhcCwFMhDHCmwa -IUSdtXdcbItRB/yfXGBhiex00IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEA -AaNoMGYwDgYDVR0PAQH/BAQDAgCkMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1Ud -EwEB/wQFMAMBAf8wLgYDVR0RBCcwJYILZXhhbXBsZS5jb22HBH8AAAGHEAAAAAAA -AAAAAAAAAAAAAAEwCwYJKoZIhvcNAQEFA0EAAoQn/ytgqpiLcZu9XKbCJsJcvkgk -Se6AbGXgSlq+ZCEVo0qIwSgeBqmsJxUu7NCSOwVJLYNEBO2DtIxoYVk+MA== ------END CERTIFICATE-----`) - -// localhostKey is the private key for localhostCert. -var localhostKey = []byte(`-----BEGIN RSA PRIVATE KEY----- -MIIBPAIBAAJBAN55NcYKZeInyTuhcCwFMhDHCmwaIUSdtXdcbItRB/yfXGBhiex0 -0IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEAAQJBAQdUx66rfh8sYsgfdcvV -NoafYpnEcB5s4m/vSVe6SU7dCK6eYec9f9wpT353ljhDUHq3EbmE4foNzJngh35d -AekCIQDhRQG5Li0Wj8TM4obOnnXUXf1jRv0UkzE9AHWLG5q3AwIhAPzSjpYUDjVW -MCUXgckTpKCuGwbJk7424Nb8bLzf3kllAiA5mUBgjfr/WtFSJdWcPQ4Zt9KTMNKD -EUO0ukpTwEIl6wIhAMbGqZK3zAAFdq8DD2jPx+UJXnh0rnOkZBzDtJ6/iN69AiEA -1Aq8MJgTaYsDQWyU/hDq5YkDJc9e9DSCvUIzqxQWMQE= ------END RSA PRIVATE KEY-----`) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go deleted file mode 100644 index 9632bfd19..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// The wire protocol for HTTP's "chunked" Transfer-Encoding. - -// This code is duplicated in net/http and net/http/httputil. -// Please make any changes in both files. - -package httputil - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" -) - -const maxLineLength = 4096 // assumed <= bufio.defaultBufSize - -var ErrLineTooLong = errors.New("header line too long") - -// newChunkedReader returns a new chunkedReader that translates the data read from r -// out of HTTP "chunked" format before returning it. -// The chunkedReader returns io.EOF when the final 0-length chunk is read. -// -// newChunkedReader is not needed by normal applications. The http package -// automatically decodes chunking when reading response bodies. -func newChunkedReader(r io.Reader) io.Reader { - br, ok := r.(*bufio.Reader) - if !ok { - br = bufio.NewReader(r) - } - return &chunkedReader{r: br} -} - -type chunkedReader struct { - r *bufio.Reader - n uint64 // unread bytes in chunk - err error - buf [2]byte -} - -func (cr *chunkedReader) beginChunk() { - // chunk-size CRLF - var line []byte - line, cr.err = readLine(cr.r) - if cr.err != nil { - return - } - cr.n, cr.err = parseHexUint(line) - if cr.err != nil { - return - } - if cr.n == 0 { - cr.err = io.EOF - } -} - -func (cr *chunkedReader) chunkHeaderAvailable() bool { - n := cr.r.Buffered() - if n > 0 { - peek, _ := cr.r.Peek(n) - return bytes.IndexByte(peek, '\n') >= 0 - } - return false -} - -func (cr *chunkedReader) Read(b []uint8) (n int, err error) { - for cr.err == nil { - if cr.n == 0 { - if n > 0 && !cr.chunkHeaderAvailable() { - // We've read enough. Don't potentially block - // reading a new chunk header. - break - } - cr.beginChunk() - continue - } - if len(b) == 0 { - break - } - rbuf := b - if uint64(len(rbuf)) > cr.n { - rbuf = rbuf[:cr.n] - } - var n0 int - n0, cr.err = cr.r.Read(rbuf) - n += n0 - b = b[n0:] - cr.n -= uint64(n0) - // If we're at the end of a chunk, read the next two - // bytes to verify they are "\r\n". - if cr.n == 0 && cr.err == nil { - if _, cr.err = io.ReadFull(cr.r, cr.buf[:2]); cr.err == nil { - if cr.buf[0] != '\r' || cr.buf[1] != '\n' { - cr.err = errors.New("malformed chunked encoding") - } - } - } - } - return n, cr.err -} - -// Read a line of bytes (up to \n) from b. -// Give up if the line exceeds maxLineLength. -// The returned bytes are a pointer into storage in -// the bufio, so they are only valid until the next bufio read. -func readLine(b *bufio.Reader) (p []byte, err error) { - if p, err = b.ReadSlice('\n'); err != nil { - // We always know when EOF is coming. - // If the caller asked for a line, there should be a line. - if err == io.EOF { - err = io.ErrUnexpectedEOF - } else if err == bufio.ErrBufferFull { - err = ErrLineTooLong - } - return nil, err - } - if len(p) >= maxLineLength { - return nil, ErrLineTooLong - } - return trimTrailingWhitespace(p), nil -} - -func trimTrailingWhitespace(b []byte) []byte { - for len(b) > 0 && isASCIISpace(b[len(b)-1]) { - b = b[:len(b)-1] - } - return b -} - -func isASCIISpace(b byte) bool { - return b == ' ' || b == '\t' || b == '\n' || b == '\r' -} - -// newChunkedWriter returns a new chunkedWriter that translates writes into HTTP -// "chunked" format before writing them to w. Closing the returned chunkedWriter -// sends the final 0-length chunk that marks the end of the stream. -// -// newChunkedWriter is not needed by normal applications. The http -// package adds chunking automatically if handlers don't set a -// Content-Length header. Using newChunkedWriter inside a handler -// would result in double chunking or chunking with a Content-Length -// length, both of which are wrong. -func newChunkedWriter(w io.Writer) io.WriteCloser { - return &chunkedWriter{w} -} - -// Writing to chunkedWriter translates to writing in HTTP chunked Transfer -// Encoding wire format to the underlying Wire chunkedWriter. -type chunkedWriter struct { - Wire io.Writer -} - -// Write the contents of data as one chunk to Wire. -// NOTE: Note that the corresponding chunk-writing procedure in Conn.Write has -// a bug since it does not check for success of io.WriteString -func (cw *chunkedWriter) Write(data []byte) (n int, err error) { - - // Don't send 0-length data. It looks like EOF for chunked encoding. - if len(data) == 0 { - return 0, nil - } - - if _, err = fmt.Fprintf(cw.Wire, "%x\r\n", len(data)); err != nil { - return 0, err - } - if n, err = cw.Wire.Write(data); err != nil { - return - } - if n != len(data) { - err = io.ErrShortWrite - return - } - _, err = io.WriteString(cw.Wire, "\r\n") - - return -} - -func (cw *chunkedWriter) Close() error { - _, err := io.WriteString(cw.Wire, "0\r\n") - return err -} - -func parseHexUint(v []byte) (n uint64, err error) { - for _, b := range v { - n <<= 4 - switch { - case '0' <= b && b <= '9': - b = b - '0' - case 'a' <= b && b <= 'f': - b = b - 'a' + 10 - case 'A' <= b && b <= 'F': - b = b - 'A' + 10 - default: - return 0, errors.New("invalid byte in chunk length") - } - n |= uint64(b) - } - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go deleted file mode 100644 index 2a7a413d0..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package httputil - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/url" - "strings" - "time" -) - -// One of the copies, say from b to r2, could be avoided by using a more -// elaborate trick where the other copy is made during Request/Response.Write. -// This would complicate things too much, given that these functions are for -// debugging only. -func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error) { - var buf bytes.Buffer - if _, err = buf.ReadFrom(b); err != nil { - return nil, nil, err - } - if err = b.Close(); err != nil { - return nil, nil, err - } - return ioutil.NopCloser(&buf), ioutil.NopCloser(bytes.NewReader(buf.Bytes())), nil -} - -// dumpConn is a net.Conn which writes to Writer and reads from Reader -type dumpConn struct { - io.Writer - io.Reader -} - -func (c *dumpConn) Close() error { return nil } -func (c *dumpConn) LocalAddr() net.Addr { return nil } -func (c *dumpConn) RemoteAddr() net.Addr { return nil } -func (c *dumpConn) SetDeadline(t time.Time) error { return nil } -func (c *dumpConn) SetReadDeadline(t time.Time) error { return nil } -func (c *dumpConn) SetWriteDeadline(t time.Time) error { return nil } - -type neverEnding byte - -func (b neverEnding) Read(p []byte) (n int, err error) { - for i := range p { - p[i] = byte(b) - } - return len(p), nil -} - -// DumpRequestOut is like DumpRequest but includes -// headers that the standard http.Transport adds, -// such as User-Agent. -func DumpRequestOut(req *http.Request, body bool) ([]byte, error) { - save := req.Body - dummyBody := false - if !body || req.Body == nil { - req.Body = nil - if req.ContentLength != 0 { - req.Body = ioutil.NopCloser(io.LimitReader(neverEnding('x'), req.ContentLength)) - dummyBody = true - } - } else { - var err error - save, req.Body, err = drainBody(req.Body) - if err != nil { - return nil, err - } - } - - // Since we're using the actual Transport code to write the request, - // switch to http so the Transport doesn't try to do an SSL - // negotiation with our dumpConn and its bytes.Buffer & pipe. - // The wire format for https and http are the same, anyway. - reqSend := req - if req.URL.Scheme == "https" { - reqSend = new(http.Request) - *reqSend = *req - reqSend.URL = new(url.URL) - *reqSend.URL = *req.URL - reqSend.URL.Scheme = "http" - } - - // Use the actual Transport code to record what we would send - // on the wire, but not using TCP. Use a Transport with a - // custom dialer that returns a fake net.Conn that waits - // for the full input (and recording it), and then responds - // with a dummy response. - var buf bytes.Buffer // records the output - pr, pw := io.Pipe() - dr := &delegateReader{c: make(chan io.Reader)} - // Wait for the request before replying with a dummy response: - go func() { - http.ReadRequest(bufio.NewReader(pr)) - dr.c <- strings.NewReader("HTTP/1.1 204 No Content\r\n\r\n") - }() - - t := &http.Transport{ - Dial: func(net, addr string) (net.Conn, error) { - return &dumpConn{io.MultiWriter(&buf, pw), dr}, nil - }, - } - defer t.CloseIdleConnections() - - _, err := t.RoundTrip(reqSend) - - req.Body = save - if err != nil { - return nil, err - } - dump := buf.Bytes() - - // If we used a dummy body above, remove it now. - // TODO: if the req.ContentLength is large, we allocate memory - // unnecessarily just to slice it off here. But this is just - // a debug function, so this is acceptable for now. We could - // discard the body earlier if this matters. - if dummyBody { - if i := bytes.Index(dump, []byte("\r\n\r\n")); i >= 0 { - dump = dump[:i+4] - } - } - return dump, nil -} - -// delegateReader is a reader that delegates to another reader, -// once it arrives on a channel. -type delegateReader struct { - c chan io.Reader - r io.Reader // nil until received from c -} - -func (r *delegateReader) Read(p []byte) (int, error) { - if r.r == nil { - r.r = <-r.c - } - return r.r.Read(p) -} - -// Return value if nonempty, def otherwise. -func valueOrDefault(value, def string) string { - if value != "" { - return value - } - return def -} - -var reqWriteExcludeHeaderDump = map[string]bool{ - "Host": true, // not in Header map anyway - "Content-Length": true, - "Transfer-Encoding": true, - "Trailer": true, -} - -// dumpAsReceived writes req to w in the form as it was received, or -// at least as accurately as possible from the information retained in -// the request. -func dumpAsReceived(req *http.Request, w io.Writer) error { - return nil -} - -// DumpRequest returns the as-received wire representation of req, -// optionally including the request body, for debugging. -// DumpRequest is semantically a no-op, but in order to -// dump the body, it reads the body data into memory and -// changes req.Body to refer to the in-memory copy. -// The documentation for http.Request.Write details which fields -// of req are used. -func DumpRequest(req *http.Request, body bool) (dump []byte, err error) { - save := req.Body - if !body || req.Body == nil { - req.Body = nil - } else { - save, req.Body, err = drainBody(req.Body) - if err != nil { - return - } - } - - var b bytes.Buffer - - fmt.Fprintf(&b, "%s %s HTTP/%d.%d\r\n", valueOrDefault(req.Method, "GET"), - req.URL.RequestURI(), req.ProtoMajor, req.ProtoMinor) - - host := req.Host - if host == "" && req.URL != nil { - host = req.URL.Host - } - if host != "" { - fmt.Fprintf(&b, "Host: %s\r\n", host) - } - - chunked := len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == "chunked" - if len(req.TransferEncoding) > 0 { - fmt.Fprintf(&b, "Transfer-Encoding: %s\r\n", strings.Join(req.TransferEncoding, ",")) - } - if req.Close { - fmt.Fprintf(&b, "Connection: close\r\n") - } - - err = req.Header.WriteSubset(&b, reqWriteExcludeHeaderDump) - if err != nil { - return - } - - io.WriteString(&b, "\r\n") - - if req.Body != nil { - var dest io.Writer = &b - if chunked { - dest = NewChunkedWriter(dest) - } - _, err = io.Copy(dest, req.Body) - if chunked { - dest.(io.Closer).Close() - io.WriteString(&b, "\r\n") - } - } - - req.Body = save - if err != nil { - return - } - dump = b.Bytes() - return -} - -// errNoBody is a sentinel error value used by failureToReadBody so we can detect -// that the lack of body was intentional. -var errNoBody = errors.New("sentinel error value") - -// failureToReadBody is a io.ReadCloser that just returns errNoBody on -// Read. It's swapped in when we don't actually want to consume the -// body, but need a non-nil one, and want to distinguish the error -// from reading the dummy body. -type failureToReadBody struct{} - -func (failureToReadBody) Read([]byte) (int, error) { return 0, errNoBody } -func (failureToReadBody) Close() error { return nil } - -var emptyBody = ioutil.NopCloser(strings.NewReader("")) - -// DumpResponse is like DumpRequest but dumps a response. -func DumpResponse(resp *http.Response, body bool) (dump []byte, err error) { - var b bytes.Buffer - save := resp.Body - savecl := resp.ContentLength - - if !body { - resp.Body = failureToReadBody{} - } else if resp.Body == nil { - resp.Body = emptyBody - } else { - save, resp.Body, err = drainBody(resp.Body) - if err != nil { - return - } - } - err = resp.Write(&b) - if err == errNoBody { - err = nil - } - resp.Body = save - resp.ContentLength = savecl - if err != nil { - return nil, err - } - return b.Bytes(), nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go deleted file mode 100644 index 74fb6c655..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package httputil provides HTTP utility functions, complementing the -// more common ones in the net/http package. -package httputil - -import "io" - -// NewChunkedReader returns a new chunkedReader that translates the data read from r -// out of HTTP "chunked" format before returning it. -// The chunkedReader returns io.EOF when the final 0-length chunk is read. -// -// NewChunkedReader is not needed by normal applications. The http package -// automatically decodes chunking when reading response bodies. -func NewChunkedReader(r io.Reader) io.Reader { - return newChunkedReader(r) -} - -// NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP -// "chunked" format before writing them to w. Closing the returned chunkedWriter -// sends the final 0-length chunk that marks the end of the stream. -// -// NewChunkedWriter is not needed by normal applications. The http -// package adds chunking automatically if handlers don't set a -// Content-Length header. Using NewChunkedWriter inside a handler -// would result in double chunking or chunking with a Content-Length -// length, both of which are wrong. -func NewChunkedWriter(w io.Writer) io.WriteCloser { - return newChunkedWriter(w) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go deleted file mode 100644 index 987bcc96b..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package httputil - -import ( - "bufio" - "errors" - "io" - "net" - "net/http" - "net/textproto" - "sync" -) - -var ( - ErrPersistEOF = &http.ProtocolError{ErrorString: "persistent connection closed"} - ErrClosed = &http.ProtocolError{ErrorString: "connection closed by user"} - ErrPipeline = &http.ProtocolError{ErrorString: "pipeline error"} -) - -// This is an API usage error - the local side is closed. -// ErrPersistEOF (above) reports that the remote side is closed. -var errClosed = errors.New("i/o operation on closed connection") - -// A ServerConn reads requests and sends responses over an underlying -// connection, until the HTTP keepalive logic commands an end. ServerConn -// also allows hijacking the underlying connection by calling Hijack -// to regain control over the connection. ServerConn supports pipe-lining, -// i.e. requests can be read out of sync (but in the same order) while the -// respective responses are sent. -// -// ServerConn is low-level and old. Applications should instead use Server -// in the net/http package. -type ServerConn struct { - lk sync.Mutex // read-write protects the following fields - c net.Conn - r *bufio.Reader - re, we error // read/write errors - lastbody io.ReadCloser - nread, nwritten int - pipereq map[*http.Request]uint - - pipe textproto.Pipeline -} - -// NewServerConn returns a new ServerConn reading and writing c. If r is not -// nil, it is the buffer to use when reading c. -// -// ServerConn is low-level and old. Applications should instead use Server -// in the net/http package. -func NewServerConn(c net.Conn, r *bufio.Reader) *ServerConn { - if r == nil { - r = bufio.NewReader(c) - } - return &ServerConn{c: c, r: r, pipereq: make(map[*http.Request]uint)} -} - -// Hijack detaches the ServerConn and returns the underlying connection as well -// as the read-side bufio which may have some left over data. Hijack may be -// called before Read has signaled the end of the keep-alive logic. The user -// should not call Hijack while Read or Write is in progress. -func (sc *ServerConn) Hijack() (c net.Conn, r *bufio.Reader) { - sc.lk.Lock() - defer sc.lk.Unlock() - c = sc.c - r = sc.r - sc.c = nil - sc.r = nil - return -} - -// Close calls Hijack and then also closes the underlying connection -func (sc *ServerConn) Close() error { - c, _ := sc.Hijack() - if c != nil { - return c.Close() - } - return nil -} - -// Read returns the next request on the wire. An ErrPersistEOF is returned if -// it is gracefully determined that there are no more requests (e.g. after the -// first request on an HTTP/1.0 connection, or after a Connection:close on a -// HTTP/1.1 connection). -func (sc *ServerConn) Read() (req *http.Request, err error) { - - // Ensure ordered execution of Reads and Writes - id := sc.pipe.Next() - sc.pipe.StartRequest(id) - defer func() { - sc.pipe.EndRequest(id) - if req == nil { - sc.pipe.StartResponse(id) - sc.pipe.EndResponse(id) - } else { - // Remember the pipeline id of this request - sc.lk.Lock() - sc.pipereq[req] = id - sc.lk.Unlock() - } - }() - - sc.lk.Lock() - if sc.we != nil { // no point receiving if write-side broken or closed - defer sc.lk.Unlock() - return nil, sc.we - } - if sc.re != nil { - defer sc.lk.Unlock() - return nil, sc.re - } - if sc.r == nil { // connection closed by user in the meantime - defer sc.lk.Unlock() - return nil, errClosed - } - r := sc.r - lastbody := sc.lastbody - sc.lastbody = nil - sc.lk.Unlock() - - // Make sure body is fully consumed, even if user does not call body.Close - if lastbody != nil { - // body.Close is assumed to be idempotent and multiple calls to - // it should return the error that its first invocation - // returned. - err = lastbody.Close() - if err != nil { - sc.lk.Lock() - defer sc.lk.Unlock() - sc.re = err - return nil, err - } - } - - req, err = http.ReadRequest(r) - sc.lk.Lock() - defer sc.lk.Unlock() - if err != nil { - if err == io.ErrUnexpectedEOF { - // A close from the opposing client is treated as a - // graceful close, even if there was some unparse-able - // data before the close. - sc.re = ErrPersistEOF - return nil, sc.re - } else { - sc.re = err - return req, err - } - } - sc.lastbody = req.Body - sc.nread++ - if req.Close { - sc.re = ErrPersistEOF - return req, sc.re - } - return req, err -} - -// Pending returns the number of unanswered requests -// that have been received on the connection. -func (sc *ServerConn) Pending() int { - sc.lk.Lock() - defer sc.lk.Unlock() - return sc.nread - sc.nwritten -} - -// Write writes resp in response to req. To close the connection gracefully, set the -// Response.Close field to true. Write should be considered operational until -// it returns an error, regardless of any errors returned on the Read side. -func (sc *ServerConn) Write(req *http.Request, resp *http.Response) error { - - // Retrieve the pipeline ID of this request/response pair - sc.lk.Lock() - id, ok := sc.pipereq[req] - delete(sc.pipereq, req) - if !ok { - sc.lk.Unlock() - return ErrPipeline - } - sc.lk.Unlock() - - // Ensure pipeline order - sc.pipe.StartResponse(id) - defer sc.pipe.EndResponse(id) - - sc.lk.Lock() - if sc.we != nil { - defer sc.lk.Unlock() - return sc.we - } - if sc.c == nil { // connection closed by user in the meantime - defer sc.lk.Unlock() - return ErrClosed - } - c := sc.c - if sc.nread <= sc.nwritten { - defer sc.lk.Unlock() - return errors.New("persist server pipe count") - } - if resp.Close { - // After signaling a keep-alive close, any pipelined unread - // requests will be lost. It is up to the user to drain them - // before signaling. - sc.re = ErrPersistEOF - } - sc.lk.Unlock() - - err := resp.Write(c) - sc.lk.Lock() - defer sc.lk.Unlock() - if err != nil { - sc.we = err - return err - } - sc.nwritten++ - - return nil -} - -// A ClientConn sends request and receives headers over an underlying -// connection, while respecting the HTTP keepalive logic. ClientConn -// supports hijacking the connection calling Hijack to -// regain control of the underlying net.Conn and deal with it as desired. -// -// ClientConn is low-level and old. Applications should instead use -// Client or Transport in the net/http package. -type ClientConn struct { - lk sync.Mutex // read-write protects the following fields - c net.Conn - r *bufio.Reader - re, we error // read/write errors - lastbody io.ReadCloser - nread, nwritten int - pipereq map[*http.Request]uint - - pipe textproto.Pipeline - writeReq func(*http.Request, io.Writer) error -} - -// NewClientConn returns a new ClientConn reading and writing c. If r is not -// nil, it is the buffer to use when reading c. -// -// ClientConn is low-level and old. Applications should use Client or -// Transport in the net/http package. -func NewClientConn(c net.Conn, r *bufio.Reader) *ClientConn { - if r == nil { - r = bufio.NewReader(c) - } - return &ClientConn{ - c: c, - r: r, - pipereq: make(map[*http.Request]uint), - writeReq: (*http.Request).Write, - } -} - -// NewProxyClientConn works like NewClientConn but writes Requests -// using Request's WriteProxy method. -// -// New code should not use NewProxyClientConn. See Client or -// Transport in the net/http package instead. -func NewProxyClientConn(c net.Conn, r *bufio.Reader) *ClientConn { - cc := NewClientConn(c, r) - cc.writeReq = (*http.Request).WriteProxy - return cc -} - -// Hijack detaches the ClientConn and returns the underlying connection as well -// as the read-side bufio which may have some left over data. Hijack may be -// called before the user or Read have signaled the end of the keep-alive -// logic. The user should not call Hijack while Read or Write is in progress. -func (cc *ClientConn) Hijack() (c net.Conn, r *bufio.Reader) { - cc.lk.Lock() - defer cc.lk.Unlock() - c = cc.c - r = cc.r - cc.c = nil - cc.r = nil - return -} - -// Close calls Hijack and then also closes the underlying connection -func (cc *ClientConn) Close() error { - c, _ := cc.Hijack() - if c != nil { - return c.Close() - } - return nil -} - -// Write writes a request. An ErrPersistEOF error is returned if the connection -// has been closed in an HTTP keepalive sense. If req.Close equals true, the -// keepalive connection is logically closed after this request and the opposing -// server is informed. An ErrUnexpectedEOF indicates the remote closed the -// underlying TCP connection, which is usually considered as graceful close. -func (cc *ClientConn) Write(req *http.Request) (err error) { - - // Ensure ordered execution of Writes - id := cc.pipe.Next() - cc.pipe.StartRequest(id) - defer func() { - cc.pipe.EndRequest(id) - if err != nil { - cc.pipe.StartResponse(id) - cc.pipe.EndResponse(id) - } else { - // Remember the pipeline id of this request - cc.lk.Lock() - cc.pipereq[req] = id - cc.lk.Unlock() - } - }() - - cc.lk.Lock() - if cc.re != nil { // no point sending if read-side closed or broken - defer cc.lk.Unlock() - return cc.re - } - if cc.we != nil { - defer cc.lk.Unlock() - return cc.we - } - if cc.c == nil { // connection closed by user in the meantime - defer cc.lk.Unlock() - return errClosed - } - c := cc.c - if req.Close { - // We write the EOF to the write-side error, because there - // still might be some pipelined reads - cc.we = ErrPersistEOF - } - cc.lk.Unlock() - - err = cc.writeReq(req, c) - cc.lk.Lock() - defer cc.lk.Unlock() - if err != nil { - cc.we = err - return err - } - cc.nwritten++ - - return nil -} - -// Pending returns the number of unanswered requests -// that have been sent on the connection. -func (cc *ClientConn) Pending() int { - cc.lk.Lock() - defer cc.lk.Unlock() - return cc.nwritten - cc.nread -} - -// Read reads the next response from the wire. A valid response might be -// returned together with an ErrPersistEOF, which means that the remote -// requested that this be the last request serviced. Read can be called -// concurrently with Write, but not with another Read. -func (cc *ClientConn) Read(req *http.Request) (resp *http.Response, err error) { - // Retrieve the pipeline ID of this request/response pair - cc.lk.Lock() - id, ok := cc.pipereq[req] - delete(cc.pipereq, req) - if !ok { - cc.lk.Unlock() - return nil, ErrPipeline - } - cc.lk.Unlock() - - // Ensure pipeline order - cc.pipe.StartResponse(id) - defer cc.pipe.EndResponse(id) - - cc.lk.Lock() - if cc.re != nil { - defer cc.lk.Unlock() - return nil, cc.re - } - if cc.r == nil { // connection closed by user in the meantime - defer cc.lk.Unlock() - return nil, errClosed - } - r := cc.r - lastbody := cc.lastbody - cc.lastbody = nil - cc.lk.Unlock() - - // Make sure body is fully consumed, even if user does not call body.Close - if lastbody != nil { - // body.Close is assumed to be idempotent and multiple calls to - // it should return the error that its first invocation - // returned. - err = lastbody.Close() - if err != nil { - cc.lk.Lock() - defer cc.lk.Unlock() - cc.re = err - return nil, err - } - } - - resp, err = http.ReadResponse(r, req) - cc.lk.Lock() - defer cc.lk.Unlock() - if err != nil { - cc.re = err - return resp, err - } - cc.lastbody = resp.Body - - cc.nread++ - - if resp.Close { - cc.re = ErrPersistEOF // don't send any more requests - return resp, cc.re - } - return resp, err -} - -// Do is convenience method that writes a request and reads a response. -func (cc *ClientConn) Do(req *http.Request) (resp *http.Response, err error) { - err = cc.Write(req) - if err != nil { - return - } - return cc.Read(req) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go deleted file mode 100644 index 48ada5f5f..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// HTTP reverse proxy handler - -package httputil - -import ( - "io" - "log" - "net" - "net/http" - "net/url" - "strings" - "sync" - "time" -) - -// onExitFlushLoop is a callback set by tests to detect the state of the -// flushLoop() goroutine. -var onExitFlushLoop func() - -// ReverseProxy is an HTTP Handler that takes an incoming request and -// sends it to another server, proxying the response back to the -// client. -type ReverseProxy struct { - // Director must be a function which modifies - // the request into a new request to be sent - // using Transport. Its response is then copied - // back to the original client unmodified. - Director func(*http.Request) - - // The transport used to perform proxy requests. - // If nil, http.DefaultTransport is used. - Transport http.RoundTripper - - // FlushInterval specifies the flush interval - // to flush to the client while copying the - // response body. - // If zero, no periodic flushing is done. - FlushInterval time.Duration -} - -func singleJoiningSlash(a, b string) string { - aslash := strings.HasSuffix(a, "/") - bslash := strings.HasPrefix(b, "/") - switch { - case aslash && bslash: - return a + b[1:] - case !aslash && !bslash: - return a + "/" + b - } - return a + b -} - -// NewSingleHostReverseProxy returns a new ReverseProxy that rewrites -// URLs to the scheme, host, and base path provided in target. If the -// target's path is "/base" and the incoming request was for "/dir", -// the target request will be for /base/dir. -func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy { - targetQuery := target.RawQuery - director := func(req *http.Request) { - req.URL.Scheme = target.Scheme - req.URL.Host = target.Host - req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path) - if targetQuery == "" || req.URL.RawQuery == "" { - req.URL.RawQuery = targetQuery + req.URL.RawQuery - } else { - req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery - } - } - return &ReverseProxy{Director: director} -} - -func copyHeader(dst, src http.Header) { - for k, vv := range src { - for _, v := range vv { - dst.Add(k, v) - } - } -} - -// Hop-by-hop headers. These are removed when sent to the backend. -// http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html -var hopHeaders = []string{ - "Connection", - "Keep-Alive", - "Proxy-Authenticate", - "Proxy-Authorization", - "Te", // canonicalized version of "TE" - "Trailers", - "Transfer-Encoding", - "Upgrade", -} - -func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { - transport := p.Transport - if transport == nil { - transport = http.DefaultTransport - } - - outreq := new(http.Request) - *outreq = *req // includes shallow copies of maps, but okay - - p.Director(outreq) - outreq.Proto = "HTTP/1.1" - outreq.ProtoMajor = 1 - outreq.ProtoMinor = 1 - outreq.Close = false - - // Remove hop-by-hop headers to the backend. Especially - // important is "Connection" because we want a persistent - // connection, regardless of what the client sent to us. This - // is modifying the same underlying map from req (shallow - // copied above) so we only copy it if necessary. - copiedHeaders := false - for _, h := range hopHeaders { - if outreq.Header.Get(h) != "" { - if !copiedHeaders { - outreq.Header = make(http.Header) - copyHeader(outreq.Header, req.Header) - copiedHeaders = true - } - outreq.Header.Del(h) - } - } - - if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil { - // If we aren't the first proxy retain prior - // X-Forwarded-For information as a comma+space - // separated list and fold multiple headers into one. - if prior, ok := outreq.Header["X-Forwarded-For"]; ok { - clientIP = strings.Join(prior, ", ") + ", " + clientIP - } - outreq.Header.Set("X-Forwarded-For", clientIP) - } - - res, err := transport.RoundTrip(outreq) - if err != nil { - log.Printf("http: proxy error: %v", err) - rw.WriteHeader(http.StatusInternalServerError) - return - } - defer res.Body.Close() - - for _, h := range hopHeaders { - res.Header.Del(h) - } - - copyHeader(rw.Header(), res.Header) - - rw.WriteHeader(res.StatusCode) - p.copyResponse(rw, res.Body) -} - -func (p *ReverseProxy) copyResponse(dst io.Writer, src io.Reader) { - if p.FlushInterval != 0 { - if wf, ok := dst.(writeFlusher); ok { - mlw := &maxLatencyWriter{ - dst: wf, - latency: p.FlushInterval, - done: make(chan bool), - } - go mlw.flushLoop() - defer mlw.stop() - dst = mlw - } - } - - io.Copy(dst, src) -} - -type writeFlusher interface { - io.Writer - http.Flusher -} - -type maxLatencyWriter struct { - dst writeFlusher - latency time.Duration - - lk sync.Mutex // protects Write + Flush - done chan bool -} - -func (m *maxLatencyWriter) Write(p []byte) (int, error) { - m.lk.Lock() - defer m.lk.Unlock() - return m.dst.Write(p) -} - -func (m *maxLatencyWriter) flushLoop() { - t := time.NewTicker(m.latency) - defer t.Stop() - for { - select { - case <-m.done: - if onExitFlushLoop != nil { - onExitFlushLoop() - } - return - case <-t.C: - m.lk.Lock() - m.dst.Flush() - m.lk.Unlock() - } - } -} - -func (m *maxLatencyWriter) stop() { m.done <- true } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go b/vendor/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go deleted file mode 100644 index 0c7548e3e..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package pprof serves via its HTTP server runtime profiling data -// in the format expected by the pprof visualization tool. -// For more information about pprof, see -// http://code.google.com/p/google-perftools/. -// -// The package is typically only imported for the side effect of -// registering its HTTP handlers. -// The handled paths all begin with /debug/pprof/. -// -// To use pprof, link this package into your program: -// import _ "net/http/pprof" -// -// If your application is not already running an http server, you -// need to start one. Add "net/http" and "log" to your imports and -// the following code to your main function: -// -// go func() { -// log.Println(http.ListenAndServe("localhost:6060", nil)) -// }() -// -// Then use the pprof tool to look at the heap profile: -// -// go tool pprof http://localhost:6060/debug/pprof/heap -// -// Or to look at a 30-second CPU profile: -// -// go tool pprof http://localhost:6060/debug/pprof/profile -// -// Or to look at the goroutine blocking profile: -// -// go tool pprof http://localhost:6060/debug/pprof/block -// -// To view all available profiles, open http://localhost:6060/debug/pprof/ -// in your browser. -// -// For a study of the facility in action, visit -// -// http://blog.golang.org/2011/06/profiling-go-programs.html -// -package pprof - -import ( - "bufio" - "bytes" - "fmt" - "html/template" - "io" - "log" - "net/http" - "os" - "runtime" - "runtime/pprof" - "strconv" - "strings" - "time" -) - -func init() { - http.Handle("/debug/pprof/", http.HandlerFunc(Index)) - http.Handle("/debug/pprof/cmdline", http.HandlerFunc(Cmdline)) - http.Handle("/debug/pprof/profile", http.HandlerFunc(Profile)) - http.Handle("/debug/pprof/symbol", http.HandlerFunc(Symbol)) -} - -// Cmdline responds with the running program's -// command line, with arguments separated by NUL bytes. -// The package initialization registers it as /debug/pprof/cmdline. -func Cmdline(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - fmt.Fprintf(w, strings.Join(os.Args, "\x00")) -} - -// Profile responds with the pprof-formatted cpu profile. -// The package initialization registers it as /debug/pprof/profile. -func Profile(w http.ResponseWriter, r *http.Request) { - sec, _ := strconv.ParseInt(r.FormValue("seconds"), 10, 64) - if sec == 0 { - sec = 30 - } - - // Set Content Type assuming StartCPUProfile will work, - // because if it does it starts writing. - w.Header().Set("Content-Type", "application/octet-stream") - if err := pprof.StartCPUProfile(w); err != nil { - // StartCPUProfile failed, so no writes yet. - // Can change header back to text content - // and send error code. - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - w.WriteHeader(http.StatusInternalServerError) - fmt.Fprintf(w, "Could not enable CPU profiling: %s\n", err) - return - } - time.Sleep(time.Duration(sec) * time.Second) - pprof.StopCPUProfile() -} - -// Symbol looks up the program counters listed in the request, -// responding with a table mapping program counters to function names. -// The package initialization registers it as /debug/pprof/symbol. -func Symbol(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - - // We have to read the whole POST body before - // writing any output. Buffer the output here. - var buf bytes.Buffer - - // We don't know how many symbols we have, but we - // do have symbol information. Pprof only cares whether - // this number is 0 (no symbols available) or > 0. - fmt.Fprintf(&buf, "num_symbols: 1\n") - - var b *bufio.Reader - if r.Method == "POST" { - b = bufio.NewReader(r.Body) - } else { - b = bufio.NewReader(strings.NewReader(r.URL.RawQuery)) - } - - for { - word, err := b.ReadSlice('+') - if err == nil { - word = word[0 : len(word)-1] // trim + - } - pc, _ := strconv.ParseUint(string(word), 0, 64) - if pc != 0 { - f := runtime.FuncForPC(uintptr(pc)) - if f != nil { - fmt.Fprintf(&buf, "%#x %s\n", pc, f.Name()) - } - } - - // Wait until here to check for err; the last - // symbol will have an err because it doesn't end in +. - if err != nil { - if err != io.EOF { - fmt.Fprintf(&buf, "reading request: %v\n", err) - } - break - } - } - - w.Write(buf.Bytes()) -} - -// Handler returns an HTTP handler that serves the named profile. -func Handler(name string) http.Handler { - return handler(name) -} - -type handler string - -func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - debug, _ := strconv.Atoi(r.FormValue("debug")) - p := pprof.Lookup(string(name)) - if p == nil { - w.WriteHeader(404) - fmt.Fprintf(w, "Unknown profile: %s\n", name) - return - } - p.WriteTo(w, debug) - return -} - -// Index responds with the pprof-formatted profile named by the request. -// For example, "/debug/pprof/heap" serves the "heap" profile. -// Index responds to a request for "/debug/pprof/" with an HTML page -// listing the available profiles. -func Index(w http.ResponseWriter, r *http.Request) { - if strings.HasPrefix(r.URL.Path, "/debug/pprof/") { - name := strings.TrimPrefix(r.URL.Path, "/debug/pprof/") - if name != "" { - handler(name).ServeHTTP(w, r) - return - } - } - - profiles := pprof.Profiles() - if err := indexTmpl.Execute(w, profiles); err != nil { - log.Print(err) - } -} - -var indexTmpl = template.Must(template.New("index").Parse(` - -/debug/pprof/ - -/debug/pprof/
-
- -profiles:
- -{{range .}} -
{{.Count}}{{.Name}} -{{end}} -
-
-full goroutine stack dump
- - -`)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/management/testutils/managementclient.go b/vendor/github.com/Azure/azure-sdk-for-go/management/testutils/managementclient.go deleted file mode 100644 index 426e20dcc..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/management/testutils/managementclient.go +++ /dev/null @@ -1,87 +0,0 @@ -// Package testutils contains some test utilities for the Azure SDK -package testutils - -import ( - "encoding/base64" - "os" - "testing" - - "github.com/Azure/azure-sdk-for-go/management" -) - -// GetTestClient returns a management Client for testing. Expects -// AZSUBSCRIPTIONID and AZCERTDATA to be present in the environment. AZCERTDATA -// is the base64encoded binary representation of the PEM certificate data. -func GetTestClient(t *testing.T) management.Client { - subid := os.Getenv("AZSUBSCRIPTIONID") - certdata := os.Getenv("AZCERTDATA") - if subid == "" || certdata == "" { - t.Skip("AZSUBSCRIPTIONID or AZCERTDATA not set, skipping test") - } - cert, err := base64.StdEncoding.DecodeString(certdata) - if err != nil { - t.Fatal(err) - } - - client, err := management.NewClient(subid, cert) - if err != nil { - t.Fatal(err) - } - return testClient{client, t} -} - -type testClient struct { - management.Client - t *testing.T -} - -func chop(d []byte) string { - const maxlen = 5000 - - s := string(d) - - if len(s) > maxlen { - return s[:maxlen] + "..." - } - return s -} - -func (l testClient) SendAzureGetRequest(url string) ([]byte, error) { - d, err := l.Client.SendAzureGetRequest(url) - logOperation(l.t, "GET", url, nil, d, "", err) - return d, err -} - -func (l testClient) SendAzurePostRequest(url string, data []byte) (management.OperationID, error) { - oid, err := l.Client.SendAzurePostRequest(url, data) - logOperation(l.t, "POST", url, data, nil, oid, err) - return oid, err -} - -func (l testClient) SendAzurePutRequest(url string, contentType string, data []byte) (management.OperationID, error) { - oid, err := l.Client.SendAzurePutRequest(url, contentType, data) - logOperation(l.t, "PUT", url, data, nil, oid, err) - return oid, err -} - -func (l testClient) SendAzureDeleteRequest(url string) (management.OperationID, error) { - oid, err := l.Client.SendAzureDeleteRequest(url) - logOperation(l.t, "DELETE", url, nil, nil, oid, err) - return oid, err -} - -func logOperation(t *testing.T, method, url string, requestData, responseData []byte, oid management.OperationID, err error) { - t.Logf("AZURE> %s %s\n", method, url) - if requestData != nil { - t.Logf(" >>> %s\n", chop(requestData)) - } - if err != nil { - t.Logf(" <<< ERROR: %+v\n", err) - } else { - if responseData != nil { - t.Logf(" <<< %s\n", chop(responseData)) - } else { - t.Logf(" <<< OperationID: %s\n", oid) - } - } -} diff --git a/vendor/github.com/DreamItGetIT/statuscake/cmd/statuscake/main.go b/vendor/github.com/DreamItGetIT/statuscake/cmd/statuscake/main.go deleted file mode 100644 index dc86b47e0..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/cmd/statuscake/main.go +++ /dev/null @@ -1,229 +0,0 @@ -package main - -import ( - "fmt" - logpkg "log" - "os" - "strconv" - - "github.com/DreamItGetIT/statuscake" -) - -var log *logpkg.Logger - -type command func(*statuscake.Client, ...string) error - -var commands map[string]command - -func init() { - log = logpkg.New(os.Stderr, "", 0) - commands = map[string]command{ - "list": cmdList, - "detail": cmdDetail, - "delete": cmdDelete, - "create": cmdCreate, - "update": cmdUpdate, - } -} - -func colouredStatus(s string) string { - switch s { - case "Up": - return fmt.Sprintf("\033[0;32m%s\033[0m", s) - case "Down": - return fmt.Sprintf("\033[0;31m%s\033[0m", s) - default: - return s - } -} - -func getEnv(name string) string { - v := os.Getenv(name) - if v == "" { - log.Fatalf("`%s` env variable is required", name) - } - - return v -} - -func cmdList(c *statuscake.Client, args ...string) error { - tt := c.Tests() - tests, err := tt.All() - if err != nil { - return err - } - - for _, t := range tests { - var paused string - if t.Paused { - paused = "yes" - } else { - paused = "no" - } - - fmt.Printf("* %d: %s\n", t.TestID, colouredStatus(t.Status)) - fmt.Printf(" WebsiteName: %s\n", t.WebsiteName) - fmt.Printf(" TestType: %s\n", t.TestType) - fmt.Printf(" Paused: %s\n", paused) - fmt.Printf(" ContactID: %d\n", t.ContactID) - fmt.Printf(" Uptime: %f\n", t.Uptime) - } - - return nil -} - -func cmdDetail(c *statuscake.Client, args ...string) error { - if len(args) != 1 { - return fmt.Errorf("command `detail` requires a single argument `TestID`") - } - - id, err := strconv.Atoi(args[0]) - if err != nil { - return err - } - - tt := c.Tests() - t, err := tt.Detail(id) - if err != nil { - return err - } - - var paused string - if t.Paused { - paused = "yes" - } else { - paused = "no" - } - - fmt.Printf("* %d: %s\n", t.TestID, colouredStatus(t.Status)) - fmt.Printf(" WebsiteName: %s\n", t.WebsiteName) - fmt.Printf(" WebsiteURL: %s\n", t.WebsiteURL) - fmt.Printf(" PingURL: %s\n", t.PingURL) - fmt.Printf(" TestType: %s\n", t.TestType) - fmt.Printf(" Paused: %s\n", paused) - fmt.Printf(" ContactID: %d\n", t.ContactID) - fmt.Printf(" Uptime: %f\n", t.Uptime) - - return nil -} - -func cmdDelete(c *statuscake.Client, args ...string) error { - if len(args) != 1 { - return fmt.Errorf("command `delete` requires a single argument `TestID`") - } - - id, err := strconv.Atoi(args[0]) - if err != nil { - return err - } - - return c.Tests().Delete(id) -} - -func askString(name string) string { - var v string - - fmt.Printf("%s: ", name) - _, err := fmt.Scanln(&v) - if err != nil { - log.Fatal(err) - } - - return v -} - -func askInt(name string) int { - v := askString(name) - i, err := strconv.Atoi(v) - if err != nil { - log.Fatalf("Invalid number `%s`", v) - } - - return i -} - -func cmdCreate(c *statuscake.Client, args ...string) error { - t := &statuscake.Test{ - WebsiteName: askString("WebsiteName"), - WebsiteURL: askString("WebsiteURL"), - TestType: askString("TestType"), - CheckRate: askInt("CheckRate"), - } - - t2, err := c.Tests().Update(t) - if err != nil { - return err - } - - fmt.Printf("CREATED: \n%+v\n", t2) - - return nil -} - -func cmdUpdate(c *statuscake.Client, args ...string) error { - if len(args) != 1 { - return fmt.Errorf("command `update` requires a single argument `TestID`") - } - - id, err := strconv.Atoi(args[0]) - if err != nil { - return err - } - - tt := c.Tests() - t, err := tt.Detail(id) - if err != nil { - return err - } - - t.TestID = id - t.WebsiteName = askString(fmt.Sprintf("WebsiteName [%s]", t.WebsiteName)) - t.WebsiteURL = askString(fmt.Sprintf("WebsiteURL [%s]", t.WebsiteURL)) - t.TestType = askString(fmt.Sprintf("TestType [%s]", t.TestType)) - t.CheckRate = askInt(fmt.Sprintf("CheckRate [%d]", t.CheckRate)) - - t2, err := c.Tests().Update(t) - if err != nil { - return err - } - - fmt.Printf("UPDATED: \n%+v\n", t2) - - return nil -} - -func usage() { - fmt.Printf("Usage:\n") - fmt.Printf(" %s COMMAND\n", os.Args[0]) - fmt.Printf("Available commands:\n") - for k := range commands { - fmt.Printf(" %+v\n", k) - } -} - -func main() { - username := getEnv("STATUSCAKE_USERNAME") - apikey := getEnv("STATUSCAKE_APIKEY") - - if len(os.Args) < 2 { - usage() - os.Exit(1) - } - - var err error - - c, err := statuscake.New(statuscake.Auth{Username: username, Apikey: apikey}) - if err != nil { - log.Fatal(err) - } - - if cmd, ok := commands[os.Args[1]]; ok { - err = cmd(c, os.Args[2:]...) - } else { - err = fmt.Errorf("Unknown command `%s`", os.Args[1]) - } - - if err != nil { - log.Fatalf("Error running command `%s`: %s", os.Args[1], err.Error()) - } -} diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/auth_error.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/auth_error.json deleted file mode 100644 index 4f14be50d..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/auth_error.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "ErrNo": 0, - "Error": "Can not access account. Was both Username and API Key provided?" -} diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_all_ok.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_all_ok.json deleted file mode 100644 index 449c34e61..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_all_ok.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "TestID": 100, - "Paused": false, - "TestType": "HTTP", - "WebsiteName": "www 1", - "ContactGroup": null, - "ContactID": 1, - "Status": "Up", - "Uptime": 100 - }, - { - "TestID": 101, - "Paused": true, - "TestType": "HTTP", - "WebsiteName": "www 2", - "ContactGroup": null, - "ContactID": 2, - "Status": "Down", - "Uptime": 0 - } -] diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_delete_error.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_delete_error.json deleted file mode 100644 index 6fad58e14..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_delete_error.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Success": false, - "Error": "this is an error" -} - diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_delete_ok.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_delete_ok.json deleted file mode 100644 index 0dd279bf3..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_delete_ok.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "TestID": 6735, - "Affected": 1, - "Success": true, - "Message": "This Check Has Been Deleted. It can not be recovered." -} diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_detail_ok.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_detail_ok.json deleted file mode 100644 index d5f357924..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_detail_ok.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "TestID": 6735, - "TestType": "HTTP", - "Paused": false, - "WebsiteName": "NL", - "ContactGroup": "StatusCake Alerts", - "ContactID": 536, - "Status": "Up", - "Uptime": 0, - "CheckRate": 60, - "Timeout": 40, - "LogoImage": "", - "WebsiteHost": "Various", - "NodeLocations": [ - "UK", - "JP", - "SG1", - "SLC" - ], - "FindString": "", - "DoNotFind": false, - "LastTested": "2013-01-20 14:38:18", - "NextLocation": "USNY", - "Processing": false, - "ProcessingState": "Pretest", - "ProcessingOn": "dalas.localdomain", - "DownTimes": "0" -} - diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_error.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_error.json deleted file mode 100644 index a76c5ebbb..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_error.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Issues": { - "WebsiteName": "issue a", - "WebsiteURL": "issue b", - "CheckRate": "issue c" - }, - "Success": false, - "Message": "Required Data is Missing." -} diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_error_slice_of_issues.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_error_slice_of_issues.json deleted file mode 100644 index 02e98ebe4..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_error_slice_of_issues.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Issues": ["hello", "world"], - "Success": false, - "Message": "Required Data is Missing." -} diff --git a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_ok.json b/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_ok.json deleted file mode 100644 index 7c2dee20b..000000000 --- a/vendor/github.com/DreamItGetIT/statuscake/fixtures/tests_update_ok.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "Issues": {}, - "Success": true, - "Message": "", - "InsertID": 1234 -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go deleted file mode 100644 index 4d6408b9d..000000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ /dev/null @@ -1,134 +0,0 @@ -// Package stscreds are credential Providers to retrieve STS AWS credentials. -// -// STS provides multiple ways to retrieve credentials which can be used when making -// future AWS service API operation calls. -package stscreds - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/service/sts" -) - -// ProviderName provides a name of AssumeRole provider -const ProviderName = "AssumeRoleProvider" - -// AssumeRoler represents the minimal subset of the STS client API used by this provider. -type AssumeRoler interface { - AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) -} - -// DefaultDuration is the default amount of time in minutes that the credentials -// will be valid for. -var DefaultDuration = time.Duration(15) * time.Minute - -// AssumeRoleProvider retrieves temporary credentials from the STS service, and -// keeps track of their expiration time. This provider must be used explicitly, -// as it is not included in the credentials chain. -type AssumeRoleProvider struct { - credentials.Expiry - - // STS client to make assume role request with. - Client AssumeRoler - - // Role to be assumed. - RoleARN string - - // Session name, if you wish to reuse the credentials elsewhere. - RoleSessionName string - - // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. - Duration time.Duration - - // Optional ExternalID to pass along, defaults to nil if not set. - ExternalID *string - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration -} - -// NewCredentials returns a pointer to a new Credentials object wrapping the -// AssumeRoleProvider. The credentials will expire every 15 minutes and the -// role will be named after a nanosecond timestamp of this operation. -// -// Takes a Config provider to create the STS client. The ConfigProvider is -// satisfied by the session.Session type. -func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { - p := &AssumeRoleProvider{ - Client: sts.New(c), - RoleARN: roleARN, - Duration: DefaultDuration, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the -// AssumeRoleProvider. The credentials will expire every 15 minutes and the -// role will be named after a nanosecond timestamp of this operation. -// -// Takes an AssumeRoler which can be satisfiede by the STS client. -func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { - p := &AssumeRoleProvider{ - Client: svc, - RoleARN: roleARN, - Duration: DefaultDuration, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// Retrieve generates a new set of temporary credentials using STS. -func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { - - // Apply defaults where parameters are not set. - if p.RoleSessionName == "" { - // Try to work out a role name that will hopefully end up unique. - p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano()) - } - if p.Duration == 0 { - // Expire as often as AWS permits. - p.Duration = DefaultDuration - } - - roleOutput, err := p.Client.AssumeRole(&sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64(p.Duration / time.Second)), - RoleArn: aws.String(p.RoleARN), - RoleSessionName: aws.String(p.RoleSessionName), - ExternalId: p.ExternalID, - }) - - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - - // We will proactively generate new credentials before they expire. - p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow) - - return credentials.Value{ - AccessKeyID: *roleOutput.Credentials.AccessKeyId, - SecretAccessKey: *roleOutput.Credentials.SecretAccessKey, - SessionToken: *roleOutput.Credentials.SessionToken, - ProviderName: ProviderName, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go deleted file mode 100644 index 5f9ed8e60..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go +++ /dev/null @@ -1,226 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package autoscalingiface provides an interface for the Auto Scaling. -package autoscalingiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/autoscaling" -) - -// AutoScalingAPI is the interface type for autoscaling.AutoScaling. -type AutoScalingAPI interface { - AttachInstancesRequest(*autoscaling.AttachInstancesInput) (*request.Request, *autoscaling.AttachInstancesOutput) - - AttachInstances(*autoscaling.AttachInstancesInput) (*autoscaling.AttachInstancesOutput, error) - - AttachLoadBalancersRequest(*autoscaling.AttachLoadBalancersInput) (*request.Request, *autoscaling.AttachLoadBalancersOutput) - - AttachLoadBalancers(*autoscaling.AttachLoadBalancersInput) (*autoscaling.AttachLoadBalancersOutput, error) - - CompleteLifecycleActionRequest(*autoscaling.CompleteLifecycleActionInput) (*request.Request, *autoscaling.CompleteLifecycleActionOutput) - - CompleteLifecycleAction(*autoscaling.CompleteLifecycleActionInput) (*autoscaling.CompleteLifecycleActionOutput, error) - - CreateAutoScalingGroupRequest(*autoscaling.CreateAutoScalingGroupInput) (*request.Request, *autoscaling.CreateAutoScalingGroupOutput) - - CreateAutoScalingGroup(*autoscaling.CreateAutoScalingGroupInput) (*autoscaling.CreateAutoScalingGroupOutput, error) - - CreateLaunchConfigurationRequest(*autoscaling.CreateLaunchConfigurationInput) (*request.Request, *autoscaling.CreateLaunchConfigurationOutput) - - CreateLaunchConfiguration(*autoscaling.CreateLaunchConfigurationInput) (*autoscaling.CreateLaunchConfigurationOutput, error) - - CreateOrUpdateTagsRequest(*autoscaling.CreateOrUpdateTagsInput) (*request.Request, *autoscaling.CreateOrUpdateTagsOutput) - - CreateOrUpdateTags(*autoscaling.CreateOrUpdateTagsInput) (*autoscaling.CreateOrUpdateTagsOutput, error) - - DeleteAutoScalingGroupRequest(*autoscaling.DeleteAutoScalingGroupInput) (*request.Request, *autoscaling.DeleteAutoScalingGroupOutput) - - DeleteAutoScalingGroup(*autoscaling.DeleteAutoScalingGroupInput) (*autoscaling.DeleteAutoScalingGroupOutput, error) - - DeleteLaunchConfigurationRequest(*autoscaling.DeleteLaunchConfigurationInput) (*request.Request, *autoscaling.DeleteLaunchConfigurationOutput) - - DeleteLaunchConfiguration(*autoscaling.DeleteLaunchConfigurationInput) (*autoscaling.DeleteLaunchConfigurationOutput, error) - - DeleteLifecycleHookRequest(*autoscaling.DeleteLifecycleHookInput) (*request.Request, *autoscaling.DeleteLifecycleHookOutput) - - DeleteLifecycleHook(*autoscaling.DeleteLifecycleHookInput) (*autoscaling.DeleteLifecycleHookOutput, error) - - DeleteNotificationConfigurationRequest(*autoscaling.DeleteNotificationConfigurationInput) (*request.Request, *autoscaling.DeleteNotificationConfigurationOutput) - - DeleteNotificationConfiguration(*autoscaling.DeleteNotificationConfigurationInput) (*autoscaling.DeleteNotificationConfigurationOutput, error) - - DeletePolicyRequest(*autoscaling.DeletePolicyInput) (*request.Request, *autoscaling.DeletePolicyOutput) - - DeletePolicy(*autoscaling.DeletePolicyInput) (*autoscaling.DeletePolicyOutput, error) - - DeleteScheduledActionRequest(*autoscaling.DeleteScheduledActionInput) (*request.Request, *autoscaling.DeleteScheduledActionOutput) - - DeleteScheduledAction(*autoscaling.DeleteScheduledActionInput) (*autoscaling.DeleteScheduledActionOutput, error) - - DeleteTagsRequest(*autoscaling.DeleteTagsInput) (*request.Request, *autoscaling.DeleteTagsOutput) - - DeleteTags(*autoscaling.DeleteTagsInput) (*autoscaling.DeleteTagsOutput, error) - - DescribeAccountLimitsRequest(*autoscaling.DescribeAccountLimitsInput) (*request.Request, *autoscaling.DescribeAccountLimitsOutput) - - DescribeAccountLimits(*autoscaling.DescribeAccountLimitsInput) (*autoscaling.DescribeAccountLimitsOutput, error) - - DescribeAdjustmentTypesRequest(*autoscaling.DescribeAdjustmentTypesInput) (*request.Request, *autoscaling.DescribeAdjustmentTypesOutput) - - DescribeAdjustmentTypes(*autoscaling.DescribeAdjustmentTypesInput) (*autoscaling.DescribeAdjustmentTypesOutput, error) - - DescribeAutoScalingGroupsRequest(*autoscaling.DescribeAutoScalingGroupsInput) (*request.Request, *autoscaling.DescribeAutoScalingGroupsOutput) - - DescribeAutoScalingGroups(*autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error) - - DescribeAutoScalingGroupsPages(*autoscaling.DescribeAutoScalingGroupsInput, func(*autoscaling.DescribeAutoScalingGroupsOutput, bool) bool) error - - DescribeAutoScalingInstancesRequest(*autoscaling.DescribeAutoScalingInstancesInput) (*request.Request, *autoscaling.DescribeAutoScalingInstancesOutput) - - DescribeAutoScalingInstances(*autoscaling.DescribeAutoScalingInstancesInput) (*autoscaling.DescribeAutoScalingInstancesOutput, error) - - DescribeAutoScalingInstancesPages(*autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool) error - - DescribeAutoScalingNotificationTypesRequest(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*request.Request, *autoscaling.DescribeAutoScalingNotificationTypesOutput) - - DescribeAutoScalingNotificationTypes(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*autoscaling.DescribeAutoScalingNotificationTypesOutput, error) - - DescribeLaunchConfigurationsRequest(*autoscaling.DescribeLaunchConfigurationsInput) (*request.Request, *autoscaling.DescribeLaunchConfigurationsOutput) - - DescribeLaunchConfigurations(*autoscaling.DescribeLaunchConfigurationsInput) (*autoscaling.DescribeLaunchConfigurationsOutput, error) - - DescribeLaunchConfigurationsPages(*autoscaling.DescribeLaunchConfigurationsInput, func(*autoscaling.DescribeLaunchConfigurationsOutput, bool) bool) error - - DescribeLifecycleHookTypesRequest(*autoscaling.DescribeLifecycleHookTypesInput) (*request.Request, *autoscaling.DescribeLifecycleHookTypesOutput) - - DescribeLifecycleHookTypes(*autoscaling.DescribeLifecycleHookTypesInput) (*autoscaling.DescribeLifecycleHookTypesOutput, error) - - DescribeLifecycleHooksRequest(*autoscaling.DescribeLifecycleHooksInput) (*request.Request, *autoscaling.DescribeLifecycleHooksOutput) - - DescribeLifecycleHooks(*autoscaling.DescribeLifecycleHooksInput) (*autoscaling.DescribeLifecycleHooksOutput, error) - - DescribeLoadBalancersRequest(*autoscaling.DescribeLoadBalancersInput) (*request.Request, *autoscaling.DescribeLoadBalancersOutput) - - DescribeLoadBalancers(*autoscaling.DescribeLoadBalancersInput) (*autoscaling.DescribeLoadBalancersOutput, error) - - DescribeMetricCollectionTypesRequest(*autoscaling.DescribeMetricCollectionTypesInput) (*request.Request, *autoscaling.DescribeMetricCollectionTypesOutput) - - DescribeMetricCollectionTypes(*autoscaling.DescribeMetricCollectionTypesInput) (*autoscaling.DescribeMetricCollectionTypesOutput, error) - - DescribeNotificationConfigurationsRequest(*autoscaling.DescribeNotificationConfigurationsInput) (*request.Request, *autoscaling.DescribeNotificationConfigurationsOutput) - - DescribeNotificationConfigurations(*autoscaling.DescribeNotificationConfigurationsInput) (*autoscaling.DescribeNotificationConfigurationsOutput, error) - - DescribeNotificationConfigurationsPages(*autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool) error - - DescribePoliciesRequest(*autoscaling.DescribePoliciesInput) (*request.Request, *autoscaling.DescribePoliciesOutput) - - DescribePolicies(*autoscaling.DescribePoliciesInput) (*autoscaling.DescribePoliciesOutput, error) - - DescribePoliciesPages(*autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool) error - - DescribeScalingActivitiesRequest(*autoscaling.DescribeScalingActivitiesInput) (*request.Request, *autoscaling.DescribeScalingActivitiesOutput) - - DescribeScalingActivities(*autoscaling.DescribeScalingActivitiesInput) (*autoscaling.DescribeScalingActivitiesOutput, error) - - DescribeScalingActivitiesPages(*autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool) error - - DescribeScalingProcessTypesRequest(*autoscaling.DescribeScalingProcessTypesInput) (*request.Request, *autoscaling.DescribeScalingProcessTypesOutput) - - DescribeScalingProcessTypes(*autoscaling.DescribeScalingProcessTypesInput) (*autoscaling.DescribeScalingProcessTypesOutput, error) - - DescribeScheduledActionsRequest(*autoscaling.DescribeScheduledActionsInput) (*request.Request, *autoscaling.DescribeScheduledActionsOutput) - - DescribeScheduledActions(*autoscaling.DescribeScheduledActionsInput) (*autoscaling.DescribeScheduledActionsOutput, error) - - DescribeScheduledActionsPages(*autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool) error - - DescribeTagsRequest(*autoscaling.DescribeTagsInput) (*request.Request, *autoscaling.DescribeTagsOutput) - - DescribeTags(*autoscaling.DescribeTagsInput) (*autoscaling.DescribeTagsOutput, error) - - DescribeTagsPages(*autoscaling.DescribeTagsInput, func(*autoscaling.DescribeTagsOutput, bool) bool) error - - DescribeTerminationPolicyTypesRequest(*autoscaling.DescribeTerminationPolicyTypesInput) (*request.Request, *autoscaling.DescribeTerminationPolicyTypesOutput) - - DescribeTerminationPolicyTypes(*autoscaling.DescribeTerminationPolicyTypesInput) (*autoscaling.DescribeTerminationPolicyTypesOutput, error) - - DetachInstancesRequest(*autoscaling.DetachInstancesInput) (*request.Request, *autoscaling.DetachInstancesOutput) - - DetachInstances(*autoscaling.DetachInstancesInput) (*autoscaling.DetachInstancesOutput, error) - - DetachLoadBalancersRequest(*autoscaling.DetachLoadBalancersInput) (*request.Request, *autoscaling.DetachLoadBalancersOutput) - - DetachLoadBalancers(*autoscaling.DetachLoadBalancersInput) (*autoscaling.DetachLoadBalancersOutput, error) - - DisableMetricsCollectionRequest(*autoscaling.DisableMetricsCollectionInput) (*request.Request, *autoscaling.DisableMetricsCollectionOutput) - - DisableMetricsCollection(*autoscaling.DisableMetricsCollectionInput) (*autoscaling.DisableMetricsCollectionOutput, error) - - EnableMetricsCollectionRequest(*autoscaling.EnableMetricsCollectionInput) (*request.Request, *autoscaling.EnableMetricsCollectionOutput) - - EnableMetricsCollection(*autoscaling.EnableMetricsCollectionInput) (*autoscaling.EnableMetricsCollectionOutput, error) - - EnterStandbyRequest(*autoscaling.EnterStandbyInput) (*request.Request, *autoscaling.EnterStandbyOutput) - - EnterStandby(*autoscaling.EnterStandbyInput) (*autoscaling.EnterStandbyOutput, error) - - ExecutePolicyRequest(*autoscaling.ExecutePolicyInput) (*request.Request, *autoscaling.ExecutePolicyOutput) - - ExecutePolicy(*autoscaling.ExecutePolicyInput) (*autoscaling.ExecutePolicyOutput, error) - - ExitStandbyRequest(*autoscaling.ExitStandbyInput) (*request.Request, *autoscaling.ExitStandbyOutput) - - ExitStandby(*autoscaling.ExitStandbyInput) (*autoscaling.ExitStandbyOutput, error) - - PutLifecycleHookRequest(*autoscaling.PutLifecycleHookInput) (*request.Request, *autoscaling.PutLifecycleHookOutput) - - PutLifecycleHook(*autoscaling.PutLifecycleHookInput) (*autoscaling.PutLifecycleHookOutput, error) - - PutNotificationConfigurationRequest(*autoscaling.PutNotificationConfigurationInput) (*request.Request, *autoscaling.PutNotificationConfigurationOutput) - - PutNotificationConfiguration(*autoscaling.PutNotificationConfigurationInput) (*autoscaling.PutNotificationConfigurationOutput, error) - - PutScalingPolicyRequest(*autoscaling.PutScalingPolicyInput) (*request.Request, *autoscaling.PutScalingPolicyOutput) - - PutScalingPolicy(*autoscaling.PutScalingPolicyInput) (*autoscaling.PutScalingPolicyOutput, error) - - PutScheduledUpdateGroupActionRequest(*autoscaling.PutScheduledUpdateGroupActionInput) (*request.Request, *autoscaling.PutScheduledUpdateGroupActionOutput) - - PutScheduledUpdateGroupAction(*autoscaling.PutScheduledUpdateGroupActionInput) (*autoscaling.PutScheduledUpdateGroupActionOutput, error) - - RecordLifecycleActionHeartbeatRequest(*autoscaling.RecordLifecycleActionHeartbeatInput) (*request.Request, *autoscaling.RecordLifecycleActionHeartbeatOutput) - - RecordLifecycleActionHeartbeat(*autoscaling.RecordLifecycleActionHeartbeatInput) (*autoscaling.RecordLifecycleActionHeartbeatOutput, error) - - ResumeProcessesRequest(*autoscaling.ScalingProcessQuery) (*request.Request, *autoscaling.ResumeProcessesOutput) - - ResumeProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.ResumeProcessesOutput, error) - - SetDesiredCapacityRequest(*autoscaling.SetDesiredCapacityInput) (*request.Request, *autoscaling.SetDesiredCapacityOutput) - - SetDesiredCapacity(*autoscaling.SetDesiredCapacityInput) (*autoscaling.SetDesiredCapacityOutput, error) - - SetInstanceHealthRequest(*autoscaling.SetInstanceHealthInput) (*request.Request, *autoscaling.SetInstanceHealthOutput) - - SetInstanceHealth(*autoscaling.SetInstanceHealthInput) (*autoscaling.SetInstanceHealthOutput, error) - - SetInstanceProtectionRequest(*autoscaling.SetInstanceProtectionInput) (*request.Request, *autoscaling.SetInstanceProtectionOutput) - - SetInstanceProtection(*autoscaling.SetInstanceProtectionInput) (*autoscaling.SetInstanceProtectionOutput, error) - - SuspendProcessesRequest(*autoscaling.ScalingProcessQuery) (*request.Request, *autoscaling.SuspendProcessesOutput) - - SuspendProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.SuspendProcessesOutput, error) - - TerminateInstanceInAutoScalingGroupRequest(*autoscaling.TerminateInstanceInAutoScalingGroupInput) (*request.Request, *autoscaling.TerminateInstanceInAutoScalingGroupOutput) - - TerminateInstanceInAutoScalingGroup(*autoscaling.TerminateInstanceInAutoScalingGroupInput) (*autoscaling.TerminateInstanceInAutoScalingGroupOutput, error) - - UpdateAutoScalingGroupRequest(*autoscaling.UpdateAutoScalingGroupInput) (*request.Request, *autoscaling.UpdateAutoScalingGroupOutput) - - UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error) -} - -var _ AutoScalingAPI = (*autoscaling.AutoScaling)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go deleted file mode 100644 index fc4e19afa..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface/interface.go +++ /dev/null @@ -1,98 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudformationiface provides an interface for the AWS CloudFormation. -package cloudformationiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/cloudformation" -) - -// CloudFormationAPI is the interface type for cloudformation.CloudFormation. -type CloudFormationAPI interface { - CancelUpdateStackRequest(*cloudformation.CancelUpdateStackInput) (*request.Request, *cloudformation.CancelUpdateStackOutput) - - CancelUpdateStack(*cloudformation.CancelUpdateStackInput) (*cloudformation.CancelUpdateStackOutput, error) - - ContinueUpdateRollbackRequest(*cloudformation.ContinueUpdateRollbackInput) (*request.Request, *cloudformation.ContinueUpdateRollbackOutput) - - ContinueUpdateRollback(*cloudformation.ContinueUpdateRollbackInput) (*cloudformation.ContinueUpdateRollbackOutput, error) - - CreateStackRequest(*cloudformation.CreateStackInput) (*request.Request, *cloudformation.CreateStackOutput) - - CreateStack(*cloudformation.CreateStackInput) (*cloudformation.CreateStackOutput, error) - - DeleteStackRequest(*cloudformation.DeleteStackInput) (*request.Request, *cloudformation.DeleteStackOutput) - - DeleteStack(*cloudformation.DeleteStackInput) (*cloudformation.DeleteStackOutput, error) - - DescribeAccountLimitsRequest(*cloudformation.DescribeAccountLimitsInput) (*request.Request, *cloudformation.DescribeAccountLimitsOutput) - - DescribeAccountLimits(*cloudformation.DescribeAccountLimitsInput) (*cloudformation.DescribeAccountLimitsOutput, error) - - DescribeStackEventsRequest(*cloudformation.DescribeStackEventsInput) (*request.Request, *cloudformation.DescribeStackEventsOutput) - - DescribeStackEvents(*cloudformation.DescribeStackEventsInput) (*cloudformation.DescribeStackEventsOutput, error) - - DescribeStackEventsPages(*cloudformation.DescribeStackEventsInput, func(*cloudformation.DescribeStackEventsOutput, bool) bool) error - - DescribeStackResourceRequest(*cloudformation.DescribeStackResourceInput) (*request.Request, *cloudformation.DescribeStackResourceOutput) - - DescribeStackResource(*cloudformation.DescribeStackResourceInput) (*cloudformation.DescribeStackResourceOutput, error) - - DescribeStackResourcesRequest(*cloudformation.DescribeStackResourcesInput) (*request.Request, *cloudformation.DescribeStackResourcesOutput) - - DescribeStackResources(*cloudformation.DescribeStackResourcesInput) (*cloudformation.DescribeStackResourcesOutput, error) - - DescribeStacksRequest(*cloudformation.DescribeStacksInput) (*request.Request, *cloudformation.DescribeStacksOutput) - - DescribeStacks(*cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error) - - DescribeStacksPages(*cloudformation.DescribeStacksInput, func(*cloudformation.DescribeStacksOutput, bool) bool) error - - EstimateTemplateCostRequest(*cloudformation.EstimateTemplateCostInput) (*request.Request, *cloudformation.EstimateTemplateCostOutput) - - EstimateTemplateCost(*cloudformation.EstimateTemplateCostInput) (*cloudformation.EstimateTemplateCostOutput, error) - - GetStackPolicyRequest(*cloudformation.GetStackPolicyInput) (*request.Request, *cloudformation.GetStackPolicyOutput) - - GetStackPolicy(*cloudformation.GetStackPolicyInput) (*cloudformation.GetStackPolicyOutput, error) - - GetTemplateRequest(*cloudformation.GetTemplateInput) (*request.Request, *cloudformation.GetTemplateOutput) - - GetTemplate(*cloudformation.GetTemplateInput) (*cloudformation.GetTemplateOutput, error) - - GetTemplateSummaryRequest(*cloudformation.GetTemplateSummaryInput) (*request.Request, *cloudformation.GetTemplateSummaryOutput) - - GetTemplateSummary(*cloudformation.GetTemplateSummaryInput) (*cloudformation.GetTemplateSummaryOutput, error) - - ListStackResourcesRequest(*cloudformation.ListStackResourcesInput) (*request.Request, *cloudformation.ListStackResourcesOutput) - - ListStackResources(*cloudformation.ListStackResourcesInput) (*cloudformation.ListStackResourcesOutput, error) - - ListStackResourcesPages(*cloudformation.ListStackResourcesInput, func(*cloudformation.ListStackResourcesOutput, bool) bool) error - - ListStacksRequest(*cloudformation.ListStacksInput) (*request.Request, *cloudformation.ListStacksOutput) - - ListStacks(*cloudformation.ListStacksInput) (*cloudformation.ListStacksOutput, error) - - ListStacksPages(*cloudformation.ListStacksInput, func(*cloudformation.ListStacksOutput, bool) bool) error - - SetStackPolicyRequest(*cloudformation.SetStackPolicyInput) (*request.Request, *cloudformation.SetStackPolicyOutput) - - SetStackPolicy(*cloudformation.SetStackPolicyInput) (*cloudformation.SetStackPolicyOutput, error) - - SignalResourceRequest(*cloudformation.SignalResourceInput) (*request.Request, *cloudformation.SignalResourceOutput) - - SignalResource(*cloudformation.SignalResourceInput) (*cloudformation.SignalResourceOutput, error) - - UpdateStackRequest(*cloudformation.UpdateStackInput) (*request.Request, *cloudformation.UpdateStackOutput) - - UpdateStack(*cloudformation.UpdateStackInput) (*cloudformation.UpdateStackOutput, error) - - ValidateTemplateRequest(*cloudformation.ValidateTemplateInput) (*request.Request, *cloudformation.ValidateTemplateOutput) - - ValidateTemplate(*cloudformation.ValidateTemplateInput) (*cloudformation.ValidateTemplateOutput, error) -} - -var _ CloudFormationAPI = (*cloudformation.CloudFormation)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/cloudtrailiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/cloudtrailiface/interface.go deleted file mode 100644 index 3100f701a..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/cloudtrailiface/interface.go +++ /dev/null @@ -1,62 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudtrailiface provides an interface for the AWS CloudTrail. -package cloudtrailiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/cloudtrail" -) - -// CloudTrailAPI is the interface type for cloudtrail.CloudTrail. -type CloudTrailAPI interface { - AddTagsRequest(*cloudtrail.AddTagsInput) (*request.Request, *cloudtrail.AddTagsOutput) - - AddTags(*cloudtrail.AddTagsInput) (*cloudtrail.AddTagsOutput, error) - - CreateTrailRequest(*cloudtrail.CreateTrailInput) (*request.Request, *cloudtrail.CreateTrailOutput) - - CreateTrail(*cloudtrail.CreateTrailInput) (*cloudtrail.CreateTrailOutput, error) - - DeleteTrailRequest(*cloudtrail.DeleteTrailInput) (*request.Request, *cloudtrail.DeleteTrailOutput) - - DeleteTrail(*cloudtrail.DeleteTrailInput) (*cloudtrail.DeleteTrailOutput, error) - - DescribeTrailsRequest(*cloudtrail.DescribeTrailsInput) (*request.Request, *cloudtrail.DescribeTrailsOutput) - - DescribeTrails(*cloudtrail.DescribeTrailsInput) (*cloudtrail.DescribeTrailsOutput, error) - - GetTrailStatusRequest(*cloudtrail.GetTrailStatusInput) (*request.Request, *cloudtrail.GetTrailStatusOutput) - - GetTrailStatus(*cloudtrail.GetTrailStatusInput) (*cloudtrail.GetTrailStatusOutput, error) - - ListPublicKeysRequest(*cloudtrail.ListPublicKeysInput) (*request.Request, *cloudtrail.ListPublicKeysOutput) - - ListPublicKeys(*cloudtrail.ListPublicKeysInput) (*cloudtrail.ListPublicKeysOutput, error) - - ListTagsRequest(*cloudtrail.ListTagsInput) (*request.Request, *cloudtrail.ListTagsOutput) - - ListTags(*cloudtrail.ListTagsInput) (*cloudtrail.ListTagsOutput, error) - - LookupEventsRequest(*cloudtrail.LookupEventsInput) (*request.Request, *cloudtrail.LookupEventsOutput) - - LookupEvents(*cloudtrail.LookupEventsInput) (*cloudtrail.LookupEventsOutput, error) - - RemoveTagsRequest(*cloudtrail.RemoveTagsInput) (*request.Request, *cloudtrail.RemoveTagsOutput) - - RemoveTags(*cloudtrail.RemoveTagsInput) (*cloudtrail.RemoveTagsOutput, error) - - StartLoggingRequest(*cloudtrail.StartLoggingInput) (*request.Request, *cloudtrail.StartLoggingOutput) - - StartLogging(*cloudtrail.StartLoggingInput) (*cloudtrail.StartLoggingOutput, error) - - StopLoggingRequest(*cloudtrail.StopLoggingInput) (*request.Request, *cloudtrail.StopLoggingOutput) - - StopLogging(*cloudtrail.StopLoggingInput) (*cloudtrail.StopLoggingOutput, error) - - UpdateTrailRequest(*cloudtrail.UpdateTrailInput) (*request.Request, *cloudtrail.UpdateTrailOutput) - - UpdateTrail(*cloudtrail.UpdateTrailInput) (*cloudtrail.UpdateTrailOutput, error) -} - -var _ CloudTrailAPI = (*cloudtrail.CloudTrail)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go deleted file mode 100644 index 140dc9e98..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go +++ /dev/null @@ -1,64 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudwatchiface provides an interface for the Amazon CloudWatch. -package cloudwatchiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/cloudwatch" -) - -// CloudWatchAPI is the interface type for cloudwatch.CloudWatch. -type CloudWatchAPI interface { - DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*request.Request, *cloudwatch.DeleteAlarmsOutput) - - DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error) - - DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*request.Request, *cloudwatch.DescribeAlarmHistoryOutput) - - DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error) - - DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error - - DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput) - - DescribeAlarms(*cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error) - - DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error - - DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput) - - DescribeAlarmsForMetric(*cloudwatch.DescribeAlarmsForMetricInput) (*cloudwatch.DescribeAlarmsForMetricOutput, error) - - DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput) - - DisableAlarmActions(*cloudwatch.DisableAlarmActionsInput) (*cloudwatch.DisableAlarmActionsOutput, error) - - EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput) - - EnableAlarmActions(*cloudwatch.EnableAlarmActionsInput) (*cloudwatch.EnableAlarmActionsOutput, error) - - GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput) - - GetMetricStatistics(*cloudwatch.GetMetricStatisticsInput) (*cloudwatch.GetMetricStatisticsOutput, error) - - ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput) - - ListMetrics(*cloudwatch.ListMetricsInput) (*cloudwatch.ListMetricsOutput, error) - - ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error - - PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput) - - PutMetricAlarm(*cloudwatch.PutMetricAlarmInput) (*cloudwatch.PutMetricAlarmOutput, error) - - PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput) - - PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error) - - SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput) - - SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error) -} - -var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/cloudwatcheventsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/cloudwatcheventsiface/interface.go deleted file mode 100644 index 92d299f1e..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/cloudwatcheventsiface/interface.go +++ /dev/null @@ -1,62 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudwatcheventsiface provides an interface for the Amazon CloudWatch Events. -package cloudwatcheventsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/cloudwatchevents" -) - -// CloudWatchEventsAPI is the interface type for cloudwatchevents.CloudWatchEvents. -type CloudWatchEventsAPI interface { - DeleteRuleRequest(*cloudwatchevents.DeleteRuleInput) (*request.Request, *cloudwatchevents.DeleteRuleOutput) - - DeleteRule(*cloudwatchevents.DeleteRuleInput) (*cloudwatchevents.DeleteRuleOutput, error) - - DescribeRuleRequest(*cloudwatchevents.DescribeRuleInput) (*request.Request, *cloudwatchevents.DescribeRuleOutput) - - DescribeRule(*cloudwatchevents.DescribeRuleInput) (*cloudwatchevents.DescribeRuleOutput, error) - - DisableRuleRequest(*cloudwatchevents.DisableRuleInput) (*request.Request, *cloudwatchevents.DisableRuleOutput) - - DisableRule(*cloudwatchevents.DisableRuleInput) (*cloudwatchevents.DisableRuleOutput, error) - - EnableRuleRequest(*cloudwatchevents.EnableRuleInput) (*request.Request, *cloudwatchevents.EnableRuleOutput) - - EnableRule(*cloudwatchevents.EnableRuleInput) (*cloudwatchevents.EnableRuleOutput, error) - - ListRuleNamesByTargetRequest(*cloudwatchevents.ListRuleNamesByTargetInput) (*request.Request, *cloudwatchevents.ListRuleNamesByTargetOutput) - - ListRuleNamesByTarget(*cloudwatchevents.ListRuleNamesByTargetInput) (*cloudwatchevents.ListRuleNamesByTargetOutput, error) - - ListRulesRequest(*cloudwatchevents.ListRulesInput) (*request.Request, *cloudwatchevents.ListRulesOutput) - - ListRules(*cloudwatchevents.ListRulesInput) (*cloudwatchevents.ListRulesOutput, error) - - ListTargetsByRuleRequest(*cloudwatchevents.ListTargetsByRuleInput) (*request.Request, *cloudwatchevents.ListTargetsByRuleOutput) - - ListTargetsByRule(*cloudwatchevents.ListTargetsByRuleInput) (*cloudwatchevents.ListTargetsByRuleOutput, error) - - PutEventsRequest(*cloudwatchevents.PutEventsInput) (*request.Request, *cloudwatchevents.PutEventsOutput) - - PutEvents(*cloudwatchevents.PutEventsInput) (*cloudwatchevents.PutEventsOutput, error) - - PutRuleRequest(*cloudwatchevents.PutRuleInput) (*request.Request, *cloudwatchevents.PutRuleOutput) - - PutRule(*cloudwatchevents.PutRuleInput) (*cloudwatchevents.PutRuleOutput, error) - - PutTargetsRequest(*cloudwatchevents.PutTargetsInput) (*request.Request, *cloudwatchevents.PutTargetsOutput) - - PutTargets(*cloudwatchevents.PutTargetsInput) (*cloudwatchevents.PutTargetsOutput, error) - - RemoveTargetsRequest(*cloudwatchevents.RemoveTargetsInput) (*request.Request, *cloudwatchevents.RemoveTargetsOutput) - - RemoveTargets(*cloudwatchevents.RemoveTargetsInput) (*cloudwatchevents.RemoveTargetsOutput, error) - - TestEventPatternRequest(*cloudwatchevents.TestEventPatternInput) (*request.Request, *cloudwatchevents.TestEventPatternOutput) - - TestEventPattern(*cloudwatchevents.TestEventPatternInput) (*cloudwatchevents.TestEventPatternOutput, error) -} - -var _ CloudWatchEventsAPI = (*cloudwatchevents.CloudWatchEvents)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface/interface.go deleted file mode 100644 index c4d87b795..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface/interface.go +++ /dev/null @@ -1,128 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package cloudwatchlogsiface provides an interface for the Amazon CloudWatch Logs. -package cloudwatchlogsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/cloudwatchlogs" -) - -// CloudWatchLogsAPI is the interface type for cloudwatchlogs.CloudWatchLogs. -type CloudWatchLogsAPI interface { - CancelExportTaskRequest(*cloudwatchlogs.CancelExportTaskInput) (*request.Request, *cloudwatchlogs.CancelExportTaskOutput) - - CancelExportTask(*cloudwatchlogs.CancelExportTaskInput) (*cloudwatchlogs.CancelExportTaskOutput, error) - - CreateExportTaskRequest(*cloudwatchlogs.CreateExportTaskInput) (*request.Request, *cloudwatchlogs.CreateExportTaskOutput) - - CreateExportTask(*cloudwatchlogs.CreateExportTaskInput) (*cloudwatchlogs.CreateExportTaskOutput, error) - - CreateLogGroupRequest(*cloudwatchlogs.CreateLogGroupInput) (*request.Request, *cloudwatchlogs.CreateLogGroupOutput) - - CreateLogGroup(*cloudwatchlogs.CreateLogGroupInput) (*cloudwatchlogs.CreateLogGroupOutput, error) - - CreateLogStreamRequest(*cloudwatchlogs.CreateLogStreamInput) (*request.Request, *cloudwatchlogs.CreateLogStreamOutput) - - CreateLogStream(*cloudwatchlogs.CreateLogStreamInput) (*cloudwatchlogs.CreateLogStreamOutput, error) - - DeleteDestinationRequest(*cloudwatchlogs.DeleteDestinationInput) (*request.Request, *cloudwatchlogs.DeleteDestinationOutput) - - DeleteDestination(*cloudwatchlogs.DeleteDestinationInput) (*cloudwatchlogs.DeleteDestinationOutput, error) - - DeleteLogGroupRequest(*cloudwatchlogs.DeleteLogGroupInput) (*request.Request, *cloudwatchlogs.DeleteLogGroupOutput) - - DeleteLogGroup(*cloudwatchlogs.DeleteLogGroupInput) (*cloudwatchlogs.DeleteLogGroupOutput, error) - - DeleteLogStreamRequest(*cloudwatchlogs.DeleteLogStreamInput) (*request.Request, *cloudwatchlogs.DeleteLogStreamOutput) - - DeleteLogStream(*cloudwatchlogs.DeleteLogStreamInput) (*cloudwatchlogs.DeleteLogStreamOutput, error) - - DeleteMetricFilterRequest(*cloudwatchlogs.DeleteMetricFilterInput) (*request.Request, *cloudwatchlogs.DeleteMetricFilterOutput) - - DeleteMetricFilter(*cloudwatchlogs.DeleteMetricFilterInput) (*cloudwatchlogs.DeleteMetricFilterOutput, error) - - DeleteRetentionPolicyRequest(*cloudwatchlogs.DeleteRetentionPolicyInput) (*request.Request, *cloudwatchlogs.DeleteRetentionPolicyOutput) - - DeleteRetentionPolicy(*cloudwatchlogs.DeleteRetentionPolicyInput) (*cloudwatchlogs.DeleteRetentionPolicyOutput, error) - - DeleteSubscriptionFilterRequest(*cloudwatchlogs.DeleteSubscriptionFilterInput) (*request.Request, *cloudwatchlogs.DeleteSubscriptionFilterOutput) - - DeleteSubscriptionFilter(*cloudwatchlogs.DeleteSubscriptionFilterInput) (*cloudwatchlogs.DeleteSubscriptionFilterOutput, error) - - DescribeDestinationsRequest(*cloudwatchlogs.DescribeDestinationsInput) (*request.Request, *cloudwatchlogs.DescribeDestinationsOutput) - - DescribeDestinations(*cloudwatchlogs.DescribeDestinationsInput) (*cloudwatchlogs.DescribeDestinationsOutput, error) - - DescribeDestinationsPages(*cloudwatchlogs.DescribeDestinationsInput, func(*cloudwatchlogs.DescribeDestinationsOutput, bool) bool) error - - DescribeExportTasksRequest(*cloudwatchlogs.DescribeExportTasksInput) (*request.Request, *cloudwatchlogs.DescribeExportTasksOutput) - - DescribeExportTasks(*cloudwatchlogs.DescribeExportTasksInput) (*cloudwatchlogs.DescribeExportTasksOutput, error) - - DescribeLogGroupsRequest(*cloudwatchlogs.DescribeLogGroupsInput) (*request.Request, *cloudwatchlogs.DescribeLogGroupsOutput) - - DescribeLogGroups(*cloudwatchlogs.DescribeLogGroupsInput) (*cloudwatchlogs.DescribeLogGroupsOutput, error) - - DescribeLogGroupsPages(*cloudwatchlogs.DescribeLogGroupsInput, func(*cloudwatchlogs.DescribeLogGroupsOutput, bool) bool) error - - DescribeLogStreamsRequest(*cloudwatchlogs.DescribeLogStreamsInput) (*request.Request, *cloudwatchlogs.DescribeLogStreamsOutput) - - DescribeLogStreams(*cloudwatchlogs.DescribeLogStreamsInput) (*cloudwatchlogs.DescribeLogStreamsOutput, error) - - DescribeLogStreamsPages(*cloudwatchlogs.DescribeLogStreamsInput, func(*cloudwatchlogs.DescribeLogStreamsOutput, bool) bool) error - - DescribeMetricFiltersRequest(*cloudwatchlogs.DescribeMetricFiltersInput) (*request.Request, *cloudwatchlogs.DescribeMetricFiltersOutput) - - DescribeMetricFilters(*cloudwatchlogs.DescribeMetricFiltersInput) (*cloudwatchlogs.DescribeMetricFiltersOutput, error) - - DescribeMetricFiltersPages(*cloudwatchlogs.DescribeMetricFiltersInput, func(*cloudwatchlogs.DescribeMetricFiltersOutput, bool) bool) error - - DescribeSubscriptionFiltersRequest(*cloudwatchlogs.DescribeSubscriptionFiltersInput) (*request.Request, *cloudwatchlogs.DescribeSubscriptionFiltersOutput) - - DescribeSubscriptionFilters(*cloudwatchlogs.DescribeSubscriptionFiltersInput) (*cloudwatchlogs.DescribeSubscriptionFiltersOutput, error) - - DescribeSubscriptionFiltersPages(*cloudwatchlogs.DescribeSubscriptionFiltersInput, func(*cloudwatchlogs.DescribeSubscriptionFiltersOutput, bool) bool) error - - FilterLogEventsRequest(*cloudwatchlogs.FilterLogEventsInput) (*request.Request, *cloudwatchlogs.FilterLogEventsOutput) - - FilterLogEvents(*cloudwatchlogs.FilterLogEventsInput) (*cloudwatchlogs.FilterLogEventsOutput, error) - - FilterLogEventsPages(*cloudwatchlogs.FilterLogEventsInput, func(*cloudwatchlogs.FilterLogEventsOutput, bool) bool) error - - GetLogEventsRequest(*cloudwatchlogs.GetLogEventsInput) (*request.Request, *cloudwatchlogs.GetLogEventsOutput) - - GetLogEvents(*cloudwatchlogs.GetLogEventsInput) (*cloudwatchlogs.GetLogEventsOutput, error) - - GetLogEventsPages(*cloudwatchlogs.GetLogEventsInput, func(*cloudwatchlogs.GetLogEventsOutput, bool) bool) error - - PutDestinationRequest(*cloudwatchlogs.PutDestinationInput) (*request.Request, *cloudwatchlogs.PutDestinationOutput) - - PutDestination(*cloudwatchlogs.PutDestinationInput) (*cloudwatchlogs.PutDestinationOutput, error) - - PutDestinationPolicyRequest(*cloudwatchlogs.PutDestinationPolicyInput) (*request.Request, *cloudwatchlogs.PutDestinationPolicyOutput) - - PutDestinationPolicy(*cloudwatchlogs.PutDestinationPolicyInput) (*cloudwatchlogs.PutDestinationPolicyOutput, error) - - PutLogEventsRequest(*cloudwatchlogs.PutLogEventsInput) (*request.Request, *cloudwatchlogs.PutLogEventsOutput) - - PutLogEvents(*cloudwatchlogs.PutLogEventsInput) (*cloudwatchlogs.PutLogEventsOutput, error) - - PutMetricFilterRequest(*cloudwatchlogs.PutMetricFilterInput) (*request.Request, *cloudwatchlogs.PutMetricFilterOutput) - - PutMetricFilter(*cloudwatchlogs.PutMetricFilterInput) (*cloudwatchlogs.PutMetricFilterOutput, error) - - PutRetentionPolicyRequest(*cloudwatchlogs.PutRetentionPolicyInput) (*request.Request, *cloudwatchlogs.PutRetentionPolicyOutput) - - PutRetentionPolicy(*cloudwatchlogs.PutRetentionPolicyInput) (*cloudwatchlogs.PutRetentionPolicyOutput, error) - - PutSubscriptionFilterRequest(*cloudwatchlogs.PutSubscriptionFilterInput) (*request.Request, *cloudwatchlogs.PutSubscriptionFilterOutput) - - PutSubscriptionFilter(*cloudwatchlogs.PutSubscriptionFilterInput) (*cloudwatchlogs.PutSubscriptionFilterOutput, error) - - TestMetricFilterRequest(*cloudwatchlogs.TestMetricFilterInput) (*request.Request, *cloudwatchlogs.TestMetricFilterOutput) - - TestMetricFilter(*cloudwatchlogs.TestMetricFilterInput) (*cloudwatchlogs.TestMetricFilterOutput, error) -} - -var _ CloudWatchLogsAPI = (*cloudwatchlogs.CloudWatchLogs)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/codecommitiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/codecommitiface/interface.go deleted file mode 100644 index fb949d6c6..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/codecommitiface/interface.go +++ /dev/null @@ -1,58 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package codecommitiface provides an interface for the AWS CodeCommit. -package codecommitiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/codecommit" -) - -// CodeCommitAPI is the interface type for codecommit.CodeCommit. -type CodeCommitAPI interface { - BatchGetRepositoriesRequest(*codecommit.BatchGetRepositoriesInput) (*request.Request, *codecommit.BatchGetRepositoriesOutput) - - BatchGetRepositories(*codecommit.BatchGetRepositoriesInput) (*codecommit.BatchGetRepositoriesOutput, error) - - CreateBranchRequest(*codecommit.CreateBranchInput) (*request.Request, *codecommit.CreateBranchOutput) - - CreateBranch(*codecommit.CreateBranchInput) (*codecommit.CreateBranchOutput, error) - - CreateRepositoryRequest(*codecommit.CreateRepositoryInput) (*request.Request, *codecommit.CreateRepositoryOutput) - - CreateRepository(*codecommit.CreateRepositoryInput) (*codecommit.CreateRepositoryOutput, error) - - DeleteRepositoryRequest(*codecommit.DeleteRepositoryInput) (*request.Request, *codecommit.DeleteRepositoryOutput) - - DeleteRepository(*codecommit.DeleteRepositoryInput) (*codecommit.DeleteRepositoryOutput, error) - - GetBranchRequest(*codecommit.GetBranchInput) (*request.Request, *codecommit.GetBranchOutput) - - GetBranch(*codecommit.GetBranchInput) (*codecommit.GetBranchOutput, error) - - GetRepositoryRequest(*codecommit.GetRepositoryInput) (*request.Request, *codecommit.GetRepositoryOutput) - - GetRepository(*codecommit.GetRepositoryInput) (*codecommit.GetRepositoryOutput, error) - - ListBranchesRequest(*codecommit.ListBranchesInput) (*request.Request, *codecommit.ListBranchesOutput) - - ListBranches(*codecommit.ListBranchesInput) (*codecommit.ListBranchesOutput, error) - - ListRepositoriesRequest(*codecommit.ListRepositoriesInput) (*request.Request, *codecommit.ListRepositoriesOutput) - - ListRepositories(*codecommit.ListRepositoriesInput) (*codecommit.ListRepositoriesOutput, error) - - UpdateDefaultBranchRequest(*codecommit.UpdateDefaultBranchInput) (*request.Request, *codecommit.UpdateDefaultBranchOutput) - - UpdateDefaultBranch(*codecommit.UpdateDefaultBranchInput) (*codecommit.UpdateDefaultBranchOutput, error) - - UpdateRepositoryDescriptionRequest(*codecommit.UpdateRepositoryDescriptionInput) (*request.Request, *codecommit.UpdateRepositoryDescriptionOutput) - - UpdateRepositoryDescription(*codecommit.UpdateRepositoryDescriptionInput) (*codecommit.UpdateRepositoryDescriptionOutput, error) - - UpdateRepositoryNameRequest(*codecommit.UpdateRepositoryNameInput) (*request.Request, *codecommit.UpdateRepositoryNameOutput) - - UpdateRepositoryName(*codecommit.UpdateRepositoryNameInput) (*codecommit.UpdateRepositoryNameOutput, error) -} - -var _ CodeCommitAPI = (*codecommit.CodeCommit)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/codedeployiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/codedeployiface/interface.go deleted file mode 100644 index 83066e488..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/codedeployiface/interface.go +++ /dev/null @@ -1,154 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package codedeployiface provides an interface for the AWS CodeDeploy. -package codedeployiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/codedeploy" -) - -// CodeDeployAPI is the interface type for codedeploy.CodeDeploy. -type CodeDeployAPI interface { - AddTagsToOnPremisesInstancesRequest(*codedeploy.AddTagsToOnPremisesInstancesInput) (*request.Request, *codedeploy.AddTagsToOnPremisesInstancesOutput) - - AddTagsToOnPremisesInstances(*codedeploy.AddTagsToOnPremisesInstancesInput) (*codedeploy.AddTagsToOnPremisesInstancesOutput, error) - - BatchGetApplicationsRequest(*codedeploy.BatchGetApplicationsInput) (*request.Request, *codedeploy.BatchGetApplicationsOutput) - - BatchGetApplications(*codedeploy.BatchGetApplicationsInput) (*codedeploy.BatchGetApplicationsOutput, error) - - BatchGetDeploymentsRequest(*codedeploy.BatchGetDeploymentsInput) (*request.Request, *codedeploy.BatchGetDeploymentsOutput) - - BatchGetDeployments(*codedeploy.BatchGetDeploymentsInput) (*codedeploy.BatchGetDeploymentsOutput, error) - - BatchGetOnPremisesInstancesRequest(*codedeploy.BatchGetOnPremisesInstancesInput) (*request.Request, *codedeploy.BatchGetOnPremisesInstancesOutput) - - BatchGetOnPremisesInstances(*codedeploy.BatchGetOnPremisesInstancesInput) (*codedeploy.BatchGetOnPremisesInstancesOutput, error) - - CreateApplicationRequest(*codedeploy.CreateApplicationInput) (*request.Request, *codedeploy.CreateApplicationOutput) - - CreateApplication(*codedeploy.CreateApplicationInput) (*codedeploy.CreateApplicationOutput, error) - - CreateDeploymentRequest(*codedeploy.CreateDeploymentInput) (*request.Request, *codedeploy.CreateDeploymentOutput) - - CreateDeployment(*codedeploy.CreateDeploymentInput) (*codedeploy.CreateDeploymentOutput, error) - - CreateDeploymentConfigRequest(*codedeploy.CreateDeploymentConfigInput) (*request.Request, *codedeploy.CreateDeploymentConfigOutput) - - CreateDeploymentConfig(*codedeploy.CreateDeploymentConfigInput) (*codedeploy.CreateDeploymentConfigOutput, error) - - CreateDeploymentGroupRequest(*codedeploy.CreateDeploymentGroupInput) (*request.Request, *codedeploy.CreateDeploymentGroupOutput) - - CreateDeploymentGroup(*codedeploy.CreateDeploymentGroupInput) (*codedeploy.CreateDeploymentGroupOutput, error) - - DeleteApplicationRequest(*codedeploy.DeleteApplicationInput) (*request.Request, *codedeploy.DeleteApplicationOutput) - - DeleteApplication(*codedeploy.DeleteApplicationInput) (*codedeploy.DeleteApplicationOutput, error) - - DeleteDeploymentConfigRequest(*codedeploy.DeleteDeploymentConfigInput) (*request.Request, *codedeploy.DeleteDeploymentConfigOutput) - - DeleteDeploymentConfig(*codedeploy.DeleteDeploymentConfigInput) (*codedeploy.DeleteDeploymentConfigOutput, error) - - DeleteDeploymentGroupRequest(*codedeploy.DeleteDeploymentGroupInput) (*request.Request, *codedeploy.DeleteDeploymentGroupOutput) - - DeleteDeploymentGroup(*codedeploy.DeleteDeploymentGroupInput) (*codedeploy.DeleteDeploymentGroupOutput, error) - - DeregisterOnPremisesInstanceRequest(*codedeploy.DeregisterOnPremisesInstanceInput) (*request.Request, *codedeploy.DeregisterOnPremisesInstanceOutput) - - DeregisterOnPremisesInstance(*codedeploy.DeregisterOnPremisesInstanceInput) (*codedeploy.DeregisterOnPremisesInstanceOutput, error) - - GetApplicationRequest(*codedeploy.GetApplicationInput) (*request.Request, *codedeploy.GetApplicationOutput) - - GetApplication(*codedeploy.GetApplicationInput) (*codedeploy.GetApplicationOutput, error) - - GetApplicationRevisionRequest(*codedeploy.GetApplicationRevisionInput) (*request.Request, *codedeploy.GetApplicationRevisionOutput) - - GetApplicationRevision(*codedeploy.GetApplicationRevisionInput) (*codedeploy.GetApplicationRevisionOutput, error) - - GetDeploymentRequest(*codedeploy.GetDeploymentInput) (*request.Request, *codedeploy.GetDeploymentOutput) - - GetDeployment(*codedeploy.GetDeploymentInput) (*codedeploy.GetDeploymentOutput, error) - - GetDeploymentConfigRequest(*codedeploy.GetDeploymentConfigInput) (*request.Request, *codedeploy.GetDeploymentConfigOutput) - - GetDeploymentConfig(*codedeploy.GetDeploymentConfigInput) (*codedeploy.GetDeploymentConfigOutput, error) - - GetDeploymentGroupRequest(*codedeploy.GetDeploymentGroupInput) (*request.Request, *codedeploy.GetDeploymentGroupOutput) - - GetDeploymentGroup(*codedeploy.GetDeploymentGroupInput) (*codedeploy.GetDeploymentGroupOutput, error) - - GetDeploymentInstanceRequest(*codedeploy.GetDeploymentInstanceInput) (*request.Request, *codedeploy.GetDeploymentInstanceOutput) - - GetDeploymentInstance(*codedeploy.GetDeploymentInstanceInput) (*codedeploy.GetDeploymentInstanceOutput, error) - - GetOnPremisesInstanceRequest(*codedeploy.GetOnPremisesInstanceInput) (*request.Request, *codedeploy.GetOnPremisesInstanceOutput) - - GetOnPremisesInstance(*codedeploy.GetOnPremisesInstanceInput) (*codedeploy.GetOnPremisesInstanceOutput, error) - - ListApplicationRevisionsRequest(*codedeploy.ListApplicationRevisionsInput) (*request.Request, *codedeploy.ListApplicationRevisionsOutput) - - ListApplicationRevisions(*codedeploy.ListApplicationRevisionsInput) (*codedeploy.ListApplicationRevisionsOutput, error) - - ListApplicationRevisionsPages(*codedeploy.ListApplicationRevisionsInput, func(*codedeploy.ListApplicationRevisionsOutput, bool) bool) error - - ListApplicationsRequest(*codedeploy.ListApplicationsInput) (*request.Request, *codedeploy.ListApplicationsOutput) - - ListApplications(*codedeploy.ListApplicationsInput) (*codedeploy.ListApplicationsOutput, error) - - ListApplicationsPages(*codedeploy.ListApplicationsInput, func(*codedeploy.ListApplicationsOutput, bool) bool) error - - ListDeploymentConfigsRequest(*codedeploy.ListDeploymentConfigsInput) (*request.Request, *codedeploy.ListDeploymentConfigsOutput) - - ListDeploymentConfigs(*codedeploy.ListDeploymentConfigsInput) (*codedeploy.ListDeploymentConfigsOutput, error) - - ListDeploymentConfigsPages(*codedeploy.ListDeploymentConfigsInput, func(*codedeploy.ListDeploymentConfigsOutput, bool) bool) error - - ListDeploymentGroupsRequest(*codedeploy.ListDeploymentGroupsInput) (*request.Request, *codedeploy.ListDeploymentGroupsOutput) - - ListDeploymentGroups(*codedeploy.ListDeploymentGroupsInput) (*codedeploy.ListDeploymentGroupsOutput, error) - - ListDeploymentGroupsPages(*codedeploy.ListDeploymentGroupsInput, func(*codedeploy.ListDeploymentGroupsOutput, bool) bool) error - - ListDeploymentInstancesRequest(*codedeploy.ListDeploymentInstancesInput) (*request.Request, *codedeploy.ListDeploymentInstancesOutput) - - ListDeploymentInstances(*codedeploy.ListDeploymentInstancesInput) (*codedeploy.ListDeploymentInstancesOutput, error) - - ListDeploymentInstancesPages(*codedeploy.ListDeploymentInstancesInput, func(*codedeploy.ListDeploymentInstancesOutput, bool) bool) error - - ListDeploymentsRequest(*codedeploy.ListDeploymentsInput) (*request.Request, *codedeploy.ListDeploymentsOutput) - - ListDeployments(*codedeploy.ListDeploymentsInput) (*codedeploy.ListDeploymentsOutput, error) - - ListDeploymentsPages(*codedeploy.ListDeploymentsInput, func(*codedeploy.ListDeploymentsOutput, bool) bool) error - - ListOnPremisesInstancesRequest(*codedeploy.ListOnPremisesInstancesInput) (*request.Request, *codedeploy.ListOnPremisesInstancesOutput) - - ListOnPremisesInstances(*codedeploy.ListOnPremisesInstancesInput) (*codedeploy.ListOnPremisesInstancesOutput, error) - - RegisterApplicationRevisionRequest(*codedeploy.RegisterApplicationRevisionInput) (*request.Request, *codedeploy.RegisterApplicationRevisionOutput) - - RegisterApplicationRevision(*codedeploy.RegisterApplicationRevisionInput) (*codedeploy.RegisterApplicationRevisionOutput, error) - - RegisterOnPremisesInstanceRequest(*codedeploy.RegisterOnPremisesInstanceInput) (*request.Request, *codedeploy.RegisterOnPremisesInstanceOutput) - - RegisterOnPremisesInstance(*codedeploy.RegisterOnPremisesInstanceInput) (*codedeploy.RegisterOnPremisesInstanceOutput, error) - - RemoveTagsFromOnPremisesInstancesRequest(*codedeploy.RemoveTagsFromOnPremisesInstancesInput) (*request.Request, *codedeploy.RemoveTagsFromOnPremisesInstancesOutput) - - RemoveTagsFromOnPremisesInstances(*codedeploy.RemoveTagsFromOnPremisesInstancesInput) (*codedeploy.RemoveTagsFromOnPremisesInstancesOutput, error) - - StopDeploymentRequest(*codedeploy.StopDeploymentInput) (*request.Request, *codedeploy.StopDeploymentOutput) - - StopDeployment(*codedeploy.StopDeploymentInput) (*codedeploy.StopDeploymentOutput, error) - - UpdateApplicationRequest(*codedeploy.UpdateApplicationInput) (*request.Request, *codedeploy.UpdateApplicationOutput) - - UpdateApplication(*codedeploy.UpdateApplicationInput) (*codedeploy.UpdateApplicationOutput, error) - - UpdateDeploymentGroupRequest(*codedeploy.UpdateDeploymentGroupInput) (*request.Request, *codedeploy.UpdateDeploymentGroupOutput) - - UpdateDeploymentGroup(*codedeploy.UpdateDeploymentGroupInput) (*codedeploy.UpdateDeploymentGroupOutput, error) -} - -var _ CodeDeployAPI = (*codedeploy.CodeDeploy)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/directoryserviceiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/directoryserviceiface/interface.go deleted file mode 100644 index fec194c91..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/directoryserviceiface/interface.go +++ /dev/null @@ -1,102 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package directoryserviceiface provides an interface for the AWS Directory Service. -package directoryserviceiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/directoryservice" -) - -// DirectoryServiceAPI is the interface type for directoryservice.DirectoryService. -type DirectoryServiceAPI interface { - ConnectDirectoryRequest(*directoryservice.ConnectDirectoryInput) (*request.Request, *directoryservice.ConnectDirectoryOutput) - - ConnectDirectory(*directoryservice.ConnectDirectoryInput) (*directoryservice.ConnectDirectoryOutput, error) - - CreateAliasRequest(*directoryservice.CreateAliasInput) (*request.Request, *directoryservice.CreateAliasOutput) - - CreateAlias(*directoryservice.CreateAliasInput) (*directoryservice.CreateAliasOutput, error) - - CreateComputerRequest(*directoryservice.CreateComputerInput) (*request.Request, *directoryservice.CreateComputerOutput) - - CreateComputer(*directoryservice.CreateComputerInput) (*directoryservice.CreateComputerOutput, error) - - CreateDirectoryRequest(*directoryservice.CreateDirectoryInput) (*request.Request, *directoryservice.CreateDirectoryOutput) - - CreateDirectory(*directoryservice.CreateDirectoryInput) (*directoryservice.CreateDirectoryOutput, error) - - CreateMicrosoftADRequest(*directoryservice.CreateMicrosoftADInput) (*request.Request, *directoryservice.CreateMicrosoftADOutput) - - CreateMicrosoftAD(*directoryservice.CreateMicrosoftADInput) (*directoryservice.CreateMicrosoftADOutput, error) - - CreateSnapshotRequest(*directoryservice.CreateSnapshotInput) (*request.Request, *directoryservice.CreateSnapshotOutput) - - CreateSnapshot(*directoryservice.CreateSnapshotInput) (*directoryservice.CreateSnapshotOutput, error) - - CreateTrustRequest(*directoryservice.CreateTrustInput) (*request.Request, *directoryservice.CreateTrustOutput) - - CreateTrust(*directoryservice.CreateTrustInput) (*directoryservice.CreateTrustOutput, error) - - DeleteDirectoryRequest(*directoryservice.DeleteDirectoryInput) (*request.Request, *directoryservice.DeleteDirectoryOutput) - - DeleteDirectory(*directoryservice.DeleteDirectoryInput) (*directoryservice.DeleteDirectoryOutput, error) - - DeleteSnapshotRequest(*directoryservice.DeleteSnapshotInput) (*request.Request, *directoryservice.DeleteSnapshotOutput) - - DeleteSnapshot(*directoryservice.DeleteSnapshotInput) (*directoryservice.DeleteSnapshotOutput, error) - - DeleteTrustRequest(*directoryservice.DeleteTrustInput) (*request.Request, *directoryservice.DeleteTrustOutput) - - DeleteTrust(*directoryservice.DeleteTrustInput) (*directoryservice.DeleteTrustOutput, error) - - DescribeDirectoriesRequest(*directoryservice.DescribeDirectoriesInput) (*request.Request, *directoryservice.DescribeDirectoriesOutput) - - DescribeDirectories(*directoryservice.DescribeDirectoriesInput) (*directoryservice.DescribeDirectoriesOutput, error) - - DescribeSnapshotsRequest(*directoryservice.DescribeSnapshotsInput) (*request.Request, *directoryservice.DescribeSnapshotsOutput) - - DescribeSnapshots(*directoryservice.DescribeSnapshotsInput) (*directoryservice.DescribeSnapshotsOutput, error) - - DescribeTrustsRequest(*directoryservice.DescribeTrustsInput) (*request.Request, *directoryservice.DescribeTrustsOutput) - - DescribeTrusts(*directoryservice.DescribeTrustsInput) (*directoryservice.DescribeTrustsOutput, error) - - DisableRadiusRequest(*directoryservice.DisableRadiusInput) (*request.Request, *directoryservice.DisableRadiusOutput) - - DisableRadius(*directoryservice.DisableRadiusInput) (*directoryservice.DisableRadiusOutput, error) - - DisableSsoRequest(*directoryservice.DisableSsoInput) (*request.Request, *directoryservice.DisableSsoOutput) - - DisableSso(*directoryservice.DisableSsoInput) (*directoryservice.DisableSsoOutput, error) - - EnableRadiusRequest(*directoryservice.EnableRadiusInput) (*request.Request, *directoryservice.EnableRadiusOutput) - - EnableRadius(*directoryservice.EnableRadiusInput) (*directoryservice.EnableRadiusOutput, error) - - EnableSsoRequest(*directoryservice.EnableSsoInput) (*request.Request, *directoryservice.EnableSsoOutput) - - EnableSso(*directoryservice.EnableSsoInput) (*directoryservice.EnableSsoOutput, error) - - GetDirectoryLimitsRequest(*directoryservice.GetDirectoryLimitsInput) (*request.Request, *directoryservice.GetDirectoryLimitsOutput) - - GetDirectoryLimits(*directoryservice.GetDirectoryLimitsInput) (*directoryservice.GetDirectoryLimitsOutput, error) - - GetSnapshotLimitsRequest(*directoryservice.GetSnapshotLimitsInput) (*request.Request, *directoryservice.GetSnapshotLimitsOutput) - - GetSnapshotLimits(*directoryservice.GetSnapshotLimitsInput) (*directoryservice.GetSnapshotLimitsOutput, error) - - RestoreFromSnapshotRequest(*directoryservice.RestoreFromSnapshotInput) (*request.Request, *directoryservice.RestoreFromSnapshotOutput) - - RestoreFromSnapshot(*directoryservice.RestoreFromSnapshotInput) (*directoryservice.RestoreFromSnapshotOutput, error) - - UpdateRadiusRequest(*directoryservice.UpdateRadiusInput) (*request.Request, *directoryservice.UpdateRadiusOutput) - - UpdateRadius(*directoryservice.UpdateRadiusInput) (*directoryservice.UpdateRadiusOutput, error) - - VerifyTrustRequest(*directoryservice.VerifyTrustInput) (*request.Request, *directoryservice.VerifyTrustOutput) - - VerifyTrust(*directoryservice.VerifyTrustInput) (*directoryservice.VerifyTrustOutput, error) -} - -var _ DirectoryServiceAPI = (*directoryservice.DirectoryService)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go deleted file mode 100644 index d2ff2acfe..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go +++ /dev/null @@ -1,473 +0,0 @@ -// Package dynamodbattribute provides conversion utilities from dynamodb.AttributeValue -// to concrete Go types and structures. These conversion utilities allow you to -// convert a Struct, Slice, Map, or Scalar value to or from dynamodb.AttributeValue. -// These are most useful to serialize concrete types to dynamodb.AttributeValue for -// requests or unmarshalling the dynamodb.AttributeValue into a well known typed form. -// -// Converting []byte fields to dynamodb.AttributeValue are only currently supported -// if the input is a map[string]interface{} type. []byte within typed structs are not -// converted correctly and are converted into base64 strings. This is a known bug, -// and will be fixed in a later release. -// -// Convert concrete type to dynamodb.AttributeValue: See (ExampleConvertTo) -// -// type Record struct { -// MyField string -// Letters []string -// A2Num map[string]int -// } -// -// ... -// -// r := Record{ -// MyField: "dynamodbattribute.ConvertToX example", -// Letters: []string{"a", "b", "c", "d"}, -// A2Num: map[string]int{"a": 1, "b": 2, "c": 3}, -// } -// av, err := dynamodbattribute.ConvertTo(r) -// fmt.Println(av, err) -// -// Convert dynamodb.AttributeValue to Concrete type: See (ExampleConvertFrom) -// -// r2 := Record{} -// err = dynamodbattribute.ConvertFrom(av, &r2) -// fmt.Println(err, reflect.DeepEqual(r, r2)) -// -// Use Conversion utilities with DynamoDB.PutItem: See () -// -// svc := dynamodb.New(nil) -// item, err := dynamodbattribute.ConvertToMap(r) -// if err != nil { -// fmt.Println("Failed to convert", err) -// return -// } -// result, err := svc.PutItem(&dynamodb.PutItemInput{ -// Item: item, -// TableName: aws.String("exampleTable"), -// }) -package dynamodbattribute - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "runtime" - "strconv" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// ConvertToMap accepts a map[string]interface{} or struct and converts it to a -// map[string]*dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a map[string]interface{}, so `json` struct tags are respected. -func ConvertToMap(in interface{}) (item map[string]*dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in == nil { - return nil, awserr.New("SerializationError", - "in must be a map[string]interface{} or struct, got ", nil) - } - - v := reflect.ValueOf(in) - if v.Kind() != reflect.Struct && !(v.Kind() == reflect.Map && v.Type().Key().Kind() == reflect.String) { - return nil, awserr.New("SerializationError", - fmt.Sprintf("in must be a map[string]interface{} or struct, got %s", - v.Type().String()), - nil) - } - - if isTyped(reflect.TypeOf(in)) { - var out map[string]interface{} - in = convertToUntyped(in, out) - } - - item = make(map[string]*dynamodb.AttributeValue) - for k, v := range in.(map[string]interface{}) { - item[k] = convertTo(v) - } - - return item, nil -} - -// ConvertFromMap accepts a map[string]*dynamodb.AttributeValue and converts it to a -// map[string]interface{} or struct. -// -// If v points to a struct, the result is first converted it to a -// map[string]interface{}, then JSON encoded/decoded it to convert to a struct, -// so `json` struct tags are respected. -func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to a map[string]interface{} or struct, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Struct && !(rv.Elem().Kind() == reflect.Map && rv.Elem().Type().Key().Kind() == reflect.String) { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to a map[string]interface{} or struct, got %s", - rv.Type()), - nil) - } - - m := make(map[string]interface{}) - for k, v := range item { - m[k] = convertFrom(v) - } - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(m, v) - } else { - rv.Elem().Set(reflect.ValueOf(m)) - } - - return err -} - -// ConvertToList accepts an array or slice and converts it to a -// []*dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a []interface{}, so `json` struct tags are respected. -func ConvertToList(in interface{}) (item []*dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in == nil { - return nil, awserr.New("SerializationError", - "in must be an array or slice, got ", - nil) - } - - v := reflect.ValueOf(in) - if v.Kind() != reflect.Array && v.Kind() != reflect.Slice { - return nil, awserr.New("SerializationError", - fmt.Sprintf("in must be an array or slice, got %s", - v.Type().String()), - nil) - } - - if isTyped(reflect.TypeOf(in)) { - var out []interface{} - in = convertToUntyped(in, out) - } - - item = make([]*dynamodb.AttributeValue, 0, len(in.([]interface{}))) - for _, v := range in.([]interface{}) { - item = append(item, convertTo(v)) - } - - return item, nil -} - -// ConvertFromList accepts a []*dynamodb.AttributeValue and converts it to an array or -// slice. -// -// If v contains any structs, the result is first converted it to a -// []interface{}, then JSON encoded/decoded it to convert to a typed array or -// slice, so `json` struct tags are respected. -func ConvertFromList(item []*dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an array or slice, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Array && rv.Elem().Kind() != reflect.Slice { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an array or slice, got %s", - rv.Type()), - nil) - } - - l := make([]interface{}, 0, len(item)) - for _, v := range item { - l = append(l, convertFrom(v)) - } - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(l, v) - } else { - rv.Elem().Set(reflect.ValueOf(l)) - } - - return err -} - -// ConvertTo accepts any interface{} and converts it to a *dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a interface{}, so `json` struct tags are respected. -func ConvertTo(in interface{}) (item *dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in != nil && isTyped(reflect.TypeOf(in)) { - var out interface{} - in = convertToUntyped(in, out) - } - - item = convertTo(in) - return item, nil -} - -// ConvertFrom accepts a *dynamodb.AttributeValue and converts it to any interface{}. -// -// If v contains any structs, the result is first converted it to a interface{}, -// then JSON encoded/decoded it to convert to a struct, so `json` struct tags -// are respected. -func ConvertFrom(item *dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an interface{} or struct, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Interface && rv.Elem().Kind() != reflect.Struct { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an interface{} or struct, got %s", - rv.Type()), - nil) - } - - res := convertFrom(item) - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(res, v) - } else if res != nil { - rv.Elem().Set(reflect.ValueOf(res)) - } - - return err -} - -func isTyped(v reflect.Type) bool { - switch v.Kind() { - case reflect.Struct: - return true - case reflect.Array, reflect.Slice: - if isTyped(v.Elem()) { - return true - } - case reflect.Map: - if isTyped(v.Key()) { - return true - } - if isTyped(v.Elem()) { - return true - } - case reflect.Ptr: - return isTyped(v.Elem()) - } - return false -} - -func convertToUntyped(in, out interface{}) interface{} { - b, err := json.Marshal(in) - if err != nil { - panic(err) - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - decoder.UseNumber() - err = decoder.Decode(&out) - if err != nil { - panic(err) - } - - return out -} - -func convertToTyped(in, out interface{}) error { - b, err := json.Marshal(in) - if err != nil { - return err - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - return decoder.Decode(&out) -} - -func convertTo(in interface{}) *dynamodb.AttributeValue { - a := &dynamodb.AttributeValue{} - - if in == nil { - a.NULL = new(bool) - *a.NULL = true - return a - } - - if m, ok := in.(map[string]interface{}); ok { - a.M = make(map[string]*dynamodb.AttributeValue) - for k, v := range m { - a.M[k] = convertTo(v) - } - return a - } - - v := reflect.ValueOf(in) - switch v.Kind() { - case reflect.Bool: - a.BOOL = new(bool) - *a.BOOL = v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - a.N = new(string) - *a.N = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - a.N = new(string) - *a.N = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - a.N = new(string) - *a.N = strconv.FormatFloat(v.Float(), 'f', -1, 64) - case reflect.String: - if n, ok := in.(json.Number); ok { - a.N = new(string) - *a.N = n.String() - } else { - a.S = new(string) - *a.S = v.String() - } - case reflect.Slice: - switch v.Type() { - case reflect.TypeOf(([]byte)(nil)): - a.B = v.Bytes() - default: - a.L = make([]*dynamodb.AttributeValue, v.Len()) - for i := 0; i < v.Len(); i++ { - a.L[i] = convertTo(v.Index(i).Interface()) - } - } - default: - panic(fmt.Sprintf("the type %s is not supported", v.Type().String())) - } - - return a -} - -func convertFrom(a *dynamodb.AttributeValue) interface{} { - if a.S != nil { - return *a.S - } - - if a.N != nil { - // Number is tricky b/c we don't know which numeric type to use. Here we - // simply try the different types from most to least restrictive. - if n, err := strconv.ParseInt(*a.N, 10, 64); err == nil { - return int(n) - } - if n, err := strconv.ParseUint(*a.N, 10, 64); err == nil { - return uint(n) - } - n, err := strconv.ParseFloat(*a.N, 64) - if err != nil { - panic(err) - } - return n - } - - if a.BOOL != nil { - return *a.BOOL - } - - if a.NULL != nil { - return nil - } - - if a.M != nil { - m := make(map[string]interface{}) - for k, v := range a.M { - m[k] = convertFrom(v) - } - return m - } - - if a.L != nil { - l := make([]interface{}, len(a.L)) - for index, v := range a.L { - l[index] = convertFrom(v) - } - return l - } - - if a.B != nil { - return a.B - } - - panic(fmt.Sprintf("%#v is not a supported dynamodb.AttributeValue", a)) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go deleted file mode 100644 index ad7a09ef0..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go +++ /dev/null @@ -1,74 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package dynamodbiface provides an interface for the Amazon DynamoDB. -package dynamodbiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// DynamoDBAPI is the interface type for dynamodb.DynamoDB. -type DynamoDBAPI interface { - BatchGetItemRequest(*dynamodb.BatchGetItemInput) (*request.Request, *dynamodb.BatchGetItemOutput) - - BatchGetItem(*dynamodb.BatchGetItemInput) (*dynamodb.BatchGetItemOutput, error) - - BatchGetItemPages(*dynamodb.BatchGetItemInput, func(*dynamodb.BatchGetItemOutput, bool) bool) error - - BatchWriteItemRequest(*dynamodb.BatchWriteItemInput) (*request.Request, *dynamodb.BatchWriteItemOutput) - - BatchWriteItem(*dynamodb.BatchWriteItemInput) (*dynamodb.BatchWriteItemOutput, error) - - CreateTableRequest(*dynamodb.CreateTableInput) (*request.Request, *dynamodb.CreateTableOutput) - - CreateTable(*dynamodb.CreateTableInput) (*dynamodb.CreateTableOutput, error) - - DeleteItemRequest(*dynamodb.DeleteItemInput) (*request.Request, *dynamodb.DeleteItemOutput) - - DeleteItem(*dynamodb.DeleteItemInput) (*dynamodb.DeleteItemOutput, error) - - DeleteTableRequest(*dynamodb.DeleteTableInput) (*request.Request, *dynamodb.DeleteTableOutput) - - DeleteTable(*dynamodb.DeleteTableInput) (*dynamodb.DeleteTableOutput, error) - - DescribeTableRequest(*dynamodb.DescribeTableInput) (*request.Request, *dynamodb.DescribeTableOutput) - - DescribeTable(*dynamodb.DescribeTableInput) (*dynamodb.DescribeTableOutput, error) - - GetItemRequest(*dynamodb.GetItemInput) (*request.Request, *dynamodb.GetItemOutput) - - GetItem(*dynamodb.GetItemInput) (*dynamodb.GetItemOutput, error) - - ListTablesRequest(*dynamodb.ListTablesInput) (*request.Request, *dynamodb.ListTablesOutput) - - ListTables(*dynamodb.ListTablesInput) (*dynamodb.ListTablesOutput, error) - - ListTablesPages(*dynamodb.ListTablesInput, func(*dynamodb.ListTablesOutput, bool) bool) error - - PutItemRequest(*dynamodb.PutItemInput) (*request.Request, *dynamodb.PutItemOutput) - - PutItem(*dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error) - - QueryRequest(*dynamodb.QueryInput) (*request.Request, *dynamodb.QueryOutput) - - Query(*dynamodb.QueryInput) (*dynamodb.QueryOutput, error) - - QueryPages(*dynamodb.QueryInput, func(*dynamodb.QueryOutput, bool) bool) error - - ScanRequest(*dynamodb.ScanInput) (*request.Request, *dynamodb.ScanOutput) - - Scan(*dynamodb.ScanInput) (*dynamodb.ScanOutput, error) - - ScanPages(*dynamodb.ScanInput, func(*dynamodb.ScanOutput, bool) bool) error - - UpdateItemRequest(*dynamodb.UpdateItemInput) (*request.Request, *dynamodb.UpdateItemOutput) - - UpdateItem(*dynamodb.UpdateItemInput) (*dynamodb.UpdateItemOutput, error) - - UpdateTableRequest(*dynamodb.UpdateTableInput) (*request.Request, *dynamodb.UpdateTableOutput) - - UpdateTable(*dynamodb.UpdateTableInput) (*dynamodb.UpdateTableOutput, error) -} - -var _ DynamoDBAPI = (*dynamodb.DynamoDB)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go deleted file mode 100644 index 3091c64d5..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go +++ /dev/null @@ -1,832 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ec2iface provides an interface for the Amazon Elastic Compute Cloud. -package ec2iface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/ec2" -) - -// EC2API is the interface type for ec2.EC2. -type EC2API interface { - AcceptVpcPeeringConnectionRequest(*ec2.AcceptVpcPeeringConnectionInput) (*request.Request, *ec2.AcceptVpcPeeringConnectionOutput) - - AcceptVpcPeeringConnection(*ec2.AcceptVpcPeeringConnectionInput) (*ec2.AcceptVpcPeeringConnectionOutput, error) - - AllocateAddressRequest(*ec2.AllocateAddressInput) (*request.Request, *ec2.AllocateAddressOutput) - - AllocateAddress(*ec2.AllocateAddressInput) (*ec2.AllocateAddressOutput, error) - - AllocateHostsRequest(*ec2.AllocateHostsInput) (*request.Request, *ec2.AllocateHostsOutput) - - AllocateHosts(*ec2.AllocateHostsInput) (*ec2.AllocateHostsOutput, error) - - AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput) - - AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) - - AssociateAddressRequest(*ec2.AssociateAddressInput) (*request.Request, *ec2.AssociateAddressOutput) - - AssociateAddress(*ec2.AssociateAddressInput) (*ec2.AssociateAddressOutput, error) - - AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput) - - AssociateDhcpOptions(*ec2.AssociateDhcpOptionsInput) (*ec2.AssociateDhcpOptionsOutput, error) - - AssociateRouteTableRequest(*ec2.AssociateRouteTableInput) (*request.Request, *ec2.AssociateRouteTableOutput) - - AssociateRouteTable(*ec2.AssociateRouteTableInput) (*ec2.AssociateRouteTableOutput, error) - - AttachClassicLinkVpcRequest(*ec2.AttachClassicLinkVpcInput) (*request.Request, *ec2.AttachClassicLinkVpcOutput) - - AttachClassicLinkVpc(*ec2.AttachClassicLinkVpcInput) (*ec2.AttachClassicLinkVpcOutput, error) - - AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*request.Request, *ec2.AttachInternetGatewayOutput) - - AttachInternetGateway(*ec2.AttachInternetGatewayInput) (*ec2.AttachInternetGatewayOutput, error) - - AttachNetworkInterfaceRequest(*ec2.AttachNetworkInterfaceInput) (*request.Request, *ec2.AttachNetworkInterfaceOutput) - - AttachNetworkInterface(*ec2.AttachNetworkInterfaceInput) (*ec2.AttachNetworkInterfaceOutput, error) - - AttachVolumeRequest(*ec2.AttachVolumeInput) (*request.Request, *ec2.VolumeAttachment) - - AttachVolume(*ec2.AttachVolumeInput) (*ec2.VolumeAttachment, error) - - AttachVpnGatewayRequest(*ec2.AttachVpnGatewayInput) (*request.Request, *ec2.AttachVpnGatewayOutput) - - AttachVpnGateway(*ec2.AttachVpnGatewayInput) (*ec2.AttachVpnGatewayOutput, error) - - AuthorizeSecurityGroupEgressRequest(*ec2.AuthorizeSecurityGroupEgressInput) (*request.Request, *ec2.AuthorizeSecurityGroupEgressOutput) - - AuthorizeSecurityGroupEgress(*ec2.AuthorizeSecurityGroupEgressInput) (*ec2.AuthorizeSecurityGroupEgressOutput, error) - - AuthorizeSecurityGroupIngressRequest(*ec2.AuthorizeSecurityGroupIngressInput) (*request.Request, *ec2.AuthorizeSecurityGroupIngressOutput) - - AuthorizeSecurityGroupIngress(*ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error) - - BundleInstanceRequest(*ec2.BundleInstanceInput) (*request.Request, *ec2.BundleInstanceOutput) - - BundleInstance(*ec2.BundleInstanceInput) (*ec2.BundleInstanceOutput, error) - - CancelBundleTaskRequest(*ec2.CancelBundleTaskInput) (*request.Request, *ec2.CancelBundleTaskOutput) - - CancelBundleTask(*ec2.CancelBundleTaskInput) (*ec2.CancelBundleTaskOutput, error) - - CancelConversionTaskRequest(*ec2.CancelConversionTaskInput) (*request.Request, *ec2.CancelConversionTaskOutput) - - CancelConversionTask(*ec2.CancelConversionTaskInput) (*ec2.CancelConversionTaskOutput, error) - - CancelExportTaskRequest(*ec2.CancelExportTaskInput) (*request.Request, *ec2.CancelExportTaskOutput) - - CancelExportTask(*ec2.CancelExportTaskInput) (*ec2.CancelExportTaskOutput, error) - - CancelImportTaskRequest(*ec2.CancelImportTaskInput) (*request.Request, *ec2.CancelImportTaskOutput) - - CancelImportTask(*ec2.CancelImportTaskInput) (*ec2.CancelImportTaskOutput, error) - - CancelReservedInstancesListingRequest(*ec2.CancelReservedInstancesListingInput) (*request.Request, *ec2.CancelReservedInstancesListingOutput) - - CancelReservedInstancesListing(*ec2.CancelReservedInstancesListingInput) (*ec2.CancelReservedInstancesListingOutput, error) - - CancelSpotFleetRequestsRequest(*ec2.CancelSpotFleetRequestsInput) (*request.Request, *ec2.CancelSpotFleetRequestsOutput) - - CancelSpotFleetRequests(*ec2.CancelSpotFleetRequestsInput) (*ec2.CancelSpotFleetRequestsOutput, error) - - CancelSpotInstanceRequestsRequest(*ec2.CancelSpotInstanceRequestsInput) (*request.Request, *ec2.CancelSpotInstanceRequestsOutput) - - CancelSpotInstanceRequests(*ec2.CancelSpotInstanceRequestsInput) (*ec2.CancelSpotInstanceRequestsOutput, error) - - ConfirmProductInstanceRequest(*ec2.ConfirmProductInstanceInput) (*request.Request, *ec2.ConfirmProductInstanceOutput) - - ConfirmProductInstance(*ec2.ConfirmProductInstanceInput) (*ec2.ConfirmProductInstanceOutput, error) - - CopyImageRequest(*ec2.CopyImageInput) (*request.Request, *ec2.CopyImageOutput) - - CopyImage(*ec2.CopyImageInput) (*ec2.CopyImageOutput, error) - - CopySnapshotRequest(*ec2.CopySnapshotInput) (*request.Request, *ec2.CopySnapshotOutput) - - CopySnapshot(*ec2.CopySnapshotInput) (*ec2.CopySnapshotOutput, error) - - CreateCustomerGatewayRequest(*ec2.CreateCustomerGatewayInput) (*request.Request, *ec2.CreateCustomerGatewayOutput) - - CreateCustomerGateway(*ec2.CreateCustomerGatewayInput) (*ec2.CreateCustomerGatewayOutput, error) - - CreateDhcpOptionsRequest(*ec2.CreateDhcpOptionsInput) (*request.Request, *ec2.CreateDhcpOptionsOutput) - - CreateDhcpOptions(*ec2.CreateDhcpOptionsInput) (*ec2.CreateDhcpOptionsOutput, error) - - CreateFlowLogsRequest(*ec2.CreateFlowLogsInput) (*request.Request, *ec2.CreateFlowLogsOutput) - - CreateFlowLogs(*ec2.CreateFlowLogsInput) (*ec2.CreateFlowLogsOutput, error) - - CreateImageRequest(*ec2.CreateImageInput) (*request.Request, *ec2.CreateImageOutput) - - CreateImage(*ec2.CreateImageInput) (*ec2.CreateImageOutput, error) - - CreateInstanceExportTaskRequest(*ec2.CreateInstanceExportTaskInput) (*request.Request, *ec2.CreateInstanceExportTaskOutput) - - CreateInstanceExportTask(*ec2.CreateInstanceExportTaskInput) (*ec2.CreateInstanceExportTaskOutput, error) - - CreateInternetGatewayRequest(*ec2.CreateInternetGatewayInput) (*request.Request, *ec2.CreateInternetGatewayOutput) - - CreateInternetGateway(*ec2.CreateInternetGatewayInput) (*ec2.CreateInternetGatewayOutput, error) - - CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*request.Request, *ec2.CreateKeyPairOutput) - - CreateKeyPair(*ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error) - - CreateNatGatewayRequest(*ec2.CreateNatGatewayInput) (*request.Request, *ec2.CreateNatGatewayOutput) - - CreateNatGateway(*ec2.CreateNatGatewayInput) (*ec2.CreateNatGatewayOutput, error) - - CreateNetworkAclRequest(*ec2.CreateNetworkAclInput) (*request.Request, *ec2.CreateNetworkAclOutput) - - CreateNetworkAcl(*ec2.CreateNetworkAclInput) (*ec2.CreateNetworkAclOutput, error) - - CreateNetworkAclEntryRequest(*ec2.CreateNetworkAclEntryInput) (*request.Request, *ec2.CreateNetworkAclEntryOutput) - - CreateNetworkAclEntry(*ec2.CreateNetworkAclEntryInput) (*ec2.CreateNetworkAclEntryOutput, error) - - CreateNetworkInterfaceRequest(*ec2.CreateNetworkInterfaceInput) (*request.Request, *ec2.CreateNetworkInterfaceOutput) - - CreateNetworkInterface(*ec2.CreateNetworkInterfaceInput) (*ec2.CreateNetworkInterfaceOutput, error) - - CreatePlacementGroupRequest(*ec2.CreatePlacementGroupInput) (*request.Request, *ec2.CreatePlacementGroupOutput) - - CreatePlacementGroup(*ec2.CreatePlacementGroupInput) (*ec2.CreatePlacementGroupOutput, error) - - CreateReservedInstancesListingRequest(*ec2.CreateReservedInstancesListingInput) (*request.Request, *ec2.CreateReservedInstancesListingOutput) - - CreateReservedInstancesListing(*ec2.CreateReservedInstancesListingInput) (*ec2.CreateReservedInstancesListingOutput, error) - - CreateRouteRequest(*ec2.CreateRouteInput) (*request.Request, *ec2.CreateRouteOutput) - - CreateRoute(*ec2.CreateRouteInput) (*ec2.CreateRouteOutput, error) - - CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*request.Request, *ec2.CreateRouteTableOutput) - - CreateRouteTable(*ec2.CreateRouteTableInput) (*ec2.CreateRouteTableOutput, error) - - CreateSecurityGroupRequest(*ec2.CreateSecurityGroupInput) (*request.Request, *ec2.CreateSecurityGroupOutput) - - CreateSecurityGroup(*ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error) - - CreateSnapshotRequest(*ec2.CreateSnapshotInput) (*request.Request, *ec2.Snapshot) - - CreateSnapshot(*ec2.CreateSnapshotInput) (*ec2.Snapshot, error) - - CreateSpotDatafeedSubscriptionRequest(*ec2.CreateSpotDatafeedSubscriptionInput) (*request.Request, *ec2.CreateSpotDatafeedSubscriptionOutput) - - CreateSpotDatafeedSubscription(*ec2.CreateSpotDatafeedSubscriptionInput) (*ec2.CreateSpotDatafeedSubscriptionOutput, error) - - CreateSubnetRequest(*ec2.CreateSubnetInput) (*request.Request, *ec2.CreateSubnetOutput) - - CreateSubnet(*ec2.CreateSubnetInput) (*ec2.CreateSubnetOutput, error) - - CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) - - CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) - - CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume) - - CreateVolume(*ec2.CreateVolumeInput) (*ec2.Volume, error) - - CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) - - CreateVpc(*ec2.CreateVpcInput) (*ec2.CreateVpcOutput, error) - - CreateVpcEndpointRequest(*ec2.CreateVpcEndpointInput) (*request.Request, *ec2.CreateVpcEndpointOutput) - - CreateVpcEndpoint(*ec2.CreateVpcEndpointInput) (*ec2.CreateVpcEndpointOutput, error) - - CreateVpcPeeringConnectionRequest(*ec2.CreateVpcPeeringConnectionInput) (*request.Request, *ec2.CreateVpcPeeringConnectionOutput) - - CreateVpcPeeringConnection(*ec2.CreateVpcPeeringConnectionInput) (*ec2.CreateVpcPeeringConnectionOutput, error) - - CreateVpnConnectionRequest(*ec2.CreateVpnConnectionInput) (*request.Request, *ec2.CreateVpnConnectionOutput) - - CreateVpnConnection(*ec2.CreateVpnConnectionInput) (*ec2.CreateVpnConnectionOutput, error) - - CreateVpnConnectionRouteRequest(*ec2.CreateVpnConnectionRouteInput) (*request.Request, *ec2.CreateVpnConnectionRouteOutput) - - CreateVpnConnectionRoute(*ec2.CreateVpnConnectionRouteInput) (*ec2.CreateVpnConnectionRouteOutput, error) - - CreateVpnGatewayRequest(*ec2.CreateVpnGatewayInput) (*request.Request, *ec2.CreateVpnGatewayOutput) - - CreateVpnGateway(*ec2.CreateVpnGatewayInput) (*ec2.CreateVpnGatewayOutput, error) - - DeleteCustomerGatewayRequest(*ec2.DeleteCustomerGatewayInput) (*request.Request, *ec2.DeleteCustomerGatewayOutput) - - DeleteCustomerGateway(*ec2.DeleteCustomerGatewayInput) (*ec2.DeleteCustomerGatewayOutput, error) - - DeleteDhcpOptionsRequest(*ec2.DeleteDhcpOptionsInput) (*request.Request, *ec2.DeleteDhcpOptionsOutput) - - DeleteDhcpOptions(*ec2.DeleteDhcpOptionsInput) (*ec2.DeleteDhcpOptionsOutput, error) - - DeleteFlowLogsRequest(*ec2.DeleteFlowLogsInput) (*request.Request, *ec2.DeleteFlowLogsOutput) - - DeleteFlowLogs(*ec2.DeleteFlowLogsInput) (*ec2.DeleteFlowLogsOutput, error) - - DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*request.Request, *ec2.DeleteInternetGatewayOutput) - - DeleteInternetGateway(*ec2.DeleteInternetGatewayInput) (*ec2.DeleteInternetGatewayOutput, error) - - DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*request.Request, *ec2.DeleteKeyPairOutput) - - DeleteKeyPair(*ec2.DeleteKeyPairInput) (*ec2.DeleteKeyPairOutput, error) - - DeleteNatGatewayRequest(*ec2.DeleteNatGatewayInput) (*request.Request, *ec2.DeleteNatGatewayOutput) - - DeleteNatGateway(*ec2.DeleteNatGatewayInput) (*ec2.DeleteNatGatewayOutput, error) - - DeleteNetworkAclRequest(*ec2.DeleteNetworkAclInput) (*request.Request, *ec2.DeleteNetworkAclOutput) - - DeleteNetworkAcl(*ec2.DeleteNetworkAclInput) (*ec2.DeleteNetworkAclOutput, error) - - DeleteNetworkAclEntryRequest(*ec2.DeleteNetworkAclEntryInput) (*request.Request, *ec2.DeleteNetworkAclEntryOutput) - - DeleteNetworkAclEntry(*ec2.DeleteNetworkAclEntryInput) (*ec2.DeleteNetworkAclEntryOutput, error) - - DeleteNetworkInterfaceRequest(*ec2.DeleteNetworkInterfaceInput) (*request.Request, *ec2.DeleteNetworkInterfaceOutput) - - DeleteNetworkInterface(*ec2.DeleteNetworkInterfaceInput) (*ec2.DeleteNetworkInterfaceOutput, error) - - DeletePlacementGroupRequest(*ec2.DeletePlacementGroupInput) (*request.Request, *ec2.DeletePlacementGroupOutput) - - DeletePlacementGroup(*ec2.DeletePlacementGroupInput) (*ec2.DeletePlacementGroupOutput, error) - - DeleteRouteRequest(*ec2.DeleteRouteInput) (*request.Request, *ec2.DeleteRouteOutput) - - DeleteRoute(*ec2.DeleteRouteInput) (*ec2.DeleteRouteOutput, error) - - DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*request.Request, *ec2.DeleteRouteTableOutput) - - DeleteRouteTable(*ec2.DeleteRouteTableInput) (*ec2.DeleteRouteTableOutput, error) - - DeleteSecurityGroupRequest(*ec2.DeleteSecurityGroupInput) (*request.Request, *ec2.DeleteSecurityGroupOutput) - - DeleteSecurityGroup(*ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error) - - DeleteSnapshotRequest(*ec2.DeleteSnapshotInput) (*request.Request, *ec2.DeleteSnapshotOutput) - - DeleteSnapshot(*ec2.DeleteSnapshotInput) (*ec2.DeleteSnapshotOutput, error) - - DeleteSpotDatafeedSubscriptionRequest(*ec2.DeleteSpotDatafeedSubscriptionInput) (*request.Request, *ec2.DeleteSpotDatafeedSubscriptionOutput) - - DeleteSpotDatafeedSubscription(*ec2.DeleteSpotDatafeedSubscriptionInput) (*ec2.DeleteSpotDatafeedSubscriptionOutput, error) - - DeleteSubnetRequest(*ec2.DeleteSubnetInput) (*request.Request, *ec2.DeleteSubnetOutput) - - DeleteSubnet(*ec2.DeleteSubnetInput) (*ec2.DeleteSubnetOutput, error) - - DeleteTagsRequest(*ec2.DeleteTagsInput) (*request.Request, *ec2.DeleteTagsOutput) - - DeleteTags(*ec2.DeleteTagsInput) (*ec2.DeleteTagsOutput, error) - - DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*request.Request, *ec2.DeleteVolumeOutput) - - DeleteVolume(*ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error) - - DeleteVpcRequest(*ec2.DeleteVpcInput) (*request.Request, *ec2.DeleteVpcOutput) - - DeleteVpc(*ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput, error) - - DeleteVpcEndpointsRequest(*ec2.DeleteVpcEndpointsInput) (*request.Request, *ec2.DeleteVpcEndpointsOutput) - - DeleteVpcEndpoints(*ec2.DeleteVpcEndpointsInput) (*ec2.DeleteVpcEndpointsOutput, error) - - DeleteVpcPeeringConnectionRequest(*ec2.DeleteVpcPeeringConnectionInput) (*request.Request, *ec2.DeleteVpcPeeringConnectionOutput) - - DeleteVpcPeeringConnection(*ec2.DeleteVpcPeeringConnectionInput) (*ec2.DeleteVpcPeeringConnectionOutput, error) - - DeleteVpnConnectionRequest(*ec2.DeleteVpnConnectionInput) (*request.Request, *ec2.DeleteVpnConnectionOutput) - - DeleteVpnConnection(*ec2.DeleteVpnConnectionInput) (*ec2.DeleteVpnConnectionOutput, error) - - DeleteVpnConnectionRouteRequest(*ec2.DeleteVpnConnectionRouteInput) (*request.Request, *ec2.DeleteVpnConnectionRouteOutput) - - DeleteVpnConnectionRoute(*ec2.DeleteVpnConnectionRouteInput) (*ec2.DeleteVpnConnectionRouteOutput, error) - - DeleteVpnGatewayRequest(*ec2.DeleteVpnGatewayInput) (*request.Request, *ec2.DeleteVpnGatewayOutput) - - DeleteVpnGateway(*ec2.DeleteVpnGatewayInput) (*ec2.DeleteVpnGatewayOutput, error) - - DeregisterImageRequest(*ec2.DeregisterImageInput) (*request.Request, *ec2.DeregisterImageOutput) - - DeregisterImage(*ec2.DeregisterImageInput) (*ec2.DeregisterImageOutput, error) - - DescribeAccountAttributesRequest(*ec2.DescribeAccountAttributesInput) (*request.Request, *ec2.DescribeAccountAttributesOutput) - - DescribeAccountAttributes(*ec2.DescribeAccountAttributesInput) (*ec2.DescribeAccountAttributesOutput, error) - - DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*request.Request, *ec2.DescribeAddressesOutput) - - DescribeAddresses(*ec2.DescribeAddressesInput) (*ec2.DescribeAddressesOutput, error) - - DescribeAvailabilityZonesRequest(*ec2.DescribeAvailabilityZonesInput) (*request.Request, *ec2.DescribeAvailabilityZonesOutput) - - DescribeAvailabilityZones(*ec2.DescribeAvailabilityZonesInput) (*ec2.DescribeAvailabilityZonesOutput, error) - - DescribeBundleTasksRequest(*ec2.DescribeBundleTasksInput) (*request.Request, *ec2.DescribeBundleTasksOutput) - - DescribeBundleTasks(*ec2.DescribeBundleTasksInput) (*ec2.DescribeBundleTasksOutput, error) - - DescribeClassicLinkInstancesRequest(*ec2.DescribeClassicLinkInstancesInput) (*request.Request, *ec2.DescribeClassicLinkInstancesOutput) - - DescribeClassicLinkInstances(*ec2.DescribeClassicLinkInstancesInput) (*ec2.DescribeClassicLinkInstancesOutput, error) - - DescribeConversionTasksRequest(*ec2.DescribeConversionTasksInput) (*request.Request, *ec2.DescribeConversionTasksOutput) - - DescribeConversionTasks(*ec2.DescribeConversionTasksInput) (*ec2.DescribeConversionTasksOutput, error) - - DescribeCustomerGatewaysRequest(*ec2.DescribeCustomerGatewaysInput) (*request.Request, *ec2.DescribeCustomerGatewaysOutput) - - DescribeCustomerGateways(*ec2.DescribeCustomerGatewaysInput) (*ec2.DescribeCustomerGatewaysOutput, error) - - DescribeDhcpOptionsRequest(*ec2.DescribeDhcpOptionsInput) (*request.Request, *ec2.DescribeDhcpOptionsOutput) - - DescribeDhcpOptions(*ec2.DescribeDhcpOptionsInput) (*ec2.DescribeDhcpOptionsOutput, error) - - DescribeExportTasksRequest(*ec2.DescribeExportTasksInput) (*request.Request, *ec2.DescribeExportTasksOutput) - - DescribeExportTasks(*ec2.DescribeExportTasksInput) (*ec2.DescribeExportTasksOutput, error) - - DescribeFlowLogsRequest(*ec2.DescribeFlowLogsInput) (*request.Request, *ec2.DescribeFlowLogsOutput) - - DescribeFlowLogs(*ec2.DescribeFlowLogsInput) (*ec2.DescribeFlowLogsOutput, error) - - DescribeHostsRequest(*ec2.DescribeHostsInput) (*request.Request, *ec2.DescribeHostsOutput) - - DescribeHosts(*ec2.DescribeHostsInput) (*ec2.DescribeHostsOutput, error) - - DescribeIdFormatRequest(*ec2.DescribeIdFormatInput) (*request.Request, *ec2.DescribeIdFormatOutput) - - DescribeIdFormat(*ec2.DescribeIdFormatInput) (*ec2.DescribeIdFormatOutput, error) - - DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput) - - DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error) - - DescribeImagesRequest(*ec2.DescribeImagesInput) (*request.Request, *ec2.DescribeImagesOutput) - - DescribeImages(*ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) - - DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) - - DescribeImportImageTasks(*ec2.DescribeImportImageTasksInput) (*ec2.DescribeImportImageTasksOutput, error) - - DescribeImportSnapshotTasksRequest(*ec2.DescribeImportSnapshotTasksInput) (*request.Request, *ec2.DescribeImportSnapshotTasksOutput) - - DescribeImportSnapshotTasks(*ec2.DescribeImportSnapshotTasksInput) (*ec2.DescribeImportSnapshotTasksOutput, error) - - DescribeInstanceAttributeRequest(*ec2.DescribeInstanceAttributeInput) (*request.Request, *ec2.DescribeInstanceAttributeOutput) - - DescribeInstanceAttribute(*ec2.DescribeInstanceAttributeInput) (*ec2.DescribeInstanceAttributeOutput, error) - - DescribeInstanceStatusRequest(*ec2.DescribeInstanceStatusInput) (*request.Request, *ec2.DescribeInstanceStatusOutput) - - DescribeInstanceStatus(*ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error) - - DescribeInstanceStatusPages(*ec2.DescribeInstanceStatusInput, func(*ec2.DescribeInstanceStatusOutput, bool) bool) error - - DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*request.Request, *ec2.DescribeInstancesOutput) - - DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error) - - DescribeInstancesPages(*ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool) error - - DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) (*request.Request, *ec2.DescribeInternetGatewaysOutput) - - DescribeInternetGateways(*ec2.DescribeInternetGatewaysInput) (*ec2.DescribeInternetGatewaysOutput, error) - - DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.Request, *ec2.DescribeKeyPairsOutput) - - DescribeKeyPairs(*ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error) - - DescribeMovingAddressesRequest(*ec2.DescribeMovingAddressesInput) (*request.Request, *ec2.DescribeMovingAddressesOutput) - - DescribeMovingAddresses(*ec2.DescribeMovingAddressesInput) (*ec2.DescribeMovingAddressesOutput, error) - - DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*request.Request, *ec2.DescribeNatGatewaysOutput) - - DescribeNatGateways(*ec2.DescribeNatGatewaysInput) (*ec2.DescribeNatGatewaysOutput, error) - - DescribeNetworkAclsRequest(*ec2.DescribeNetworkAclsInput) (*request.Request, *ec2.DescribeNetworkAclsOutput) - - DescribeNetworkAcls(*ec2.DescribeNetworkAclsInput) (*ec2.DescribeNetworkAclsOutput, error) - - DescribeNetworkInterfaceAttributeRequest(*ec2.DescribeNetworkInterfaceAttributeInput) (*request.Request, *ec2.DescribeNetworkInterfaceAttributeOutput) - - DescribeNetworkInterfaceAttribute(*ec2.DescribeNetworkInterfaceAttributeInput) (*ec2.DescribeNetworkInterfaceAttributeOutput, error) - - DescribeNetworkInterfacesRequest(*ec2.DescribeNetworkInterfacesInput) (*request.Request, *ec2.DescribeNetworkInterfacesOutput) - - DescribeNetworkInterfaces(*ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error) - - DescribePlacementGroupsRequest(*ec2.DescribePlacementGroupsInput) (*request.Request, *ec2.DescribePlacementGroupsOutput) - - DescribePlacementGroups(*ec2.DescribePlacementGroupsInput) (*ec2.DescribePlacementGroupsOutput, error) - - DescribePrefixListsRequest(*ec2.DescribePrefixListsInput) (*request.Request, *ec2.DescribePrefixListsOutput) - - DescribePrefixLists(*ec2.DescribePrefixListsInput) (*ec2.DescribePrefixListsOutput, error) - - DescribeRegionsRequest(*ec2.DescribeRegionsInput) (*request.Request, *ec2.DescribeRegionsOutput) - - DescribeRegions(*ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error) - - DescribeReservedInstancesRequest(*ec2.DescribeReservedInstancesInput) (*request.Request, *ec2.DescribeReservedInstancesOutput) - - DescribeReservedInstances(*ec2.DescribeReservedInstancesInput) (*ec2.DescribeReservedInstancesOutput, error) - - DescribeReservedInstancesListingsRequest(*ec2.DescribeReservedInstancesListingsInput) (*request.Request, *ec2.DescribeReservedInstancesListingsOutput) - - DescribeReservedInstancesListings(*ec2.DescribeReservedInstancesListingsInput) (*ec2.DescribeReservedInstancesListingsOutput, error) - - DescribeReservedInstancesModificationsRequest(*ec2.DescribeReservedInstancesModificationsInput) (*request.Request, *ec2.DescribeReservedInstancesModificationsOutput) - - DescribeReservedInstancesModifications(*ec2.DescribeReservedInstancesModificationsInput) (*ec2.DescribeReservedInstancesModificationsOutput, error) - - DescribeReservedInstancesModificationsPages(*ec2.DescribeReservedInstancesModificationsInput, func(*ec2.DescribeReservedInstancesModificationsOutput, bool) bool) error - - DescribeReservedInstancesOfferingsRequest(*ec2.DescribeReservedInstancesOfferingsInput) (*request.Request, *ec2.DescribeReservedInstancesOfferingsOutput) - - DescribeReservedInstancesOfferings(*ec2.DescribeReservedInstancesOfferingsInput) (*ec2.DescribeReservedInstancesOfferingsOutput, error) - - DescribeReservedInstancesOfferingsPages(*ec2.DescribeReservedInstancesOfferingsInput, func(*ec2.DescribeReservedInstancesOfferingsOutput, bool) bool) error - - DescribeRouteTablesRequest(*ec2.DescribeRouteTablesInput) (*request.Request, *ec2.DescribeRouteTablesOutput) - - DescribeRouteTables(*ec2.DescribeRouteTablesInput) (*ec2.DescribeRouteTablesOutput, error) - - DescribeScheduledInstanceAvailabilityRequest(*ec2.DescribeScheduledInstanceAvailabilityInput) (*request.Request, *ec2.DescribeScheduledInstanceAvailabilityOutput) - - DescribeScheduledInstanceAvailability(*ec2.DescribeScheduledInstanceAvailabilityInput) (*ec2.DescribeScheduledInstanceAvailabilityOutput, error) - - DescribeScheduledInstancesRequest(*ec2.DescribeScheduledInstancesInput) (*request.Request, *ec2.DescribeScheduledInstancesOutput) - - DescribeScheduledInstances(*ec2.DescribeScheduledInstancesInput) (*ec2.DescribeScheduledInstancesOutput, error) - - DescribeSecurityGroupsRequest(*ec2.DescribeSecurityGroupsInput) (*request.Request, *ec2.DescribeSecurityGroupsOutput) - - DescribeSecurityGroups(*ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) - - DescribeSnapshotAttributeRequest(*ec2.DescribeSnapshotAttributeInput) (*request.Request, *ec2.DescribeSnapshotAttributeOutput) - - DescribeSnapshotAttribute(*ec2.DescribeSnapshotAttributeInput) (*ec2.DescribeSnapshotAttributeOutput, error) - - DescribeSnapshotsRequest(*ec2.DescribeSnapshotsInput) (*request.Request, *ec2.DescribeSnapshotsOutput) - - DescribeSnapshots(*ec2.DescribeSnapshotsInput) (*ec2.DescribeSnapshotsOutput, error) - - DescribeSnapshotsPages(*ec2.DescribeSnapshotsInput, func(*ec2.DescribeSnapshotsOutput, bool) bool) error - - DescribeSpotDatafeedSubscriptionRequest(*ec2.DescribeSpotDatafeedSubscriptionInput) (*request.Request, *ec2.DescribeSpotDatafeedSubscriptionOutput) - - DescribeSpotDatafeedSubscription(*ec2.DescribeSpotDatafeedSubscriptionInput) (*ec2.DescribeSpotDatafeedSubscriptionOutput, error) - - DescribeSpotFleetInstancesRequest(*ec2.DescribeSpotFleetInstancesInput) (*request.Request, *ec2.DescribeSpotFleetInstancesOutput) - - DescribeSpotFleetInstances(*ec2.DescribeSpotFleetInstancesInput) (*ec2.DescribeSpotFleetInstancesOutput, error) - - DescribeSpotFleetRequestHistoryRequest(*ec2.DescribeSpotFleetRequestHistoryInput) (*request.Request, *ec2.DescribeSpotFleetRequestHistoryOutput) - - DescribeSpotFleetRequestHistory(*ec2.DescribeSpotFleetRequestHistoryInput) (*ec2.DescribeSpotFleetRequestHistoryOutput, error) - - DescribeSpotFleetRequestsRequest(*ec2.DescribeSpotFleetRequestsInput) (*request.Request, *ec2.DescribeSpotFleetRequestsOutput) - - DescribeSpotFleetRequests(*ec2.DescribeSpotFleetRequestsInput) (*ec2.DescribeSpotFleetRequestsOutput, error) - - DescribeSpotInstanceRequestsRequest(*ec2.DescribeSpotInstanceRequestsInput) (*request.Request, *ec2.DescribeSpotInstanceRequestsOutput) - - DescribeSpotInstanceRequests(*ec2.DescribeSpotInstanceRequestsInput) (*ec2.DescribeSpotInstanceRequestsOutput, error) - - DescribeSpotPriceHistoryRequest(*ec2.DescribeSpotPriceHistoryInput) (*request.Request, *ec2.DescribeSpotPriceHistoryOutput) - - DescribeSpotPriceHistory(*ec2.DescribeSpotPriceHistoryInput) (*ec2.DescribeSpotPriceHistoryOutput, error) - - DescribeSpotPriceHistoryPages(*ec2.DescribeSpotPriceHistoryInput, func(*ec2.DescribeSpotPriceHistoryOutput, bool) bool) error - - DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput) - - DescribeSubnets(*ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) - - DescribeTagsRequest(*ec2.DescribeTagsInput) (*request.Request, *ec2.DescribeTagsOutput) - - DescribeTags(*ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error) - - DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error - - DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) - - DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) - - DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*request.Request, *ec2.DescribeVolumeStatusOutput) - - DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error) - - DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error - - DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*request.Request, *ec2.DescribeVolumesOutput) - - DescribeVolumes(*ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error) - - DescribeVolumesPages(*ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool) error - - DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) - - DescribeVpcAttribute(*ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) - - DescribeVpcClassicLinkRequest(*ec2.DescribeVpcClassicLinkInput) (*request.Request, *ec2.DescribeVpcClassicLinkOutput) - - DescribeVpcClassicLink(*ec2.DescribeVpcClassicLinkInput) (*ec2.DescribeVpcClassicLinkOutput, error) - - DescribeVpcClassicLinkDnsSupportRequest(*ec2.DescribeVpcClassicLinkDnsSupportInput) (*request.Request, *ec2.DescribeVpcClassicLinkDnsSupportOutput) - - DescribeVpcClassicLinkDnsSupport(*ec2.DescribeVpcClassicLinkDnsSupportInput) (*ec2.DescribeVpcClassicLinkDnsSupportOutput, error) - - DescribeVpcEndpointServicesRequest(*ec2.DescribeVpcEndpointServicesInput) (*request.Request, *ec2.DescribeVpcEndpointServicesOutput) - - DescribeVpcEndpointServices(*ec2.DescribeVpcEndpointServicesInput) (*ec2.DescribeVpcEndpointServicesOutput, error) - - DescribeVpcEndpointsRequest(*ec2.DescribeVpcEndpointsInput) (*request.Request, *ec2.DescribeVpcEndpointsOutput) - - DescribeVpcEndpoints(*ec2.DescribeVpcEndpointsInput) (*ec2.DescribeVpcEndpointsOutput, error) - - DescribeVpcPeeringConnectionsRequest(*ec2.DescribeVpcPeeringConnectionsInput) (*request.Request, *ec2.DescribeVpcPeeringConnectionsOutput) - - DescribeVpcPeeringConnections(*ec2.DescribeVpcPeeringConnectionsInput) (*ec2.DescribeVpcPeeringConnectionsOutput, error) - - DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) - - DescribeVpcs(*ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) - - DescribeVpnConnectionsRequest(*ec2.DescribeVpnConnectionsInput) (*request.Request, *ec2.DescribeVpnConnectionsOutput) - - DescribeVpnConnections(*ec2.DescribeVpnConnectionsInput) (*ec2.DescribeVpnConnectionsOutput, error) - - DescribeVpnGatewaysRequest(*ec2.DescribeVpnGatewaysInput) (*request.Request, *ec2.DescribeVpnGatewaysOutput) - - DescribeVpnGateways(*ec2.DescribeVpnGatewaysInput) (*ec2.DescribeVpnGatewaysOutput, error) - - DetachClassicLinkVpcRequest(*ec2.DetachClassicLinkVpcInput) (*request.Request, *ec2.DetachClassicLinkVpcOutput) - - DetachClassicLinkVpc(*ec2.DetachClassicLinkVpcInput) (*ec2.DetachClassicLinkVpcOutput, error) - - DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*request.Request, *ec2.DetachInternetGatewayOutput) - - DetachInternetGateway(*ec2.DetachInternetGatewayInput) (*ec2.DetachInternetGatewayOutput, error) - - DetachNetworkInterfaceRequest(*ec2.DetachNetworkInterfaceInput) (*request.Request, *ec2.DetachNetworkInterfaceOutput) - - DetachNetworkInterface(*ec2.DetachNetworkInterfaceInput) (*ec2.DetachNetworkInterfaceOutput, error) - - DetachVolumeRequest(*ec2.DetachVolumeInput) (*request.Request, *ec2.VolumeAttachment) - - DetachVolume(*ec2.DetachVolumeInput) (*ec2.VolumeAttachment, error) - - DetachVpnGatewayRequest(*ec2.DetachVpnGatewayInput) (*request.Request, *ec2.DetachVpnGatewayOutput) - - DetachVpnGateway(*ec2.DetachVpnGatewayInput) (*ec2.DetachVpnGatewayOutput, error) - - DisableVgwRoutePropagationRequest(*ec2.DisableVgwRoutePropagationInput) (*request.Request, *ec2.DisableVgwRoutePropagationOutput) - - DisableVgwRoutePropagation(*ec2.DisableVgwRoutePropagationInput) (*ec2.DisableVgwRoutePropagationOutput, error) - - DisableVpcClassicLinkRequest(*ec2.DisableVpcClassicLinkInput) (*request.Request, *ec2.DisableVpcClassicLinkOutput) - - DisableVpcClassicLink(*ec2.DisableVpcClassicLinkInput) (*ec2.DisableVpcClassicLinkOutput, error) - - DisableVpcClassicLinkDnsSupportRequest(*ec2.DisableVpcClassicLinkDnsSupportInput) (*request.Request, *ec2.DisableVpcClassicLinkDnsSupportOutput) - - DisableVpcClassicLinkDnsSupport(*ec2.DisableVpcClassicLinkDnsSupportInput) (*ec2.DisableVpcClassicLinkDnsSupportOutput, error) - - DisassociateAddressRequest(*ec2.DisassociateAddressInput) (*request.Request, *ec2.DisassociateAddressOutput) - - DisassociateAddress(*ec2.DisassociateAddressInput) (*ec2.DisassociateAddressOutput, error) - - DisassociateRouteTableRequest(*ec2.DisassociateRouteTableInput) (*request.Request, *ec2.DisassociateRouteTableOutput) - - DisassociateRouteTable(*ec2.DisassociateRouteTableInput) (*ec2.DisassociateRouteTableOutput, error) - - EnableVgwRoutePropagationRequest(*ec2.EnableVgwRoutePropagationInput) (*request.Request, *ec2.EnableVgwRoutePropagationOutput) - - EnableVgwRoutePropagation(*ec2.EnableVgwRoutePropagationInput) (*ec2.EnableVgwRoutePropagationOutput, error) - - EnableVolumeIORequest(*ec2.EnableVolumeIOInput) (*request.Request, *ec2.EnableVolumeIOOutput) - - EnableVolumeIO(*ec2.EnableVolumeIOInput) (*ec2.EnableVolumeIOOutput, error) - - EnableVpcClassicLinkRequest(*ec2.EnableVpcClassicLinkInput) (*request.Request, *ec2.EnableVpcClassicLinkOutput) - - EnableVpcClassicLink(*ec2.EnableVpcClassicLinkInput) (*ec2.EnableVpcClassicLinkOutput, error) - - EnableVpcClassicLinkDnsSupportRequest(*ec2.EnableVpcClassicLinkDnsSupportInput) (*request.Request, *ec2.EnableVpcClassicLinkDnsSupportOutput) - - EnableVpcClassicLinkDnsSupport(*ec2.EnableVpcClassicLinkDnsSupportInput) (*ec2.EnableVpcClassicLinkDnsSupportOutput, error) - - GetConsoleOutputRequest(*ec2.GetConsoleOutputInput) (*request.Request, *ec2.GetConsoleOutputOutput) - - GetConsoleOutput(*ec2.GetConsoleOutputInput) (*ec2.GetConsoleOutputOutput, error) - - GetPasswordDataRequest(*ec2.GetPasswordDataInput) (*request.Request, *ec2.GetPasswordDataOutput) - - GetPasswordData(*ec2.GetPasswordDataInput) (*ec2.GetPasswordDataOutput, error) - - ImportImageRequest(*ec2.ImportImageInput) (*request.Request, *ec2.ImportImageOutput) - - ImportImage(*ec2.ImportImageInput) (*ec2.ImportImageOutput, error) - - ImportInstanceRequest(*ec2.ImportInstanceInput) (*request.Request, *ec2.ImportInstanceOutput) - - ImportInstance(*ec2.ImportInstanceInput) (*ec2.ImportInstanceOutput, error) - - ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*request.Request, *ec2.ImportKeyPairOutput) - - ImportKeyPair(*ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error) - - ImportSnapshotRequest(*ec2.ImportSnapshotInput) (*request.Request, *ec2.ImportSnapshotOutput) - - ImportSnapshot(*ec2.ImportSnapshotInput) (*ec2.ImportSnapshotOutput, error) - - ImportVolumeRequest(*ec2.ImportVolumeInput) (*request.Request, *ec2.ImportVolumeOutput) - - ImportVolume(*ec2.ImportVolumeInput) (*ec2.ImportVolumeOutput, error) - - ModifyHostsRequest(*ec2.ModifyHostsInput) (*request.Request, *ec2.ModifyHostsOutput) - - ModifyHosts(*ec2.ModifyHostsInput) (*ec2.ModifyHostsOutput, error) - - ModifyIdFormatRequest(*ec2.ModifyIdFormatInput) (*request.Request, *ec2.ModifyIdFormatOutput) - - ModifyIdFormat(*ec2.ModifyIdFormatInput) (*ec2.ModifyIdFormatOutput, error) - - ModifyImageAttributeRequest(*ec2.ModifyImageAttributeInput) (*request.Request, *ec2.ModifyImageAttributeOutput) - - ModifyImageAttribute(*ec2.ModifyImageAttributeInput) (*ec2.ModifyImageAttributeOutput, error) - - ModifyInstanceAttributeRequest(*ec2.ModifyInstanceAttributeInput) (*request.Request, *ec2.ModifyInstanceAttributeOutput) - - ModifyInstanceAttribute(*ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error) - - ModifyInstancePlacementRequest(*ec2.ModifyInstancePlacementInput) (*request.Request, *ec2.ModifyInstancePlacementOutput) - - ModifyInstancePlacement(*ec2.ModifyInstancePlacementInput) (*ec2.ModifyInstancePlacementOutput, error) - - ModifyNetworkInterfaceAttributeRequest(*ec2.ModifyNetworkInterfaceAttributeInput) (*request.Request, *ec2.ModifyNetworkInterfaceAttributeOutput) - - ModifyNetworkInterfaceAttribute(*ec2.ModifyNetworkInterfaceAttributeInput) (*ec2.ModifyNetworkInterfaceAttributeOutput, error) - - ModifyReservedInstancesRequest(*ec2.ModifyReservedInstancesInput) (*request.Request, *ec2.ModifyReservedInstancesOutput) - - ModifyReservedInstances(*ec2.ModifyReservedInstancesInput) (*ec2.ModifyReservedInstancesOutput, error) - - ModifySnapshotAttributeRequest(*ec2.ModifySnapshotAttributeInput) (*request.Request, *ec2.ModifySnapshotAttributeOutput) - - ModifySnapshotAttribute(*ec2.ModifySnapshotAttributeInput) (*ec2.ModifySnapshotAttributeOutput, error) - - ModifySpotFleetRequestRequest(*ec2.ModifySpotFleetRequestInput) (*request.Request, *ec2.ModifySpotFleetRequestOutput) - - ModifySpotFleetRequest(*ec2.ModifySpotFleetRequestInput) (*ec2.ModifySpotFleetRequestOutput, error) - - ModifySubnetAttributeRequest(*ec2.ModifySubnetAttributeInput) (*request.Request, *ec2.ModifySubnetAttributeOutput) - - ModifySubnetAttribute(*ec2.ModifySubnetAttributeInput) (*ec2.ModifySubnetAttributeOutput, error) - - ModifyVolumeAttributeRequest(*ec2.ModifyVolumeAttributeInput) (*request.Request, *ec2.ModifyVolumeAttributeOutput) - - ModifyVolumeAttribute(*ec2.ModifyVolumeAttributeInput) (*ec2.ModifyVolumeAttributeOutput, error) - - ModifyVpcAttributeRequest(*ec2.ModifyVpcAttributeInput) (*request.Request, *ec2.ModifyVpcAttributeOutput) - - ModifyVpcAttribute(*ec2.ModifyVpcAttributeInput) (*ec2.ModifyVpcAttributeOutput, error) - - ModifyVpcEndpointRequest(*ec2.ModifyVpcEndpointInput) (*request.Request, *ec2.ModifyVpcEndpointOutput) - - ModifyVpcEndpoint(*ec2.ModifyVpcEndpointInput) (*ec2.ModifyVpcEndpointOutput, error) - - MonitorInstancesRequest(*ec2.MonitorInstancesInput) (*request.Request, *ec2.MonitorInstancesOutput) - - MonitorInstances(*ec2.MonitorInstancesInput) (*ec2.MonitorInstancesOutput, error) - - MoveAddressToVpcRequest(*ec2.MoveAddressToVpcInput) (*request.Request, *ec2.MoveAddressToVpcOutput) - - MoveAddressToVpc(*ec2.MoveAddressToVpcInput) (*ec2.MoveAddressToVpcOutput, error) - - PurchaseReservedInstancesOfferingRequest(*ec2.PurchaseReservedInstancesOfferingInput) (*request.Request, *ec2.PurchaseReservedInstancesOfferingOutput) - - PurchaseReservedInstancesOffering(*ec2.PurchaseReservedInstancesOfferingInput) (*ec2.PurchaseReservedInstancesOfferingOutput, error) - - PurchaseScheduledInstancesRequest(*ec2.PurchaseScheduledInstancesInput) (*request.Request, *ec2.PurchaseScheduledInstancesOutput) - - PurchaseScheduledInstances(*ec2.PurchaseScheduledInstancesInput) (*ec2.PurchaseScheduledInstancesOutput, error) - - RebootInstancesRequest(*ec2.RebootInstancesInput) (*request.Request, *ec2.RebootInstancesOutput) - - RebootInstances(*ec2.RebootInstancesInput) (*ec2.RebootInstancesOutput, error) - - RegisterImageRequest(*ec2.RegisterImageInput) (*request.Request, *ec2.RegisterImageOutput) - - RegisterImage(*ec2.RegisterImageInput) (*ec2.RegisterImageOutput, error) - - RejectVpcPeeringConnectionRequest(*ec2.RejectVpcPeeringConnectionInput) (*request.Request, *ec2.RejectVpcPeeringConnectionOutput) - - RejectVpcPeeringConnection(*ec2.RejectVpcPeeringConnectionInput) (*ec2.RejectVpcPeeringConnectionOutput, error) - - ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) - - ReleaseAddress(*ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) - - ReleaseHostsRequest(*ec2.ReleaseHostsInput) (*request.Request, *ec2.ReleaseHostsOutput) - - ReleaseHosts(*ec2.ReleaseHostsInput) (*ec2.ReleaseHostsOutput, error) - - ReplaceNetworkAclAssociationRequest(*ec2.ReplaceNetworkAclAssociationInput) (*request.Request, *ec2.ReplaceNetworkAclAssociationOutput) - - ReplaceNetworkAclAssociation(*ec2.ReplaceNetworkAclAssociationInput) (*ec2.ReplaceNetworkAclAssociationOutput, error) - - ReplaceNetworkAclEntryRequest(*ec2.ReplaceNetworkAclEntryInput) (*request.Request, *ec2.ReplaceNetworkAclEntryOutput) - - ReplaceNetworkAclEntry(*ec2.ReplaceNetworkAclEntryInput) (*ec2.ReplaceNetworkAclEntryOutput, error) - - ReplaceRouteRequest(*ec2.ReplaceRouteInput) (*request.Request, *ec2.ReplaceRouteOutput) - - ReplaceRoute(*ec2.ReplaceRouteInput) (*ec2.ReplaceRouteOutput, error) - - ReplaceRouteTableAssociationRequest(*ec2.ReplaceRouteTableAssociationInput) (*request.Request, *ec2.ReplaceRouteTableAssociationOutput) - - ReplaceRouteTableAssociation(*ec2.ReplaceRouteTableAssociationInput) (*ec2.ReplaceRouteTableAssociationOutput, error) - - ReportInstanceStatusRequest(*ec2.ReportInstanceStatusInput) (*request.Request, *ec2.ReportInstanceStatusOutput) - - ReportInstanceStatus(*ec2.ReportInstanceStatusInput) (*ec2.ReportInstanceStatusOutput, error) - - RequestSpotFleetRequest(*ec2.RequestSpotFleetInput) (*request.Request, *ec2.RequestSpotFleetOutput) - - RequestSpotFleet(*ec2.RequestSpotFleetInput) (*ec2.RequestSpotFleetOutput, error) - - RequestSpotInstancesRequest(*ec2.RequestSpotInstancesInput) (*request.Request, *ec2.RequestSpotInstancesOutput) - - RequestSpotInstances(*ec2.RequestSpotInstancesInput) (*ec2.RequestSpotInstancesOutput, error) - - ResetImageAttributeRequest(*ec2.ResetImageAttributeInput) (*request.Request, *ec2.ResetImageAttributeOutput) - - ResetImageAttribute(*ec2.ResetImageAttributeInput) (*ec2.ResetImageAttributeOutput, error) - - ResetInstanceAttributeRequest(*ec2.ResetInstanceAttributeInput) (*request.Request, *ec2.ResetInstanceAttributeOutput) - - ResetInstanceAttribute(*ec2.ResetInstanceAttributeInput) (*ec2.ResetInstanceAttributeOutput, error) - - ResetNetworkInterfaceAttributeRequest(*ec2.ResetNetworkInterfaceAttributeInput) (*request.Request, *ec2.ResetNetworkInterfaceAttributeOutput) - - ResetNetworkInterfaceAttribute(*ec2.ResetNetworkInterfaceAttributeInput) (*ec2.ResetNetworkInterfaceAttributeOutput, error) - - ResetSnapshotAttributeRequest(*ec2.ResetSnapshotAttributeInput) (*request.Request, *ec2.ResetSnapshotAttributeOutput) - - ResetSnapshotAttribute(*ec2.ResetSnapshotAttributeInput) (*ec2.ResetSnapshotAttributeOutput, error) - - RestoreAddressToClassicRequest(*ec2.RestoreAddressToClassicInput) (*request.Request, *ec2.RestoreAddressToClassicOutput) - - RestoreAddressToClassic(*ec2.RestoreAddressToClassicInput) (*ec2.RestoreAddressToClassicOutput, error) - - RevokeSecurityGroupEgressRequest(*ec2.RevokeSecurityGroupEgressInput) (*request.Request, *ec2.RevokeSecurityGroupEgressOutput) - - RevokeSecurityGroupEgress(*ec2.RevokeSecurityGroupEgressInput) (*ec2.RevokeSecurityGroupEgressOutput, error) - - RevokeSecurityGroupIngressRequest(*ec2.RevokeSecurityGroupIngressInput) (*request.Request, *ec2.RevokeSecurityGroupIngressOutput) - - RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error) - - RunInstancesRequest(*ec2.RunInstancesInput) (*request.Request, *ec2.Reservation) - - RunInstances(*ec2.RunInstancesInput) (*ec2.Reservation, error) - - RunScheduledInstancesRequest(*ec2.RunScheduledInstancesInput) (*request.Request, *ec2.RunScheduledInstancesOutput) - - RunScheduledInstances(*ec2.RunScheduledInstancesInput) (*ec2.RunScheduledInstancesOutput, error) - - StartInstancesRequest(*ec2.StartInstancesInput) (*request.Request, *ec2.StartInstancesOutput) - - StartInstances(*ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error) - - StopInstancesRequest(*ec2.StopInstancesInput) (*request.Request, *ec2.StopInstancesOutput) - - StopInstances(*ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error) - - TerminateInstancesRequest(*ec2.TerminateInstancesInput) (*request.Request, *ec2.TerminateInstancesOutput) - - TerminateInstances(*ec2.TerminateInstancesInput) (*ec2.TerminateInstancesOutput, error) - - UnassignPrivateIpAddressesRequest(*ec2.UnassignPrivateIpAddressesInput) (*request.Request, *ec2.UnassignPrivateIpAddressesOutput) - - UnassignPrivateIpAddresses(*ec2.UnassignPrivateIpAddressesInput) (*ec2.UnassignPrivateIpAddressesOutput, error) - - UnmonitorInstancesRequest(*ec2.UnmonitorInstancesInput) (*request.Request, *ec2.UnmonitorInstancesOutput) - - UnmonitorInstances(*ec2.UnmonitorInstancesInput) (*ec2.UnmonitorInstancesOutput, error) -} - -var _ EC2API = (*ec2.EC2)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go deleted file mode 100644 index f98fda647..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go +++ /dev/null @@ -1,78 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ecriface provides an interface for the Amazon EC2 Container Registry. -package ecriface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/ecr" -) - -// ECRAPI is the interface type for ecr.ECR. -type ECRAPI interface { - BatchCheckLayerAvailabilityRequest(*ecr.BatchCheckLayerAvailabilityInput) (*request.Request, *ecr.BatchCheckLayerAvailabilityOutput) - - BatchCheckLayerAvailability(*ecr.BatchCheckLayerAvailabilityInput) (*ecr.BatchCheckLayerAvailabilityOutput, error) - - BatchDeleteImageRequest(*ecr.BatchDeleteImageInput) (*request.Request, *ecr.BatchDeleteImageOutput) - - BatchDeleteImage(*ecr.BatchDeleteImageInput) (*ecr.BatchDeleteImageOutput, error) - - BatchGetImageRequest(*ecr.BatchGetImageInput) (*request.Request, *ecr.BatchGetImageOutput) - - BatchGetImage(*ecr.BatchGetImageInput) (*ecr.BatchGetImageOutput, error) - - CompleteLayerUploadRequest(*ecr.CompleteLayerUploadInput) (*request.Request, *ecr.CompleteLayerUploadOutput) - - CompleteLayerUpload(*ecr.CompleteLayerUploadInput) (*ecr.CompleteLayerUploadOutput, error) - - CreateRepositoryRequest(*ecr.CreateRepositoryInput) (*request.Request, *ecr.CreateRepositoryOutput) - - CreateRepository(*ecr.CreateRepositoryInput) (*ecr.CreateRepositoryOutput, error) - - DeleteRepositoryRequest(*ecr.DeleteRepositoryInput) (*request.Request, *ecr.DeleteRepositoryOutput) - - DeleteRepository(*ecr.DeleteRepositoryInput) (*ecr.DeleteRepositoryOutput, error) - - DeleteRepositoryPolicyRequest(*ecr.DeleteRepositoryPolicyInput) (*request.Request, *ecr.DeleteRepositoryPolicyOutput) - - DeleteRepositoryPolicy(*ecr.DeleteRepositoryPolicyInput) (*ecr.DeleteRepositoryPolicyOutput, error) - - DescribeRepositoriesRequest(*ecr.DescribeRepositoriesInput) (*request.Request, *ecr.DescribeRepositoriesOutput) - - DescribeRepositories(*ecr.DescribeRepositoriesInput) (*ecr.DescribeRepositoriesOutput, error) - - GetAuthorizationTokenRequest(*ecr.GetAuthorizationTokenInput) (*request.Request, *ecr.GetAuthorizationTokenOutput) - - GetAuthorizationToken(*ecr.GetAuthorizationTokenInput) (*ecr.GetAuthorizationTokenOutput, error) - - GetDownloadUrlForLayerRequest(*ecr.GetDownloadUrlForLayerInput) (*request.Request, *ecr.GetDownloadUrlForLayerOutput) - - GetDownloadUrlForLayer(*ecr.GetDownloadUrlForLayerInput) (*ecr.GetDownloadUrlForLayerOutput, error) - - GetRepositoryPolicyRequest(*ecr.GetRepositoryPolicyInput) (*request.Request, *ecr.GetRepositoryPolicyOutput) - - GetRepositoryPolicy(*ecr.GetRepositoryPolicyInput) (*ecr.GetRepositoryPolicyOutput, error) - - InitiateLayerUploadRequest(*ecr.InitiateLayerUploadInput) (*request.Request, *ecr.InitiateLayerUploadOutput) - - InitiateLayerUpload(*ecr.InitiateLayerUploadInput) (*ecr.InitiateLayerUploadOutput, error) - - ListImagesRequest(*ecr.ListImagesInput) (*request.Request, *ecr.ListImagesOutput) - - ListImages(*ecr.ListImagesInput) (*ecr.ListImagesOutput, error) - - PutImageRequest(*ecr.PutImageInput) (*request.Request, *ecr.PutImageOutput) - - PutImage(*ecr.PutImageInput) (*ecr.PutImageOutput, error) - - SetRepositoryPolicyRequest(*ecr.SetRepositoryPolicyInput) (*request.Request, *ecr.SetRepositoryPolicyOutput) - - SetRepositoryPolicy(*ecr.SetRepositoryPolicyInput) (*ecr.SetRepositoryPolicyOutput, error) - - UploadLayerPartRequest(*ecr.UploadLayerPartInput) (*request.Request, *ecr.UploadLayerPartOutput) - - UploadLayerPart(*ecr.UploadLayerPartInput) (*ecr.UploadLayerPartOutput, error) -} - -var _ ECRAPI = (*ecr.ECR)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/ecsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/ecsiface/interface.go deleted file mode 100644 index 58a4aecef..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/ecsiface/interface.go +++ /dev/null @@ -1,134 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package ecsiface provides an interface for the Amazon EC2 Container Service. -package ecsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/ecs" -) - -// ECSAPI is the interface type for ecs.ECS. -type ECSAPI interface { - CreateClusterRequest(*ecs.CreateClusterInput) (*request.Request, *ecs.CreateClusterOutput) - - CreateCluster(*ecs.CreateClusterInput) (*ecs.CreateClusterOutput, error) - - CreateServiceRequest(*ecs.CreateServiceInput) (*request.Request, *ecs.CreateServiceOutput) - - CreateService(*ecs.CreateServiceInput) (*ecs.CreateServiceOutput, error) - - DeleteClusterRequest(*ecs.DeleteClusterInput) (*request.Request, *ecs.DeleteClusterOutput) - - DeleteCluster(*ecs.DeleteClusterInput) (*ecs.DeleteClusterOutput, error) - - DeleteServiceRequest(*ecs.DeleteServiceInput) (*request.Request, *ecs.DeleteServiceOutput) - - DeleteService(*ecs.DeleteServiceInput) (*ecs.DeleteServiceOutput, error) - - DeregisterContainerInstanceRequest(*ecs.DeregisterContainerInstanceInput) (*request.Request, *ecs.DeregisterContainerInstanceOutput) - - DeregisterContainerInstance(*ecs.DeregisterContainerInstanceInput) (*ecs.DeregisterContainerInstanceOutput, error) - - DeregisterTaskDefinitionRequest(*ecs.DeregisterTaskDefinitionInput) (*request.Request, *ecs.DeregisterTaskDefinitionOutput) - - DeregisterTaskDefinition(*ecs.DeregisterTaskDefinitionInput) (*ecs.DeregisterTaskDefinitionOutput, error) - - DescribeClustersRequest(*ecs.DescribeClustersInput) (*request.Request, *ecs.DescribeClustersOutput) - - DescribeClusters(*ecs.DescribeClustersInput) (*ecs.DescribeClustersOutput, error) - - DescribeContainerInstancesRequest(*ecs.DescribeContainerInstancesInput) (*request.Request, *ecs.DescribeContainerInstancesOutput) - - DescribeContainerInstances(*ecs.DescribeContainerInstancesInput) (*ecs.DescribeContainerInstancesOutput, error) - - DescribeServicesRequest(*ecs.DescribeServicesInput) (*request.Request, *ecs.DescribeServicesOutput) - - DescribeServices(*ecs.DescribeServicesInput) (*ecs.DescribeServicesOutput, error) - - DescribeTaskDefinitionRequest(*ecs.DescribeTaskDefinitionInput) (*request.Request, *ecs.DescribeTaskDefinitionOutput) - - DescribeTaskDefinition(*ecs.DescribeTaskDefinitionInput) (*ecs.DescribeTaskDefinitionOutput, error) - - DescribeTasksRequest(*ecs.DescribeTasksInput) (*request.Request, *ecs.DescribeTasksOutput) - - DescribeTasks(*ecs.DescribeTasksInput) (*ecs.DescribeTasksOutput, error) - - DiscoverPollEndpointRequest(*ecs.DiscoverPollEndpointInput) (*request.Request, *ecs.DiscoverPollEndpointOutput) - - DiscoverPollEndpoint(*ecs.DiscoverPollEndpointInput) (*ecs.DiscoverPollEndpointOutput, error) - - ListClustersRequest(*ecs.ListClustersInput) (*request.Request, *ecs.ListClustersOutput) - - ListClusters(*ecs.ListClustersInput) (*ecs.ListClustersOutput, error) - - ListClustersPages(*ecs.ListClustersInput, func(*ecs.ListClustersOutput, bool) bool) error - - ListContainerInstancesRequest(*ecs.ListContainerInstancesInput) (*request.Request, *ecs.ListContainerInstancesOutput) - - ListContainerInstances(*ecs.ListContainerInstancesInput) (*ecs.ListContainerInstancesOutput, error) - - ListContainerInstancesPages(*ecs.ListContainerInstancesInput, func(*ecs.ListContainerInstancesOutput, bool) bool) error - - ListServicesRequest(*ecs.ListServicesInput) (*request.Request, *ecs.ListServicesOutput) - - ListServices(*ecs.ListServicesInput) (*ecs.ListServicesOutput, error) - - ListServicesPages(*ecs.ListServicesInput, func(*ecs.ListServicesOutput, bool) bool) error - - ListTaskDefinitionFamiliesRequest(*ecs.ListTaskDefinitionFamiliesInput) (*request.Request, *ecs.ListTaskDefinitionFamiliesOutput) - - ListTaskDefinitionFamilies(*ecs.ListTaskDefinitionFamiliesInput) (*ecs.ListTaskDefinitionFamiliesOutput, error) - - ListTaskDefinitionFamiliesPages(*ecs.ListTaskDefinitionFamiliesInput, func(*ecs.ListTaskDefinitionFamiliesOutput, bool) bool) error - - ListTaskDefinitionsRequest(*ecs.ListTaskDefinitionsInput) (*request.Request, *ecs.ListTaskDefinitionsOutput) - - ListTaskDefinitions(*ecs.ListTaskDefinitionsInput) (*ecs.ListTaskDefinitionsOutput, error) - - ListTaskDefinitionsPages(*ecs.ListTaskDefinitionsInput, func(*ecs.ListTaskDefinitionsOutput, bool) bool) error - - ListTasksRequest(*ecs.ListTasksInput) (*request.Request, *ecs.ListTasksOutput) - - ListTasks(*ecs.ListTasksInput) (*ecs.ListTasksOutput, error) - - ListTasksPages(*ecs.ListTasksInput, func(*ecs.ListTasksOutput, bool) bool) error - - RegisterContainerInstanceRequest(*ecs.RegisterContainerInstanceInput) (*request.Request, *ecs.RegisterContainerInstanceOutput) - - RegisterContainerInstance(*ecs.RegisterContainerInstanceInput) (*ecs.RegisterContainerInstanceOutput, error) - - RegisterTaskDefinitionRequest(*ecs.RegisterTaskDefinitionInput) (*request.Request, *ecs.RegisterTaskDefinitionOutput) - - RegisterTaskDefinition(*ecs.RegisterTaskDefinitionInput) (*ecs.RegisterTaskDefinitionOutput, error) - - RunTaskRequest(*ecs.RunTaskInput) (*request.Request, *ecs.RunTaskOutput) - - RunTask(*ecs.RunTaskInput) (*ecs.RunTaskOutput, error) - - StartTaskRequest(*ecs.StartTaskInput) (*request.Request, *ecs.StartTaskOutput) - - StartTask(*ecs.StartTaskInput) (*ecs.StartTaskOutput, error) - - StopTaskRequest(*ecs.StopTaskInput) (*request.Request, *ecs.StopTaskOutput) - - StopTask(*ecs.StopTaskInput) (*ecs.StopTaskOutput, error) - - SubmitContainerStateChangeRequest(*ecs.SubmitContainerStateChangeInput) (*request.Request, *ecs.SubmitContainerStateChangeOutput) - - SubmitContainerStateChange(*ecs.SubmitContainerStateChangeInput) (*ecs.SubmitContainerStateChangeOutput, error) - - SubmitTaskStateChangeRequest(*ecs.SubmitTaskStateChangeInput) (*request.Request, *ecs.SubmitTaskStateChangeOutput) - - SubmitTaskStateChange(*ecs.SubmitTaskStateChangeInput) (*ecs.SubmitTaskStateChangeOutput, error) - - UpdateContainerAgentRequest(*ecs.UpdateContainerAgentInput) (*request.Request, *ecs.UpdateContainerAgentOutput) - - UpdateContainerAgent(*ecs.UpdateContainerAgentInput) (*ecs.UpdateContainerAgentOutput, error) - - UpdateServiceRequest(*ecs.UpdateServiceInput) (*request.Request, *ecs.UpdateServiceOutput) - - UpdateService(*ecs.UpdateServiceInput) (*ecs.UpdateServiceOutput, error) -} - -var _ ECSAPI = (*ecs.ECS)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/efs/efsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/efs/efsiface/interface.go deleted file mode 100644 index 53542f18d..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/efsiface/interface.go +++ /dev/null @@ -1,58 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package efsiface provides an interface for the Amazon Elastic File System. -package efsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/efs" -) - -// EFSAPI is the interface type for efs.EFS. -type EFSAPI interface { - CreateFileSystemRequest(*efs.CreateFileSystemInput) (*request.Request, *efs.FileSystemDescription) - - CreateFileSystem(*efs.CreateFileSystemInput) (*efs.FileSystemDescription, error) - - CreateMountTargetRequest(*efs.CreateMountTargetInput) (*request.Request, *efs.MountTargetDescription) - - CreateMountTarget(*efs.CreateMountTargetInput) (*efs.MountTargetDescription, error) - - CreateTagsRequest(*efs.CreateTagsInput) (*request.Request, *efs.CreateTagsOutput) - - CreateTags(*efs.CreateTagsInput) (*efs.CreateTagsOutput, error) - - DeleteFileSystemRequest(*efs.DeleteFileSystemInput) (*request.Request, *efs.DeleteFileSystemOutput) - - DeleteFileSystem(*efs.DeleteFileSystemInput) (*efs.DeleteFileSystemOutput, error) - - DeleteMountTargetRequest(*efs.DeleteMountTargetInput) (*request.Request, *efs.DeleteMountTargetOutput) - - DeleteMountTarget(*efs.DeleteMountTargetInput) (*efs.DeleteMountTargetOutput, error) - - DeleteTagsRequest(*efs.DeleteTagsInput) (*request.Request, *efs.DeleteTagsOutput) - - DeleteTags(*efs.DeleteTagsInput) (*efs.DeleteTagsOutput, error) - - DescribeFileSystemsRequest(*efs.DescribeFileSystemsInput) (*request.Request, *efs.DescribeFileSystemsOutput) - - DescribeFileSystems(*efs.DescribeFileSystemsInput) (*efs.DescribeFileSystemsOutput, error) - - DescribeMountTargetSecurityGroupsRequest(*efs.DescribeMountTargetSecurityGroupsInput) (*request.Request, *efs.DescribeMountTargetSecurityGroupsOutput) - - DescribeMountTargetSecurityGroups(*efs.DescribeMountTargetSecurityGroupsInput) (*efs.DescribeMountTargetSecurityGroupsOutput, error) - - DescribeMountTargetsRequest(*efs.DescribeMountTargetsInput) (*request.Request, *efs.DescribeMountTargetsOutput) - - DescribeMountTargets(*efs.DescribeMountTargetsInput) (*efs.DescribeMountTargetsOutput, error) - - DescribeTagsRequest(*efs.DescribeTagsInput) (*request.Request, *efs.DescribeTagsOutput) - - DescribeTags(*efs.DescribeTagsInput) (*efs.DescribeTagsOutput, error) - - ModifyMountTargetSecurityGroupsRequest(*efs.ModifyMountTargetSecurityGroupsInput) (*request.Request, *efs.ModifyMountTargetSecurityGroupsOutput) - - ModifyMountTargetSecurityGroups(*efs.ModifyMountTargetSecurityGroupsInput) (*efs.ModifyMountTargetSecurityGroupsOutput, error) -} - -var _ EFSAPI = (*efs.EFS)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface/interface.go deleted file mode 100644 index 6ea5142f4..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface/interface.go +++ /dev/null @@ -1,186 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elasticacheiface provides an interface for the Amazon ElastiCache. -package elasticacheiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/elasticache" -) - -// ElastiCacheAPI is the interface type for elasticache.ElastiCache. -type ElastiCacheAPI interface { - AddTagsToResourceRequest(*elasticache.AddTagsToResourceInput) (*request.Request, *elasticache.TagListMessage) - - AddTagsToResource(*elasticache.AddTagsToResourceInput) (*elasticache.TagListMessage, error) - - AuthorizeCacheSecurityGroupIngressRequest(*elasticache.AuthorizeCacheSecurityGroupIngressInput) (*request.Request, *elasticache.AuthorizeCacheSecurityGroupIngressOutput) - - AuthorizeCacheSecurityGroupIngress(*elasticache.AuthorizeCacheSecurityGroupIngressInput) (*elasticache.AuthorizeCacheSecurityGroupIngressOutput, error) - - CopySnapshotRequest(*elasticache.CopySnapshotInput) (*request.Request, *elasticache.CopySnapshotOutput) - - CopySnapshot(*elasticache.CopySnapshotInput) (*elasticache.CopySnapshotOutput, error) - - CreateCacheClusterRequest(*elasticache.CreateCacheClusterInput) (*request.Request, *elasticache.CreateCacheClusterOutput) - - CreateCacheCluster(*elasticache.CreateCacheClusterInput) (*elasticache.CreateCacheClusterOutput, error) - - CreateCacheParameterGroupRequest(*elasticache.CreateCacheParameterGroupInput) (*request.Request, *elasticache.CreateCacheParameterGroupOutput) - - CreateCacheParameterGroup(*elasticache.CreateCacheParameterGroupInput) (*elasticache.CreateCacheParameterGroupOutput, error) - - CreateCacheSecurityGroupRequest(*elasticache.CreateCacheSecurityGroupInput) (*request.Request, *elasticache.CreateCacheSecurityGroupOutput) - - CreateCacheSecurityGroup(*elasticache.CreateCacheSecurityGroupInput) (*elasticache.CreateCacheSecurityGroupOutput, error) - - CreateCacheSubnetGroupRequest(*elasticache.CreateCacheSubnetGroupInput) (*request.Request, *elasticache.CreateCacheSubnetGroupOutput) - - CreateCacheSubnetGroup(*elasticache.CreateCacheSubnetGroupInput) (*elasticache.CreateCacheSubnetGroupOutput, error) - - CreateReplicationGroupRequest(*elasticache.CreateReplicationGroupInput) (*request.Request, *elasticache.CreateReplicationGroupOutput) - - CreateReplicationGroup(*elasticache.CreateReplicationGroupInput) (*elasticache.CreateReplicationGroupOutput, error) - - CreateSnapshotRequest(*elasticache.CreateSnapshotInput) (*request.Request, *elasticache.CreateSnapshotOutput) - - CreateSnapshot(*elasticache.CreateSnapshotInput) (*elasticache.CreateSnapshotOutput, error) - - DeleteCacheClusterRequest(*elasticache.DeleteCacheClusterInput) (*request.Request, *elasticache.DeleteCacheClusterOutput) - - DeleteCacheCluster(*elasticache.DeleteCacheClusterInput) (*elasticache.DeleteCacheClusterOutput, error) - - DeleteCacheParameterGroupRequest(*elasticache.DeleteCacheParameterGroupInput) (*request.Request, *elasticache.DeleteCacheParameterGroupOutput) - - DeleteCacheParameterGroup(*elasticache.DeleteCacheParameterGroupInput) (*elasticache.DeleteCacheParameterGroupOutput, error) - - DeleteCacheSecurityGroupRequest(*elasticache.DeleteCacheSecurityGroupInput) (*request.Request, *elasticache.DeleteCacheSecurityGroupOutput) - - DeleteCacheSecurityGroup(*elasticache.DeleteCacheSecurityGroupInput) (*elasticache.DeleteCacheSecurityGroupOutput, error) - - DeleteCacheSubnetGroupRequest(*elasticache.DeleteCacheSubnetGroupInput) (*request.Request, *elasticache.DeleteCacheSubnetGroupOutput) - - DeleteCacheSubnetGroup(*elasticache.DeleteCacheSubnetGroupInput) (*elasticache.DeleteCacheSubnetGroupOutput, error) - - DeleteReplicationGroupRequest(*elasticache.DeleteReplicationGroupInput) (*request.Request, *elasticache.DeleteReplicationGroupOutput) - - DeleteReplicationGroup(*elasticache.DeleteReplicationGroupInput) (*elasticache.DeleteReplicationGroupOutput, error) - - DeleteSnapshotRequest(*elasticache.DeleteSnapshotInput) (*request.Request, *elasticache.DeleteSnapshotOutput) - - DeleteSnapshot(*elasticache.DeleteSnapshotInput) (*elasticache.DeleteSnapshotOutput, error) - - DescribeCacheClustersRequest(*elasticache.DescribeCacheClustersInput) (*request.Request, *elasticache.DescribeCacheClustersOutput) - - DescribeCacheClusters(*elasticache.DescribeCacheClustersInput) (*elasticache.DescribeCacheClustersOutput, error) - - DescribeCacheClustersPages(*elasticache.DescribeCacheClustersInput, func(*elasticache.DescribeCacheClustersOutput, bool) bool) error - - DescribeCacheEngineVersionsRequest(*elasticache.DescribeCacheEngineVersionsInput) (*request.Request, *elasticache.DescribeCacheEngineVersionsOutput) - - DescribeCacheEngineVersions(*elasticache.DescribeCacheEngineVersionsInput) (*elasticache.DescribeCacheEngineVersionsOutput, error) - - DescribeCacheEngineVersionsPages(*elasticache.DescribeCacheEngineVersionsInput, func(*elasticache.DescribeCacheEngineVersionsOutput, bool) bool) error - - DescribeCacheParameterGroupsRequest(*elasticache.DescribeCacheParameterGroupsInput) (*request.Request, *elasticache.DescribeCacheParameterGroupsOutput) - - DescribeCacheParameterGroups(*elasticache.DescribeCacheParameterGroupsInput) (*elasticache.DescribeCacheParameterGroupsOutput, error) - - DescribeCacheParameterGroupsPages(*elasticache.DescribeCacheParameterGroupsInput, func(*elasticache.DescribeCacheParameterGroupsOutput, bool) bool) error - - DescribeCacheParametersRequest(*elasticache.DescribeCacheParametersInput) (*request.Request, *elasticache.DescribeCacheParametersOutput) - - DescribeCacheParameters(*elasticache.DescribeCacheParametersInput) (*elasticache.DescribeCacheParametersOutput, error) - - DescribeCacheParametersPages(*elasticache.DescribeCacheParametersInput, func(*elasticache.DescribeCacheParametersOutput, bool) bool) error - - DescribeCacheSecurityGroupsRequest(*elasticache.DescribeCacheSecurityGroupsInput) (*request.Request, *elasticache.DescribeCacheSecurityGroupsOutput) - - DescribeCacheSecurityGroups(*elasticache.DescribeCacheSecurityGroupsInput) (*elasticache.DescribeCacheSecurityGroupsOutput, error) - - DescribeCacheSecurityGroupsPages(*elasticache.DescribeCacheSecurityGroupsInput, func(*elasticache.DescribeCacheSecurityGroupsOutput, bool) bool) error - - DescribeCacheSubnetGroupsRequest(*elasticache.DescribeCacheSubnetGroupsInput) (*request.Request, *elasticache.DescribeCacheSubnetGroupsOutput) - - DescribeCacheSubnetGroups(*elasticache.DescribeCacheSubnetGroupsInput) (*elasticache.DescribeCacheSubnetGroupsOutput, error) - - DescribeCacheSubnetGroupsPages(*elasticache.DescribeCacheSubnetGroupsInput, func(*elasticache.DescribeCacheSubnetGroupsOutput, bool) bool) error - - DescribeEngineDefaultParametersRequest(*elasticache.DescribeEngineDefaultParametersInput) (*request.Request, *elasticache.DescribeEngineDefaultParametersOutput) - - DescribeEngineDefaultParameters(*elasticache.DescribeEngineDefaultParametersInput) (*elasticache.DescribeEngineDefaultParametersOutput, error) - - DescribeEngineDefaultParametersPages(*elasticache.DescribeEngineDefaultParametersInput, func(*elasticache.DescribeEngineDefaultParametersOutput, bool) bool) error - - DescribeEventsRequest(*elasticache.DescribeEventsInput) (*request.Request, *elasticache.DescribeEventsOutput) - - DescribeEvents(*elasticache.DescribeEventsInput) (*elasticache.DescribeEventsOutput, error) - - DescribeEventsPages(*elasticache.DescribeEventsInput, func(*elasticache.DescribeEventsOutput, bool) bool) error - - DescribeReplicationGroupsRequest(*elasticache.DescribeReplicationGroupsInput) (*request.Request, *elasticache.DescribeReplicationGroupsOutput) - - DescribeReplicationGroups(*elasticache.DescribeReplicationGroupsInput) (*elasticache.DescribeReplicationGroupsOutput, error) - - DescribeReplicationGroupsPages(*elasticache.DescribeReplicationGroupsInput, func(*elasticache.DescribeReplicationGroupsOutput, bool) bool) error - - DescribeReservedCacheNodesRequest(*elasticache.DescribeReservedCacheNodesInput) (*request.Request, *elasticache.DescribeReservedCacheNodesOutput) - - DescribeReservedCacheNodes(*elasticache.DescribeReservedCacheNodesInput) (*elasticache.DescribeReservedCacheNodesOutput, error) - - DescribeReservedCacheNodesPages(*elasticache.DescribeReservedCacheNodesInput, func(*elasticache.DescribeReservedCacheNodesOutput, bool) bool) error - - DescribeReservedCacheNodesOfferingsRequest(*elasticache.DescribeReservedCacheNodesOfferingsInput) (*request.Request, *elasticache.DescribeReservedCacheNodesOfferingsOutput) - - DescribeReservedCacheNodesOfferings(*elasticache.DescribeReservedCacheNodesOfferingsInput) (*elasticache.DescribeReservedCacheNodesOfferingsOutput, error) - - DescribeReservedCacheNodesOfferingsPages(*elasticache.DescribeReservedCacheNodesOfferingsInput, func(*elasticache.DescribeReservedCacheNodesOfferingsOutput, bool) bool) error - - DescribeSnapshotsRequest(*elasticache.DescribeSnapshotsInput) (*request.Request, *elasticache.DescribeSnapshotsOutput) - - DescribeSnapshots(*elasticache.DescribeSnapshotsInput) (*elasticache.DescribeSnapshotsOutput, error) - - DescribeSnapshotsPages(*elasticache.DescribeSnapshotsInput, func(*elasticache.DescribeSnapshotsOutput, bool) bool) error - - ListTagsForResourceRequest(*elasticache.ListTagsForResourceInput) (*request.Request, *elasticache.TagListMessage) - - ListTagsForResource(*elasticache.ListTagsForResourceInput) (*elasticache.TagListMessage, error) - - ModifyCacheClusterRequest(*elasticache.ModifyCacheClusterInput) (*request.Request, *elasticache.ModifyCacheClusterOutput) - - ModifyCacheCluster(*elasticache.ModifyCacheClusterInput) (*elasticache.ModifyCacheClusterOutput, error) - - ModifyCacheParameterGroupRequest(*elasticache.ModifyCacheParameterGroupInput) (*request.Request, *elasticache.CacheParameterGroupNameMessage) - - ModifyCacheParameterGroup(*elasticache.ModifyCacheParameterGroupInput) (*elasticache.CacheParameterGroupNameMessage, error) - - ModifyCacheSubnetGroupRequest(*elasticache.ModifyCacheSubnetGroupInput) (*request.Request, *elasticache.ModifyCacheSubnetGroupOutput) - - ModifyCacheSubnetGroup(*elasticache.ModifyCacheSubnetGroupInput) (*elasticache.ModifyCacheSubnetGroupOutput, error) - - ModifyReplicationGroupRequest(*elasticache.ModifyReplicationGroupInput) (*request.Request, *elasticache.ModifyReplicationGroupOutput) - - ModifyReplicationGroup(*elasticache.ModifyReplicationGroupInput) (*elasticache.ModifyReplicationGroupOutput, error) - - PurchaseReservedCacheNodesOfferingRequest(*elasticache.PurchaseReservedCacheNodesOfferingInput) (*request.Request, *elasticache.PurchaseReservedCacheNodesOfferingOutput) - - PurchaseReservedCacheNodesOffering(*elasticache.PurchaseReservedCacheNodesOfferingInput) (*elasticache.PurchaseReservedCacheNodesOfferingOutput, error) - - RebootCacheClusterRequest(*elasticache.RebootCacheClusterInput) (*request.Request, *elasticache.RebootCacheClusterOutput) - - RebootCacheCluster(*elasticache.RebootCacheClusterInput) (*elasticache.RebootCacheClusterOutput, error) - - RemoveTagsFromResourceRequest(*elasticache.RemoveTagsFromResourceInput) (*request.Request, *elasticache.TagListMessage) - - RemoveTagsFromResource(*elasticache.RemoveTagsFromResourceInput) (*elasticache.TagListMessage, error) - - ResetCacheParameterGroupRequest(*elasticache.ResetCacheParameterGroupInput) (*request.Request, *elasticache.CacheParameterGroupNameMessage) - - ResetCacheParameterGroup(*elasticache.ResetCacheParameterGroupInput) (*elasticache.CacheParameterGroupNameMessage, error) - - RevokeCacheSecurityGroupIngressRequest(*elasticache.RevokeCacheSecurityGroupIngressInput) (*request.Request, *elasticache.RevokeCacheSecurityGroupIngressOutput) - - RevokeCacheSecurityGroupIngress(*elasticache.RevokeCacheSecurityGroupIngressInput) (*elasticache.RevokeCacheSecurityGroupIngressOutput, error) -} - -var _ ElastiCacheAPI = (*elasticache.ElastiCache)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/elasticsearchserviceiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/elasticsearchserviceiface/interface.go deleted file mode 100644 index 974a57852..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/elasticsearchserviceiface/interface.go +++ /dev/null @@ -1,54 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elasticsearchserviceiface provides an interface for the Amazon Elasticsearch Service. -package elasticsearchserviceiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/elasticsearchservice" -) - -// ElasticsearchServiceAPI is the interface type for elasticsearchservice.ElasticsearchService. -type ElasticsearchServiceAPI interface { - AddTagsRequest(*elasticsearchservice.AddTagsInput) (*request.Request, *elasticsearchservice.AddTagsOutput) - - AddTags(*elasticsearchservice.AddTagsInput) (*elasticsearchservice.AddTagsOutput, error) - - CreateElasticsearchDomainRequest(*elasticsearchservice.CreateElasticsearchDomainInput) (*request.Request, *elasticsearchservice.CreateElasticsearchDomainOutput) - - CreateElasticsearchDomain(*elasticsearchservice.CreateElasticsearchDomainInput) (*elasticsearchservice.CreateElasticsearchDomainOutput, error) - - DeleteElasticsearchDomainRequest(*elasticsearchservice.DeleteElasticsearchDomainInput) (*request.Request, *elasticsearchservice.DeleteElasticsearchDomainOutput) - - DeleteElasticsearchDomain(*elasticsearchservice.DeleteElasticsearchDomainInput) (*elasticsearchservice.DeleteElasticsearchDomainOutput, error) - - DescribeElasticsearchDomainRequest(*elasticsearchservice.DescribeElasticsearchDomainInput) (*request.Request, *elasticsearchservice.DescribeElasticsearchDomainOutput) - - DescribeElasticsearchDomain(*elasticsearchservice.DescribeElasticsearchDomainInput) (*elasticsearchservice.DescribeElasticsearchDomainOutput, error) - - DescribeElasticsearchDomainConfigRequest(*elasticsearchservice.DescribeElasticsearchDomainConfigInput) (*request.Request, *elasticsearchservice.DescribeElasticsearchDomainConfigOutput) - - DescribeElasticsearchDomainConfig(*elasticsearchservice.DescribeElasticsearchDomainConfigInput) (*elasticsearchservice.DescribeElasticsearchDomainConfigOutput, error) - - DescribeElasticsearchDomainsRequest(*elasticsearchservice.DescribeElasticsearchDomainsInput) (*request.Request, *elasticsearchservice.DescribeElasticsearchDomainsOutput) - - DescribeElasticsearchDomains(*elasticsearchservice.DescribeElasticsearchDomainsInput) (*elasticsearchservice.DescribeElasticsearchDomainsOutput, error) - - ListDomainNamesRequest(*elasticsearchservice.ListDomainNamesInput) (*request.Request, *elasticsearchservice.ListDomainNamesOutput) - - ListDomainNames(*elasticsearchservice.ListDomainNamesInput) (*elasticsearchservice.ListDomainNamesOutput, error) - - ListTagsRequest(*elasticsearchservice.ListTagsInput) (*request.Request, *elasticsearchservice.ListTagsOutput) - - ListTags(*elasticsearchservice.ListTagsInput) (*elasticsearchservice.ListTagsOutput, error) - - RemoveTagsRequest(*elasticsearchservice.RemoveTagsInput) (*request.Request, *elasticsearchservice.RemoveTagsOutput) - - RemoveTags(*elasticsearchservice.RemoveTagsInput) (*elasticsearchservice.RemoveTagsOutput, error) - - UpdateElasticsearchDomainConfigRequest(*elasticsearchservice.UpdateElasticsearchDomainConfigInput) (*request.Request, *elasticsearchservice.UpdateElasticsearchDomainConfigOutput) - - UpdateElasticsearchDomainConfig(*elasticsearchservice.UpdateElasticsearchDomainConfigInput) (*elasticsearchservice.UpdateElasticsearchDomainConfigOutput, error) -} - -var _ ElasticsearchServiceAPI = (*elasticsearchservice.ElasticsearchService)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go deleted file mode 100644 index 5674133f7..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go +++ /dev/null @@ -1,128 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package elbiface provides an interface for the Elastic Load Balancing. -package elbiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/elb" -) - -// ELBAPI is the interface type for elb.ELB. -type ELBAPI interface { - AddTagsRequest(*elb.AddTagsInput) (*request.Request, *elb.AddTagsOutput) - - AddTags(*elb.AddTagsInput) (*elb.AddTagsOutput, error) - - ApplySecurityGroupsToLoadBalancerRequest(*elb.ApplySecurityGroupsToLoadBalancerInput) (*request.Request, *elb.ApplySecurityGroupsToLoadBalancerOutput) - - ApplySecurityGroupsToLoadBalancer(*elb.ApplySecurityGroupsToLoadBalancerInput) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error) - - AttachLoadBalancerToSubnetsRequest(*elb.AttachLoadBalancerToSubnetsInput) (*request.Request, *elb.AttachLoadBalancerToSubnetsOutput) - - AttachLoadBalancerToSubnets(*elb.AttachLoadBalancerToSubnetsInput) (*elb.AttachLoadBalancerToSubnetsOutput, error) - - ConfigureHealthCheckRequest(*elb.ConfigureHealthCheckInput) (*request.Request, *elb.ConfigureHealthCheckOutput) - - ConfigureHealthCheck(*elb.ConfigureHealthCheckInput) (*elb.ConfigureHealthCheckOutput, error) - - CreateAppCookieStickinessPolicyRequest(*elb.CreateAppCookieStickinessPolicyInput) (*request.Request, *elb.CreateAppCookieStickinessPolicyOutput) - - CreateAppCookieStickinessPolicy(*elb.CreateAppCookieStickinessPolicyInput) (*elb.CreateAppCookieStickinessPolicyOutput, error) - - CreateLBCookieStickinessPolicyRequest(*elb.CreateLBCookieStickinessPolicyInput) (*request.Request, *elb.CreateLBCookieStickinessPolicyOutput) - - CreateLBCookieStickinessPolicy(*elb.CreateLBCookieStickinessPolicyInput) (*elb.CreateLBCookieStickinessPolicyOutput, error) - - CreateLoadBalancerRequest(*elb.CreateLoadBalancerInput) (*request.Request, *elb.CreateLoadBalancerOutput) - - CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error) - - CreateLoadBalancerListenersRequest(*elb.CreateLoadBalancerListenersInput) (*request.Request, *elb.CreateLoadBalancerListenersOutput) - - CreateLoadBalancerListeners(*elb.CreateLoadBalancerListenersInput) (*elb.CreateLoadBalancerListenersOutput, error) - - CreateLoadBalancerPolicyRequest(*elb.CreateLoadBalancerPolicyInput) (*request.Request, *elb.CreateLoadBalancerPolicyOutput) - - CreateLoadBalancerPolicy(*elb.CreateLoadBalancerPolicyInput) (*elb.CreateLoadBalancerPolicyOutput, error) - - DeleteLoadBalancerRequest(*elb.DeleteLoadBalancerInput) (*request.Request, *elb.DeleteLoadBalancerOutput) - - DeleteLoadBalancer(*elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error) - - DeleteLoadBalancerListenersRequest(*elb.DeleteLoadBalancerListenersInput) (*request.Request, *elb.DeleteLoadBalancerListenersOutput) - - DeleteLoadBalancerListeners(*elb.DeleteLoadBalancerListenersInput) (*elb.DeleteLoadBalancerListenersOutput, error) - - DeleteLoadBalancerPolicyRequest(*elb.DeleteLoadBalancerPolicyInput) (*request.Request, *elb.DeleteLoadBalancerPolicyOutput) - - DeleteLoadBalancerPolicy(*elb.DeleteLoadBalancerPolicyInput) (*elb.DeleteLoadBalancerPolicyOutput, error) - - DeregisterInstancesFromLoadBalancerRequest(*elb.DeregisterInstancesFromLoadBalancerInput) (*request.Request, *elb.DeregisterInstancesFromLoadBalancerOutput) - - DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error) - - DescribeInstanceHealthRequest(*elb.DescribeInstanceHealthInput) (*request.Request, *elb.DescribeInstanceHealthOutput) - - DescribeInstanceHealth(*elb.DescribeInstanceHealthInput) (*elb.DescribeInstanceHealthOutput, error) - - DescribeLoadBalancerAttributesRequest(*elb.DescribeLoadBalancerAttributesInput) (*request.Request, *elb.DescribeLoadBalancerAttributesOutput) - - DescribeLoadBalancerAttributes(*elb.DescribeLoadBalancerAttributesInput) (*elb.DescribeLoadBalancerAttributesOutput, error) - - DescribeLoadBalancerPoliciesRequest(*elb.DescribeLoadBalancerPoliciesInput) (*request.Request, *elb.DescribeLoadBalancerPoliciesOutput) - - DescribeLoadBalancerPolicies(*elb.DescribeLoadBalancerPoliciesInput) (*elb.DescribeLoadBalancerPoliciesOutput, error) - - DescribeLoadBalancerPolicyTypesRequest(*elb.DescribeLoadBalancerPolicyTypesInput) (*request.Request, *elb.DescribeLoadBalancerPolicyTypesOutput) - - DescribeLoadBalancerPolicyTypes(*elb.DescribeLoadBalancerPolicyTypesInput) (*elb.DescribeLoadBalancerPolicyTypesOutput, error) - - DescribeLoadBalancersRequest(*elb.DescribeLoadBalancersInput) (*request.Request, *elb.DescribeLoadBalancersOutput) - - DescribeLoadBalancers(*elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error) - - DescribeLoadBalancersPages(*elb.DescribeLoadBalancersInput, func(*elb.DescribeLoadBalancersOutput, bool) bool) error - - DescribeTagsRequest(*elb.DescribeTagsInput) (*request.Request, *elb.DescribeTagsOutput) - - DescribeTags(*elb.DescribeTagsInput) (*elb.DescribeTagsOutput, error) - - DetachLoadBalancerFromSubnetsRequest(*elb.DetachLoadBalancerFromSubnetsInput) (*request.Request, *elb.DetachLoadBalancerFromSubnetsOutput) - - DetachLoadBalancerFromSubnets(*elb.DetachLoadBalancerFromSubnetsInput) (*elb.DetachLoadBalancerFromSubnetsOutput, error) - - DisableAvailabilityZonesForLoadBalancerRequest(*elb.DisableAvailabilityZonesForLoadBalancerInput) (*request.Request, *elb.DisableAvailabilityZonesForLoadBalancerOutput) - - DisableAvailabilityZonesForLoadBalancer(*elb.DisableAvailabilityZonesForLoadBalancerInput) (*elb.DisableAvailabilityZonesForLoadBalancerOutput, error) - - EnableAvailabilityZonesForLoadBalancerRequest(*elb.EnableAvailabilityZonesForLoadBalancerInput) (*request.Request, *elb.EnableAvailabilityZonesForLoadBalancerOutput) - - EnableAvailabilityZonesForLoadBalancer(*elb.EnableAvailabilityZonesForLoadBalancerInput) (*elb.EnableAvailabilityZonesForLoadBalancerOutput, error) - - ModifyLoadBalancerAttributesRequest(*elb.ModifyLoadBalancerAttributesInput) (*request.Request, *elb.ModifyLoadBalancerAttributesOutput) - - ModifyLoadBalancerAttributes(*elb.ModifyLoadBalancerAttributesInput) (*elb.ModifyLoadBalancerAttributesOutput, error) - - RegisterInstancesWithLoadBalancerRequest(*elb.RegisterInstancesWithLoadBalancerInput) (*request.Request, *elb.RegisterInstancesWithLoadBalancerOutput) - - RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error) - - RemoveTagsRequest(*elb.RemoveTagsInput) (*request.Request, *elb.RemoveTagsOutput) - - RemoveTags(*elb.RemoveTagsInput) (*elb.RemoveTagsOutput, error) - - SetLoadBalancerListenerSSLCertificateRequest(*elb.SetLoadBalancerListenerSSLCertificateInput) (*request.Request, *elb.SetLoadBalancerListenerSSLCertificateOutput) - - SetLoadBalancerListenerSSLCertificate(*elb.SetLoadBalancerListenerSSLCertificateInput) (*elb.SetLoadBalancerListenerSSLCertificateOutput, error) - - SetLoadBalancerPoliciesForBackendServerRequest(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*request.Request, *elb.SetLoadBalancerPoliciesForBackendServerOutput) - - SetLoadBalancerPoliciesForBackendServer(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error) - - SetLoadBalancerPoliciesOfListenerRequest(*elb.SetLoadBalancerPoliciesOfListenerInput) (*request.Request, *elb.SetLoadBalancerPoliciesOfListenerOutput) - - SetLoadBalancerPoliciesOfListener(*elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error) -} - -var _ ELBAPI = (*elb.ELB)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/firehose/firehoseiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/firehose/firehoseiface/interface.go deleted file mode 100644 index 0c18342d0..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/firehoseiface/interface.go +++ /dev/null @@ -1,42 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package firehoseiface provides an interface for the Amazon Kinesis Firehose. -package firehoseiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/firehose" -) - -// FirehoseAPI is the interface type for firehose.Firehose. -type FirehoseAPI interface { - CreateDeliveryStreamRequest(*firehose.CreateDeliveryStreamInput) (*request.Request, *firehose.CreateDeliveryStreamOutput) - - CreateDeliveryStream(*firehose.CreateDeliveryStreamInput) (*firehose.CreateDeliveryStreamOutput, error) - - DeleteDeliveryStreamRequest(*firehose.DeleteDeliveryStreamInput) (*request.Request, *firehose.DeleteDeliveryStreamOutput) - - DeleteDeliveryStream(*firehose.DeleteDeliveryStreamInput) (*firehose.DeleteDeliveryStreamOutput, error) - - DescribeDeliveryStreamRequest(*firehose.DescribeDeliveryStreamInput) (*request.Request, *firehose.DescribeDeliveryStreamOutput) - - DescribeDeliveryStream(*firehose.DescribeDeliveryStreamInput) (*firehose.DescribeDeliveryStreamOutput, error) - - ListDeliveryStreamsRequest(*firehose.ListDeliveryStreamsInput) (*request.Request, *firehose.ListDeliveryStreamsOutput) - - ListDeliveryStreams(*firehose.ListDeliveryStreamsInput) (*firehose.ListDeliveryStreamsOutput, error) - - PutRecordRequest(*firehose.PutRecordInput) (*request.Request, *firehose.PutRecordOutput) - - PutRecord(*firehose.PutRecordInput) (*firehose.PutRecordOutput, error) - - PutRecordBatchRequest(*firehose.PutRecordBatchInput) (*request.Request, *firehose.PutRecordBatchOutput) - - PutRecordBatch(*firehose.PutRecordBatchInput) (*firehose.PutRecordBatchOutput, error) - - UpdateDestinationRequest(*firehose.UpdateDestinationInput) (*request.Request, *firehose.UpdateDestinationOutput) - - UpdateDestination(*firehose.UpdateDestinationInput) (*firehose.UpdateDestinationOutput, error) -} - -var _ FirehoseAPI = (*firehose.Firehose)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/glacier/glacieriface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/glacier/glacieriface/interface.go deleted file mode 100644 index 7b2f76798..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/glacieriface/interface.go +++ /dev/null @@ -1,146 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package glacieriface provides an interface for the Amazon Glacier. -package glacieriface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/glacier" -) - -// GlacierAPI is the interface type for glacier.Glacier. -type GlacierAPI interface { - AbortMultipartUploadRequest(*glacier.AbortMultipartUploadInput) (*request.Request, *glacier.AbortMultipartUploadOutput) - - AbortMultipartUpload(*glacier.AbortMultipartUploadInput) (*glacier.AbortMultipartUploadOutput, error) - - AbortVaultLockRequest(*glacier.AbortVaultLockInput) (*request.Request, *glacier.AbortVaultLockOutput) - - AbortVaultLock(*glacier.AbortVaultLockInput) (*glacier.AbortVaultLockOutput, error) - - AddTagsToVaultRequest(*glacier.AddTagsToVaultInput) (*request.Request, *glacier.AddTagsToVaultOutput) - - AddTagsToVault(*glacier.AddTagsToVaultInput) (*glacier.AddTagsToVaultOutput, error) - - CompleteMultipartUploadRequest(*glacier.CompleteMultipartUploadInput) (*request.Request, *glacier.ArchiveCreationOutput) - - CompleteMultipartUpload(*glacier.CompleteMultipartUploadInput) (*glacier.ArchiveCreationOutput, error) - - CompleteVaultLockRequest(*glacier.CompleteVaultLockInput) (*request.Request, *glacier.CompleteVaultLockOutput) - - CompleteVaultLock(*glacier.CompleteVaultLockInput) (*glacier.CompleteVaultLockOutput, error) - - CreateVaultRequest(*glacier.CreateVaultInput) (*request.Request, *glacier.CreateVaultOutput) - - CreateVault(*glacier.CreateVaultInput) (*glacier.CreateVaultOutput, error) - - DeleteArchiveRequest(*glacier.DeleteArchiveInput) (*request.Request, *glacier.DeleteArchiveOutput) - - DeleteArchive(*glacier.DeleteArchiveInput) (*glacier.DeleteArchiveOutput, error) - - DeleteVaultRequest(*glacier.DeleteVaultInput) (*request.Request, *glacier.DeleteVaultOutput) - - DeleteVault(*glacier.DeleteVaultInput) (*glacier.DeleteVaultOutput, error) - - DeleteVaultAccessPolicyRequest(*glacier.DeleteVaultAccessPolicyInput) (*request.Request, *glacier.DeleteVaultAccessPolicyOutput) - - DeleteVaultAccessPolicy(*glacier.DeleteVaultAccessPolicyInput) (*glacier.DeleteVaultAccessPolicyOutput, error) - - DeleteVaultNotificationsRequest(*glacier.DeleteVaultNotificationsInput) (*request.Request, *glacier.DeleteVaultNotificationsOutput) - - DeleteVaultNotifications(*glacier.DeleteVaultNotificationsInput) (*glacier.DeleteVaultNotificationsOutput, error) - - DescribeJobRequest(*glacier.DescribeJobInput) (*request.Request, *glacier.JobDescription) - - DescribeJob(*glacier.DescribeJobInput) (*glacier.JobDescription, error) - - DescribeVaultRequest(*glacier.DescribeVaultInput) (*request.Request, *glacier.DescribeVaultOutput) - - DescribeVault(*glacier.DescribeVaultInput) (*glacier.DescribeVaultOutput, error) - - GetDataRetrievalPolicyRequest(*glacier.GetDataRetrievalPolicyInput) (*request.Request, *glacier.GetDataRetrievalPolicyOutput) - - GetDataRetrievalPolicy(*glacier.GetDataRetrievalPolicyInput) (*glacier.GetDataRetrievalPolicyOutput, error) - - GetJobOutputRequest(*glacier.GetJobOutputInput) (*request.Request, *glacier.GetJobOutputOutput) - - GetJobOutput(*glacier.GetJobOutputInput) (*glacier.GetJobOutputOutput, error) - - GetVaultAccessPolicyRequest(*glacier.GetVaultAccessPolicyInput) (*request.Request, *glacier.GetVaultAccessPolicyOutput) - - GetVaultAccessPolicy(*glacier.GetVaultAccessPolicyInput) (*glacier.GetVaultAccessPolicyOutput, error) - - GetVaultLockRequest(*glacier.GetVaultLockInput) (*request.Request, *glacier.GetVaultLockOutput) - - GetVaultLock(*glacier.GetVaultLockInput) (*glacier.GetVaultLockOutput, error) - - GetVaultNotificationsRequest(*glacier.GetVaultNotificationsInput) (*request.Request, *glacier.GetVaultNotificationsOutput) - - GetVaultNotifications(*glacier.GetVaultNotificationsInput) (*glacier.GetVaultNotificationsOutput, error) - - InitiateJobRequest(*glacier.InitiateJobInput) (*request.Request, *glacier.InitiateJobOutput) - - InitiateJob(*glacier.InitiateJobInput) (*glacier.InitiateJobOutput, error) - - InitiateMultipartUploadRequest(*glacier.InitiateMultipartUploadInput) (*request.Request, *glacier.InitiateMultipartUploadOutput) - - InitiateMultipartUpload(*glacier.InitiateMultipartUploadInput) (*glacier.InitiateMultipartUploadOutput, error) - - InitiateVaultLockRequest(*glacier.InitiateVaultLockInput) (*request.Request, *glacier.InitiateVaultLockOutput) - - InitiateVaultLock(*glacier.InitiateVaultLockInput) (*glacier.InitiateVaultLockOutput, error) - - ListJobsRequest(*glacier.ListJobsInput) (*request.Request, *glacier.ListJobsOutput) - - ListJobs(*glacier.ListJobsInput) (*glacier.ListJobsOutput, error) - - ListJobsPages(*glacier.ListJobsInput, func(*glacier.ListJobsOutput, bool) bool) error - - ListMultipartUploadsRequest(*glacier.ListMultipartUploadsInput) (*request.Request, *glacier.ListMultipartUploadsOutput) - - ListMultipartUploads(*glacier.ListMultipartUploadsInput) (*glacier.ListMultipartUploadsOutput, error) - - ListMultipartUploadsPages(*glacier.ListMultipartUploadsInput, func(*glacier.ListMultipartUploadsOutput, bool) bool) error - - ListPartsRequest(*glacier.ListPartsInput) (*request.Request, *glacier.ListPartsOutput) - - ListParts(*glacier.ListPartsInput) (*glacier.ListPartsOutput, error) - - ListPartsPages(*glacier.ListPartsInput, func(*glacier.ListPartsOutput, bool) bool) error - - ListTagsForVaultRequest(*glacier.ListTagsForVaultInput) (*request.Request, *glacier.ListTagsForVaultOutput) - - ListTagsForVault(*glacier.ListTagsForVaultInput) (*glacier.ListTagsForVaultOutput, error) - - ListVaultsRequest(*glacier.ListVaultsInput) (*request.Request, *glacier.ListVaultsOutput) - - ListVaults(*glacier.ListVaultsInput) (*glacier.ListVaultsOutput, error) - - ListVaultsPages(*glacier.ListVaultsInput, func(*glacier.ListVaultsOutput, bool) bool) error - - RemoveTagsFromVaultRequest(*glacier.RemoveTagsFromVaultInput) (*request.Request, *glacier.RemoveTagsFromVaultOutput) - - RemoveTagsFromVault(*glacier.RemoveTagsFromVaultInput) (*glacier.RemoveTagsFromVaultOutput, error) - - SetDataRetrievalPolicyRequest(*glacier.SetDataRetrievalPolicyInput) (*request.Request, *glacier.SetDataRetrievalPolicyOutput) - - SetDataRetrievalPolicy(*glacier.SetDataRetrievalPolicyInput) (*glacier.SetDataRetrievalPolicyOutput, error) - - SetVaultAccessPolicyRequest(*glacier.SetVaultAccessPolicyInput) (*request.Request, *glacier.SetVaultAccessPolicyOutput) - - SetVaultAccessPolicy(*glacier.SetVaultAccessPolicyInput) (*glacier.SetVaultAccessPolicyOutput, error) - - SetVaultNotificationsRequest(*glacier.SetVaultNotificationsInput) (*request.Request, *glacier.SetVaultNotificationsOutput) - - SetVaultNotifications(*glacier.SetVaultNotificationsInput) (*glacier.SetVaultNotificationsOutput, error) - - UploadArchiveRequest(*glacier.UploadArchiveInput) (*request.Request, *glacier.ArchiveCreationOutput) - - UploadArchive(*glacier.UploadArchiveInput) (*glacier.ArchiveCreationOutput, error) - - UploadMultipartPartRequest(*glacier.UploadMultipartPartInput) (*request.Request, *glacier.UploadMultipartPartOutput) - - UploadMultipartPart(*glacier.UploadMultipartPartInput) (*glacier.UploadMultipartPartOutput, error) -} - -var _ GlacierAPI = (*glacier.Glacier)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/iamiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/iam/iamiface/interface.go deleted file mode 100644 index 3df15410a..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/iamiface/interface.go +++ /dev/null @@ -1,510 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package iamiface provides an interface for the AWS Identity and Access Management. -package iamiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/iam" -) - -// IAMAPI is the interface type for iam.IAM. -type IAMAPI interface { - AddClientIDToOpenIDConnectProviderRequest(*iam.AddClientIDToOpenIDConnectProviderInput) (*request.Request, *iam.AddClientIDToOpenIDConnectProviderOutput) - - AddClientIDToOpenIDConnectProvider(*iam.AddClientIDToOpenIDConnectProviderInput) (*iam.AddClientIDToOpenIDConnectProviderOutput, error) - - AddRoleToInstanceProfileRequest(*iam.AddRoleToInstanceProfileInput) (*request.Request, *iam.AddRoleToInstanceProfileOutput) - - AddRoleToInstanceProfile(*iam.AddRoleToInstanceProfileInput) (*iam.AddRoleToInstanceProfileOutput, error) - - AddUserToGroupRequest(*iam.AddUserToGroupInput) (*request.Request, *iam.AddUserToGroupOutput) - - AddUserToGroup(*iam.AddUserToGroupInput) (*iam.AddUserToGroupOutput, error) - - AttachGroupPolicyRequest(*iam.AttachGroupPolicyInput) (*request.Request, *iam.AttachGroupPolicyOutput) - - AttachGroupPolicy(*iam.AttachGroupPolicyInput) (*iam.AttachGroupPolicyOutput, error) - - AttachRolePolicyRequest(*iam.AttachRolePolicyInput) (*request.Request, *iam.AttachRolePolicyOutput) - - AttachRolePolicy(*iam.AttachRolePolicyInput) (*iam.AttachRolePolicyOutput, error) - - AttachUserPolicyRequest(*iam.AttachUserPolicyInput) (*request.Request, *iam.AttachUserPolicyOutput) - - AttachUserPolicy(*iam.AttachUserPolicyInput) (*iam.AttachUserPolicyOutput, error) - - ChangePasswordRequest(*iam.ChangePasswordInput) (*request.Request, *iam.ChangePasswordOutput) - - ChangePassword(*iam.ChangePasswordInput) (*iam.ChangePasswordOutput, error) - - CreateAccessKeyRequest(*iam.CreateAccessKeyInput) (*request.Request, *iam.CreateAccessKeyOutput) - - CreateAccessKey(*iam.CreateAccessKeyInput) (*iam.CreateAccessKeyOutput, error) - - CreateAccountAliasRequest(*iam.CreateAccountAliasInput) (*request.Request, *iam.CreateAccountAliasOutput) - - CreateAccountAlias(*iam.CreateAccountAliasInput) (*iam.CreateAccountAliasOutput, error) - - CreateGroupRequest(*iam.CreateGroupInput) (*request.Request, *iam.CreateGroupOutput) - - CreateGroup(*iam.CreateGroupInput) (*iam.CreateGroupOutput, error) - - CreateInstanceProfileRequest(*iam.CreateInstanceProfileInput) (*request.Request, *iam.CreateInstanceProfileOutput) - - CreateInstanceProfile(*iam.CreateInstanceProfileInput) (*iam.CreateInstanceProfileOutput, error) - - CreateLoginProfileRequest(*iam.CreateLoginProfileInput) (*request.Request, *iam.CreateLoginProfileOutput) - - CreateLoginProfile(*iam.CreateLoginProfileInput) (*iam.CreateLoginProfileOutput, error) - - CreateOpenIDConnectProviderRequest(*iam.CreateOpenIDConnectProviderInput) (*request.Request, *iam.CreateOpenIDConnectProviderOutput) - - CreateOpenIDConnectProvider(*iam.CreateOpenIDConnectProviderInput) (*iam.CreateOpenIDConnectProviderOutput, error) - - CreatePolicyRequest(*iam.CreatePolicyInput) (*request.Request, *iam.CreatePolicyOutput) - - CreatePolicy(*iam.CreatePolicyInput) (*iam.CreatePolicyOutput, error) - - CreatePolicyVersionRequest(*iam.CreatePolicyVersionInput) (*request.Request, *iam.CreatePolicyVersionOutput) - - CreatePolicyVersion(*iam.CreatePolicyVersionInput) (*iam.CreatePolicyVersionOutput, error) - - CreateRoleRequest(*iam.CreateRoleInput) (*request.Request, *iam.CreateRoleOutput) - - CreateRole(*iam.CreateRoleInput) (*iam.CreateRoleOutput, error) - - CreateSAMLProviderRequest(*iam.CreateSAMLProviderInput) (*request.Request, *iam.CreateSAMLProviderOutput) - - CreateSAMLProvider(*iam.CreateSAMLProviderInput) (*iam.CreateSAMLProviderOutput, error) - - CreateUserRequest(*iam.CreateUserInput) (*request.Request, *iam.CreateUserOutput) - - CreateUser(*iam.CreateUserInput) (*iam.CreateUserOutput, error) - - CreateVirtualMFADeviceRequest(*iam.CreateVirtualMFADeviceInput) (*request.Request, *iam.CreateVirtualMFADeviceOutput) - - CreateVirtualMFADevice(*iam.CreateVirtualMFADeviceInput) (*iam.CreateVirtualMFADeviceOutput, error) - - DeactivateMFADeviceRequest(*iam.DeactivateMFADeviceInput) (*request.Request, *iam.DeactivateMFADeviceOutput) - - DeactivateMFADevice(*iam.DeactivateMFADeviceInput) (*iam.DeactivateMFADeviceOutput, error) - - DeleteAccessKeyRequest(*iam.DeleteAccessKeyInput) (*request.Request, *iam.DeleteAccessKeyOutput) - - DeleteAccessKey(*iam.DeleteAccessKeyInput) (*iam.DeleteAccessKeyOutput, error) - - DeleteAccountAliasRequest(*iam.DeleteAccountAliasInput) (*request.Request, *iam.DeleteAccountAliasOutput) - - DeleteAccountAlias(*iam.DeleteAccountAliasInput) (*iam.DeleteAccountAliasOutput, error) - - DeleteAccountPasswordPolicyRequest(*iam.DeleteAccountPasswordPolicyInput) (*request.Request, *iam.DeleteAccountPasswordPolicyOutput) - - DeleteAccountPasswordPolicy(*iam.DeleteAccountPasswordPolicyInput) (*iam.DeleteAccountPasswordPolicyOutput, error) - - DeleteGroupRequest(*iam.DeleteGroupInput) (*request.Request, *iam.DeleteGroupOutput) - - DeleteGroup(*iam.DeleteGroupInput) (*iam.DeleteGroupOutput, error) - - DeleteGroupPolicyRequest(*iam.DeleteGroupPolicyInput) (*request.Request, *iam.DeleteGroupPolicyOutput) - - DeleteGroupPolicy(*iam.DeleteGroupPolicyInput) (*iam.DeleteGroupPolicyOutput, error) - - DeleteInstanceProfileRequest(*iam.DeleteInstanceProfileInput) (*request.Request, *iam.DeleteInstanceProfileOutput) - - DeleteInstanceProfile(*iam.DeleteInstanceProfileInput) (*iam.DeleteInstanceProfileOutput, error) - - DeleteLoginProfileRequest(*iam.DeleteLoginProfileInput) (*request.Request, *iam.DeleteLoginProfileOutput) - - DeleteLoginProfile(*iam.DeleteLoginProfileInput) (*iam.DeleteLoginProfileOutput, error) - - DeleteOpenIDConnectProviderRequest(*iam.DeleteOpenIDConnectProviderInput) (*request.Request, *iam.DeleteOpenIDConnectProviderOutput) - - DeleteOpenIDConnectProvider(*iam.DeleteOpenIDConnectProviderInput) (*iam.DeleteOpenIDConnectProviderOutput, error) - - DeletePolicyRequest(*iam.DeletePolicyInput) (*request.Request, *iam.DeletePolicyOutput) - - DeletePolicy(*iam.DeletePolicyInput) (*iam.DeletePolicyOutput, error) - - DeletePolicyVersionRequest(*iam.DeletePolicyVersionInput) (*request.Request, *iam.DeletePolicyVersionOutput) - - DeletePolicyVersion(*iam.DeletePolicyVersionInput) (*iam.DeletePolicyVersionOutput, error) - - DeleteRoleRequest(*iam.DeleteRoleInput) (*request.Request, *iam.DeleteRoleOutput) - - DeleteRole(*iam.DeleteRoleInput) (*iam.DeleteRoleOutput, error) - - DeleteRolePolicyRequest(*iam.DeleteRolePolicyInput) (*request.Request, *iam.DeleteRolePolicyOutput) - - DeleteRolePolicy(*iam.DeleteRolePolicyInput) (*iam.DeleteRolePolicyOutput, error) - - DeleteSAMLProviderRequest(*iam.DeleteSAMLProviderInput) (*request.Request, *iam.DeleteSAMLProviderOutput) - - DeleteSAMLProvider(*iam.DeleteSAMLProviderInput) (*iam.DeleteSAMLProviderOutput, error) - - DeleteSSHPublicKeyRequest(*iam.DeleteSSHPublicKeyInput) (*request.Request, *iam.DeleteSSHPublicKeyOutput) - - DeleteSSHPublicKey(*iam.DeleteSSHPublicKeyInput) (*iam.DeleteSSHPublicKeyOutput, error) - - DeleteServerCertificateRequest(*iam.DeleteServerCertificateInput) (*request.Request, *iam.DeleteServerCertificateOutput) - - DeleteServerCertificate(*iam.DeleteServerCertificateInput) (*iam.DeleteServerCertificateOutput, error) - - DeleteSigningCertificateRequest(*iam.DeleteSigningCertificateInput) (*request.Request, *iam.DeleteSigningCertificateOutput) - - DeleteSigningCertificate(*iam.DeleteSigningCertificateInput) (*iam.DeleteSigningCertificateOutput, error) - - DeleteUserRequest(*iam.DeleteUserInput) (*request.Request, *iam.DeleteUserOutput) - - DeleteUser(*iam.DeleteUserInput) (*iam.DeleteUserOutput, error) - - DeleteUserPolicyRequest(*iam.DeleteUserPolicyInput) (*request.Request, *iam.DeleteUserPolicyOutput) - - DeleteUserPolicy(*iam.DeleteUserPolicyInput) (*iam.DeleteUserPolicyOutput, error) - - DeleteVirtualMFADeviceRequest(*iam.DeleteVirtualMFADeviceInput) (*request.Request, *iam.DeleteVirtualMFADeviceOutput) - - DeleteVirtualMFADevice(*iam.DeleteVirtualMFADeviceInput) (*iam.DeleteVirtualMFADeviceOutput, error) - - DetachGroupPolicyRequest(*iam.DetachGroupPolicyInput) (*request.Request, *iam.DetachGroupPolicyOutput) - - DetachGroupPolicy(*iam.DetachGroupPolicyInput) (*iam.DetachGroupPolicyOutput, error) - - DetachRolePolicyRequest(*iam.DetachRolePolicyInput) (*request.Request, *iam.DetachRolePolicyOutput) - - DetachRolePolicy(*iam.DetachRolePolicyInput) (*iam.DetachRolePolicyOutput, error) - - DetachUserPolicyRequest(*iam.DetachUserPolicyInput) (*request.Request, *iam.DetachUserPolicyOutput) - - DetachUserPolicy(*iam.DetachUserPolicyInput) (*iam.DetachUserPolicyOutput, error) - - EnableMFADeviceRequest(*iam.EnableMFADeviceInput) (*request.Request, *iam.EnableMFADeviceOutput) - - EnableMFADevice(*iam.EnableMFADeviceInput) (*iam.EnableMFADeviceOutput, error) - - GenerateCredentialReportRequest(*iam.GenerateCredentialReportInput) (*request.Request, *iam.GenerateCredentialReportOutput) - - GenerateCredentialReport(*iam.GenerateCredentialReportInput) (*iam.GenerateCredentialReportOutput, error) - - GetAccessKeyLastUsedRequest(*iam.GetAccessKeyLastUsedInput) (*request.Request, *iam.GetAccessKeyLastUsedOutput) - - GetAccessKeyLastUsed(*iam.GetAccessKeyLastUsedInput) (*iam.GetAccessKeyLastUsedOutput, error) - - GetAccountAuthorizationDetailsRequest(*iam.GetAccountAuthorizationDetailsInput) (*request.Request, *iam.GetAccountAuthorizationDetailsOutput) - - GetAccountAuthorizationDetails(*iam.GetAccountAuthorizationDetailsInput) (*iam.GetAccountAuthorizationDetailsOutput, error) - - GetAccountAuthorizationDetailsPages(*iam.GetAccountAuthorizationDetailsInput, func(*iam.GetAccountAuthorizationDetailsOutput, bool) bool) error - - GetAccountPasswordPolicyRequest(*iam.GetAccountPasswordPolicyInput) (*request.Request, *iam.GetAccountPasswordPolicyOutput) - - GetAccountPasswordPolicy(*iam.GetAccountPasswordPolicyInput) (*iam.GetAccountPasswordPolicyOutput, error) - - GetAccountSummaryRequest(*iam.GetAccountSummaryInput) (*request.Request, *iam.GetAccountSummaryOutput) - - GetAccountSummary(*iam.GetAccountSummaryInput) (*iam.GetAccountSummaryOutput, error) - - GetContextKeysForCustomPolicyRequest(*iam.GetContextKeysForCustomPolicyInput) (*request.Request, *iam.GetContextKeysForPolicyResponse) - - GetContextKeysForCustomPolicy(*iam.GetContextKeysForCustomPolicyInput) (*iam.GetContextKeysForPolicyResponse, error) - - GetContextKeysForPrincipalPolicyRequest(*iam.GetContextKeysForPrincipalPolicyInput) (*request.Request, *iam.GetContextKeysForPolicyResponse) - - GetContextKeysForPrincipalPolicy(*iam.GetContextKeysForPrincipalPolicyInput) (*iam.GetContextKeysForPolicyResponse, error) - - GetCredentialReportRequest(*iam.GetCredentialReportInput) (*request.Request, *iam.GetCredentialReportOutput) - - GetCredentialReport(*iam.GetCredentialReportInput) (*iam.GetCredentialReportOutput, error) - - GetGroupRequest(*iam.GetGroupInput) (*request.Request, *iam.GetGroupOutput) - - GetGroup(*iam.GetGroupInput) (*iam.GetGroupOutput, error) - - GetGroupPages(*iam.GetGroupInput, func(*iam.GetGroupOutput, bool) bool) error - - GetGroupPolicyRequest(*iam.GetGroupPolicyInput) (*request.Request, *iam.GetGroupPolicyOutput) - - GetGroupPolicy(*iam.GetGroupPolicyInput) (*iam.GetGroupPolicyOutput, error) - - GetInstanceProfileRequest(*iam.GetInstanceProfileInput) (*request.Request, *iam.GetInstanceProfileOutput) - - GetInstanceProfile(*iam.GetInstanceProfileInput) (*iam.GetInstanceProfileOutput, error) - - GetLoginProfileRequest(*iam.GetLoginProfileInput) (*request.Request, *iam.GetLoginProfileOutput) - - GetLoginProfile(*iam.GetLoginProfileInput) (*iam.GetLoginProfileOutput, error) - - GetOpenIDConnectProviderRequest(*iam.GetOpenIDConnectProviderInput) (*request.Request, *iam.GetOpenIDConnectProviderOutput) - - GetOpenIDConnectProvider(*iam.GetOpenIDConnectProviderInput) (*iam.GetOpenIDConnectProviderOutput, error) - - GetPolicyRequest(*iam.GetPolicyInput) (*request.Request, *iam.GetPolicyOutput) - - GetPolicy(*iam.GetPolicyInput) (*iam.GetPolicyOutput, error) - - GetPolicyVersionRequest(*iam.GetPolicyVersionInput) (*request.Request, *iam.GetPolicyVersionOutput) - - GetPolicyVersion(*iam.GetPolicyVersionInput) (*iam.GetPolicyVersionOutput, error) - - GetRoleRequest(*iam.GetRoleInput) (*request.Request, *iam.GetRoleOutput) - - GetRole(*iam.GetRoleInput) (*iam.GetRoleOutput, error) - - GetRolePolicyRequest(*iam.GetRolePolicyInput) (*request.Request, *iam.GetRolePolicyOutput) - - GetRolePolicy(*iam.GetRolePolicyInput) (*iam.GetRolePolicyOutput, error) - - GetSAMLProviderRequest(*iam.GetSAMLProviderInput) (*request.Request, *iam.GetSAMLProviderOutput) - - GetSAMLProvider(*iam.GetSAMLProviderInput) (*iam.GetSAMLProviderOutput, error) - - GetSSHPublicKeyRequest(*iam.GetSSHPublicKeyInput) (*request.Request, *iam.GetSSHPublicKeyOutput) - - GetSSHPublicKey(*iam.GetSSHPublicKeyInput) (*iam.GetSSHPublicKeyOutput, error) - - GetServerCertificateRequest(*iam.GetServerCertificateInput) (*request.Request, *iam.GetServerCertificateOutput) - - GetServerCertificate(*iam.GetServerCertificateInput) (*iam.GetServerCertificateOutput, error) - - GetUserRequest(*iam.GetUserInput) (*request.Request, *iam.GetUserOutput) - - GetUser(*iam.GetUserInput) (*iam.GetUserOutput, error) - - GetUserPolicyRequest(*iam.GetUserPolicyInput) (*request.Request, *iam.GetUserPolicyOutput) - - GetUserPolicy(*iam.GetUserPolicyInput) (*iam.GetUserPolicyOutput, error) - - ListAccessKeysRequest(*iam.ListAccessKeysInput) (*request.Request, *iam.ListAccessKeysOutput) - - ListAccessKeys(*iam.ListAccessKeysInput) (*iam.ListAccessKeysOutput, error) - - ListAccessKeysPages(*iam.ListAccessKeysInput, func(*iam.ListAccessKeysOutput, bool) bool) error - - ListAccountAliasesRequest(*iam.ListAccountAliasesInput) (*request.Request, *iam.ListAccountAliasesOutput) - - ListAccountAliases(*iam.ListAccountAliasesInput) (*iam.ListAccountAliasesOutput, error) - - ListAccountAliasesPages(*iam.ListAccountAliasesInput, func(*iam.ListAccountAliasesOutput, bool) bool) error - - ListAttachedGroupPoliciesRequest(*iam.ListAttachedGroupPoliciesInput) (*request.Request, *iam.ListAttachedGroupPoliciesOutput) - - ListAttachedGroupPolicies(*iam.ListAttachedGroupPoliciesInput) (*iam.ListAttachedGroupPoliciesOutput, error) - - ListAttachedGroupPoliciesPages(*iam.ListAttachedGroupPoliciesInput, func(*iam.ListAttachedGroupPoliciesOutput, bool) bool) error - - ListAttachedRolePoliciesRequest(*iam.ListAttachedRolePoliciesInput) (*request.Request, *iam.ListAttachedRolePoliciesOutput) - - ListAttachedRolePolicies(*iam.ListAttachedRolePoliciesInput) (*iam.ListAttachedRolePoliciesOutput, error) - - ListAttachedRolePoliciesPages(*iam.ListAttachedRolePoliciesInput, func(*iam.ListAttachedRolePoliciesOutput, bool) bool) error - - ListAttachedUserPoliciesRequest(*iam.ListAttachedUserPoliciesInput) (*request.Request, *iam.ListAttachedUserPoliciesOutput) - - ListAttachedUserPolicies(*iam.ListAttachedUserPoliciesInput) (*iam.ListAttachedUserPoliciesOutput, error) - - ListAttachedUserPoliciesPages(*iam.ListAttachedUserPoliciesInput, func(*iam.ListAttachedUserPoliciesOutput, bool) bool) error - - ListEntitiesForPolicyRequest(*iam.ListEntitiesForPolicyInput) (*request.Request, *iam.ListEntitiesForPolicyOutput) - - ListEntitiesForPolicy(*iam.ListEntitiesForPolicyInput) (*iam.ListEntitiesForPolicyOutput, error) - - ListEntitiesForPolicyPages(*iam.ListEntitiesForPolicyInput, func(*iam.ListEntitiesForPolicyOutput, bool) bool) error - - ListGroupPoliciesRequest(*iam.ListGroupPoliciesInput) (*request.Request, *iam.ListGroupPoliciesOutput) - - ListGroupPolicies(*iam.ListGroupPoliciesInput) (*iam.ListGroupPoliciesOutput, error) - - ListGroupPoliciesPages(*iam.ListGroupPoliciesInput, func(*iam.ListGroupPoliciesOutput, bool) bool) error - - ListGroupsRequest(*iam.ListGroupsInput) (*request.Request, *iam.ListGroupsOutput) - - ListGroups(*iam.ListGroupsInput) (*iam.ListGroupsOutput, error) - - ListGroupsPages(*iam.ListGroupsInput, func(*iam.ListGroupsOutput, bool) bool) error - - ListGroupsForUserRequest(*iam.ListGroupsForUserInput) (*request.Request, *iam.ListGroupsForUserOutput) - - ListGroupsForUser(*iam.ListGroupsForUserInput) (*iam.ListGroupsForUserOutput, error) - - ListGroupsForUserPages(*iam.ListGroupsForUserInput, func(*iam.ListGroupsForUserOutput, bool) bool) error - - ListInstanceProfilesRequest(*iam.ListInstanceProfilesInput) (*request.Request, *iam.ListInstanceProfilesOutput) - - ListInstanceProfiles(*iam.ListInstanceProfilesInput) (*iam.ListInstanceProfilesOutput, error) - - ListInstanceProfilesPages(*iam.ListInstanceProfilesInput, func(*iam.ListInstanceProfilesOutput, bool) bool) error - - ListInstanceProfilesForRoleRequest(*iam.ListInstanceProfilesForRoleInput) (*request.Request, *iam.ListInstanceProfilesForRoleOutput) - - ListInstanceProfilesForRole(*iam.ListInstanceProfilesForRoleInput) (*iam.ListInstanceProfilesForRoleOutput, error) - - ListInstanceProfilesForRolePages(*iam.ListInstanceProfilesForRoleInput, func(*iam.ListInstanceProfilesForRoleOutput, bool) bool) error - - ListMFADevicesRequest(*iam.ListMFADevicesInput) (*request.Request, *iam.ListMFADevicesOutput) - - ListMFADevices(*iam.ListMFADevicesInput) (*iam.ListMFADevicesOutput, error) - - ListMFADevicesPages(*iam.ListMFADevicesInput, func(*iam.ListMFADevicesOutput, bool) bool) error - - ListOpenIDConnectProvidersRequest(*iam.ListOpenIDConnectProvidersInput) (*request.Request, *iam.ListOpenIDConnectProvidersOutput) - - ListOpenIDConnectProviders(*iam.ListOpenIDConnectProvidersInput) (*iam.ListOpenIDConnectProvidersOutput, error) - - ListPoliciesRequest(*iam.ListPoliciesInput) (*request.Request, *iam.ListPoliciesOutput) - - ListPolicies(*iam.ListPoliciesInput) (*iam.ListPoliciesOutput, error) - - ListPoliciesPages(*iam.ListPoliciesInput, func(*iam.ListPoliciesOutput, bool) bool) error - - ListPolicyVersionsRequest(*iam.ListPolicyVersionsInput) (*request.Request, *iam.ListPolicyVersionsOutput) - - ListPolicyVersions(*iam.ListPolicyVersionsInput) (*iam.ListPolicyVersionsOutput, error) - - ListRolePoliciesRequest(*iam.ListRolePoliciesInput) (*request.Request, *iam.ListRolePoliciesOutput) - - ListRolePolicies(*iam.ListRolePoliciesInput) (*iam.ListRolePoliciesOutput, error) - - ListRolePoliciesPages(*iam.ListRolePoliciesInput, func(*iam.ListRolePoliciesOutput, bool) bool) error - - ListRolesRequest(*iam.ListRolesInput) (*request.Request, *iam.ListRolesOutput) - - ListRoles(*iam.ListRolesInput) (*iam.ListRolesOutput, error) - - ListRolesPages(*iam.ListRolesInput, func(*iam.ListRolesOutput, bool) bool) error - - ListSAMLProvidersRequest(*iam.ListSAMLProvidersInput) (*request.Request, *iam.ListSAMLProvidersOutput) - - ListSAMLProviders(*iam.ListSAMLProvidersInput) (*iam.ListSAMLProvidersOutput, error) - - ListSSHPublicKeysRequest(*iam.ListSSHPublicKeysInput) (*request.Request, *iam.ListSSHPublicKeysOutput) - - ListSSHPublicKeys(*iam.ListSSHPublicKeysInput) (*iam.ListSSHPublicKeysOutput, error) - - ListServerCertificatesRequest(*iam.ListServerCertificatesInput) (*request.Request, *iam.ListServerCertificatesOutput) - - ListServerCertificates(*iam.ListServerCertificatesInput) (*iam.ListServerCertificatesOutput, error) - - ListServerCertificatesPages(*iam.ListServerCertificatesInput, func(*iam.ListServerCertificatesOutput, bool) bool) error - - ListSigningCertificatesRequest(*iam.ListSigningCertificatesInput) (*request.Request, *iam.ListSigningCertificatesOutput) - - ListSigningCertificates(*iam.ListSigningCertificatesInput) (*iam.ListSigningCertificatesOutput, error) - - ListSigningCertificatesPages(*iam.ListSigningCertificatesInput, func(*iam.ListSigningCertificatesOutput, bool) bool) error - - ListUserPoliciesRequest(*iam.ListUserPoliciesInput) (*request.Request, *iam.ListUserPoliciesOutput) - - ListUserPolicies(*iam.ListUserPoliciesInput) (*iam.ListUserPoliciesOutput, error) - - ListUserPoliciesPages(*iam.ListUserPoliciesInput, func(*iam.ListUserPoliciesOutput, bool) bool) error - - ListUsersRequest(*iam.ListUsersInput) (*request.Request, *iam.ListUsersOutput) - - ListUsers(*iam.ListUsersInput) (*iam.ListUsersOutput, error) - - ListUsersPages(*iam.ListUsersInput, func(*iam.ListUsersOutput, bool) bool) error - - ListVirtualMFADevicesRequest(*iam.ListVirtualMFADevicesInput) (*request.Request, *iam.ListVirtualMFADevicesOutput) - - ListVirtualMFADevices(*iam.ListVirtualMFADevicesInput) (*iam.ListVirtualMFADevicesOutput, error) - - ListVirtualMFADevicesPages(*iam.ListVirtualMFADevicesInput, func(*iam.ListVirtualMFADevicesOutput, bool) bool) error - - PutGroupPolicyRequest(*iam.PutGroupPolicyInput) (*request.Request, *iam.PutGroupPolicyOutput) - - PutGroupPolicy(*iam.PutGroupPolicyInput) (*iam.PutGroupPolicyOutput, error) - - PutRolePolicyRequest(*iam.PutRolePolicyInput) (*request.Request, *iam.PutRolePolicyOutput) - - PutRolePolicy(*iam.PutRolePolicyInput) (*iam.PutRolePolicyOutput, error) - - PutUserPolicyRequest(*iam.PutUserPolicyInput) (*request.Request, *iam.PutUserPolicyOutput) - - PutUserPolicy(*iam.PutUserPolicyInput) (*iam.PutUserPolicyOutput, error) - - RemoveClientIDFromOpenIDConnectProviderRequest(*iam.RemoveClientIDFromOpenIDConnectProviderInput) (*request.Request, *iam.RemoveClientIDFromOpenIDConnectProviderOutput) - - RemoveClientIDFromOpenIDConnectProvider(*iam.RemoveClientIDFromOpenIDConnectProviderInput) (*iam.RemoveClientIDFromOpenIDConnectProviderOutput, error) - - RemoveRoleFromInstanceProfileRequest(*iam.RemoveRoleFromInstanceProfileInput) (*request.Request, *iam.RemoveRoleFromInstanceProfileOutput) - - RemoveRoleFromInstanceProfile(*iam.RemoveRoleFromInstanceProfileInput) (*iam.RemoveRoleFromInstanceProfileOutput, error) - - RemoveUserFromGroupRequest(*iam.RemoveUserFromGroupInput) (*request.Request, *iam.RemoveUserFromGroupOutput) - - RemoveUserFromGroup(*iam.RemoveUserFromGroupInput) (*iam.RemoveUserFromGroupOutput, error) - - ResyncMFADeviceRequest(*iam.ResyncMFADeviceInput) (*request.Request, *iam.ResyncMFADeviceOutput) - - ResyncMFADevice(*iam.ResyncMFADeviceInput) (*iam.ResyncMFADeviceOutput, error) - - SetDefaultPolicyVersionRequest(*iam.SetDefaultPolicyVersionInput) (*request.Request, *iam.SetDefaultPolicyVersionOutput) - - SetDefaultPolicyVersion(*iam.SetDefaultPolicyVersionInput) (*iam.SetDefaultPolicyVersionOutput, error) - - SimulateCustomPolicyRequest(*iam.SimulateCustomPolicyInput) (*request.Request, *iam.SimulatePolicyResponse) - - SimulateCustomPolicy(*iam.SimulateCustomPolicyInput) (*iam.SimulatePolicyResponse, error) - - SimulatePrincipalPolicyRequest(*iam.SimulatePrincipalPolicyInput) (*request.Request, *iam.SimulatePolicyResponse) - - SimulatePrincipalPolicy(*iam.SimulatePrincipalPolicyInput) (*iam.SimulatePolicyResponse, error) - - UpdateAccessKeyRequest(*iam.UpdateAccessKeyInput) (*request.Request, *iam.UpdateAccessKeyOutput) - - UpdateAccessKey(*iam.UpdateAccessKeyInput) (*iam.UpdateAccessKeyOutput, error) - - UpdateAccountPasswordPolicyRequest(*iam.UpdateAccountPasswordPolicyInput) (*request.Request, *iam.UpdateAccountPasswordPolicyOutput) - - UpdateAccountPasswordPolicy(*iam.UpdateAccountPasswordPolicyInput) (*iam.UpdateAccountPasswordPolicyOutput, error) - - UpdateAssumeRolePolicyRequest(*iam.UpdateAssumeRolePolicyInput) (*request.Request, *iam.UpdateAssumeRolePolicyOutput) - - UpdateAssumeRolePolicy(*iam.UpdateAssumeRolePolicyInput) (*iam.UpdateAssumeRolePolicyOutput, error) - - UpdateGroupRequest(*iam.UpdateGroupInput) (*request.Request, *iam.UpdateGroupOutput) - - UpdateGroup(*iam.UpdateGroupInput) (*iam.UpdateGroupOutput, error) - - UpdateLoginProfileRequest(*iam.UpdateLoginProfileInput) (*request.Request, *iam.UpdateLoginProfileOutput) - - UpdateLoginProfile(*iam.UpdateLoginProfileInput) (*iam.UpdateLoginProfileOutput, error) - - UpdateOpenIDConnectProviderThumbprintRequest(*iam.UpdateOpenIDConnectProviderThumbprintInput) (*request.Request, *iam.UpdateOpenIDConnectProviderThumbprintOutput) - - UpdateOpenIDConnectProviderThumbprint(*iam.UpdateOpenIDConnectProviderThumbprintInput) (*iam.UpdateOpenIDConnectProviderThumbprintOutput, error) - - UpdateSAMLProviderRequest(*iam.UpdateSAMLProviderInput) (*request.Request, *iam.UpdateSAMLProviderOutput) - - UpdateSAMLProvider(*iam.UpdateSAMLProviderInput) (*iam.UpdateSAMLProviderOutput, error) - - UpdateSSHPublicKeyRequest(*iam.UpdateSSHPublicKeyInput) (*request.Request, *iam.UpdateSSHPublicKeyOutput) - - UpdateSSHPublicKey(*iam.UpdateSSHPublicKeyInput) (*iam.UpdateSSHPublicKeyOutput, error) - - UpdateServerCertificateRequest(*iam.UpdateServerCertificateInput) (*request.Request, *iam.UpdateServerCertificateOutput) - - UpdateServerCertificate(*iam.UpdateServerCertificateInput) (*iam.UpdateServerCertificateOutput, error) - - UpdateSigningCertificateRequest(*iam.UpdateSigningCertificateInput) (*request.Request, *iam.UpdateSigningCertificateOutput) - - UpdateSigningCertificate(*iam.UpdateSigningCertificateInput) (*iam.UpdateSigningCertificateOutput, error) - - UpdateUserRequest(*iam.UpdateUserInput) (*request.Request, *iam.UpdateUserOutput) - - UpdateUser(*iam.UpdateUserInput) (*iam.UpdateUserOutput, error) - - UploadSSHPublicKeyRequest(*iam.UploadSSHPublicKeyInput) (*request.Request, *iam.UploadSSHPublicKeyOutput) - - UploadSSHPublicKey(*iam.UploadSSHPublicKeyInput) (*iam.UploadSSHPublicKeyOutput, error) - - UploadServerCertificateRequest(*iam.UploadServerCertificateInput) (*request.Request, *iam.UploadServerCertificateOutput) - - UploadServerCertificate(*iam.UploadServerCertificateInput) (*iam.UploadServerCertificateOutput, error) - - UploadSigningCertificateRequest(*iam.UploadSigningCertificateInput) (*request.Request, *iam.UploadSigningCertificateOutput) - - UploadSigningCertificate(*iam.UploadSigningCertificateInput) (*iam.UploadSigningCertificateOutput, error) -} - -var _ IAMAPI = (*iam.IAM)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/kinesisiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/kinesisiface/interface.go deleted file mode 100644 index 014eeee52..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/kinesisiface/interface.go +++ /dev/null @@ -1,78 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package kinesisiface provides an interface for the Amazon Kinesis. -package kinesisiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/kinesis" -) - -// KinesisAPI is the interface type for kinesis.Kinesis. -type KinesisAPI interface { - AddTagsToStreamRequest(*kinesis.AddTagsToStreamInput) (*request.Request, *kinesis.AddTagsToStreamOutput) - - AddTagsToStream(*kinesis.AddTagsToStreamInput) (*kinesis.AddTagsToStreamOutput, error) - - CreateStreamRequest(*kinesis.CreateStreamInput) (*request.Request, *kinesis.CreateStreamOutput) - - CreateStream(*kinesis.CreateStreamInput) (*kinesis.CreateStreamOutput, error) - - DecreaseStreamRetentionPeriodRequest(*kinesis.DecreaseStreamRetentionPeriodInput) (*request.Request, *kinesis.DecreaseStreamRetentionPeriodOutput) - - DecreaseStreamRetentionPeriod(*kinesis.DecreaseStreamRetentionPeriodInput) (*kinesis.DecreaseStreamRetentionPeriodOutput, error) - - DeleteStreamRequest(*kinesis.DeleteStreamInput) (*request.Request, *kinesis.DeleteStreamOutput) - - DeleteStream(*kinesis.DeleteStreamInput) (*kinesis.DeleteStreamOutput, error) - - DescribeStreamRequest(*kinesis.DescribeStreamInput) (*request.Request, *kinesis.DescribeStreamOutput) - - DescribeStream(*kinesis.DescribeStreamInput) (*kinesis.DescribeStreamOutput, error) - - DescribeStreamPages(*kinesis.DescribeStreamInput, func(*kinesis.DescribeStreamOutput, bool) bool) error - - GetRecordsRequest(*kinesis.GetRecordsInput) (*request.Request, *kinesis.GetRecordsOutput) - - GetRecords(*kinesis.GetRecordsInput) (*kinesis.GetRecordsOutput, error) - - GetShardIteratorRequest(*kinesis.GetShardIteratorInput) (*request.Request, *kinesis.GetShardIteratorOutput) - - GetShardIterator(*kinesis.GetShardIteratorInput) (*kinesis.GetShardIteratorOutput, error) - - IncreaseStreamRetentionPeriodRequest(*kinesis.IncreaseStreamRetentionPeriodInput) (*request.Request, *kinesis.IncreaseStreamRetentionPeriodOutput) - - IncreaseStreamRetentionPeriod(*kinesis.IncreaseStreamRetentionPeriodInput) (*kinesis.IncreaseStreamRetentionPeriodOutput, error) - - ListStreamsRequest(*kinesis.ListStreamsInput) (*request.Request, *kinesis.ListStreamsOutput) - - ListStreams(*kinesis.ListStreamsInput) (*kinesis.ListStreamsOutput, error) - - ListStreamsPages(*kinesis.ListStreamsInput, func(*kinesis.ListStreamsOutput, bool) bool) error - - ListTagsForStreamRequest(*kinesis.ListTagsForStreamInput) (*request.Request, *kinesis.ListTagsForStreamOutput) - - ListTagsForStream(*kinesis.ListTagsForStreamInput) (*kinesis.ListTagsForStreamOutput, error) - - MergeShardsRequest(*kinesis.MergeShardsInput) (*request.Request, *kinesis.MergeShardsOutput) - - MergeShards(*kinesis.MergeShardsInput) (*kinesis.MergeShardsOutput, error) - - PutRecordRequest(*kinesis.PutRecordInput) (*request.Request, *kinesis.PutRecordOutput) - - PutRecord(*kinesis.PutRecordInput) (*kinesis.PutRecordOutput, error) - - PutRecordsRequest(*kinesis.PutRecordsInput) (*request.Request, *kinesis.PutRecordsOutput) - - PutRecords(*kinesis.PutRecordsInput) (*kinesis.PutRecordsOutput, error) - - RemoveTagsFromStreamRequest(*kinesis.RemoveTagsFromStreamInput) (*request.Request, *kinesis.RemoveTagsFromStreamOutput) - - RemoveTagsFromStream(*kinesis.RemoveTagsFromStreamInput) (*kinesis.RemoveTagsFromStreamOutput, error) - - SplitShardRequest(*kinesis.SplitShardInput) (*request.Request, *kinesis.SplitShardOutput) - - SplitShard(*kinesis.SplitShardInput) (*kinesis.SplitShardOutput, error) -} - -var _ KinesisAPI = (*kinesis.Kinesis)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/lambdaiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/lambdaiface/interface.go deleted file mode 100644 index 03c2a40d9..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/lambdaiface/interface.go +++ /dev/null @@ -1,114 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package lambdaiface provides an interface for the AWS Lambda. -package lambdaiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/lambda" -) - -// LambdaAPI is the interface type for lambda.Lambda. -type LambdaAPI interface { - AddPermissionRequest(*lambda.AddPermissionInput) (*request.Request, *lambda.AddPermissionOutput) - - AddPermission(*lambda.AddPermissionInput) (*lambda.AddPermissionOutput, error) - - CreateAliasRequest(*lambda.CreateAliasInput) (*request.Request, *lambda.AliasConfiguration) - - CreateAlias(*lambda.CreateAliasInput) (*lambda.AliasConfiguration, error) - - CreateEventSourceMappingRequest(*lambda.CreateEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration) - - CreateEventSourceMapping(*lambda.CreateEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error) - - CreateFunctionRequest(*lambda.CreateFunctionInput) (*request.Request, *lambda.FunctionConfiguration) - - CreateFunction(*lambda.CreateFunctionInput) (*lambda.FunctionConfiguration, error) - - DeleteAliasRequest(*lambda.DeleteAliasInput) (*request.Request, *lambda.DeleteAliasOutput) - - DeleteAlias(*lambda.DeleteAliasInput) (*lambda.DeleteAliasOutput, error) - - DeleteEventSourceMappingRequest(*lambda.DeleteEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration) - - DeleteEventSourceMapping(*lambda.DeleteEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error) - - DeleteFunctionRequest(*lambda.DeleteFunctionInput) (*request.Request, *lambda.DeleteFunctionOutput) - - DeleteFunction(*lambda.DeleteFunctionInput) (*lambda.DeleteFunctionOutput, error) - - GetAliasRequest(*lambda.GetAliasInput) (*request.Request, *lambda.AliasConfiguration) - - GetAlias(*lambda.GetAliasInput) (*lambda.AliasConfiguration, error) - - GetEventSourceMappingRequest(*lambda.GetEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration) - - GetEventSourceMapping(*lambda.GetEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error) - - GetFunctionRequest(*lambda.GetFunctionInput) (*request.Request, *lambda.GetFunctionOutput) - - GetFunction(*lambda.GetFunctionInput) (*lambda.GetFunctionOutput, error) - - GetFunctionConfigurationRequest(*lambda.GetFunctionConfigurationInput) (*request.Request, *lambda.FunctionConfiguration) - - GetFunctionConfiguration(*lambda.GetFunctionConfigurationInput) (*lambda.FunctionConfiguration, error) - - GetPolicyRequest(*lambda.GetPolicyInput) (*request.Request, *lambda.GetPolicyOutput) - - GetPolicy(*lambda.GetPolicyInput) (*lambda.GetPolicyOutput, error) - - InvokeRequest(*lambda.InvokeInput) (*request.Request, *lambda.InvokeOutput) - - Invoke(*lambda.InvokeInput) (*lambda.InvokeOutput, error) - - InvokeAsyncRequest(*lambda.InvokeAsyncInput) (*request.Request, *lambda.InvokeAsyncOutput) - - InvokeAsync(*lambda.InvokeAsyncInput) (*lambda.InvokeAsyncOutput, error) - - ListAliasesRequest(*lambda.ListAliasesInput) (*request.Request, *lambda.ListAliasesOutput) - - ListAliases(*lambda.ListAliasesInput) (*lambda.ListAliasesOutput, error) - - ListEventSourceMappingsRequest(*lambda.ListEventSourceMappingsInput) (*request.Request, *lambda.ListEventSourceMappingsOutput) - - ListEventSourceMappings(*lambda.ListEventSourceMappingsInput) (*lambda.ListEventSourceMappingsOutput, error) - - ListEventSourceMappingsPages(*lambda.ListEventSourceMappingsInput, func(*lambda.ListEventSourceMappingsOutput, bool) bool) error - - ListFunctionsRequest(*lambda.ListFunctionsInput) (*request.Request, *lambda.ListFunctionsOutput) - - ListFunctions(*lambda.ListFunctionsInput) (*lambda.ListFunctionsOutput, error) - - ListFunctionsPages(*lambda.ListFunctionsInput, func(*lambda.ListFunctionsOutput, bool) bool) error - - ListVersionsByFunctionRequest(*lambda.ListVersionsByFunctionInput) (*request.Request, *lambda.ListVersionsByFunctionOutput) - - ListVersionsByFunction(*lambda.ListVersionsByFunctionInput) (*lambda.ListVersionsByFunctionOutput, error) - - PublishVersionRequest(*lambda.PublishVersionInput) (*request.Request, *lambda.FunctionConfiguration) - - PublishVersion(*lambda.PublishVersionInput) (*lambda.FunctionConfiguration, error) - - RemovePermissionRequest(*lambda.RemovePermissionInput) (*request.Request, *lambda.RemovePermissionOutput) - - RemovePermission(*lambda.RemovePermissionInput) (*lambda.RemovePermissionOutput, error) - - UpdateAliasRequest(*lambda.UpdateAliasInput) (*request.Request, *lambda.AliasConfiguration) - - UpdateAlias(*lambda.UpdateAliasInput) (*lambda.AliasConfiguration, error) - - UpdateEventSourceMappingRequest(*lambda.UpdateEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration) - - UpdateEventSourceMapping(*lambda.UpdateEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error) - - UpdateFunctionCodeRequest(*lambda.UpdateFunctionCodeInput) (*request.Request, *lambda.FunctionConfiguration) - - UpdateFunctionCode(*lambda.UpdateFunctionCodeInput) (*lambda.FunctionConfiguration, error) - - UpdateFunctionConfigurationRequest(*lambda.UpdateFunctionConfigurationInput) (*request.Request, *lambda.FunctionConfiguration) - - UpdateFunctionConfiguration(*lambda.UpdateFunctionConfigurationInput) (*lambda.FunctionConfiguration, error) -} - -var _ LambdaAPI = (*lambda.Lambda)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/opsworks/opsworksiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/opsworks/opsworksiface/interface.go deleted file mode 100644 index 9e477674a..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/opsworksiface/interface.go +++ /dev/null @@ -1,296 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package opsworksiface provides an interface for the AWS OpsWorks. -package opsworksiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/opsworks" -) - -// OpsWorksAPI is the interface type for opsworks.OpsWorks. -type OpsWorksAPI interface { - AssignInstanceRequest(*opsworks.AssignInstanceInput) (*request.Request, *opsworks.AssignInstanceOutput) - - AssignInstance(*opsworks.AssignInstanceInput) (*opsworks.AssignInstanceOutput, error) - - AssignVolumeRequest(*opsworks.AssignVolumeInput) (*request.Request, *opsworks.AssignVolumeOutput) - - AssignVolume(*opsworks.AssignVolumeInput) (*opsworks.AssignVolumeOutput, error) - - AssociateElasticIpRequest(*opsworks.AssociateElasticIpInput) (*request.Request, *opsworks.AssociateElasticIpOutput) - - AssociateElasticIp(*opsworks.AssociateElasticIpInput) (*opsworks.AssociateElasticIpOutput, error) - - AttachElasticLoadBalancerRequest(*opsworks.AttachElasticLoadBalancerInput) (*request.Request, *opsworks.AttachElasticLoadBalancerOutput) - - AttachElasticLoadBalancer(*opsworks.AttachElasticLoadBalancerInput) (*opsworks.AttachElasticLoadBalancerOutput, error) - - CloneStackRequest(*opsworks.CloneStackInput) (*request.Request, *opsworks.CloneStackOutput) - - CloneStack(*opsworks.CloneStackInput) (*opsworks.CloneStackOutput, error) - - CreateAppRequest(*opsworks.CreateAppInput) (*request.Request, *opsworks.CreateAppOutput) - - CreateApp(*opsworks.CreateAppInput) (*opsworks.CreateAppOutput, error) - - CreateDeploymentRequest(*opsworks.CreateDeploymentInput) (*request.Request, *opsworks.CreateDeploymentOutput) - - CreateDeployment(*opsworks.CreateDeploymentInput) (*opsworks.CreateDeploymentOutput, error) - - CreateInstanceRequest(*opsworks.CreateInstanceInput) (*request.Request, *opsworks.CreateInstanceOutput) - - CreateInstance(*opsworks.CreateInstanceInput) (*opsworks.CreateInstanceOutput, error) - - CreateLayerRequest(*opsworks.CreateLayerInput) (*request.Request, *opsworks.CreateLayerOutput) - - CreateLayer(*opsworks.CreateLayerInput) (*opsworks.CreateLayerOutput, error) - - CreateStackRequest(*opsworks.CreateStackInput) (*request.Request, *opsworks.CreateStackOutput) - - CreateStack(*opsworks.CreateStackInput) (*opsworks.CreateStackOutput, error) - - CreateUserProfileRequest(*opsworks.CreateUserProfileInput) (*request.Request, *opsworks.CreateUserProfileOutput) - - CreateUserProfile(*opsworks.CreateUserProfileInput) (*opsworks.CreateUserProfileOutput, error) - - DeleteAppRequest(*opsworks.DeleteAppInput) (*request.Request, *opsworks.DeleteAppOutput) - - DeleteApp(*opsworks.DeleteAppInput) (*opsworks.DeleteAppOutput, error) - - DeleteInstanceRequest(*opsworks.DeleteInstanceInput) (*request.Request, *opsworks.DeleteInstanceOutput) - - DeleteInstance(*opsworks.DeleteInstanceInput) (*opsworks.DeleteInstanceOutput, error) - - DeleteLayerRequest(*opsworks.DeleteLayerInput) (*request.Request, *opsworks.DeleteLayerOutput) - - DeleteLayer(*opsworks.DeleteLayerInput) (*opsworks.DeleteLayerOutput, error) - - DeleteStackRequest(*opsworks.DeleteStackInput) (*request.Request, *opsworks.DeleteStackOutput) - - DeleteStack(*opsworks.DeleteStackInput) (*opsworks.DeleteStackOutput, error) - - DeleteUserProfileRequest(*opsworks.DeleteUserProfileInput) (*request.Request, *opsworks.DeleteUserProfileOutput) - - DeleteUserProfile(*opsworks.DeleteUserProfileInput) (*opsworks.DeleteUserProfileOutput, error) - - DeregisterEcsClusterRequest(*opsworks.DeregisterEcsClusterInput) (*request.Request, *opsworks.DeregisterEcsClusterOutput) - - DeregisterEcsCluster(*opsworks.DeregisterEcsClusterInput) (*opsworks.DeregisterEcsClusterOutput, error) - - DeregisterElasticIpRequest(*opsworks.DeregisterElasticIpInput) (*request.Request, *opsworks.DeregisterElasticIpOutput) - - DeregisterElasticIp(*opsworks.DeregisterElasticIpInput) (*opsworks.DeregisterElasticIpOutput, error) - - DeregisterInstanceRequest(*opsworks.DeregisterInstanceInput) (*request.Request, *opsworks.DeregisterInstanceOutput) - - DeregisterInstance(*opsworks.DeregisterInstanceInput) (*opsworks.DeregisterInstanceOutput, error) - - DeregisterRdsDbInstanceRequest(*opsworks.DeregisterRdsDbInstanceInput) (*request.Request, *opsworks.DeregisterRdsDbInstanceOutput) - - DeregisterRdsDbInstance(*opsworks.DeregisterRdsDbInstanceInput) (*opsworks.DeregisterRdsDbInstanceOutput, error) - - DeregisterVolumeRequest(*opsworks.DeregisterVolumeInput) (*request.Request, *opsworks.DeregisterVolumeOutput) - - DeregisterVolume(*opsworks.DeregisterVolumeInput) (*opsworks.DeregisterVolumeOutput, error) - - DescribeAgentVersionsRequest(*opsworks.DescribeAgentVersionsInput) (*request.Request, *opsworks.DescribeAgentVersionsOutput) - - DescribeAgentVersions(*opsworks.DescribeAgentVersionsInput) (*opsworks.DescribeAgentVersionsOutput, error) - - DescribeAppsRequest(*opsworks.DescribeAppsInput) (*request.Request, *opsworks.DescribeAppsOutput) - - DescribeApps(*opsworks.DescribeAppsInput) (*opsworks.DescribeAppsOutput, error) - - DescribeCommandsRequest(*opsworks.DescribeCommandsInput) (*request.Request, *opsworks.DescribeCommandsOutput) - - DescribeCommands(*opsworks.DescribeCommandsInput) (*opsworks.DescribeCommandsOutput, error) - - DescribeDeploymentsRequest(*opsworks.DescribeDeploymentsInput) (*request.Request, *opsworks.DescribeDeploymentsOutput) - - DescribeDeployments(*opsworks.DescribeDeploymentsInput) (*opsworks.DescribeDeploymentsOutput, error) - - DescribeEcsClustersRequest(*opsworks.DescribeEcsClustersInput) (*request.Request, *opsworks.DescribeEcsClustersOutput) - - DescribeEcsClusters(*opsworks.DescribeEcsClustersInput) (*opsworks.DescribeEcsClustersOutput, error) - - DescribeEcsClustersPages(*opsworks.DescribeEcsClustersInput, func(*opsworks.DescribeEcsClustersOutput, bool) bool) error - - DescribeElasticIpsRequest(*opsworks.DescribeElasticIpsInput) (*request.Request, *opsworks.DescribeElasticIpsOutput) - - DescribeElasticIps(*opsworks.DescribeElasticIpsInput) (*opsworks.DescribeElasticIpsOutput, error) - - DescribeElasticLoadBalancersRequest(*opsworks.DescribeElasticLoadBalancersInput) (*request.Request, *opsworks.DescribeElasticLoadBalancersOutput) - - DescribeElasticLoadBalancers(*opsworks.DescribeElasticLoadBalancersInput) (*opsworks.DescribeElasticLoadBalancersOutput, error) - - DescribeInstancesRequest(*opsworks.DescribeInstancesInput) (*request.Request, *opsworks.DescribeInstancesOutput) - - DescribeInstances(*opsworks.DescribeInstancesInput) (*opsworks.DescribeInstancesOutput, error) - - DescribeLayersRequest(*opsworks.DescribeLayersInput) (*request.Request, *opsworks.DescribeLayersOutput) - - DescribeLayers(*opsworks.DescribeLayersInput) (*opsworks.DescribeLayersOutput, error) - - DescribeLoadBasedAutoScalingRequest(*opsworks.DescribeLoadBasedAutoScalingInput) (*request.Request, *opsworks.DescribeLoadBasedAutoScalingOutput) - - DescribeLoadBasedAutoScaling(*opsworks.DescribeLoadBasedAutoScalingInput) (*opsworks.DescribeLoadBasedAutoScalingOutput, error) - - DescribeMyUserProfileRequest(*opsworks.DescribeMyUserProfileInput) (*request.Request, *opsworks.DescribeMyUserProfileOutput) - - DescribeMyUserProfile(*opsworks.DescribeMyUserProfileInput) (*opsworks.DescribeMyUserProfileOutput, error) - - DescribePermissionsRequest(*opsworks.DescribePermissionsInput) (*request.Request, *opsworks.DescribePermissionsOutput) - - DescribePermissions(*opsworks.DescribePermissionsInput) (*opsworks.DescribePermissionsOutput, error) - - DescribeRaidArraysRequest(*opsworks.DescribeRaidArraysInput) (*request.Request, *opsworks.DescribeRaidArraysOutput) - - DescribeRaidArrays(*opsworks.DescribeRaidArraysInput) (*opsworks.DescribeRaidArraysOutput, error) - - DescribeRdsDbInstancesRequest(*opsworks.DescribeRdsDbInstancesInput) (*request.Request, *opsworks.DescribeRdsDbInstancesOutput) - - DescribeRdsDbInstances(*opsworks.DescribeRdsDbInstancesInput) (*opsworks.DescribeRdsDbInstancesOutput, error) - - DescribeServiceErrorsRequest(*opsworks.DescribeServiceErrorsInput) (*request.Request, *opsworks.DescribeServiceErrorsOutput) - - DescribeServiceErrors(*opsworks.DescribeServiceErrorsInput) (*opsworks.DescribeServiceErrorsOutput, error) - - DescribeStackProvisioningParametersRequest(*opsworks.DescribeStackProvisioningParametersInput) (*request.Request, *opsworks.DescribeStackProvisioningParametersOutput) - - DescribeStackProvisioningParameters(*opsworks.DescribeStackProvisioningParametersInput) (*opsworks.DescribeStackProvisioningParametersOutput, error) - - DescribeStackSummaryRequest(*opsworks.DescribeStackSummaryInput) (*request.Request, *opsworks.DescribeStackSummaryOutput) - - DescribeStackSummary(*opsworks.DescribeStackSummaryInput) (*opsworks.DescribeStackSummaryOutput, error) - - DescribeStacksRequest(*opsworks.DescribeStacksInput) (*request.Request, *opsworks.DescribeStacksOutput) - - DescribeStacks(*opsworks.DescribeStacksInput) (*opsworks.DescribeStacksOutput, error) - - DescribeTimeBasedAutoScalingRequest(*opsworks.DescribeTimeBasedAutoScalingInput) (*request.Request, *opsworks.DescribeTimeBasedAutoScalingOutput) - - DescribeTimeBasedAutoScaling(*opsworks.DescribeTimeBasedAutoScalingInput) (*opsworks.DescribeTimeBasedAutoScalingOutput, error) - - DescribeUserProfilesRequest(*opsworks.DescribeUserProfilesInput) (*request.Request, *opsworks.DescribeUserProfilesOutput) - - DescribeUserProfiles(*opsworks.DescribeUserProfilesInput) (*opsworks.DescribeUserProfilesOutput, error) - - DescribeVolumesRequest(*opsworks.DescribeVolumesInput) (*request.Request, *opsworks.DescribeVolumesOutput) - - DescribeVolumes(*opsworks.DescribeVolumesInput) (*opsworks.DescribeVolumesOutput, error) - - DetachElasticLoadBalancerRequest(*opsworks.DetachElasticLoadBalancerInput) (*request.Request, *opsworks.DetachElasticLoadBalancerOutput) - - DetachElasticLoadBalancer(*opsworks.DetachElasticLoadBalancerInput) (*opsworks.DetachElasticLoadBalancerOutput, error) - - DisassociateElasticIpRequest(*opsworks.DisassociateElasticIpInput) (*request.Request, *opsworks.DisassociateElasticIpOutput) - - DisassociateElasticIp(*opsworks.DisassociateElasticIpInput) (*opsworks.DisassociateElasticIpOutput, error) - - GetHostnameSuggestionRequest(*opsworks.GetHostnameSuggestionInput) (*request.Request, *opsworks.GetHostnameSuggestionOutput) - - GetHostnameSuggestion(*opsworks.GetHostnameSuggestionInput) (*opsworks.GetHostnameSuggestionOutput, error) - - GrantAccessRequest(*opsworks.GrantAccessInput) (*request.Request, *opsworks.GrantAccessOutput) - - GrantAccess(*opsworks.GrantAccessInput) (*opsworks.GrantAccessOutput, error) - - RebootInstanceRequest(*opsworks.RebootInstanceInput) (*request.Request, *opsworks.RebootInstanceOutput) - - RebootInstance(*opsworks.RebootInstanceInput) (*opsworks.RebootInstanceOutput, error) - - RegisterEcsClusterRequest(*opsworks.RegisterEcsClusterInput) (*request.Request, *opsworks.RegisterEcsClusterOutput) - - RegisterEcsCluster(*opsworks.RegisterEcsClusterInput) (*opsworks.RegisterEcsClusterOutput, error) - - RegisterElasticIpRequest(*opsworks.RegisterElasticIpInput) (*request.Request, *opsworks.RegisterElasticIpOutput) - - RegisterElasticIp(*opsworks.RegisterElasticIpInput) (*opsworks.RegisterElasticIpOutput, error) - - RegisterInstanceRequest(*opsworks.RegisterInstanceInput) (*request.Request, *opsworks.RegisterInstanceOutput) - - RegisterInstance(*opsworks.RegisterInstanceInput) (*opsworks.RegisterInstanceOutput, error) - - RegisterRdsDbInstanceRequest(*opsworks.RegisterRdsDbInstanceInput) (*request.Request, *opsworks.RegisterRdsDbInstanceOutput) - - RegisterRdsDbInstance(*opsworks.RegisterRdsDbInstanceInput) (*opsworks.RegisterRdsDbInstanceOutput, error) - - RegisterVolumeRequest(*opsworks.RegisterVolumeInput) (*request.Request, *opsworks.RegisterVolumeOutput) - - RegisterVolume(*opsworks.RegisterVolumeInput) (*opsworks.RegisterVolumeOutput, error) - - SetLoadBasedAutoScalingRequest(*opsworks.SetLoadBasedAutoScalingInput) (*request.Request, *opsworks.SetLoadBasedAutoScalingOutput) - - SetLoadBasedAutoScaling(*opsworks.SetLoadBasedAutoScalingInput) (*opsworks.SetLoadBasedAutoScalingOutput, error) - - SetPermissionRequest(*opsworks.SetPermissionInput) (*request.Request, *opsworks.SetPermissionOutput) - - SetPermission(*opsworks.SetPermissionInput) (*opsworks.SetPermissionOutput, error) - - SetTimeBasedAutoScalingRequest(*opsworks.SetTimeBasedAutoScalingInput) (*request.Request, *opsworks.SetTimeBasedAutoScalingOutput) - - SetTimeBasedAutoScaling(*opsworks.SetTimeBasedAutoScalingInput) (*opsworks.SetTimeBasedAutoScalingOutput, error) - - StartInstanceRequest(*opsworks.StartInstanceInput) (*request.Request, *opsworks.StartInstanceOutput) - - StartInstance(*opsworks.StartInstanceInput) (*opsworks.StartInstanceOutput, error) - - StartStackRequest(*opsworks.StartStackInput) (*request.Request, *opsworks.StartStackOutput) - - StartStack(*opsworks.StartStackInput) (*opsworks.StartStackOutput, error) - - StopInstanceRequest(*opsworks.StopInstanceInput) (*request.Request, *opsworks.StopInstanceOutput) - - StopInstance(*opsworks.StopInstanceInput) (*opsworks.StopInstanceOutput, error) - - StopStackRequest(*opsworks.StopStackInput) (*request.Request, *opsworks.StopStackOutput) - - StopStack(*opsworks.StopStackInput) (*opsworks.StopStackOutput, error) - - UnassignInstanceRequest(*opsworks.UnassignInstanceInput) (*request.Request, *opsworks.UnassignInstanceOutput) - - UnassignInstance(*opsworks.UnassignInstanceInput) (*opsworks.UnassignInstanceOutput, error) - - UnassignVolumeRequest(*opsworks.UnassignVolumeInput) (*request.Request, *opsworks.UnassignVolumeOutput) - - UnassignVolume(*opsworks.UnassignVolumeInput) (*opsworks.UnassignVolumeOutput, error) - - UpdateAppRequest(*opsworks.UpdateAppInput) (*request.Request, *opsworks.UpdateAppOutput) - - UpdateApp(*opsworks.UpdateAppInput) (*opsworks.UpdateAppOutput, error) - - UpdateElasticIpRequest(*opsworks.UpdateElasticIpInput) (*request.Request, *opsworks.UpdateElasticIpOutput) - - UpdateElasticIp(*opsworks.UpdateElasticIpInput) (*opsworks.UpdateElasticIpOutput, error) - - UpdateInstanceRequest(*opsworks.UpdateInstanceInput) (*request.Request, *opsworks.UpdateInstanceOutput) - - UpdateInstance(*opsworks.UpdateInstanceInput) (*opsworks.UpdateInstanceOutput, error) - - UpdateLayerRequest(*opsworks.UpdateLayerInput) (*request.Request, *opsworks.UpdateLayerOutput) - - UpdateLayer(*opsworks.UpdateLayerInput) (*opsworks.UpdateLayerOutput, error) - - UpdateMyUserProfileRequest(*opsworks.UpdateMyUserProfileInput) (*request.Request, *opsworks.UpdateMyUserProfileOutput) - - UpdateMyUserProfile(*opsworks.UpdateMyUserProfileInput) (*opsworks.UpdateMyUserProfileOutput, error) - - UpdateRdsDbInstanceRequest(*opsworks.UpdateRdsDbInstanceInput) (*request.Request, *opsworks.UpdateRdsDbInstanceOutput) - - UpdateRdsDbInstance(*opsworks.UpdateRdsDbInstanceInput) (*opsworks.UpdateRdsDbInstanceOutput, error) - - UpdateStackRequest(*opsworks.UpdateStackInput) (*request.Request, *opsworks.UpdateStackOutput) - - UpdateStack(*opsworks.UpdateStackInput) (*opsworks.UpdateStackOutput, error) - - UpdateUserProfileRequest(*opsworks.UpdateUserProfileInput) (*request.Request, *opsworks.UpdateUserProfileOutput) - - UpdateUserProfile(*opsworks.UpdateUserProfileInput) (*opsworks.UpdateUserProfileOutput, error) - - UpdateVolumeRequest(*opsworks.UpdateVolumeInput) (*request.Request, *opsworks.UpdateVolumeOutput) - - UpdateVolume(*opsworks.UpdateVolumeInput) (*opsworks.UpdateVolumeOutput, error) -} - -var _ OpsWorksAPI = (*opsworks.OpsWorks)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/rdsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/rds/rdsiface/interface.go deleted file mode 100644 index db350eeea..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/rdsiface/interface.go +++ /dev/null @@ -1,360 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package rdsiface provides an interface for the Amazon Relational Database Service. -package rdsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/rds" -) - -// RDSAPI is the interface type for rds.RDS. -type RDSAPI interface { - AddSourceIdentifierToSubscriptionRequest(*rds.AddSourceIdentifierToSubscriptionInput) (*request.Request, *rds.AddSourceIdentifierToSubscriptionOutput) - - AddSourceIdentifierToSubscription(*rds.AddSourceIdentifierToSubscriptionInput) (*rds.AddSourceIdentifierToSubscriptionOutput, error) - - AddTagsToResourceRequest(*rds.AddTagsToResourceInput) (*request.Request, *rds.AddTagsToResourceOutput) - - AddTagsToResource(*rds.AddTagsToResourceInput) (*rds.AddTagsToResourceOutput, error) - - ApplyPendingMaintenanceActionRequest(*rds.ApplyPendingMaintenanceActionInput) (*request.Request, *rds.ApplyPendingMaintenanceActionOutput) - - ApplyPendingMaintenanceAction(*rds.ApplyPendingMaintenanceActionInput) (*rds.ApplyPendingMaintenanceActionOutput, error) - - AuthorizeDBSecurityGroupIngressRequest(*rds.AuthorizeDBSecurityGroupIngressInput) (*request.Request, *rds.AuthorizeDBSecurityGroupIngressOutput) - - AuthorizeDBSecurityGroupIngress(*rds.AuthorizeDBSecurityGroupIngressInput) (*rds.AuthorizeDBSecurityGroupIngressOutput, error) - - CopyDBClusterSnapshotRequest(*rds.CopyDBClusterSnapshotInput) (*request.Request, *rds.CopyDBClusterSnapshotOutput) - - CopyDBClusterSnapshot(*rds.CopyDBClusterSnapshotInput) (*rds.CopyDBClusterSnapshotOutput, error) - - CopyDBParameterGroupRequest(*rds.CopyDBParameterGroupInput) (*request.Request, *rds.CopyDBParameterGroupOutput) - - CopyDBParameterGroup(*rds.CopyDBParameterGroupInput) (*rds.CopyDBParameterGroupOutput, error) - - CopyDBSnapshotRequest(*rds.CopyDBSnapshotInput) (*request.Request, *rds.CopyDBSnapshotOutput) - - CopyDBSnapshot(*rds.CopyDBSnapshotInput) (*rds.CopyDBSnapshotOutput, error) - - CopyOptionGroupRequest(*rds.CopyOptionGroupInput) (*request.Request, *rds.CopyOptionGroupOutput) - - CopyOptionGroup(*rds.CopyOptionGroupInput) (*rds.CopyOptionGroupOutput, error) - - CreateDBClusterRequest(*rds.CreateDBClusterInput) (*request.Request, *rds.CreateDBClusterOutput) - - CreateDBCluster(*rds.CreateDBClusterInput) (*rds.CreateDBClusterOutput, error) - - CreateDBClusterParameterGroupRequest(*rds.CreateDBClusterParameterGroupInput) (*request.Request, *rds.CreateDBClusterParameterGroupOutput) - - CreateDBClusterParameterGroup(*rds.CreateDBClusterParameterGroupInput) (*rds.CreateDBClusterParameterGroupOutput, error) - - CreateDBClusterSnapshotRequest(*rds.CreateDBClusterSnapshotInput) (*request.Request, *rds.CreateDBClusterSnapshotOutput) - - CreateDBClusterSnapshot(*rds.CreateDBClusterSnapshotInput) (*rds.CreateDBClusterSnapshotOutput, error) - - CreateDBInstanceRequest(*rds.CreateDBInstanceInput) (*request.Request, *rds.CreateDBInstanceOutput) - - CreateDBInstance(*rds.CreateDBInstanceInput) (*rds.CreateDBInstanceOutput, error) - - CreateDBInstanceReadReplicaRequest(*rds.CreateDBInstanceReadReplicaInput) (*request.Request, *rds.CreateDBInstanceReadReplicaOutput) - - CreateDBInstanceReadReplica(*rds.CreateDBInstanceReadReplicaInput) (*rds.CreateDBInstanceReadReplicaOutput, error) - - CreateDBParameterGroupRequest(*rds.CreateDBParameterGroupInput) (*request.Request, *rds.CreateDBParameterGroupOutput) - - CreateDBParameterGroup(*rds.CreateDBParameterGroupInput) (*rds.CreateDBParameterGroupOutput, error) - - CreateDBSecurityGroupRequest(*rds.CreateDBSecurityGroupInput) (*request.Request, *rds.CreateDBSecurityGroupOutput) - - CreateDBSecurityGroup(*rds.CreateDBSecurityGroupInput) (*rds.CreateDBSecurityGroupOutput, error) - - CreateDBSnapshotRequest(*rds.CreateDBSnapshotInput) (*request.Request, *rds.CreateDBSnapshotOutput) - - CreateDBSnapshot(*rds.CreateDBSnapshotInput) (*rds.CreateDBSnapshotOutput, error) - - CreateDBSubnetGroupRequest(*rds.CreateDBSubnetGroupInput) (*request.Request, *rds.CreateDBSubnetGroupOutput) - - CreateDBSubnetGroup(*rds.CreateDBSubnetGroupInput) (*rds.CreateDBSubnetGroupOutput, error) - - CreateEventSubscriptionRequest(*rds.CreateEventSubscriptionInput) (*request.Request, *rds.CreateEventSubscriptionOutput) - - CreateEventSubscription(*rds.CreateEventSubscriptionInput) (*rds.CreateEventSubscriptionOutput, error) - - CreateOptionGroupRequest(*rds.CreateOptionGroupInput) (*request.Request, *rds.CreateOptionGroupOutput) - - CreateOptionGroup(*rds.CreateOptionGroupInput) (*rds.CreateOptionGroupOutput, error) - - DeleteDBClusterRequest(*rds.DeleteDBClusterInput) (*request.Request, *rds.DeleteDBClusterOutput) - - DeleteDBCluster(*rds.DeleteDBClusterInput) (*rds.DeleteDBClusterOutput, error) - - DeleteDBClusterParameterGroupRequest(*rds.DeleteDBClusterParameterGroupInput) (*request.Request, *rds.DeleteDBClusterParameterGroupOutput) - - DeleteDBClusterParameterGroup(*rds.DeleteDBClusterParameterGroupInput) (*rds.DeleteDBClusterParameterGroupOutput, error) - - DeleteDBClusterSnapshotRequest(*rds.DeleteDBClusterSnapshotInput) (*request.Request, *rds.DeleteDBClusterSnapshotOutput) - - DeleteDBClusterSnapshot(*rds.DeleteDBClusterSnapshotInput) (*rds.DeleteDBClusterSnapshotOutput, error) - - DeleteDBInstanceRequest(*rds.DeleteDBInstanceInput) (*request.Request, *rds.DeleteDBInstanceOutput) - - DeleteDBInstance(*rds.DeleteDBInstanceInput) (*rds.DeleteDBInstanceOutput, error) - - DeleteDBParameterGroupRequest(*rds.DeleteDBParameterGroupInput) (*request.Request, *rds.DeleteDBParameterGroupOutput) - - DeleteDBParameterGroup(*rds.DeleteDBParameterGroupInput) (*rds.DeleteDBParameterGroupOutput, error) - - DeleteDBSecurityGroupRequest(*rds.DeleteDBSecurityGroupInput) (*request.Request, *rds.DeleteDBSecurityGroupOutput) - - DeleteDBSecurityGroup(*rds.DeleteDBSecurityGroupInput) (*rds.DeleteDBSecurityGroupOutput, error) - - DeleteDBSnapshotRequest(*rds.DeleteDBSnapshotInput) (*request.Request, *rds.DeleteDBSnapshotOutput) - - DeleteDBSnapshot(*rds.DeleteDBSnapshotInput) (*rds.DeleteDBSnapshotOutput, error) - - DeleteDBSubnetGroupRequest(*rds.DeleteDBSubnetGroupInput) (*request.Request, *rds.DeleteDBSubnetGroupOutput) - - DeleteDBSubnetGroup(*rds.DeleteDBSubnetGroupInput) (*rds.DeleteDBSubnetGroupOutput, error) - - DeleteEventSubscriptionRequest(*rds.DeleteEventSubscriptionInput) (*request.Request, *rds.DeleteEventSubscriptionOutput) - - DeleteEventSubscription(*rds.DeleteEventSubscriptionInput) (*rds.DeleteEventSubscriptionOutput, error) - - DeleteOptionGroupRequest(*rds.DeleteOptionGroupInput) (*request.Request, *rds.DeleteOptionGroupOutput) - - DeleteOptionGroup(*rds.DeleteOptionGroupInput) (*rds.DeleteOptionGroupOutput, error) - - DescribeAccountAttributesRequest(*rds.DescribeAccountAttributesInput) (*request.Request, *rds.DescribeAccountAttributesOutput) - - DescribeAccountAttributes(*rds.DescribeAccountAttributesInput) (*rds.DescribeAccountAttributesOutput, error) - - DescribeCertificatesRequest(*rds.DescribeCertificatesInput) (*request.Request, *rds.DescribeCertificatesOutput) - - DescribeCertificates(*rds.DescribeCertificatesInput) (*rds.DescribeCertificatesOutput, error) - - DescribeDBClusterParameterGroupsRequest(*rds.DescribeDBClusterParameterGroupsInput) (*request.Request, *rds.DescribeDBClusterParameterGroupsOutput) - - DescribeDBClusterParameterGroups(*rds.DescribeDBClusterParameterGroupsInput) (*rds.DescribeDBClusterParameterGroupsOutput, error) - - DescribeDBClusterParametersRequest(*rds.DescribeDBClusterParametersInput) (*request.Request, *rds.DescribeDBClusterParametersOutput) - - DescribeDBClusterParameters(*rds.DescribeDBClusterParametersInput) (*rds.DescribeDBClusterParametersOutput, error) - - DescribeDBClusterSnapshotsRequest(*rds.DescribeDBClusterSnapshotsInput) (*request.Request, *rds.DescribeDBClusterSnapshotsOutput) - - DescribeDBClusterSnapshots(*rds.DescribeDBClusterSnapshotsInput) (*rds.DescribeDBClusterSnapshotsOutput, error) - - DescribeDBClustersRequest(*rds.DescribeDBClustersInput) (*request.Request, *rds.DescribeDBClustersOutput) - - DescribeDBClusters(*rds.DescribeDBClustersInput) (*rds.DescribeDBClustersOutput, error) - - DescribeDBEngineVersionsRequest(*rds.DescribeDBEngineVersionsInput) (*request.Request, *rds.DescribeDBEngineVersionsOutput) - - DescribeDBEngineVersions(*rds.DescribeDBEngineVersionsInput) (*rds.DescribeDBEngineVersionsOutput, error) - - DescribeDBEngineVersionsPages(*rds.DescribeDBEngineVersionsInput, func(*rds.DescribeDBEngineVersionsOutput, bool) bool) error - - DescribeDBInstancesRequest(*rds.DescribeDBInstancesInput) (*request.Request, *rds.DescribeDBInstancesOutput) - - DescribeDBInstances(*rds.DescribeDBInstancesInput) (*rds.DescribeDBInstancesOutput, error) - - DescribeDBInstancesPages(*rds.DescribeDBInstancesInput, func(*rds.DescribeDBInstancesOutput, bool) bool) error - - DescribeDBLogFilesRequest(*rds.DescribeDBLogFilesInput) (*request.Request, *rds.DescribeDBLogFilesOutput) - - DescribeDBLogFiles(*rds.DescribeDBLogFilesInput) (*rds.DescribeDBLogFilesOutput, error) - - DescribeDBLogFilesPages(*rds.DescribeDBLogFilesInput, func(*rds.DescribeDBLogFilesOutput, bool) bool) error - - DescribeDBParameterGroupsRequest(*rds.DescribeDBParameterGroupsInput) (*request.Request, *rds.DescribeDBParameterGroupsOutput) - - DescribeDBParameterGroups(*rds.DescribeDBParameterGroupsInput) (*rds.DescribeDBParameterGroupsOutput, error) - - DescribeDBParameterGroupsPages(*rds.DescribeDBParameterGroupsInput, func(*rds.DescribeDBParameterGroupsOutput, bool) bool) error - - DescribeDBParametersRequest(*rds.DescribeDBParametersInput) (*request.Request, *rds.DescribeDBParametersOutput) - - DescribeDBParameters(*rds.DescribeDBParametersInput) (*rds.DescribeDBParametersOutput, error) - - DescribeDBParametersPages(*rds.DescribeDBParametersInput, func(*rds.DescribeDBParametersOutput, bool) bool) error - - DescribeDBSecurityGroupsRequest(*rds.DescribeDBSecurityGroupsInput) (*request.Request, *rds.DescribeDBSecurityGroupsOutput) - - DescribeDBSecurityGroups(*rds.DescribeDBSecurityGroupsInput) (*rds.DescribeDBSecurityGroupsOutput, error) - - DescribeDBSecurityGroupsPages(*rds.DescribeDBSecurityGroupsInput, func(*rds.DescribeDBSecurityGroupsOutput, bool) bool) error - - DescribeDBSnapshotAttributesRequest(*rds.DescribeDBSnapshotAttributesInput) (*request.Request, *rds.DescribeDBSnapshotAttributesOutput) - - DescribeDBSnapshotAttributes(*rds.DescribeDBSnapshotAttributesInput) (*rds.DescribeDBSnapshotAttributesOutput, error) - - DescribeDBSnapshotsRequest(*rds.DescribeDBSnapshotsInput) (*request.Request, *rds.DescribeDBSnapshotsOutput) - - DescribeDBSnapshots(*rds.DescribeDBSnapshotsInput) (*rds.DescribeDBSnapshotsOutput, error) - - DescribeDBSnapshotsPages(*rds.DescribeDBSnapshotsInput, func(*rds.DescribeDBSnapshotsOutput, bool) bool) error - - DescribeDBSubnetGroupsRequest(*rds.DescribeDBSubnetGroupsInput) (*request.Request, *rds.DescribeDBSubnetGroupsOutput) - - DescribeDBSubnetGroups(*rds.DescribeDBSubnetGroupsInput) (*rds.DescribeDBSubnetGroupsOutput, error) - - DescribeDBSubnetGroupsPages(*rds.DescribeDBSubnetGroupsInput, func(*rds.DescribeDBSubnetGroupsOutput, bool) bool) error - - DescribeEngineDefaultClusterParametersRequest(*rds.DescribeEngineDefaultClusterParametersInput) (*request.Request, *rds.DescribeEngineDefaultClusterParametersOutput) - - DescribeEngineDefaultClusterParameters(*rds.DescribeEngineDefaultClusterParametersInput) (*rds.DescribeEngineDefaultClusterParametersOutput, error) - - DescribeEngineDefaultParametersRequest(*rds.DescribeEngineDefaultParametersInput) (*request.Request, *rds.DescribeEngineDefaultParametersOutput) - - DescribeEngineDefaultParameters(*rds.DescribeEngineDefaultParametersInput) (*rds.DescribeEngineDefaultParametersOutput, error) - - DescribeEngineDefaultParametersPages(*rds.DescribeEngineDefaultParametersInput, func(*rds.DescribeEngineDefaultParametersOutput, bool) bool) error - - DescribeEventCategoriesRequest(*rds.DescribeEventCategoriesInput) (*request.Request, *rds.DescribeEventCategoriesOutput) - - DescribeEventCategories(*rds.DescribeEventCategoriesInput) (*rds.DescribeEventCategoriesOutput, error) - - DescribeEventSubscriptionsRequest(*rds.DescribeEventSubscriptionsInput) (*request.Request, *rds.DescribeEventSubscriptionsOutput) - - DescribeEventSubscriptions(*rds.DescribeEventSubscriptionsInput) (*rds.DescribeEventSubscriptionsOutput, error) - - DescribeEventSubscriptionsPages(*rds.DescribeEventSubscriptionsInput, func(*rds.DescribeEventSubscriptionsOutput, bool) bool) error - - DescribeEventsRequest(*rds.DescribeEventsInput) (*request.Request, *rds.DescribeEventsOutput) - - DescribeEvents(*rds.DescribeEventsInput) (*rds.DescribeEventsOutput, error) - - DescribeEventsPages(*rds.DescribeEventsInput, func(*rds.DescribeEventsOutput, bool) bool) error - - DescribeOptionGroupOptionsRequest(*rds.DescribeOptionGroupOptionsInput) (*request.Request, *rds.DescribeOptionGroupOptionsOutput) - - DescribeOptionGroupOptions(*rds.DescribeOptionGroupOptionsInput) (*rds.DescribeOptionGroupOptionsOutput, error) - - DescribeOptionGroupOptionsPages(*rds.DescribeOptionGroupOptionsInput, func(*rds.DescribeOptionGroupOptionsOutput, bool) bool) error - - DescribeOptionGroupsRequest(*rds.DescribeOptionGroupsInput) (*request.Request, *rds.DescribeOptionGroupsOutput) - - DescribeOptionGroups(*rds.DescribeOptionGroupsInput) (*rds.DescribeOptionGroupsOutput, error) - - DescribeOptionGroupsPages(*rds.DescribeOptionGroupsInput, func(*rds.DescribeOptionGroupsOutput, bool) bool) error - - DescribeOrderableDBInstanceOptionsRequest(*rds.DescribeOrderableDBInstanceOptionsInput) (*request.Request, *rds.DescribeOrderableDBInstanceOptionsOutput) - - DescribeOrderableDBInstanceOptions(*rds.DescribeOrderableDBInstanceOptionsInput) (*rds.DescribeOrderableDBInstanceOptionsOutput, error) - - DescribeOrderableDBInstanceOptionsPages(*rds.DescribeOrderableDBInstanceOptionsInput, func(*rds.DescribeOrderableDBInstanceOptionsOutput, bool) bool) error - - DescribePendingMaintenanceActionsRequest(*rds.DescribePendingMaintenanceActionsInput) (*request.Request, *rds.DescribePendingMaintenanceActionsOutput) - - DescribePendingMaintenanceActions(*rds.DescribePendingMaintenanceActionsInput) (*rds.DescribePendingMaintenanceActionsOutput, error) - - DescribeReservedDBInstancesRequest(*rds.DescribeReservedDBInstancesInput) (*request.Request, *rds.DescribeReservedDBInstancesOutput) - - DescribeReservedDBInstances(*rds.DescribeReservedDBInstancesInput) (*rds.DescribeReservedDBInstancesOutput, error) - - DescribeReservedDBInstancesPages(*rds.DescribeReservedDBInstancesInput, func(*rds.DescribeReservedDBInstancesOutput, bool) bool) error - - DescribeReservedDBInstancesOfferingsRequest(*rds.DescribeReservedDBInstancesOfferingsInput) (*request.Request, *rds.DescribeReservedDBInstancesOfferingsOutput) - - DescribeReservedDBInstancesOfferings(*rds.DescribeReservedDBInstancesOfferingsInput) (*rds.DescribeReservedDBInstancesOfferingsOutput, error) - - DescribeReservedDBInstancesOfferingsPages(*rds.DescribeReservedDBInstancesOfferingsInput, func(*rds.DescribeReservedDBInstancesOfferingsOutput, bool) bool) error - - DownloadDBLogFilePortionRequest(*rds.DownloadDBLogFilePortionInput) (*request.Request, *rds.DownloadDBLogFilePortionOutput) - - DownloadDBLogFilePortion(*rds.DownloadDBLogFilePortionInput) (*rds.DownloadDBLogFilePortionOutput, error) - - DownloadDBLogFilePortionPages(*rds.DownloadDBLogFilePortionInput, func(*rds.DownloadDBLogFilePortionOutput, bool) bool) error - - FailoverDBClusterRequest(*rds.FailoverDBClusterInput) (*request.Request, *rds.FailoverDBClusterOutput) - - FailoverDBCluster(*rds.FailoverDBClusterInput) (*rds.FailoverDBClusterOutput, error) - - ListTagsForResourceRequest(*rds.ListTagsForResourceInput) (*request.Request, *rds.ListTagsForResourceOutput) - - ListTagsForResource(*rds.ListTagsForResourceInput) (*rds.ListTagsForResourceOutput, error) - - ModifyDBClusterRequest(*rds.ModifyDBClusterInput) (*request.Request, *rds.ModifyDBClusterOutput) - - ModifyDBCluster(*rds.ModifyDBClusterInput) (*rds.ModifyDBClusterOutput, error) - - ModifyDBClusterParameterGroupRequest(*rds.ModifyDBClusterParameterGroupInput) (*request.Request, *rds.DBClusterParameterGroupNameMessage) - - ModifyDBClusterParameterGroup(*rds.ModifyDBClusterParameterGroupInput) (*rds.DBClusterParameterGroupNameMessage, error) - - ModifyDBInstanceRequest(*rds.ModifyDBInstanceInput) (*request.Request, *rds.ModifyDBInstanceOutput) - - ModifyDBInstance(*rds.ModifyDBInstanceInput) (*rds.ModifyDBInstanceOutput, error) - - ModifyDBParameterGroupRequest(*rds.ModifyDBParameterGroupInput) (*request.Request, *rds.DBParameterGroupNameMessage) - - ModifyDBParameterGroup(*rds.ModifyDBParameterGroupInput) (*rds.DBParameterGroupNameMessage, error) - - ModifyDBSnapshotAttributeRequest(*rds.ModifyDBSnapshotAttributeInput) (*request.Request, *rds.ModifyDBSnapshotAttributeOutput) - - ModifyDBSnapshotAttribute(*rds.ModifyDBSnapshotAttributeInput) (*rds.ModifyDBSnapshotAttributeOutput, error) - - ModifyDBSubnetGroupRequest(*rds.ModifyDBSubnetGroupInput) (*request.Request, *rds.ModifyDBSubnetGroupOutput) - - ModifyDBSubnetGroup(*rds.ModifyDBSubnetGroupInput) (*rds.ModifyDBSubnetGroupOutput, error) - - ModifyEventSubscriptionRequest(*rds.ModifyEventSubscriptionInput) (*request.Request, *rds.ModifyEventSubscriptionOutput) - - ModifyEventSubscription(*rds.ModifyEventSubscriptionInput) (*rds.ModifyEventSubscriptionOutput, error) - - ModifyOptionGroupRequest(*rds.ModifyOptionGroupInput) (*request.Request, *rds.ModifyOptionGroupOutput) - - ModifyOptionGroup(*rds.ModifyOptionGroupInput) (*rds.ModifyOptionGroupOutput, error) - - PromoteReadReplicaRequest(*rds.PromoteReadReplicaInput) (*request.Request, *rds.PromoteReadReplicaOutput) - - PromoteReadReplica(*rds.PromoteReadReplicaInput) (*rds.PromoteReadReplicaOutput, error) - - PurchaseReservedDBInstancesOfferingRequest(*rds.PurchaseReservedDBInstancesOfferingInput) (*request.Request, *rds.PurchaseReservedDBInstancesOfferingOutput) - - PurchaseReservedDBInstancesOffering(*rds.PurchaseReservedDBInstancesOfferingInput) (*rds.PurchaseReservedDBInstancesOfferingOutput, error) - - RebootDBInstanceRequest(*rds.RebootDBInstanceInput) (*request.Request, *rds.RebootDBInstanceOutput) - - RebootDBInstance(*rds.RebootDBInstanceInput) (*rds.RebootDBInstanceOutput, error) - - RemoveSourceIdentifierFromSubscriptionRequest(*rds.RemoveSourceIdentifierFromSubscriptionInput) (*request.Request, *rds.RemoveSourceIdentifierFromSubscriptionOutput) - - RemoveSourceIdentifierFromSubscription(*rds.RemoveSourceIdentifierFromSubscriptionInput) (*rds.RemoveSourceIdentifierFromSubscriptionOutput, error) - - RemoveTagsFromResourceRequest(*rds.RemoveTagsFromResourceInput) (*request.Request, *rds.RemoveTagsFromResourceOutput) - - RemoveTagsFromResource(*rds.RemoveTagsFromResourceInput) (*rds.RemoveTagsFromResourceOutput, error) - - ResetDBClusterParameterGroupRequest(*rds.ResetDBClusterParameterGroupInput) (*request.Request, *rds.DBClusterParameterGroupNameMessage) - - ResetDBClusterParameterGroup(*rds.ResetDBClusterParameterGroupInput) (*rds.DBClusterParameterGroupNameMessage, error) - - ResetDBParameterGroupRequest(*rds.ResetDBParameterGroupInput) (*request.Request, *rds.DBParameterGroupNameMessage) - - ResetDBParameterGroup(*rds.ResetDBParameterGroupInput) (*rds.DBParameterGroupNameMessage, error) - - RestoreDBClusterFromSnapshotRequest(*rds.RestoreDBClusterFromSnapshotInput) (*request.Request, *rds.RestoreDBClusterFromSnapshotOutput) - - RestoreDBClusterFromSnapshot(*rds.RestoreDBClusterFromSnapshotInput) (*rds.RestoreDBClusterFromSnapshotOutput, error) - - RestoreDBClusterToPointInTimeRequest(*rds.RestoreDBClusterToPointInTimeInput) (*request.Request, *rds.RestoreDBClusterToPointInTimeOutput) - - RestoreDBClusterToPointInTime(*rds.RestoreDBClusterToPointInTimeInput) (*rds.RestoreDBClusterToPointInTimeOutput, error) - - RestoreDBInstanceFromDBSnapshotRequest(*rds.RestoreDBInstanceFromDBSnapshotInput) (*request.Request, *rds.RestoreDBInstanceFromDBSnapshotOutput) - - RestoreDBInstanceFromDBSnapshot(*rds.RestoreDBInstanceFromDBSnapshotInput) (*rds.RestoreDBInstanceFromDBSnapshotOutput, error) - - RestoreDBInstanceToPointInTimeRequest(*rds.RestoreDBInstanceToPointInTimeInput) (*request.Request, *rds.RestoreDBInstanceToPointInTimeOutput) - - RestoreDBInstanceToPointInTime(*rds.RestoreDBInstanceToPointInTimeInput) (*rds.RestoreDBInstanceToPointInTimeOutput, error) - - RevokeDBSecurityGroupIngressRequest(*rds.RevokeDBSecurityGroupIngressInput) (*request.Request, *rds.RevokeDBSecurityGroupIngressOutput) - - RevokeDBSecurityGroupIngress(*rds.RevokeDBSecurityGroupIngressInput) (*rds.RevokeDBSecurityGroupIngressOutput, error) -} - -var _ RDSAPI = (*rds.RDS)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/redshift/redshiftiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/redshift/redshiftiface/interface.go deleted file mode 100644 index 44a538869..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/redshiftiface/interface.go +++ /dev/null @@ -1,280 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package redshiftiface provides an interface for the Amazon Redshift. -package redshiftiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/redshift" -) - -// RedshiftAPI is the interface type for redshift.Redshift. -type RedshiftAPI interface { - AuthorizeClusterSecurityGroupIngressRequest(*redshift.AuthorizeClusterSecurityGroupIngressInput) (*request.Request, *redshift.AuthorizeClusterSecurityGroupIngressOutput) - - AuthorizeClusterSecurityGroupIngress(*redshift.AuthorizeClusterSecurityGroupIngressInput) (*redshift.AuthorizeClusterSecurityGroupIngressOutput, error) - - AuthorizeSnapshotAccessRequest(*redshift.AuthorizeSnapshotAccessInput) (*request.Request, *redshift.AuthorizeSnapshotAccessOutput) - - AuthorizeSnapshotAccess(*redshift.AuthorizeSnapshotAccessInput) (*redshift.AuthorizeSnapshotAccessOutput, error) - - CopyClusterSnapshotRequest(*redshift.CopyClusterSnapshotInput) (*request.Request, *redshift.CopyClusterSnapshotOutput) - - CopyClusterSnapshot(*redshift.CopyClusterSnapshotInput) (*redshift.CopyClusterSnapshotOutput, error) - - CreateClusterRequest(*redshift.CreateClusterInput) (*request.Request, *redshift.CreateClusterOutput) - - CreateCluster(*redshift.CreateClusterInput) (*redshift.CreateClusterOutput, error) - - CreateClusterParameterGroupRequest(*redshift.CreateClusterParameterGroupInput) (*request.Request, *redshift.CreateClusterParameterGroupOutput) - - CreateClusterParameterGroup(*redshift.CreateClusterParameterGroupInput) (*redshift.CreateClusterParameterGroupOutput, error) - - CreateClusterSecurityGroupRequest(*redshift.CreateClusterSecurityGroupInput) (*request.Request, *redshift.CreateClusterSecurityGroupOutput) - - CreateClusterSecurityGroup(*redshift.CreateClusterSecurityGroupInput) (*redshift.CreateClusterSecurityGroupOutput, error) - - CreateClusterSnapshotRequest(*redshift.CreateClusterSnapshotInput) (*request.Request, *redshift.CreateClusterSnapshotOutput) - - CreateClusterSnapshot(*redshift.CreateClusterSnapshotInput) (*redshift.CreateClusterSnapshotOutput, error) - - CreateClusterSubnetGroupRequest(*redshift.CreateClusterSubnetGroupInput) (*request.Request, *redshift.CreateClusterSubnetGroupOutput) - - CreateClusterSubnetGroup(*redshift.CreateClusterSubnetGroupInput) (*redshift.CreateClusterSubnetGroupOutput, error) - - CreateEventSubscriptionRequest(*redshift.CreateEventSubscriptionInput) (*request.Request, *redshift.CreateEventSubscriptionOutput) - - CreateEventSubscription(*redshift.CreateEventSubscriptionInput) (*redshift.CreateEventSubscriptionOutput, error) - - CreateHsmClientCertificateRequest(*redshift.CreateHsmClientCertificateInput) (*request.Request, *redshift.CreateHsmClientCertificateOutput) - - CreateHsmClientCertificate(*redshift.CreateHsmClientCertificateInput) (*redshift.CreateHsmClientCertificateOutput, error) - - CreateHsmConfigurationRequest(*redshift.CreateHsmConfigurationInput) (*request.Request, *redshift.CreateHsmConfigurationOutput) - - CreateHsmConfiguration(*redshift.CreateHsmConfigurationInput) (*redshift.CreateHsmConfigurationOutput, error) - - CreateSnapshotCopyGrantRequest(*redshift.CreateSnapshotCopyGrantInput) (*request.Request, *redshift.CreateSnapshotCopyGrantOutput) - - CreateSnapshotCopyGrant(*redshift.CreateSnapshotCopyGrantInput) (*redshift.CreateSnapshotCopyGrantOutput, error) - - CreateTagsRequest(*redshift.CreateTagsInput) (*request.Request, *redshift.CreateTagsOutput) - - CreateTags(*redshift.CreateTagsInput) (*redshift.CreateTagsOutput, error) - - DeleteClusterRequest(*redshift.DeleteClusterInput) (*request.Request, *redshift.DeleteClusterOutput) - - DeleteCluster(*redshift.DeleteClusterInput) (*redshift.DeleteClusterOutput, error) - - DeleteClusterParameterGroupRequest(*redshift.DeleteClusterParameterGroupInput) (*request.Request, *redshift.DeleteClusterParameterGroupOutput) - - DeleteClusterParameterGroup(*redshift.DeleteClusterParameterGroupInput) (*redshift.DeleteClusterParameterGroupOutput, error) - - DeleteClusterSecurityGroupRequest(*redshift.DeleteClusterSecurityGroupInput) (*request.Request, *redshift.DeleteClusterSecurityGroupOutput) - - DeleteClusterSecurityGroup(*redshift.DeleteClusterSecurityGroupInput) (*redshift.DeleteClusterSecurityGroupOutput, error) - - DeleteClusterSnapshotRequest(*redshift.DeleteClusterSnapshotInput) (*request.Request, *redshift.DeleteClusterSnapshotOutput) - - DeleteClusterSnapshot(*redshift.DeleteClusterSnapshotInput) (*redshift.DeleteClusterSnapshotOutput, error) - - DeleteClusterSubnetGroupRequest(*redshift.DeleteClusterSubnetGroupInput) (*request.Request, *redshift.DeleteClusterSubnetGroupOutput) - - DeleteClusterSubnetGroup(*redshift.DeleteClusterSubnetGroupInput) (*redshift.DeleteClusterSubnetGroupOutput, error) - - DeleteEventSubscriptionRequest(*redshift.DeleteEventSubscriptionInput) (*request.Request, *redshift.DeleteEventSubscriptionOutput) - - DeleteEventSubscription(*redshift.DeleteEventSubscriptionInput) (*redshift.DeleteEventSubscriptionOutput, error) - - DeleteHsmClientCertificateRequest(*redshift.DeleteHsmClientCertificateInput) (*request.Request, *redshift.DeleteHsmClientCertificateOutput) - - DeleteHsmClientCertificate(*redshift.DeleteHsmClientCertificateInput) (*redshift.DeleteHsmClientCertificateOutput, error) - - DeleteHsmConfigurationRequest(*redshift.DeleteHsmConfigurationInput) (*request.Request, *redshift.DeleteHsmConfigurationOutput) - - DeleteHsmConfiguration(*redshift.DeleteHsmConfigurationInput) (*redshift.DeleteHsmConfigurationOutput, error) - - DeleteSnapshotCopyGrantRequest(*redshift.DeleteSnapshotCopyGrantInput) (*request.Request, *redshift.DeleteSnapshotCopyGrantOutput) - - DeleteSnapshotCopyGrant(*redshift.DeleteSnapshotCopyGrantInput) (*redshift.DeleteSnapshotCopyGrantOutput, error) - - DeleteTagsRequest(*redshift.DeleteTagsInput) (*request.Request, *redshift.DeleteTagsOutput) - - DeleteTags(*redshift.DeleteTagsInput) (*redshift.DeleteTagsOutput, error) - - DescribeClusterParameterGroupsRequest(*redshift.DescribeClusterParameterGroupsInput) (*request.Request, *redshift.DescribeClusterParameterGroupsOutput) - - DescribeClusterParameterGroups(*redshift.DescribeClusterParameterGroupsInput) (*redshift.DescribeClusterParameterGroupsOutput, error) - - DescribeClusterParameterGroupsPages(*redshift.DescribeClusterParameterGroupsInput, func(*redshift.DescribeClusterParameterGroupsOutput, bool) bool) error - - DescribeClusterParametersRequest(*redshift.DescribeClusterParametersInput) (*request.Request, *redshift.DescribeClusterParametersOutput) - - DescribeClusterParameters(*redshift.DescribeClusterParametersInput) (*redshift.DescribeClusterParametersOutput, error) - - DescribeClusterParametersPages(*redshift.DescribeClusterParametersInput, func(*redshift.DescribeClusterParametersOutput, bool) bool) error - - DescribeClusterSecurityGroupsRequest(*redshift.DescribeClusterSecurityGroupsInput) (*request.Request, *redshift.DescribeClusterSecurityGroupsOutput) - - DescribeClusterSecurityGroups(*redshift.DescribeClusterSecurityGroupsInput) (*redshift.DescribeClusterSecurityGroupsOutput, error) - - DescribeClusterSecurityGroupsPages(*redshift.DescribeClusterSecurityGroupsInput, func(*redshift.DescribeClusterSecurityGroupsOutput, bool) bool) error - - DescribeClusterSnapshotsRequest(*redshift.DescribeClusterSnapshotsInput) (*request.Request, *redshift.DescribeClusterSnapshotsOutput) - - DescribeClusterSnapshots(*redshift.DescribeClusterSnapshotsInput) (*redshift.DescribeClusterSnapshotsOutput, error) - - DescribeClusterSnapshotsPages(*redshift.DescribeClusterSnapshotsInput, func(*redshift.DescribeClusterSnapshotsOutput, bool) bool) error - - DescribeClusterSubnetGroupsRequest(*redshift.DescribeClusterSubnetGroupsInput) (*request.Request, *redshift.DescribeClusterSubnetGroupsOutput) - - DescribeClusterSubnetGroups(*redshift.DescribeClusterSubnetGroupsInput) (*redshift.DescribeClusterSubnetGroupsOutput, error) - - DescribeClusterSubnetGroupsPages(*redshift.DescribeClusterSubnetGroupsInput, func(*redshift.DescribeClusterSubnetGroupsOutput, bool) bool) error - - DescribeClusterVersionsRequest(*redshift.DescribeClusterVersionsInput) (*request.Request, *redshift.DescribeClusterVersionsOutput) - - DescribeClusterVersions(*redshift.DescribeClusterVersionsInput) (*redshift.DescribeClusterVersionsOutput, error) - - DescribeClusterVersionsPages(*redshift.DescribeClusterVersionsInput, func(*redshift.DescribeClusterVersionsOutput, bool) bool) error - - DescribeClustersRequest(*redshift.DescribeClustersInput) (*request.Request, *redshift.DescribeClustersOutput) - - DescribeClusters(*redshift.DescribeClustersInput) (*redshift.DescribeClustersOutput, error) - - DescribeClustersPages(*redshift.DescribeClustersInput, func(*redshift.DescribeClustersOutput, bool) bool) error - - DescribeDefaultClusterParametersRequest(*redshift.DescribeDefaultClusterParametersInput) (*request.Request, *redshift.DescribeDefaultClusterParametersOutput) - - DescribeDefaultClusterParameters(*redshift.DescribeDefaultClusterParametersInput) (*redshift.DescribeDefaultClusterParametersOutput, error) - - DescribeDefaultClusterParametersPages(*redshift.DescribeDefaultClusterParametersInput, func(*redshift.DescribeDefaultClusterParametersOutput, bool) bool) error - - DescribeEventCategoriesRequest(*redshift.DescribeEventCategoriesInput) (*request.Request, *redshift.DescribeEventCategoriesOutput) - - DescribeEventCategories(*redshift.DescribeEventCategoriesInput) (*redshift.DescribeEventCategoriesOutput, error) - - DescribeEventSubscriptionsRequest(*redshift.DescribeEventSubscriptionsInput) (*request.Request, *redshift.DescribeEventSubscriptionsOutput) - - DescribeEventSubscriptions(*redshift.DescribeEventSubscriptionsInput) (*redshift.DescribeEventSubscriptionsOutput, error) - - DescribeEventSubscriptionsPages(*redshift.DescribeEventSubscriptionsInput, func(*redshift.DescribeEventSubscriptionsOutput, bool) bool) error - - DescribeEventsRequest(*redshift.DescribeEventsInput) (*request.Request, *redshift.DescribeEventsOutput) - - DescribeEvents(*redshift.DescribeEventsInput) (*redshift.DescribeEventsOutput, error) - - DescribeEventsPages(*redshift.DescribeEventsInput, func(*redshift.DescribeEventsOutput, bool) bool) error - - DescribeHsmClientCertificatesRequest(*redshift.DescribeHsmClientCertificatesInput) (*request.Request, *redshift.DescribeHsmClientCertificatesOutput) - - DescribeHsmClientCertificates(*redshift.DescribeHsmClientCertificatesInput) (*redshift.DescribeHsmClientCertificatesOutput, error) - - DescribeHsmClientCertificatesPages(*redshift.DescribeHsmClientCertificatesInput, func(*redshift.DescribeHsmClientCertificatesOutput, bool) bool) error - - DescribeHsmConfigurationsRequest(*redshift.DescribeHsmConfigurationsInput) (*request.Request, *redshift.DescribeHsmConfigurationsOutput) - - DescribeHsmConfigurations(*redshift.DescribeHsmConfigurationsInput) (*redshift.DescribeHsmConfigurationsOutput, error) - - DescribeHsmConfigurationsPages(*redshift.DescribeHsmConfigurationsInput, func(*redshift.DescribeHsmConfigurationsOutput, bool) bool) error - - DescribeLoggingStatusRequest(*redshift.DescribeLoggingStatusInput) (*request.Request, *redshift.LoggingStatus) - - DescribeLoggingStatus(*redshift.DescribeLoggingStatusInput) (*redshift.LoggingStatus, error) - - DescribeOrderableClusterOptionsRequest(*redshift.DescribeOrderableClusterOptionsInput) (*request.Request, *redshift.DescribeOrderableClusterOptionsOutput) - - DescribeOrderableClusterOptions(*redshift.DescribeOrderableClusterOptionsInput) (*redshift.DescribeOrderableClusterOptionsOutput, error) - - DescribeOrderableClusterOptionsPages(*redshift.DescribeOrderableClusterOptionsInput, func(*redshift.DescribeOrderableClusterOptionsOutput, bool) bool) error - - DescribeReservedNodeOfferingsRequest(*redshift.DescribeReservedNodeOfferingsInput) (*request.Request, *redshift.DescribeReservedNodeOfferingsOutput) - - DescribeReservedNodeOfferings(*redshift.DescribeReservedNodeOfferingsInput) (*redshift.DescribeReservedNodeOfferingsOutput, error) - - DescribeReservedNodeOfferingsPages(*redshift.DescribeReservedNodeOfferingsInput, func(*redshift.DescribeReservedNodeOfferingsOutput, bool) bool) error - - DescribeReservedNodesRequest(*redshift.DescribeReservedNodesInput) (*request.Request, *redshift.DescribeReservedNodesOutput) - - DescribeReservedNodes(*redshift.DescribeReservedNodesInput) (*redshift.DescribeReservedNodesOutput, error) - - DescribeReservedNodesPages(*redshift.DescribeReservedNodesInput, func(*redshift.DescribeReservedNodesOutput, bool) bool) error - - DescribeResizeRequest(*redshift.DescribeResizeInput) (*request.Request, *redshift.DescribeResizeOutput) - - DescribeResize(*redshift.DescribeResizeInput) (*redshift.DescribeResizeOutput, error) - - DescribeSnapshotCopyGrantsRequest(*redshift.DescribeSnapshotCopyGrantsInput) (*request.Request, *redshift.DescribeSnapshotCopyGrantsOutput) - - DescribeSnapshotCopyGrants(*redshift.DescribeSnapshotCopyGrantsInput) (*redshift.DescribeSnapshotCopyGrantsOutput, error) - - DescribeTagsRequest(*redshift.DescribeTagsInput) (*request.Request, *redshift.DescribeTagsOutput) - - DescribeTags(*redshift.DescribeTagsInput) (*redshift.DescribeTagsOutput, error) - - DisableLoggingRequest(*redshift.DisableLoggingInput) (*request.Request, *redshift.LoggingStatus) - - DisableLogging(*redshift.DisableLoggingInput) (*redshift.LoggingStatus, error) - - DisableSnapshotCopyRequest(*redshift.DisableSnapshotCopyInput) (*request.Request, *redshift.DisableSnapshotCopyOutput) - - DisableSnapshotCopy(*redshift.DisableSnapshotCopyInput) (*redshift.DisableSnapshotCopyOutput, error) - - EnableLoggingRequest(*redshift.EnableLoggingInput) (*request.Request, *redshift.LoggingStatus) - - EnableLogging(*redshift.EnableLoggingInput) (*redshift.LoggingStatus, error) - - EnableSnapshotCopyRequest(*redshift.EnableSnapshotCopyInput) (*request.Request, *redshift.EnableSnapshotCopyOutput) - - EnableSnapshotCopy(*redshift.EnableSnapshotCopyInput) (*redshift.EnableSnapshotCopyOutput, error) - - ModifyClusterRequest(*redshift.ModifyClusterInput) (*request.Request, *redshift.ModifyClusterOutput) - - ModifyCluster(*redshift.ModifyClusterInput) (*redshift.ModifyClusterOutput, error) - - ModifyClusterParameterGroupRequest(*redshift.ModifyClusterParameterGroupInput) (*request.Request, *redshift.ClusterParameterGroupNameMessage) - - ModifyClusterParameterGroup(*redshift.ModifyClusterParameterGroupInput) (*redshift.ClusterParameterGroupNameMessage, error) - - ModifyClusterSubnetGroupRequest(*redshift.ModifyClusterSubnetGroupInput) (*request.Request, *redshift.ModifyClusterSubnetGroupOutput) - - ModifyClusterSubnetGroup(*redshift.ModifyClusterSubnetGroupInput) (*redshift.ModifyClusterSubnetGroupOutput, error) - - ModifyEventSubscriptionRequest(*redshift.ModifyEventSubscriptionInput) (*request.Request, *redshift.ModifyEventSubscriptionOutput) - - ModifyEventSubscription(*redshift.ModifyEventSubscriptionInput) (*redshift.ModifyEventSubscriptionOutput, error) - - ModifySnapshotCopyRetentionPeriodRequest(*redshift.ModifySnapshotCopyRetentionPeriodInput) (*request.Request, *redshift.ModifySnapshotCopyRetentionPeriodOutput) - - ModifySnapshotCopyRetentionPeriod(*redshift.ModifySnapshotCopyRetentionPeriodInput) (*redshift.ModifySnapshotCopyRetentionPeriodOutput, error) - - PurchaseReservedNodeOfferingRequest(*redshift.PurchaseReservedNodeOfferingInput) (*request.Request, *redshift.PurchaseReservedNodeOfferingOutput) - - PurchaseReservedNodeOffering(*redshift.PurchaseReservedNodeOfferingInput) (*redshift.PurchaseReservedNodeOfferingOutput, error) - - RebootClusterRequest(*redshift.RebootClusterInput) (*request.Request, *redshift.RebootClusterOutput) - - RebootCluster(*redshift.RebootClusterInput) (*redshift.RebootClusterOutput, error) - - ResetClusterParameterGroupRequest(*redshift.ResetClusterParameterGroupInput) (*request.Request, *redshift.ClusterParameterGroupNameMessage) - - ResetClusterParameterGroup(*redshift.ResetClusterParameterGroupInput) (*redshift.ClusterParameterGroupNameMessage, error) - - RestoreFromClusterSnapshotRequest(*redshift.RestoreFromClusterSnapshotInput) (*request.Request, *redshift.RestoreFromClusterSnapshotOutput) - - RestoreFromClusterSnapshot(*redshift.RestoreFromClusterSnapshotInput) (*redshift.RestoreFromClusterSnapshotOutput, error) - - RevokeClusterSecurityGroupIngressRequest(*redshift.RevokeClusterSecurityGroupIngressInput) (*request.Request, *redshift.RevokeClusterSecurityGroupIngressOutput) - - RevokeClusterSecurityGroupIngress(*redshift.RevokeClusterSecurityGroupIngressInput) (*redshift.RevokeClusterSecurityGroupIngressOutput, error) - - RevokeSnapshotAccessRequest(*redshift.RevokeSnapshotAccessInput) (*request.Request, *redshift.RevokeSnapshotAccessOutput) - - RevokeSnapshotAccess(*redshift.RevokeSnapshotAccessInput) (*redshift.RevokeSnapshotAccessOutput, error) - - RotateEncryptionKeyRequest(*redshift.RotateEncryptionKeyInput) (*request.Request, *redshift.RotateEncryptionKeyOutput) - - RotateEncryptionKey(*redshift.RotateEncryptionKeyInput) (*redshift.RotateEncryptionKeyOutput, error) -} - -var _ RedshiftAPI = (*redshift.Redshift)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go deleted file mode 100644 index a2baa130e..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go +++ /dev/null @@ -1,212 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package route53iface provides an interface for the Amazon Route 53. -package route53iface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/route53" -) - -// Route53API is the interface type for route53.Route53. -type Route53API interface { - AssociateVPCWithHostedZoneRequest(*route53.AssociateVPCWithHostedZoneInput) (*request.Request, *route53.AssociateVPCWithHostedZoneOutput) - - AssociateVPCWithHostedZone(*route53.AssociateVPCWithHostedZoneInput) (*route53.AssociateVPCWithHostedZoneOutput, error) - - ChangeResourceRecordSetsRequest(*route53.ChangeResourceRecordSetsInput) (*request.Request, *route53.ChangeResourceRecordSetsOutput) - - ChangeResourceRecordSets(*route53.ChangeResourceRecordSetsInput) (*route53.ChangeResourceRecordSetsOutput, error) - - ChangeTagsForResourceRequest(*route53.ChangeTagsForResourceInput) (*request.Request, *route53.ChangeTagsForResourceOutput) - - ChangeTagsForResource(*route53.ChangeTagsForResourceInput) (*route53.ChangeTagsForResourceOutput, error) - - CreateHealthCheckRequest(*route53.CreateHealthCheckInput) (*request.Request, *route53.CreateHealthCheckOutput) - - CreateHealthCheck(*route53.CreateHealthCheckInput) (*route53.CreateHealthCheckOutput, error) - - CreateHostedZoneRequest(*route53.CreateHostedZoneInput) (*request.Request, *route53.CreateHostedZoneOutput) - - CreateHostedZone(*route53.CreateHostedZoneInput) (*route53.CreateHostedZoneOutput, error) - - CreateReusableDelegationSetRequest(*route53.CreateReusableDelegationSetInput) (*request.Request, *route53.CreateReusableDelegationSetOutput) - - CreateReusableDelegationSet(*route53.CreateReusableDelegationSetInput) (*route53.CreateReusableDelegationSetOutput, error) - - CreateTrafficPolicyRequest(*route53.CreateTrafficPolicyInput) (*request.Request, *route53.CreateTrafficPolicyOutput) - - CreateTrafficPolicy(*route53.CreateTrafficPolicyInput) (*route53.CreateTrafficPolicyOutput, error) - - CreateTrafficPolicyInstanceRequest(*route53.CreateTrafficPolicyInstanceInput) (*request.Request, *route53.CreateTrafficPolicyInstanceOutput) - - CreateTrafficPolicyInstance(*route53.CreateTrafficPolicyInstanceInput) (*route53.CreateTrafficPolicyInstanceOutput, error) - - CreateTrafficPolicyVersionRequest(*route53.CreateTrafficPolicyVersionInput) (*request.Request, *route53.CreateTrafficPolicyVersionOutput) - - CreateTrafficPolicyVersion(*route53.CreateTrafficPolicyVersionInput) (*route53.CreateTrafficPolicyVersionOutput, error) - - DeleteHealthCheckRequest(*route53.DeleteHealthCheckInput) (*request.Request, *route53.DeleteHealthCheckOutput) - - DeleteHealthCheck(*route53.DeleteHealthCheckInput) (*route53.DeleteHealthCheckOutput, error) - - DeleteHostedZoneRequest(*route53.DeleteHostedZoneInput) (*request.Request, *route53.DeleteHostedZoneOutput) - - DeleteHostedZone(*route53.DeleteHostedZoneInput) (*route53.DeleteHostedZoneOutput, error) - - DeleteReusableDelegationSetRequest(*route53.DeleteReusableDelegationSetInput) (*request.Request, *route53.DeleteReusableDelegationSetOutput) - - DeleteReusableDelegationSet(*route53.DeleteReusableDelegationSetInput) (*route53.DeleteReusableDelegationSetOutput, error) - - DeleteTrafficPolicyRequest(*route53.DeleteTrafficPolicyInput) (*request.Request, *route53.DeleteTrafficPolicyOutput) - - DeleteTrafficPolicy(*route53.DeleteTrafficPolicyInput) (*route53.DeleteTrafficPolicyOutput, error) - - DeleteTrafficPolicyInstanceRequest(*route53.DeleteTrafficPolicyInstanceInput) (*request.Request, *route53.DeleteTrafficPolicyInstanceOutput) - - DeleteTrafficPolicyInstance(*route53.DeleteTrafficPolicyInstanceInput) (*route53.DeleteTrafficPolicyInstanceOutput, error) - - DisassociateVPCFromHostedZoneRequest(*route53.DisassociateVPCFromHostedZoneInput) (*request.Request, *route53.DisassociateVPCFromHostedZoneOutput) - - DisassociateVPCFromHostedZone(*route53.DisassociateVPCFromHostedZoneInput) (*route53.DisassociateVPCFromHostedZoneOutput, error) - - GetChangeRequest(*route53.GetChangeInput) (*request.Request, *route53.GetChangeOutput) - - GetChange(*route53.GetChangeInput) (*route53.GetChangeOutput, error) - - GetChangeDetailsRequest(*route53.GetChangeDetailsInput) (*request.Request, *route53.GetChangeDetailsOutput) - - GetChangeDetails(*route53.GetChangeDetailsInput) (*route53.GetChangeDetailsOutput, error) - - GetCheckerIpRangesRequest(*route53.GetCheckerIpRangesInput) (*request.Request, *route53.GetCheckerIpRangesOutput) - - GetCheckerIpRanges(*route53.GetCheckerIpRangesInput) (*route53.GetCheckerIpRangesOutput, error) - - GetGeoLocationRequest(*route53.GetGeoLocationInput) (*request.Request, *route53.GetGeoLocationOutput) - - GetGeoLocation(*route53.GetGeoLocationInput) (*route53.GetGeoLocationOutput, error) - - GetHealthCheckRequest(*route53.GetHealthCheckInput) (*request.Request, *route53.GetHealthCheckOutput) - - GetHealthCheck(*route53.GetHealthCheckInput) (*route53.GetHealthCheckOutput, error) - - GetHealthCheckCountRequest(*route53.GetHealthCheckCountInput) (*request.Request, *route53.GetHealthCheckCountOutput) - - GetHealthCheckCount(*route53.GetHealthCheckCountInput) (*route53.GetHealthCheckCountOutput, error) - - GetHealthCheckLastFailureReasonRequest(*route53.GetHealthCheckLastFailureReasonInput) (*request.Request, *route53.GetHealthCheckLastFailureReasonOutput) - - GetHealthCheckLastFailureReason(*route53.GetHealthCheckLastFailureReasonInput) (*route53.GetHealthCheckLastFailureReasonOutput, error) - - GetHealthCheckStatusRequest(*route53.GetHealthCheckStatusInput) (*request.Request, *route53.GetHealthCheckStatusOutput) - - GetHealthCheckStatus(*route53.GetHealthCheckStatusInput) (*route53.GetHealthCheckStatusOutput, error) - - GetHostedZoneRequest(*route53.GetHostedZoneInput) (*request.Request, *route53.GetHostedZoneOutput) - - GetHostedZone(*route53.GetHostedZoneInput) (*route53.GetHostedZoneOutput, error) - - GetHostedZoneCountRequest(*route53.GetHostedZoneCountInput) (*request.Request, *route53.GetHostedZoneCountOutput) - - GetHostedZoneCount(*route53.GetHostedZoneCountInput) (*route53.GetHostedZoneCountOutput, error) - - GetReusableDelegationSetRequest(*route53.GetReusableDelegationSetInput) (*request.Request, *route53.GetReusableDelegationSetOutput) - - GetReusableDelegationSet(*route53.GetReusableDelegationSetInput) (*route53.GetReusableDelegationSetOutput, error) - - GetTrafficPolicyRequest(*route53.GetTrafficPolicyInput) (*request.Request, *route53.GetTrafficPolicyOutput) - - GetTrafficPolicy(*route53.GetTrafficPolicyInput) (*route53.GetTrafficPolicyOutput, error) - - GetTrafficPolicyInstanceRequest(*route53.GetTrafficPolicyInstanceInput) (*request.Request, *route53.GetTrafficPolicyInstanceOutput) - - GetTrafficPolicyInstance(*route53.GetTrafficPolicyInstanceInput) (*route53.GetTrafficPolicyInstanceOutput, error) - - GetTrafficPolicyInstanceCountRequest(*route53.GetTrafficPolicyInstanceCountInput) (*request.Request, *route53.GetTrafficPolicyInstanceCountOutput) - - GetTrafficPolicyInstanceCount(*route53.GetTrafficPolicyInstanceCountInput) (*route53.GetTrafficPolicyInstanceCountOutput, error) - - ListChangeBatchesByHostedZoneRequest(*route53.ListChangeBatchesByHostedZoneInput) (*request.Request, *route53.ListChangeBatchesByHostedZoneOutput) - - ListChangeBatchesByHostedZone(*route53.ListChangeBatchesByHostedZoneInput) (*route53.ListChangeBatchesByHostedZoneOutput, error) - - ListChangeBatchesByRRSetRequest(*route53.ListChangeBatchesByRRSetInput) (*request.Request, *route53.ListChangeBatchesByRRSetOutput) - - ListChangeBatchesByRRSet(*route53.ListChangeBatchesByRRSetInput) (*route53.ListChangeBatchesByRRSetOutput, error) - - ListGeoLocationsRequest(*route53.ListGeoLocationsInput) (*request.Request, *route53.ListGeoLocationsOutput) - - ListGeoLocations(*route53.ListGeoLocationsInput) (*route53.ListGeoLocationsOutput, error) - - ListHealthChecksRequest(*route53.ListHealthChecksInput) (*request.Request, *route53.ListHealthChecksOutput) - - ListHealthChecks(*route53.ListHealthChecksInput) (*route53.ListHealthChecksOutput, error) - - ListHealthChecksPages(*route53.ListHealthChecksInput, func(*route53.ListHealthChecksOutput, bool) bool) error - - ListHostedZonesRequest(*route53.ListHostedZonesInput) (*request.Request, *route53.ListHostedZonesOutput) - - ListHostedZones(*route53.ListHostedZonesInput) (*route53.ListHostedZonesOutput, error) - - ListHostedZonesPages(*route53.ListHostedZonesInput, func(*route53.ListHostedZonesOutput, bool) bool) error - - ListHostedZonesByNameRequest(*route53.ListHostedZonesByNameInput) (*request.Request, *route53.ListHostedZonesByNameOutput) - - ListHostedZonesByName(*route53.ListHostedZonesByNameInput) (*route53.ListHostedZonesByNameOutput, error) - - ListResourceRecordSetsRequest(*route53.ListResourceRecordSetsInput) (*request.Request, *route53.ListResourceRecordSetsOutput) - - ListResourceRecordSets(*route53.ListResourceRecordSetsInput) (*route53.ListResourceRecordSetsOutput, error) - - ListResourceRecordSetsPages(*route53.ListResourceRecordSetsInput, func(*route53.ListResourceRecordSetsOutput, bool) bool) error - - ListReusableDelegationSetsRequest(*route53.ListReusableDelegationSetsInput) (*request.Request, *route53.ListReusableDelegationSetsOutput) - - ListReusableDelegationSets(*route53.ListReusableDelegationSetsInput) (*route53.ListReusableDelegationSetsOutput, error) - - ListTagsForResourceRequest(*route53.ListTagsForResourceInput) (*request.Request, *route53.ListTagsForResourceOutput) - - ListTagsForResource(*route53.ListTagsForResourceInput) (*route53.ListTagsForResourceOutput, error) - - ListTagsForResourcesRequest(*route53.ListTagsForResourcesInput) (*request.Request, *route53.ListTagsForResourcesOutput) - - ListTagsForResources(*route53.ListTagsForResourcesInput) (*route53.ListTagsForResourcesOutput, error) - - ListTrafficPoliciesRequest(*route53.ListTrafficPoliciesInput) (*request.Request, *route53.ListTrafficPoliciesOutput) - - ListTrafficPolicies(*route53.ListTrafficPoliciesInput) (*route53.ListTrafficPoliciesOutput, error) - - ListTrafficPolicyInstancesRequest(*route53.ListTrafficPolicyInstancesInput) (*request.Request, *route53.ListTrafficPolicyInstancesOutput) - - ListTrafficPolicyInstances(*route53.ListTrafficPolicyInstancesInput) (*route53.ListTrafficPolicyInstancesOutput, error) - - ListTrafficPolicyInstancesByHostedZoneRequest(*route53.ListTrafficPolicyInstancesByHostedZoneInput) (*request.Request, *route53.ListTrafficPolicyInstancesByHostedZoneOutput) - - ListTrafficPolicyInstancesByHostedZone(*route53.ListTrafficPolicyInstancesByHostedZoneInput) (*route53.ListTrafficPolicyInstancesByHostedZoneOutput, error) - - ListTrafficPolicyInstancesByPolicyRequest(*route53.ListTrafficPolicyInstancesByPolicyInput) (*request.Request, *route53.ListTrafficPolicyInstancesByPolicyOutput) - - ListTrafficPolicyInstancesByPolicy(*route53.ListTrafficPolicyInstancesByPolicyInput) (*route53.ListTrafficPolicyInstancesByPolicyOutput, error) - - ListTrafficPolicyVersionsRequest(*route53.ListTrafficPolicyVersionsInput) (*request.Request, *route53.ListTrafficPolicyVersionsOutput) - - ListTrafficPolicyVersions(*route53.ListTrafficPolicyVersionsInput) (*route53.ListTrafficPolicyVersionsOutput, error) - - UpdateHealthCheckRequest(*route53.UpdateHealthCheckInput) (*request.Request, *route53.UpdateHealthCheckOutput) - - UpdateHealthCheck(*route53.UpdateHealthCheckInput) (*route53.UpdateHealthCheckOutput, error) - - UpdateHostedZoneCommentRequest(*route53.UpdateHostedZoneCommentInput) (*request.Request, *route53.UpdateHostedZoneCommentOutput) - - UpdateHostedZoneComment(*route53.UpdateHostedZoneCommentInput) (*route53.UpdateHostedZoneCommentOutput, error) - - UpdateTrafficPolicyCommentRequest(*route53.UpdateTrafficPolicyCommentInput) (*request.Request, *route53.UpdateTrafficPolicyCommentOutput) - - UpdateTrafficPolicyComment(*route53.UpdateTrafficPolicyCommentInput) (*route53.UpdateTrafficPolicyCommentOutput, error) - - UpdateTrafficPolicyInstanceRequest(*route53.UpdateTrafficPolicyInstanceInput) (*request.Request, *route53.UpdateTrafficPolicyInstanceOutput) - - UpdateTrafficPolicyInstance(*route53.UpdateTrafficPolicyInstanceInput) (*route53.UpdateTrafficPolicyInstanceOutput, error) -} - -var _ Route53API = (*route53.Route53)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go deleted file mode 100644 index 9e66afb34..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go +++ /dev/null @@ -1,246 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package s3iface provides an interface for the Amazon Simple Storage Service. -package s3iface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/s3" -) - -// S3API is the interface type for s3.S3. -type S3API interface { - AbortMultipartUploadRequest(*s3.AbortMultipartUploadInput) (*request.Request, *s3.AbortMultipartUploadOutput) - - AbortMultipartUpload(*s3.AbortMultipartUploadInput) (*s3.AbortMultipartUploadOutput, error) - - CompleteMultipartUploadRequest(*s3.CompleteMultipartUploadInput) (*request.Request, *s3.CompleteMultipartUploadOutput) - - CompleteMultipartUpload(*s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error) - - CopyObjectRequest(*s3.CopyObjectInput) (*request.Request, *s3.CopyObjectOutput) - - CopyObject(*s3.CopyObjectInput) (*s3.CopyObjectOutput, error) - - CreateBucketRequest(*s3.CreateBucketInput) (*request.Request, *s3.CreateBucketOutput) - - CreateBucket(*s3.CreateBucketInput) (*s3.CreateBucketOutput, error) - - CreateMultipartUploadRequest(*s3.CreateMultipartUploadInput) (*request.Request, *s3.CreateMultipartUploadOutput) - - CreateMultipartUpload(*s3.CreateMultipartUploadInput) (*s3.CreateMultipartUploadOutput, error) - - DeleteBucketRequest(*s3.DeleteBucketInput) (*request.Request, *s3.DeleteBucketOutput) - - DeleteBucket(*s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error) - - DeleteBucketCorsRequest(*s3.DeleteBucketCorsInput) (*request.Request, *s3.DeleteBucketCorsOutput) - - DeleteBucketCors(*s3.DeleteBucketCorsInput) (*s3.DeleteBucketCorsOutput, error) - - DeleteBucketLifecycleRequest(*s3.DeleteBucketLifecycleInput) (*request.Request, *s3.DeleteBucketLifecycleOutput) - - DeleteBucketLifecycle(*s3.DeleteBucketLifecycleInput) (*s3.DeleteBucketLifecycleOutput, error) - - DeleteBucketPolicyRequest(*s3.DeleteBucketPolicyInput) (*request.Request, *s3.DeleteBucketPolicyOutput) - - DeleteBucketPolicy(*s3.DeleteBucketPolicyInput) (*s3.DeleteBucketPolicyOutput, error) - - DeleteBucketReplicationRequest(*s3.DeleteBucketReplicationInput) (*request.Request, *s3.DeleteBucketReplicationOutput) - - DeleteBucketReplication(*s3.DeleteBucketReplicationInput) (*s3.DeleteBucketReplicationOutput, error) - - DeleteBucketTaggingRequest(*s3.DeleteBucketTaggingInput) (*request.Request, *s3.DeleteBucketTaggingOutput) - - DeleteBucketTagging(*s3.DeleteBucketTaggingInput) (*s3.DeleteBucketTaggingOutput, error) - - DeleteBucketWebsiteRequest(*s3.DeleteBucketWebsiteInput) (*request.Request, *s3.DeleteBucketWebsiteOutput) - - DeleteBucketWebsite(*s3.DeleteBucketWebsiteInput) (*s3.DeleteBucketWebsiteOutput, error) - - DeleteObjectRequest(*s3.DeleteObjectInput) (*request.Request, *s3.DeleteObjectOutput) - - DeleteObject(*s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error) - - DeleteObjectsRequest(*s3.DeleteObjectsInput) (*request.Request, *s3.DeleteObjectsOutput) - - DeleteObjects(*s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error) - - GetBucketAclRequest(*s3.GetBucketAclInput) (*request.Request, *s3.GetBucketAclOutput) - - GetBucketAcl(*s3.GetBucketAclInput) (*s3.GetBucketAclOutput, error) - - GetBucketCorsRequest(*s3.GetBucketCorsInput) (*request.Request, *s3.GetBucketCorsOutput) - - GetBucketCors(*s3.GetBucketCorsInput) (*s3.GetBucketCorsOutput, error) - - GetBucketLifecycleRequest(*s3.GetBucketLifecycleInput) (*request.Request, *s3.GetBucketLifecycleOutput) - - GetBucketLifecycle(*s3.GetBucketLifecycleInput) (*s3.GetBucketLifecycleOutput, error) - - GetBucketLifecycleConfigurationRequest(*s3.GetBucketLifecycleConfigurationInput) (*request.Request, *s3.GetBucketLifecycleConfigurationOutput) - - GetBucketLifecycleConfiguration(*s3.GetBucketLifecycleConfigurationInput) (*s3.GetBucketLifecycleConfigurationOutput, error) - - GetBucketLocationRequest(*s3.GetBucketLocationInput) (*request.Request, *s3.GetBucketLocationOutput) - - GetBucketLocation(*s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error) - - GetBucketLoggingRequest(*s3.GetBucketLoggingInput) (*request.Request, *s3.GetBucketLoggingOutput) - - GetBucketLogging(*s3.GetBucketLoggingInput) (*s3.GetBucketLoggingOutput, error) - - GetBucketNotificationRequest(*s3.GetBucketNotificationConfigurationRequest) (*request.Request, *s3.NotificationConfigurationDeprecated) - - GetBucketNotification(*s3.GetBucketNotificationConfigurationRequest) (*s3.NotificationConfigurationDeprecated, error) - - GetBucketNotificationConfigurationRequest(*s3.GetBucketNotificationConfigurationRequest) (*request.Request, *s3.NotificationConfiguration) - - GetBucketNotificationConfiguration(*s3.GetBucketNotificationConfigurationRequest) (*s3.NotificationConfiguration, error) - - GetBucketPolicyRequest(*s3.GetBucketPolicyInput) (*request.Request, *s3.GetBucketPolicyOutput) - - GetBucketPolicy(*s3.GetBucketPolicyInput) (*s3.GetBucketPolicyOutput, error) - - GetBucketReplicationRequest(*s3.GetBucketReplicationInput) (*request.Request, *s3.GetBucketReplicationOutput) - - GetBucketReplication(*s3.GetBucketReplicationInput) (*s3.GetBucketReplicationOutput, error) - - GetBucketRequestPaymentRequest(*s3.GetBucketRequestPaymentInput) (*request.Request, *s3.GetBucketRequestPaymentOutput) - - GetBucketRequestPayment(*s3.GetBucketRequestPaymentInput) (*s3.GetBucketRequestPaymentOutput, error) - - GetBucketTaggingRequest(*s3.GetBucketTaggingInput) (*request.Request, *s3.GetBucketTaggingOutput) - - GetBucketTagging(*s3.GetBucketTaggingInput) (*s3.GetBucketTaggingOutput, error) - - GetBucketVersioningRequest(*s3.GetBucketVersioningInput) (*request.Request, *s3.GetBucketVersioningOutput) - - GetBucketVersioning(*s3.GetBucketVersioningInput) (*s3.GetBucketVersioningOutput, error) - - GetBucketWebsiteRequest(*s3.GetBucketWebsiteInput) (*request.Request, *s3.GetBucketWebsiteOutput) - - GetBucketWebsite(*s3.GetBucketWebsiteInput) (*s3.GetBucketWebsiteOutput, error) - - GetObjectRequest(*s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) - - GetObject(*s3.GetObjectInput) (*s3.GetObjectOutput, error) - - GetObjectAclRequest(*s3.GetObjectAclInput) (*request.Request, *s3.GetObjectAclOutput) - - GetObjectAcl(*s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error) - - GetObjectTorrentRequest(*s3.GetObjectTorrentInput) (*request.Request, *s3.GetObjectTorrentOutput) - - GetObjectTorrent(*s3.GetObjectTorrentInput) (*s3.GetObjectTorrentOutput, error) - - HeadBucketRequest(*s3.HeadBucketInput) (*request.Request, *s3.HeadBucketOutput) - - HeadBucket(*s3.HeadBucketInput) (*s3.HeadBucketOutput, error) - - HeadObjectRequest(*s3.HeadObjectInput) (*request.Request, *s3.HeadObjectOutput) - - HeadObject(*s3.HeadObjectInput) (*s3.HeadObjectOutput, error) - - ListBucketsRequest(*s3.ListBucketsInput) (*request.Request, *s3.ListBucketsOutput) - - ListBuckets(*s3.ListBucketsInput) (*s3.ListBucketsOutput, error) - - ListMultipartUploadsRequest(*s3.ListMultipartUploadsInput) (*request.Request, *s3.ListMultipartUploadsOutput) - - ListMultipartUploads(*s3.ListMultipartUploadsInput) (*s3.ListMultipartUploadsOutput, error) - - ListMultipartUploadsPages(*s3.ListMultipartUploadsInput, func(*s3.ListMultipartUploadsOutput, bool) bool) error - - ListObjectVersionsRequest(*s3.ListObjectVersionsInput) (*request.Request, *s3.ListObjectVersionsOutput) - - ListObjectVersions(*s3.ListObjectVersionsInput) (*s3.ListObjectVersionsOutput, error) - - ListObjectVersionsPages(*s3.ListObjectVersionsInput, func(*s3.ListObjectVersionsOutput, bool) bool) error - - ListObjectsRequest(*s3.ListObjectsInput) (*request.Request, *s3.ListObjectsOutput) - - ListObjects(*s3.ListObjectsInput) (*s3.ListObjectsOutput, error) - - ListObjectsPages(*s3.ListObjectsInput, func(*s3.ListObjectsOutput, bool) bool) error - - ListPartsRequest(*s3.ListPartsInput) (*request.Request, *s3.ListPartsOutput) - - ListParts(*s3.ListPartsInput) (*s3.ListPartsOutput, error) - - ListPartsPages(*s3.ListPartsInput, func(*s3.ListPartsOutput, bool) bool) error - - PutBucketAclRequest(*s3.PutBucketAclInput) (*request.Request, *s3.PutBucketAclOutput) - - PutBucketAcl(*s3.PutBucketAclInput) (*s3.PutBucketAclOutput, error) - - PutBucketCorsRequest(*s3.PutBucketCorsInput) (*request.Request, *s3.PutBucketCorsOutput) - - PutBucketCors(*s3.PutBucketCorsInput) (*s3.PutBucketCorsOutput, error) - - PutBucketLifecycleRequest(*s3.PutBucketLifecycleInput) (*request.Request, *s3.PutBucketLifecycleOutput) - - PutBucketLifecycle(*s3.PutBucketLifecycleInput) (*s3.PutBucketLifecycleOutput, error) - - PutBucketLifecycleConfigurationRequest(*s3.PutBucketLifecycleConfigurationInput) (*request.Request, *s3.PutBucketLifecycleConfigurationOutput) - - PutBucketLifecycleConfiguration(*s3.PutBucketLifecycleConfigurationInput) (*s3.PutBucketLifecycleConfigurationOutput, error) - - PutBucketLoggingRequest(*s3.PutBucketLoggingInput) (*request.Request, *s3.PutBucketLoggingOutput) - - PutBucketLogging(*s3.PutBucketLoggingInput) (*s3.PutBucketLoggingOutput, error) - - PutBucketNotificationRequest(*s3.PutBucketNotificationInput) (*request.Request, *s3.PutBucketNotificationOutput) - - PutBucketNotification(*s3.PutBucketNotificationInput) (*s3.PutBucketNotificationOutput, error) - - PutBucketNotificationConfigurationRequest(*s3.PutBucketNotificationConfigurationInput) (*request.Request, *s3.PutBucketNotificationConfigurationOutput) - - PutBucketNotificationConfiguration(*s3.PutBucketNotificationConfigurationInput) (*s3.PutBucketNotificationConfigurationOutput, error) - - PutBucketPolicyRequest(*s3.PutBucketPolicyInput) (*request.Request, *s3.PutBucketPolicyOutput) - - PutBucketPolicy(*s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error) - - PutBucketReplicationRequest(*s3.PutBucketReplicationInput) (*request.Request, *s3.PutBucketReplicationOutput) - - PutBucketReplication(*s3.PutBucketReplicationInput) (*s3.PutBucketReplicationOutput, error) - - PutBucketRequestPaymentRequest(*s3.PutBucketRequestPaymentInput) (*request.Request, *s3.PutBucketRequestPaymentOutput) - - PutBucketRequestPayment(*s3.PutBucketRequestPaymentInput) (*s3.PutBucketRequestPaymentOutput, error) - - PutBucketTaggingRequest(*s3.PutBucketTaggingInput) (*request.Request, *s3.PutBucketTaggingOutput) - - PutBucketTagging(*s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error) - - PutBucketVersioningRequest(*s3.PutBucketVersioningInput) (*request.Request, *s3.PutBucketVersioningOutput) - - PutBucketVersioning(*s3.PutBucketVersioningInput) (*s3.PutBucketVersioningOutput, error) - - PutBucketWebsiteRequest(*s3.PutBucketWebsiteInput) (*request.Request, *s3.PutBucketWebsiteOutput) - - PutBucketWebsite(*s3.PutBucketWebsiteInput) (*s3.PutBucketWebsiteOutput, error) - - PutObjectRequest(*s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) - - PutObject(*s3.PutObjectInput) (*s3.PutObjectOutput, error) - - PutObjectAclRequest(*s3.PutObjectAclInput) (*request.Request, *s3.PutObjectAclOutput) - - PutObjectAcl(*s3.PutObjectAclInput) (*s3.PutObjectAclOutput, error) - - RestoreObjectRequest(*s3.RestoreObjectInput) (*request.Request, *s3.RestoreObjectOutput) - - RestoreObject(*s3.RestoreObjectInput) (*s3.RestoreObjectOutput, error) - - UploadPartRequest(*s3.UploadPartInput) (*request.Request, *s3.UploadPartOutput) - - UploadPart(*s3.UploadPartInput) (*s3.UploadPartOutput, error) - - UploadPartCopyRequest(*s3.UploadPartCopyInput) (*request.Request, *s3.UploadPartCopyOutput) - - UploadPartCopy(*s3.UploadPartCopyInput) (*s3.UploadPartCopyOutput, error) -} - -var _ S3API = (*s3.S3)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go deleted file mode 100644 index 229c0d63b..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package s3manager provides utilities to upload and download objects from -// S3 concurrently. Helpful for when working with large objects. -package s3manager diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go deleted file mode 100644 index 8d6d9310f..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download.go +++ /dev/null @@ -1,354 +0,0 @@ -package s3manager - -import ( - "fmt" - "io" - "net/http" - "strconv" - "strings" - "sync" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3iface" -) - -// DefaultDownloadPartSize is the default range of bytes to get at a time when -// using Download(). -const DefaultDownloadPartSize = 1024 * 1024 * 5 - -// DefaultDownloadConcurrency is the default number of goroutines to spin up -// when using Download(). -const DefaultDownloadConcurrency = 5 - -// The Downloader structure that calls Download(). It is safe to call Download() -// on this structure for multiple objects and across concurrent goroutines. -// Mutating the Downloader's properties is not safe to be done concurrently. -type Downloader struct { - // The buffer size (in bytes) to use when buffering data into chunks and - // sending them as parts to S3. The minimum allowed part size is 5MB, and - // if this value is set to zero, the DefaultPartSize value will be used. - PartSize int64 - - // The number of goroutines to spin up in parallel when sending parts. - // If this is set to zero, the DefaultConcurrency value will be used. - Concurrency int - - // An S3 client to use when performing downloads. - S3 s3iface.S3API -} - -// NewDownloader creates a new Downloader instance to downloads objects from -// S3 in concurrent chunks. Pass in additional functional options to customize -// the downloader behavior. Requires a client.ConfigProvider in order to create -// a S3 service client. The session.Session satisfies the client.ConfigProvider -// interface. -// -// Example: -// // The session the S3 Downloader will use -// sess := session.New() -// -// // Create a downloader with the session and default options -// downloader := s3manager.NewDownloader(sess) -// -// // Create a downloader with the session and custom options -// downloader := s3manager.NewDownloader(sess, func(d *s3manager.Uploader) { -// d.PartSize = 64 * 1024 * 1024 // 64MB per part -// }) -func NewDownloader(c client.ConfigProvider, options ...func(*Downloader)) *Downloader { - d := &Downloader{ - S3: s3.New(c), - PartSize: DefaultDownloadPartSize, - Concurrency: DefaultDownloadConcurrency, - } - for _, option := range options { - option(d) - } - - return d -} - -// NewDownloaderWithClient creates a new Downloader instance to downloads -// objects from S3 in concurrent chunks. Pass in additional functional -// options to customize the downloader behavior. Requires a S3 service client -// to make S3 API calls. -// -// Example: -// // The S3 client the S3 Downloader will use -// s3Svc := s3.new(session.New()) -// -// // Create a downloader with the s3 client and default options -// downloader := s3manager.NewDownloaderWithClient(s3Svc) -// -// // Create a downloader with the s3 client and custom options -// downloader := s3manager.NewDownloaderWithClient(s3Svc, func(d *s3manager.Uploader) { -// d.PartSize = 64 * 1024 * 1024 // 64MB per part -// }) -func NewDownloaderWithClient(svc s3iface.S3API, options ...func(*Downloader)) *Downloader { - d := &Downloader{ - S3: svc, - PartSize: DefaultDownloadPartSize, - Concurrency: DefaultDownloadConcurrency, - } - for _, option := range options { - option(d) - } - - return d -} - -// Download downloads an object in S3 and writes the payload into w using -// concurrent GET requests. -// -// Additional functional options can be provided to configure the individual -// upload. These options are copies of the Uploader instance Upload is called from. -// Modifying the options will not impact the original Uploader instance. -// -// It is safe to call this method concurrently across goroutines. -// -// The w io.WriterAt can be satisfied by an os.File to do multipart concurrent -// downloads, or in memory []byte wrapper using aws.WriteAtBuffer. -func (d Downloader) Download(w io.WriterAt, input *s3.GetObjectInput, options ...func(*Downloader)) (n int64, err error) { - impl := downloader{w: w, in: input, ctx: d} - - for _, option := range options { - option(&impl.ctx) - } - - return impl.download() -} - -// downloader is the implementation structure used internally by Downloader. -type downloader struct { - ctx Downloader - - in *s3.GetObjectInput - w io.WriterAt - - wg sync.WaitGroup - m sync.Mutex - - pos int64 - totalBytes int64 - written int64 - err error -} - -// init initializes the downloader with default options. -func (d *downloader) init() { - d.totalBytes = -1 - - if d.ctx.Concurrency == 0 { - d.ctx.Concurrency = DefaultDownloadConcurrency - } - - if d.ctx.PartSize == 0 { - d.ctx.PartSize = DefaultDownloadPartSize - } -} - -// download performs the implementation of the object download across ranged -// GETs. -func (d *downloader) download() (n int64, err error) { - d.init() - - // Spin off first worker to check additional header information - d.getChunk() - - if total := d.getTotalBytes(); total >= 0 { - // Spin up workers - ch := make(chan dlchunk, d.ctx.Concurrency) - - for i := 0; i < d.ctx.Concurrency; i++ { - d.wg.Add(1) - go d.downloadPart(ch) - } - - // Assign work - for d.getErr() == nil { - if d.pos >= total { - break // We're finished queueing chunks - } - - // Queue the next range of bytes to read. - ch <- dlchunk{w: d.w, start: d.pos, size: d.ctx.PartSize} - d.pos += d.ctx.PartSize - } - - // Wait for completion - close(ch) - d.wg.Wait() - } else { - // Checking if we read anything new - for d.err == nil { - d.getChunk() - } - - // We expect a 416 error letting us know we are done downloading the - // total bytes. Since we do not know the content's length, this will - // keep grabbing chunks of data until the range of bytes specified in - // the request is out of range of the content. Once, this happens, a - // 416 should occur. - e, ok := d.err.(awserr.RequestFailure) - if ok && e.StatusCode() == http.StatusRequestedRangeNotSatisfiable { - d.err = nil - } - } - - // Return error - return d.written, d.err -} - -// downloadPart is an individual goroutine worker reading from the ch channel -// and performing a GetObject request on the data with a given byte range. -// -// If this is the first worker, this operation also resolves the total number -// of bytes to be read so that the worker manager knows when it is finished. -func (d *downloader) downloadPart(ch chan dlchunk) { - defer d.wg.Done() - for { - chunk, ok := <-ch - if !ok { - break - } - d.downloadChunk(chunk) - } -} - -// getChunk grabs a chunk of data from the body. -// Not thread safe. Should only used when grabbing data on a single thread. -func (d *downloader) getChunk() { - chunk := dlchunk{w: d.w, start: d.pos, size: d.ctx.PartSize} - d.pos += d.ctx.PartSize - d.downloadChunk(chunk) -} - -// downloadChunk downloads the chunk froom s3 -func (d *downloader) downloadChunk(chunk dlchunk) { - if d.getErr() != nil { - return - } - // Get the next byte range of data - in := &s3.GetObjectInput{} - awsutil.Copy(in, d.in) - rng := fmt.Sprintf("bytes=%d-%d", - chunk.start, chunk.start+chunk.size-1) - in.Range = &rng - - req, resp := d.ctx.S3.GetObjectRequest(in) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("S3Manager")) - err := req.Send() - - if err != nil { - d.setErr(err) - } else { - d.setTotalBytes(resp) // Set total if not yet set. - - n, err := io.Copy(&chunk, resp.Body) - resp.Body.Close() - - if err != nil { - d.setErr(err) - } - d.incrWritten(n) - } -} - -// getTotalBytes is a thread-safe getter for retrieving the total byte status. -func (d *downloader) getTotalBytes() int64 { - d.m.Lock() - defer d.m.Unlock() - - return d.totalBytes -} - -// setTotalBytes is a thread-safe setter for setting the total byte status. -// Will extract the object's total bytes from the Content-Range if the file -// will be chunked, or Content-Length. Content-Length is used when the response -// does not include a Content-Range. Meaning the object was not chunked. This -// occurs when the full file fits within the PartSize directive. -func (d *downloader) setTotalBytes(resp *s3.GetObjectOutput) { - d.m.Lock() - defer d.m.Unlock() - - if d.totalBytes >= 0 { - return - } - - if resp.ContentRange == nil { - // ContentRange is nil when the full file contents is provied, and - // is not chunked. Use ContentLength instead. - if resp.ContentLength != nil { - d.totalBytes = *resp.ContentLength - return - } - } else { - parts := strings.Split(*resp.ContentRange, "/") - - total := int64(-1) - var err error - // Checking for whether or not a numbered total exists - // If one does not exist, we will assume the total to be -1, undefined, - // and sequentially download each chunk until hitting a 416 error - totalStr := parts[len(parts)-1] - if totalStr != "*" { - total, err = strconv.ParseInt(totalStr, 10, 64) - if err != nil { - d.err = err - return - } - } - - d.totalBytes = total - } -} - -func (d *downloader) incrWritten(n int64) { - d.m.Lock() - defer d.m.Unlock() - - d.written += n -} - -// getErr is a thread-safe getter for the error object -func (d *downloader) getErr() error { - d.m.Lock() - defer d.m.Unlock() - - return d.err -} - -// setErr is a thread-safe setter for the error object -func (d *downloader) setErr(e error) { - d.m.Lock() - defer d.m.Unlock() - - d.err = e -} - -// dlchunk represents a single chunk of data to write by the worker routine. -// This structure also implements an io.SectionReader style interface for -// io.WriterAt, effectively making it an io.SectionWriter (which does not -// exist). -type dlchunk struct { - w io.WriterAt - start int64 - size int64 - cur int64 -} - -// Write wraps io.WriterAt for the dlchunk, writing from the dlchunk's start -// position to its end (or EOF). -func (c *dlchunk) Write(p []byte) (n int, err error) { - if c.cur >= c.size { - return 0, io.EOF - } - - n, err = c.w.WriteAt(p, c.start+c.cur) - c.cur += int64(n) - - return -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/s3manageriface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/s3manageriface/interface.go deleted file mode 100644 index b7d0a1256..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/s3manageriface/interface.go +++ /dev/null @@ -1,23 +0,0 @@ -// Package s3manageriface provides an interface for the s3manager package -package s3manageriface - -import ( - "io" - - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -// DownloaderAPI is the interface type for s3manager.Downloader. -type DownloaderAPI interface { - Download(io.WriterAt, *s3.GetObjectInput, ...func(*s3manager.Downloader)) (int64, error) -} - -var _ DownloaderAPI = (*s3manager.Downloader)(nil) - -// UploaderAPI is the interface type for s3manager.Uploader. -type UploaderAPI interface { - Upload(*s3manager.UploadInput, ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error) -} - -var _ UploaderAPI = (*s3manager.Uploader)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go deleted file mode 100644 index 44ee75a17..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go +++ /dev/null @@ -1,661 +0,0 @@ -package s3manager - -import ( - "bytes" - "fmt" - "io" - "sort" - "sync" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3iface" -) - -// MaxUploadParts is the maximum allowed number of parts in a multi-part upload -// on Amazon S3. -const MaxUploadParts = 10000 - -// MinUploadPartSize is the minimum allowed part size when uploading a part to -// Amazon S3. -const MinUploadPartSize int64 = 1024 * 1024 * 5 - -// DefaultUploadPartSize is the default part size to buffer chunks of a -// payload into. -const DefaultUploadPartSize = MinUploadPartSize - -// DefaultUploadConcurrency is the default number of goroutines to spin up when -// using Upload(). -const DefaultUploadConcurrency = 5 - -// A MultiUploadFailure wraps a failed S3 multipart upload. An error returned -// will satisfy this interface when a multi part upload failed to upload all -// chucks to S3. In the case of a failure the UploadID is needed to operate on -// the chunks, if any, which were uploaded. -// -// Example: -// -// u := s3manager.NewUploader(opts) -// output, err := u.upload(input) -// if err != nil { -// if multierr, ok := err.(MultiUploadFailure); ok { -// // Process error and its associated uploadID -// fmt.Println("Error:", multierr.Code(), multierr.Message(), multierr.UploadID()) -// } else { -// // Process error generically -// fmt.Println("Error:", err.Error()) -// } -// } -// -type MultiUploadFailure interface { - awserr.Error - - // Returns the upload id for the S3 multipart upload that failed. - UploadID() string -} - -// So that the Error interface type can be included as an anonymous field -// in the multiUploadError struct and not conflict with the error.Error() method. -type awsError awserr.Error - -// A multiUploadError wraps the upload ID of a failed s3 multipart upload. -// Composed of BaseError for code, message, and original error -// -// Should be used for an error that occurred failing a S3 multipart upload, -// and a upload ID is available. If an uploadID is not available a more relevant -type multiUploadError struct { - awsError - - // ID for multipart upload which failed. - uploadID string -} - -// Error returns the string representation of the error. -// -// See apierr.BaseError ErrorWithExtra for output format -// -// Satisfies the error interface. -func (m multiUploadError) Error() string { - extra := fmt.Sprintf("upload id: %s", m.uploadID) - return awserr.SprintError(m.Code(), m.Message(), extra, m.OrigErr()) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (m multiUploadError) String() string { - return m.Error() -} - -// UploadID returns the id of the S3 upload which failed. -func (m multiUploadError) UploadID() string { - return m.uploadID -} - -// UploadInput contains all input for upload requests to Amazon S3. -type UploadInput struct { - // The canned ACL to apply to the object. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string"` - - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - Key *string `location:"uri" locationName:"Key" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256, - // aws:kms). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT - // requests for an object protected by AWS KMS will fail if not made via SSL - // or using SigV4. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version - SSEKMSKeyID *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string"` - - // The type of storage to use for the object. Defaults to 'STANDARD'. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` - - // The readable body payload to send to S3. - Body io.Reader -} - -// UploadOutput represents a response from the Upload() call. -type UploadOutput struct { - // The URL where the object was uploaded to. - Location string - - // The version of the object that was uploaded. Will only be populated if - // the S3 Bucket is versioned. If the bucket is not versioned this field - // will not be set. - VersionID *string - - // The ID for a multipart upload to S3. In the case of an error the error - // can be cast to the MultiUploadFailure interface to extract the upload ID. - UploadID string -} - -// The Uploader structure that calls Upload(). It is safe to call Upload() -// on this structure for multiple objects and across concurrent goroutines. -// Mutating the Uploader's properties is not safe to be done concurrently. -type Uploader struct { - // The buffer size (in bytes) to use when buffering data into chunks and - // sending them as parts to S3. The minimum allowed part size is 5MB, and - // if this value is set to zero, the DefaultPartSize value will be used. - PartSize int64 - - // The number of goroutines to spin up in parallel when sending parts. - // If this is set to zero, the DefaultConcurrency value will be used. - Concurrency int - - // Setting this value to true will cause the SDK to avoid calling - // AbortMultipartUpload on a failure, leaving all successfully uploaded - // parts on S3 for manual recovery. - // - // Note that storing parts of an incomplete multipart upload counts towards - // space usage on S3 and will add additional costs if not cleaned up. - LeavePartsOnError bool - - // MaxUploadParts is the max number of parts which will be uploaded to S3. - // Will be used to calculate the partsize of the object to be uploaded. - // E.g: 5GB file, with MaxUploadParts set to 100, will upload the file - // as 100, 50MB parts. - // With a limited of s3.MaxUploadParts (10,000 parts). - MaxUploadParts int - - // The client to use when uploading to S3. - S3 s3iface.S3API -} - -// NewUploader creates a new Uploader instance to upload objects to S3. Pass In -// additional functional options to customize the uploader's behavior. Requires a -// client.ConfigProvider in order to create a S3 service client. The session.Session -// satisfies the client.ConfigProvider interface. -// -// Example: -// // The session the S3 Uploader will use -// sess := session.New() -// -// // Create an uploader with the session and default options -// uploader := s3manager.NewUploader(sess) -// -// // Create an uploader with the session and custom options -// uploader := s3manager.NewUploader(session, func(u *s3manager.Uploader) { -// u.PartSize = 64 * 1024 * 1024 // 64MB per part -// }) -func NewUploader(c client.ConfigProvider, options ...func(*Uploader)) *Uploader { - u := &Uploader{ - S3: s3.New(c), - PartSize: DefaultUploadPartSize, - Concurrency: DefaultUploadConcurrency, - LeavePartsOnError: false, - MaxUploadParts: MaxUploadParts, - } - - for _, option := range options { - option(u) - } - - return u -} - -// NewUploaderWithClient creates a new Uploader instance to upload objects to S3. Pass in -// additional functional options to customize the uploader's behavior. Requires -// a S3 service client to make S3 API calls. -// -// Example: -// // S3 service client the Upload manager will use. -// s3Svc := s3.New(session.New()) -// -// // Create an uploader with S3 client and default options -// uploader := s3manager.NewUploaderWithClient(s3Svc) -// -// // Create an uploader with S3 client and custom options -// uploader := s3manager.NewUploaderWithClient(s3Svc, func(u *s3manager.Uploader) { -// u.PartSize = 64 * 1024 * 1024 // 64MB per part -// }) -func NewUploaderWithClient(svc s3iface.S3API, options ...func(*Uploader)) *Uploader { - u := &Uploader{ - S3: svc, - PartSize: DefaultUploadPartSize, - Concurrency: DefaultUploadConcurrency, - LeavePartsOnError: false, - MaxUploadParts: MaxUploadParts, - } - - for _, option := range options { - option(u) - } - - return u -} - -// Upload uploads an object to S3, intelligently buffering large files into -// smaller chunks and sending them in parallel across multiple goroutines. You -// can configure the buffer size and concurrency through the Uploader's parameters. -// -// Additional functional options can be provided to configure the individual -// upload. These options are copies of the Uploader instance Upload is called from. -// Modifying the options will not impact the original Uploader instance. -// -// It is safe to call this method concurrently across goroutines. -// -// Example: -// // Upload input parameters -// upParams := &s3manager.UploadInput{ -// Bucket: &bucketName, -// Key: &keyName, -// Body: file, -// } -// -// // Perform an upload. -// result, err := uploader.Upload(upParams) -// -// // Perform upload with options different than the those in the Uploader. -// result, err := uploader.Upload(upParams, func(u *s3manager.Uploader) { -// u.PartSize = 10 * 1024 * 1024 // 10MB part size -// u.LeavePartsOnError = true // Dont delete the parts if the upload fails. -// }) -func (u Uploader) Upload(input *UploadInput, options ...func(*Uploader)) (*UploadOutput, error) { - i := uploader{in: input, ctx: u} - - for _, option := range options { - option(&i.ctx) - } - - return i.upload() -} - -// internal structure to manage an upload to S3. -type uploader struct { - ctx Uploader - - in *UploadInput - - readerPos int64 // current reader position - totalSize int64 // set to -1 if the size is not known -} - -// internal logic for deciding whether to upload a single part or use a -// multipart upload. -func (u *uploader) upload() (*UploadOutput, error) { - u.init() - - if u.ctx.PartSize < MinUploadPartSize { - msg := fmt.Sprintf("part size must be at least %d bytes", MinUploadPartSize) - return nil, awserr.New("ConfigError", msg, nil) - } - - // Do one read to determine if we have more than one part - buf, err := u.nextReader() - if err == io.EOF || err == io.ErrUnexpectedEOF { // single part - return u.singlePart(buf) - } else if err != nil { - return nil, awserr.New("ReadRequestBody", "read upload data failed", err) - } - - mu := multiuploader{uploader: u} - return mu.upload(buf) -} - -// init will initialize all default options. -func (u *uploader) init() { - if u.ctx.Concurrency == 0 { - u.ctx.Concurrency = DefaultUploadConcurrency - } - if u.ctx.PartSize == 0 { - u.ctx.PartSize = DefaultUploadPartSize - } - - // Try to get the total size for some optimizations - u.initSize() -} - -// initSize tries to detect the total stream size, setting u.totalSize. If -// the size is not known, totalSize is set to -1. -func (u *uploader) initSize() { - u.totalSize = -1 - - switch r := u.in.Body.(type) { - case io.Seeker: - pos, _ := r.Seek(0, 1) - defer r.Seek(pos, 0) - - n, err := r.Seek(0, 2) - if err != nil { - return - } - u.totalSize = n - - // Try to adjust partSize if it is too small and account for - // integer division truncation. - if u.totalSize/u.ctx.PartSize >= int64(u.ctx.MaxUploadParts) { - // Add one to the part size to account for remainders - // during the size calculation. e.g odd number of bytes. - u.ctx.PartSize = (u.totalSize / int64(u.ctx.MaxUploadParts)) + 1 - } - } -} - -// nextReader returns a seekable reader representing the next packet of data. -// This operation increases the shared u.readerPos counter, but note that it -// does not need to be wrapped in a mutex because nextReader is only called -// from the main thread. -func (u *uploader) nextReader() (io.ReadSeeker, error) { - switch r := u.in.Body.(type) { - case io.ReaderAt: - var err error - - n := u.ctx.PartSize - if u.totalSize >= 0 { - bytesLeft := u.totalSize - u.readerPos - - if bytesLeft == 0 { - err = io.EOF - n = bytesLeft - } else if bytesLeft <= u.ctx.PartSize { - err = io.ErrUnexpectedEOF - n = bytesLeft - } - } - - buf := io.NewSectionReader(r, u.readerPos, n) - u.readerPos += n - - return buf, err - - default: - packet := make([]byte, u.ctx.PartSize) - n, err := io.ReadFull(u.in.Body, packet) - u.readerPos += int64(n) - - return bytes.NewReader(packet[0:n]), err - } -} - -// singlePart contains upload logic for uploading a single chunk via -// a regular PutObject request. Multipart requests require at least two -// parts, or at least 5MB of data. -func (u *uploader) singlePart(buf io.ReadSeeker) (*UploadOutput, error) { - params := &s3.PutObjectInput{} - awsutil.Copy(params, u.in) - params.Body = buf - - req, out := u.ctx.S3.PutObjectRequest(params) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("S3Manager")) - if err := req.Send(); err != nil { - return nil, err - } - - url := req.HTTPRequest.URL.String() - return &UploadOutput{ - Location: url, - VersionID: out.VersionId, - }, nil -} - -// internal structure to manage a specific multipart upload to S3. -type multiuploader struct { - *uploader - wg sync.WaitGroup - m sync.Mutex - err error - uploadID string - parts completedParts -} - -// keeps track of a single chunk of data being sent to S3. -type chunk struct { - buf io.ReadSeeker - num int64 -} - -// completedParts is a wrapper to make parts sortable by their part number, -// since S3 required this list to be sent in sorted order. -type completedParts []*s3.CompletedPart - -func (a completedParts) Len() int { return len(a) } -func (a completedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a completedParts) Less(i, j int) bool { return *a[i].PartNumber < *a[j].PartNumber } - -// upload will perform a multipart upload using the firstBuf buffer containing -// the first chunk of data. -func (u *multiuploader) upload(firstBuf io.ReadSeeker) (*UploadOutput, error) { - params := &s3.CreateMultipartUploadInput{} - awsutil.Copy(params, u.in) - - // Create the multipart - req, resp := u.ctx.S3.CreateMultipartUploadRequest(params) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("S3Manager")) - if err := req.Send(); err != nil { - return nil, err - } - u.uploadID = *resp.UploadId - - // Create the workers - ch := make(chan chunk, u.ctx.Concurrency) - for i := 0; i < u.ctx.Concurrency; i++ { - u.wg.Add(1) - go u.readChunk(ch) - } - - // Send part 1 to the workers - var num int64 = 1 - ch <- chunk{buf: firstBuf, num: num} - - // Read and queue the rest of the parts - for u.geterr() == nil { - // This upload exceeded maximum number of supported parts, error now. - if num > int64(u.ctx.MaxUploadParts) || num > int64(MaxUploadParts) { - var msg string - if num > int64(u.ctx.MaxUploadParts) { - msg = fmt.Sprintf("exceeded total allowed configured MaxUploadParts (%d). Adjust PartSize to fit in this limit", - u.ctx.MaxUploadParts) - } else { - msg = fmt.Sprintf("exceeded total allowed S3 limit MaxUploadParts (%d). Adjust PartSize to fit in this limit", - MaxUploadParts) - } - u.seterr(awserr.New("TotalPartsExceeded", msg, nil)) - break - } - num++ - - buf, err := u.nextReader() - if err == io.EOF { - break - } - - ch <- chunk{buf: buf, num: num} - - if err != nil && err != io.ErrUnexpectedEOF { - u.seterr(awserr.New( - "ReadRequestBody", - "read multipart upload data failed", - err)) - break - } - } - - // Close the channel, wait for workers, and complete upload - close(ch) - u.wg.Wait() - complete := u.complete() - - if err := u.geterr(); err != nil { - return nil, &multiUploadError{ - awsError: awserr.New( - "MultipartUpload", - "upload multipart failed", - err), - uploadID: u.uploadID, - } - } - return &UploadOutput{ - Location: *complete.Location, - VersionID: complete.VersionId, - UploadID: u.uploadID, - }, nil -} - -// readChunk runs in worker goroutines to pull chunks off of the ch channel -// and send() them as UploadPart requests. -func (u *multiuploader) readChunk(ch chan chunk) { - defer u.wg.Done() - for { - data, ok := <-ch - - if !ok { - break - } - - if u.geterr() == nil { - if err := u.send(data); err != nil { - u.seterr(err) - } - } - } -} - -// send performs an UploadPart request and keeps track of the completed -// part information. -func (u *multiuploader) send(c chunk) error { - req, resp := u.ctx.S3.UploadPartRequest(&s3.UploadPartInput{ - Bucket: u.in.Bucket, - Key: u.in.Key, - Body: c.buf, - UploadId: &u.uploadID, - PartNumber: &c.num, - }) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("S3Manager")) - if err := req.Send(); err != nil { - return err - } - - n := c.num - completed := &s3.CompletedPart{ETag: resp.ETag, PartNumber: &n} - - u.m.Lock() - u.parts = append(u.parts, completed) - u.m.Unlock() - - return nil -} - -// geterr is a thread-safe getter for the error object -func (u *multiuploader) geterr() error { - u.m.Lock() - defer u.m.Unlock() - - return u.err -} - -// seterr is a thread-safe setter for the error object -func (u *multiuploader) seterr(e error) { - u.m.Lock() - defer u.m.Unlock() - - u.err = e -} - -// fail will abort the multipart unless LeavePartsOnError is set to true. -func (u *multiuploader) fail() { - if u.ctx.LeavePartsOnError { - return - } - - req, _ := u.ctx.S3.AbortMultipartUploadRequest(&s3.AbortMultipartUploadInput{ - Bucket: u.in.Bucket, - Key: u.in.Key, - UploadId: &u.uploadID, - }) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("S3Manager")) - req.Send() -} - -// complete successfully completes a multipart upload and returns the response. -func (u *multiuploader) complete() *s3.CompleteMultipartUploadOutput { - if u.geterr() != nil { - u.fail() - return nil - } - - // Parts must be sorted in PartNumber order. - sort.Sort(u.parts) - - req, resp := u.ctx.S3.CompleteMultipartUploadRequest(&s3.CompleteMultipartUploadInput{ - Bucket: u.in.Bucket, - Key: u.in.Key, - UploadId: &u.uploadID, - MultipartUpload: &s3.CompletedMultipartUpload{Parts: u.parts}, - }) - req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("S3Manager")) - if err := req.Send(); err != nil { - u.seterr(err) - u.fail() - } - - return resp -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sns/snsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sns/snsiface/interface.go deleted file mode 100644 index 0df9e5024..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/snsiface/interface.go +++ /dev/null @@ -1,124 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package snsiface provides an interface for the Amazon Simple Notification Service. -package snsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/sns" -) - -// SNSAPI is the interface type for sns.SNS. -type SNSAPI interface { - AddPermissionRequest(*sns.AddPermissionInput) (*request.Request, *sns.AddPermissionOutput) - - AddPermission(*sns.AddPermissionInput) (*sns.AddPermissionOutput, error) - - ConfirmSubscriptionRequest(*sns.ConfirmSubscriptionInput) (*request.Request, *sns.ConfirmSubscriptionOutput) - - ConfirmSubscription(*sns.ConfirmSubscriptionInput) (*sns.ConfirmSubscriptionOutput, error) - - CreatePlatformApplicationRequest(*sns.CreatePlatformApplicationInput) (*request.Request, *sns.CreatePlatformApplicationOutput) - - CreatePlatformApplication(*sns.CreatePlatformApplicationInput) (*sns.CreatePlatformApplicationOutput, error) - - CreatePlatformEndpointRequest(*sns.CreatePlatformEndpointInput) (*request.Request, *sns.CreatePlatformEndpointOutput) - - CreatePlatformEndpoint(*sns.CreatePlatformEndpointInput) (*sns.CreatePlatformEndpointOutput, error) - - CreateTopicRequest(*sns.CreateTopicInput) (*request.Request, *sns.CreateTopicOutput) - - CreateTopic(*sns.CreateTopicInput) (*sns.CreateTopicOutput, error) - - DeleteEndpointRequest(*sns.DeleteEndpointInput) (*request.Request, *sns.DeleteEndpointOutput) - - DeleteEndpoint(*sns.DeleteEndpointInput) (*sns.DeleteEndpointOutput, error) - - DeletePlatformApplicationRequest(*sns.DeletePlatformApplicationInput) (*request.Request, *sns.DeletePlatformApplicationOutput) - - DeletePlatformApplication(*sns.DeletePlatformApplicationInput) (*sns.DeletePlatformApplicationOutput, error) - - DeleteTopicRequest(*sns.DeleteTopicInput) (*request.Request, *sns.DeleteTopicOutput) - - DeleteTopic(*sns.DeleteTopicInput) (*sns.DeleteTopicOutput, error) - - GetEndpointAttributesRequest(*sns.GetEndpointAttributesInput) (*request.Request, *sns.GetEndpointAttributesOutput) - - GetEndpointAttributes(*sns.GetEndpointAttributesInput) (*sns.GetEndpointAttributesOutput, error) - - GetPlatformApplicationAttributesRequest(*sns.GetPlatformApplicationAttributesInput) (*request.Request, *sns.GetPlatformApplicationAttributesOutput) - - GetPlatformApplicationAttributes(*sns.GetPlatformApplicationAttributesInput) (*sns.GetPlatformApplicationAttributesOutput, error) - - GetSubscriptionAttributesRequest(*sns.GetSubscriptionAttributesInput) (*request.Request, *sns.GetSubscriptionAttributesOutput) - - GetSubscriptionAttributes(*sns.GetSubscriptionAttributesInput) (*sns.GetSubscriptionAttributesOutput, error) - - GetTopicAttributesRequest(*sns.GetTopicAttributesInput) (*request.Request, *sns.GetTopicAttributesOutput) - - GetTopicAttributes(*sns.GetTopicAttributesInput) (*sns.GetTopicAttributesOutput, error) - - ListEndpointsByPlatformApplicationRequest(*sns.ListEndpointsByPlatformApplicationInput) (*request.Request, *sns.ListEndpointsByPlatformApplicationOutput) - - ListEndpointsByPlatformApplication(*sns.ListEndpointsByPlatformApplicationInput) (*sns.ListEndpointsByPlatformApplicationOutput, error) - - ListEndpointsByPlatformApplicationPages(*sns.ListEndpointsByPlatformApplicationInput, func(*sns.ListEndpointsByPlatformApplicationOutput, bool) bool) error - - ListPlatformApplicationsRequest(*sns.ListPlatformApplicationsInput) (*request.Request, *sns.ListPlatformApplicationsOutput) - - ListPlatformApplications(*sns.ListPlatformApplicationsInput) (*sns.ListPlatformApplicationsOutput, error) - - ListPlatformApplicationsPages(*sns.ListPlatformApplicationsInput, func(*sns.ListPlatformApplicationsOutput, bool) bool) error - - ListSubscriptionsRequest(*sns.ListSubscriptionsInput) (*request.Request, *sns.ListSubscriptionsOutput) - - ListSubscriptions(*sns.ListSubscriptionsInput) (*sns.ListSubscriptionsOutput, error) - - ListSubscriptionsPages(*sns.ListSubscriptionsInput, func(*sns.ListSubscriptionsOutput, bool) bool) error - - ListSubscriptionsByTopicRequest(*sns.ListSubscriptionsByTopicInput) (*request.Request, *sns.ListSubscriptionsByTopicOutput) - - ListSubscriptionsByTopic(*sns.ListSubscriptionsByTopicInput) (*sns.ListSubscriptionsByTopicOutput, error) - - ListSubscriptionsByTopicPages(*sns.ListSubscriptionsByTopicInput, func(*sns.ListSubscriptionsByTopicOutput, bool) bool) error - - ListTopicsRequest(*sns.ListTopicsInput) (*request.Request, *sns.ListTopicsOutput) - - ListTopics(*sns.ListTopicsInput) (*sns.ListTopicsOutput, error) - - ListTopicsPages(*sns.ListTopicsInput, func(*sns.ListTopicsOutput, bool) bool) error - - PublishRequest(*sns.PublishInput) (*request.Request, *sns.PublishOutput) - - Publish(*sns.PublishInput) (*sns.PublishOutput, error) - - RemovePermissionRequest(*sns.RemovePermissionInput) (*request.Request, *sns.RemovePermissionOutput) - - RemovePermission(*sns.RemovePermissionInput) (*sns.RemovePermissionOutput, error) - - SetEndpointAttributesRequest(*sns.SetEndpointAttributesInput) (*request.Request, *sns.SetEndpointAttributesOutput) - - SetEndpointAttributes(*sns.SetEndpointAttributesInput) (*sns.SetEndpointAttributesOutput, error) - - SetPlatformApplicationAttributesRequest(*sns.SetPlatformApplicationAttributesInput) (*request.Request, *sns.SetPlatformApplicationAttributesOutput) - - SetPlatformApplicationAttributes(*sns.SetPlatformApplicationAttributesInput) (*sns.SetPlatformApplicationAttributesOutput, error) - - SetSubscriptionAttributesRequest(*sns.SetSubscriptionAttributesInput) (*request.Request, *sns.SetSubscriptionAttributesOutput) - - SetSubscriptionAttributes(*sns.SetSubscriptionAttributesInput) (*sns.SetSubscriptionAttributesOutput, error) - - SetTopicAttributesRequest(*sns.SetTopicAttributesInput) (*request.Request, *sns.SetTopicAttributesOutput) - - SetTopicAttributes(*sns.SetTopicAttributesInput) (*sns.SetTopicAttributesOutput, error) - - SubscribeRequest(*sns.SubscribeInput) (*request.Request, *sns.SubscribeOutput) - - Subscribe(*sns.SubscribeInput) (*sns.SubscribeOutput, error) - - UnsubscribeRequest(*sns.UnsubscribeInput) (*request.Request, *sns.UnsubscribeOutput) - - Unsubscribe(*sns.UnsubscribeInput) (*sns.UnsubscribeOutput, error) -} - -var _ SNSAPI = (*sns.SNS)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go deleted file mode 100644 index 55647fa17..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go +++ /dev/null @@ -1,82 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -// Package sqsiface provides an interface for the Amazon Simple Queue Service. -package sqsiface - -import ( - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/sqs" -) - -// SQSAPI is the interface type for sqs.SQS. -type SQSAPI interface { - AddPermissionRequest(*sqs.AddPermissionInput) (*request.Request, *sqs.AddPermissionOutput) - - AddPermission(*sqs.AddPermissionInput) (*sqs.AddPermissionOutput, error) - - ChangeMessageVisibilityRequest(*sqs.ChangeMessageVisibilityInput) (*request.Request, *sqs.ChangeMessageVisibilityOutput) - - ChangeMessageVisibility(*sqs.ChangeMessageVisibilityInput) (*sqs.ChangeMessageVisibilityOutput, error) - - ChangeMessageVisibilityBatchRequest(*sqs.ChangeMessageVisibilityBatchInput) (*request.Request, *sqs.ChangeMessageVisibilityBatchOutput) - - ChangeMessageVisibilityBatch(*sqs.ChangeMessageVisibilityBatchInput) (*sqs.ChangeMessageVisibilityBatchOutput, error) - - CreateQueueRequest(*sqs.CreateQueueInput) (*request.Request, *sqs.CreateQueueOutput) - - CreateQueue(*sqs.CreateQueueInput) (*sqs.CreateQueueOutput, error) - - DeleteMessageRequest(*sqs.DeleteMessageInput) (*request.Request, *sqs.DeleteMessageOutput) - - DeleteMessage(*sqs.DeleteMessageInput) (*sqs.DeleteMessageOutput, error) - - DeleteMessageBatchRequest(*sqs.DeleteMessageBatchInput) (*request.Request, *sqs.DeleteMessageBatchOutput) - - DeleteMessageBatch(*sqs.DeleteMessageBatchInput) (*sqs.DeleteMessageBatchOutput, error) - - DeleteQueueRequest(*sqs.DeleteQueueInput) (*request.Request, *sqs.DeleteQueueOutput) - - DeleteQueue(*sqs.DeleteQueueInput) (*sqs.DeleteQueueOutput, error) - - GetQueueAttributesRequest(*sqs.GetQueueAttributesInput) (*request.Request, *sqs.GetQueueAttributesOutput) - - GetQueueAttributes(*sqs.GetQueueAttributesInput) (*sqs.GetQueueAttributesOutput, error) - - GetQueueUrlRequest(*sqs.GetQueueUrlInput) (*request.Request, *sqs.GetQueueUrlOutput) - - GetQueueUrl(*sqs.GetQueueUrlInput) (*sqs.GetQueueUrlOutput, error) - - ListDeadLetterSourceQueuesRequest(*sqs.ListDeadLetterSourceQueuesInput) (*request.Request, *sqs.ListDeadLetterSourceQueuesOutput) - - ListDeadLetterSourceQueues(*sqs.ListDeadLetterSourceQueuesInput) (*sqs.ListDeadLetterSourceQueuesOutput, error) - - ListQueuesRequest(*sqs.ListQueuesInput) (*request.Request, *sqs.ListQueuesOutput) - - ListQueues(*sqs.ListQueuesInput) (*sqs.ListQueuesOutput, error) - - PurgeQueueRequest(*sqs.PurgeQueueInput) (*request.Request, *sqs.PurgeQueueOutput) - - PurgeQueue(*sqs.PurgeQueueInput) (*sqs.PurgeQueueOutput, error) - - ReceiveMessageRequest(*sqs.ReceiveMessageInput) (*request.Request, *sqs.ReceiveMessageOutput) - - ReceiveMessage(*sqs.ReceiveMessageInput) (*sqs.ReceiveMessageOutput, error) - - RemovePermissionRequest(*sqs.RemovePermissionInput) (*request.Request, *sqs.RemovePermissionOutput) - - RemovePermission(*sqs.RemovePermissionInput) (*sqs.RemovePermissionOutput, error) - - SendMessageRequest(*sqs.SendMessageInput) (*request.Request, *sqs.SendMessageOutput) - - SendMessage(*sqs.SendMessageInput) (*sqs.SendMessageOutput, error) - - SendMessageBatchRequest(*sqs.SendMessageBatchInput) (*request.Request, *sqs.SendMessageBatchOutput) - - SendMessageBatch(*sqs.SendMessageBatchInput) (*sqs.SendMessageBatchOutput, error) - - SetQueueAttributesRequest(*sqs.SetQueueAttributesInput) (*request.Request, *sqs.SetQueueAttributesOutput) - - SetQueueAttributes(*sqs.SetQueueAttributesInput) (*sqs.SetQueueAttributesOutput, error) -} - -var _ SQSAPI = (*sqs.SQS)(nil) diff --git a/vendor/github.com/bgentry/speakeasy/example/main.go b/vendor/github.com/bgentry/speakeasy/example/main.go deleted file mode 100644 index d71153a16..000000000 --- a/vendor/github.com/bgentry/speakeasy/example/main.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "github.com/bgentry/speakeasy" -) - -func main() { - password, err := speakeasy.Ask("Please enter a password: ") - if err != nil { - fmt.Println(err) - os.Exit(1) - } - fmt.Printf("Password result: %q\n", password) - fmt.Printf("Password len: %d\n", len(password)) -} diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/akrennmair/gopcap/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/akrennmair/gopcap/LICENSE deleted file mode 100644 index 385fac9f2..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/akrennmair/gopcap/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Andreas Krennmair nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/bgentry/speakeasy/LICENSE_WINDOWS b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/bgentry/speakeasy/LICENSE_WINDOWS deleted file mode 100644 index ff177f612..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/bgentry/speakeasy/LICENSE_WINDOWS +++ /dev/null @@ -1,201 +0,0 @@ - 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 [2013] [the CloudFoundry Authors] - -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/coreos/etcd/Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE deleted file mode 100644 index 004e77fe5..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Ben Johnson - -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/coreos/etcd/Godeps/_workspace/src/github.com/cheggaaa/pb/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/cheggaaa/pb/LICENSE deleted file mode 100644 index 13ef3fe53..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/cheggaaa/pb/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Sergey Cherepanov -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli/LICENSE deleted file mode 100644 index 5515ccfb7..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (C) 2013 Jeremy Saenz -All Rights Reserved. - -MIT LICENSE - -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/coreos/etcd/Godeps/_workspace/src/github.com/coreos/gexpect/LICENCE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/gexpect/LICENCE deleted file mode 100644 index 50adb0f19..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/gexpect/LICENCE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (C) 2014 Thomas Rooney - -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. \ No newline at end of file diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/LICENSE.md b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/LICENSE.md deleted file mode 100644 index 1cade6cef..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Brian Goff - -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/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/LICENSE deleted file mode 100644 index 335e38e19..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/LICENSE +++ /dev/null @@ -1,36 +0,0 @@ -Extensions for Protocol Buffers to create more go like structures. - -Copyright (c) 2013, Vastech SA (PTY) LTD. All rights reserved. -http://github.com/gogo/protobuf/gogoproto - -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/golang/glog/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/golang/glog/LICENSE deleted file mode 100644 index 37ec93a14..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/golang/glog/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -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: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -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 -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/coreos/etcd/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 1b1b1921e..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/google/btree/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/google/btree/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/google/btree/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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/coreos/etcd/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE deleted file mode 100644 index 5f0d1fb6a..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2014 Alan Shreve - -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/coreos/etcd/Godeps/_workspace/src/github.com/jonboulle/clockwork/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/jonboulle/clockwork/LICENSE deleted file mode 100644 index 5c304d1a4..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/jonboulle/clockwork/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ -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/coreos/etcd/Godeps/_workspace/src/github.com/kballard/go-shellquote/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/kballard/go-shellquote/LICENSE deleted file mode 100644 index a6d77312e..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/kballard/go-shellquote/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014 Kevin Ballard - -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/coreos/etcd/Godeps/_workspace/src/github.com/kr/pty/License b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/kr/pty/License deleted file mode 100644 index 6b7558b6b..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/kr/pty/License +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2011 Keith Rarick - -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/coreos/etcd/Godeps/_workspace/src/github.com/olekukonko/ts/LICENCE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/olekukonko/ts/LICENCE deleted file mode 100644 index 1fd848425..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/olekukonko/ts/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014 by Oleku Konko - -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. \ No newline at end of file diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - 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/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE deleted file mode 100644 index 53c5e9aa1..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE +++ /dev/null @@ -1,7 +0,0 @@ -procfs provides functions to retrieve system, kernel and process -metrics from the pseudo-filesystem proc. - -Copyright 2014-2015 The Prometheus Authors - -This product includes software developed at -SoundCloud Ltd. (http://soundcloud.com/). diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/russross/blackfriday/LICENSE.txt b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/russross/blackfriday/LICENSE.txt deleted file mode 100644 index 2885af360..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/russross/blackfriday/LICENSE.txt +++ /dev/null @@ -1,29 +0,0 @@ -Blackfriday is distributed under the Simplified BSD License: - -> Copyright © 2011 Russ Ross -> All rights reserved. -> -> Redistribution and use in source and binary forms, with or without -> modification, are permitted provided that the following conditions -> are met: -> -> 1. Redistributions of source code must retain the above copyright -> notice, this list of conditions and the following disclaimer. -> -> 2. Redistributions in binary form must reproduce the above -> copyright notice, this list of conditions and the following -> disclaimer in the documentation and/or other materials provided with -> the distribution. -> -> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -> FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -> COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -> INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -> BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -> LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -> ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -> POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/shurcooL/sanitized_anchor_name/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/shurcooL/sanitized_anchor_name/LICENSE deleted file mode 100644 index 5f4e3ed57..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/shurcooL/sanitized_anchor_name/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Dmitri Shuralyov - -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/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt deleted file mode 100644 index 298f0e266..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt +++ /dev/null @@ -1,174 +0,0 @@ - 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. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/licenses.go b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/licenses.go deleted file mode 100644 index 5ad9c96ef..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/licenses.go +++ /dev/null @@ -1,1133 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// 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. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -import "strings" - -//Licenses contains all possible licenses a user can chose from -var Licenses map[string]License - -//License represents a software license agreement, containing the Name of -// the license, its possible matches (on the command line as given to cobra) -// the header to be used with each file on the file's creating, and the text -// of the license -type License struct { - Name string // The type of license in use - PossibleMatches []string // Similar names to guess - Text string // License text data - Header string // License header for source files -} - -// given a license name (in), try to match the license indicated -func matchLicense(in string) string { - for key, lic := range Licenses { - for _, match := range lic.PossibleMatches { - if strings.EqualFold(in, match) { - return key - } - } - } - return "" -} - -func init() { - Licenses = make(map[string]License) - - Licenses["apache"] = License{ - Name: "Apache 2.0", - PossibleMatches: []string{"apache", "apache20", "apache 2.0", "apache2.0", "apache-2.0"}, - Header: ` -// 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.`, - Text: ` - 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. -`, - } - - Licenses["mit"] = License{ - Name: "Mit", - PossibleMatches: []string{"mit"}, - Header: ` -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.`, - Text: `The MIT License (MIT) - -{{ .copyright }} - -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. -`, - } - - Licenses["bsd"] = License{ - Name: "NewBSD", - PossibleMatches: []string{"bsd", "newbsd", "3 clause bsd"}, - Header: ` -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } - - Licenses["freebsd"] = License{ - Name: "Simplified BSD License", - PossibleMatches: []string{"freebsd", "simpbsd", "simple bsd", "2 clause bsd"}, - Header: ` -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } - - Licenses["gpl3"] = License{ - Name: "GNU General Public License 3.0", - PossibleMatches: []string{"gpl3", "gpl", "gnu gpl3", "gnu gpl"}, - Header: `{{ .copyright }} - - This file is part of {{ .appName }}. - - {{ .appName }} is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - {{ .appName }} is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with {{ .appName }}. If not, see . - `, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. -`, - } - - // Licenses["apache20"] = License{ - // Name: "Apache 2.0", - // PossibleMatches: []string{"apache", "apache20", ""}, - // Header: ` - // `, - // Text: ` - // `, - // } -} diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE deleted file mode 100644 index 63ed1cfea..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 Alex Ogier. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/LICENSE deleted file mode 100644 index 95a0f0541..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012-2015 Ugorji Nwoke. -All rights reserved. - -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/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/README.md b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/README.md deleted file mode 100644 index 3ae8a056f..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# codecgen tool - -Generate is given a list of *.go files to parse, and an output file (fout), -codecgen will create an output file __file.go__ which -contains `codec.Selfer` implementations for the named types found -in the files parsed. - -Using codecgen is very straightforward. - -**Download and install the tool** - -`go get -u github.com/ugorji/go/codec/codecgen` - -**Run the tool on your files** - -The command line format is: - -`codecgen [options] (-o outfile) (infile ...)` - -```sh -% codecgen -? -Usage of codecgen: - -c="github.com/ugorji/go/codec": codec path - -o="": out file - -r=".*": regex for type name to match - -rt="": tags for go run - -t="": build tag to put in file - -u=false: Use unsafe, e.g. to avoid unnecessary allocation on []byte->string - -x=false: keep temp file - -% codecgen -o values_codecgen.go values.go values2.go moretypedefs.go -``` - -Please see the [blog article](http://ugorji.net/blog/go-codecgen) -for more information on how to use the tool. - diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go deleted file mode 100644 index f370b4c79..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// codecgen generates codec.Selfer implementations for a set of types. -package main - -import ( - "bufio" - "bytes" - "errors" - "flag" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "math/rand" - "os" - "os/exec" - "path/filepath" - "regexp" - "strconv" - "text/template" - "time" -) - -const genCodecPkg = "codec1978" // keep this in sync with codec.genCodecPkg - -const genFrunMainTmpl = `//+build ignore - -package main -{{ if .Types }}import "{{ .ImportPath }}"{{ end }} -func main() { - {{ $.PackageName }}.CodecGenTempWrite{{ .RandString }}() -} -` - -// const genFrunPkgTmpl = `//+build codecgen -const genFrunPkgTmpl = ` -package {{ $.PackageName }} - -import ( - {{ if not .CodecPkgFiles }}{{ .CodecPkgName }} "{{ .CodecImportPath }}"{{ end }} - "os" - "reflect" - "bytes" - "strings" - "go/format" -) - -func CodecGenTempWrite{{ .RandString }}() { - fout, err := os.Create("{{ .OutFile }}") - if err != nil { - panic(err) - } - defer fout.Close() - var out bytes.Buffer - - var typs []reflect.Type -{{ range $index, $element := .Types }} - var t{{ $index }} {{ . }} - typs = append(typs, reflect.TypeOf(t{{ $index }})) -{{ end }} - {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}Gen(&out, "{{ .BuildTag }}", "{{ .PackageName }}", "{{ .RandString }}", {{ .UseUnsafe }}, {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}NewTypeInfos(strings.Split("{{ .StructTags }}", ",")), typs...) - bout, err := format.Source(out.Bytes()) - if err != nil { - fout.Write(out.Bytes()) - panic(err) - } - fout.Write(bout) -} - -` - -// Generate is given a list of *.go files to parse, and an output file (fout). -// -// It finds all types T in the files, and it creates 2 tmp files (frun). -// - main package file passed to 'go run' -// - package level file which calls *genRunner.Selfer to write Selfer impls for each T. -// We use a package level file so that it can reference unexported types in the package being worked on. -// Tool then executes: "go run __frun__" which creates fout. -// fout contains Codec(En|De)codeSelf implementations for every type T. -// -func Generate(outfile, buildTag, codecPkgPath string, uid int64, useUnsafe bool, goRunTag string, - st string, regexName *regexp.Regexp, deleteTempFile bool, infiles ...string) (err error) { - // For each file, grab AST, find each type, and write a call to it. - if len(infiles) == 0 { - return - } - if outfile == "" || codecPkgPath == "" { - err = errors.New("outfile and codec package path cannot be blank") - return - } - if uid < 0 { - uid = -uid - } - if uid == 0 { - rr := rand.New(rand.NewSource(time.Now().UnixNano())) - uid = 101 + rr.Int63n(9777) - } - // We have to parse dir for package, before opening the temp file for writing (else ImportDir fails). - // Also, ImportDir(...) must take an absolute path. - lastdir := filepath.Dir(outfile) - absdir, err := filepath.Abs(lastdir) - if err != nil { - return - } - pkg, err := build.Default.ImportDir(absdir, build.AllowBinary) - if err != nil { - return - } - type tmplT struct { - CodecPkgName string - CodecImportPath string - ImportPath string - OutFile string - PackageName string - RandString string - BuildTag string - StructTags string - Types []string - CodecPkgFiles bool - UseUnsafe bool - } - tv := tmplT{ - CodecPkgName: genCodecPkg, - OutFile: outfile, - CodecImportPath: codecPkgPath, - BuildTag: buildTag, - UseUnsafe: useUnsafe, - RandString: strconv.FormatInt(uid, 10), - StructTags: st, - } - tv.ImportPath = pkg.ImportPath - if tv.ImportPath == tv.CodecImportPath { - tv.CodecPkgFiles = true - tv.CodecPkgName = "codec" - } - astfiles := make([]*ast.File, len(infiles)) - for i, infile := range infiles { - if filepath.Dir(infile) != lastdir { - err = errors.New("in files must all be in same directory as outfile") - return - } - fset := token.NewFileSet() - astfiles[i], err = parser.ParseFile(fset, infile, nil, 0) - if err != nil { - return - } - if i == 0 { - tv.PackageName = astfiles[i].Name.Name - if tv.PackageName == "main" { - // codecgen cannot be run on types in the 'main' package. - // A temporary 'main' package must be created, and should reference the fully built - // package containing the types. - // Also, the temporary main package will conflict with the main package which already has a main method. - err = errors.New("codecgen cannot be run on types in the 'main' package") - return - } - } - } - - for _, f := range astfiles { - for _, d := range f.Decls { - if gd, ok := d.(*ast.GenDecl); ok { - for _, dd := range gd.Specs { - if td, ok := dd.(*ast.TypeSpec); ok { - // if len(td.Name.Name) == 0 || td.Name.Name[0] > 'Z' || td.Name.Name[0] < 'A' { - if len(td.Name.Name) == 0 { - continue - } - - // only generate for: - // struct: StructType - // primitives (numbers, bool, string): Ident - // map: MapType - // slice, array: ArrayType - // chan: ChanType - // do not generate: - // FuncType, InterfaceType, StarExpr (ptr), etc - switch td.Type.(type) { - case *ast.StructType, *ast.Ident, *ast.MapType, *ast.ArrayType, *ast.ChanType: - if regexName.FindStringIndex(td.Name.Name) != nil { - tv.Types = append(tv.Types, td.Name.Name) - } - } - } - } - } - } - } - - if len(tv.Types) == 0 { - return - } - - // we cannot use ioutil.TempFile, because we cannot guarantee the file suffix (.go). - // Also, we cannot create file in temp directory, - // because go run will not work (as it needs to see the types here). - // Consequently, create the temp file in the current directory, and remove when done. - - // frun, err = ioutil.TempFile("", "codecgen-") - // frunName := filepath.Join(os.TempDir(), "codecgen-"+strconv.FormatInt(time.Now().UnixNano(), 10)+".go") - - frunMainName := "codecgen-main-" + tv.RandString + ".generated.go" - frunPkgName := "codecgen-pkg-" + tv.RandString + ".generated.go" - if deleteTempFile { - defer os.Remove(frunMainName) - defer os.Remove(frunPkgName) - } - // var frunMain, frunPkg *os.File - if _, err = gen1(frunMainName, genFrunMainTmpl, &tv); err != nil { - return - } - if _, err = gen1(frunPkgName, genFrunPkgTmpl, &tv); err != nil { - return - } - - // remove outfile, so "go run ..." will not think that types in outfile already exist. - os.Remove(outfile) - - // execute go run frun - cmd := exec.Command("go", "run", "-tags="+goRunTag, frunMainName) //, frunPkg.Name()) - var buf bytes.Buffer - cmd.Stdout = &buf - cmd.Stderr = &buf - if err = cmd.Run(); err != nil { - err = fmt.Errorf("error running 'go run %s': %v, console: %s", - frunMainName, err, buf.Bytes()) - return - } - os.Stdout.Write(buf.Bytes()) - return -} - -func gen1(frunName, tmplStr string, tv interface{}) (frun *os.File, err error) { - os.Remove(frunName) - if frun, err = os.Create(frunName); err != nil { - return - } - defer frun.Close() - - t := template.New("") - if t, err = t.Parse(tmplStr); err != nil { - return - } - bw := bufio.NewWriter(frun) - if err = t.Execute(bw, tv); err != nil { - return - } - if err = bw.Flush(); err != nil { - return - } - return -} - -func main() { - o := flag.String("o", "", "out file") - c := flag.String("c", genCodecPath, "codec path") - t := flag.String("t", "", "build tag to put in file") - r := flag.String("r", ".*", "regex for type name to match") - rt := flag.String("rt", "", "tags for go run") - st := flag.String("st", "codec,json", "struct tag keys to introspect") - x := flag.Bool("x", false, "keep temp file") - u := flag.Bool("u", false, "Use unsafe, e.g. to avoid unnecessary allocation on []byte->string") - d := flag.Int64("d", 0, "random identifier for use in generated code") - flag.Parse() - if err := Generate(*o, *t, *c, *d, *u, *rt, *st, - regexp.MustCompile(*r), !*x, flag.Args()...); err != nil { - fmt.Fprintf(os.Stderr, "codecgen error: %v\n", err) - os.Exit(1) - } -} diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/z.go b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/z.go deleted file mode 100644 index e120a4eb9..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/z.go +++ /dev/null @@ -1,3 +0,0 @@ -package main - -const genCodecPath = "github.com/ugorji/go/codec" diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/xiang90/probing/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/xiang90/probing/LICENSE deleted file mode 100644 index cde8b8b05..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/xiang90/probing/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Xiang Li - -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/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea5e..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/PATENTS b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/PATENTS deleted file mode 100644 index 733099041..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google 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, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go deleted file mode 100644 index e3170e333..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.5 - -package ctxhttp - -import "net/http" - -func canceler(client *http.Client, req *http.Request) func() { - // TODO(djd): Respect any existing value of req.Cancel. - ch := make(chan struct{}) - req.Cancel = ch - - return func() { - close(ch) - } -} diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go deleted file mode 100644 index 56bcbadb8..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.5 - -package ctxhttp - -import "net/http" - -type requestCanceler interface { - CancelRequest(*http.Request) -} - -func canceler(client *http.Client, req *http.Request) func() { - rc, ok := client.Transport.(requestCanceler) - if !ok { - return func() {} - } - return func() { - rc.CancelRequest(req) - } -} diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go deleted file mode 100644 index 8089ef0af..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ctxhttp provides helper functions for performing context-aware HTTP requests. -package ctxhttp - -import ( - "io" - "net/http" - "net/url" - "strings" - - "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context" -) - -func nop() {} - -var ( - testHookContextDoneBeforeHeaders = nop - testHookDoReturned = nop - testHookDidBodyClose = nop -) - -// Do sends an HTTP request with the provided http.Client and returns an HTTP response. -// If the client is nil, http.DefaultClient is used. -// If the context is canceled or times out, ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - - // Request cancelation changed in Go 1.5, see cancelreq.go and cancelreq_go14.go. - cancel := canceler(client, req) - - type responseAndError struct { - resp *http.Response - err error - } - result := make(chan responseAndError, 1) - - go func() { - resp, err := client.Do(req) - testHookDoReturned() - result <- responseAndError{resp, err} - }() - - var resp *http.Response - - select { - case <-ctx.Done(): - testHookContextDoneBeforeHeaders() - cancel() - // Clean up after the goroutine calling client.Do: - go func() { - if r := <-result; r.resp != nil { - testHookDidBodyClose() - r.resp.Body.Close() - } - }() - return nil, ctx.Err() - case r := <-result: - var err error - resp, err = r.resp, r.err - if err != nil { - return resp, err - } - } - - c := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - cancel() - case <-c: - // The response's Body is closed. - } - }() - resp.Body = ¬ifyingReader{resp.Body, c} - - return resp, nil -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} - -// notifyingReader is an io.ReadCloser that closes the notify channel after -// Close is called or a Read fails on the underlying ReadCloser. -type notifyingReader struct { - io.ReadCloser - notify chan<- struct{} -} - -func (r *notifyingReader) Read(p []byte) (int, error) { - n, err := r.ReadCloser.Read(p) - if err != nil && r.notify != nil { - close(r.notify) - r.notify = nil - } - return n, err -} - -func (r *notifyingReader) Close() error { - err := r.ReadCloser.Close() - if r.notify != nil { - close(r.notify) - r.notify = nil - } - return err -} diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/LICENSE b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/LICENSE deleted file mode 100644 index f4988b450..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright 2014, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/PATENTS b/vendor/github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/PATENTS deleted file mode 100644 index 619f9dbfe..000000000 --- a/vendor/github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the GRPC project. - -Google 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, -transfer and otherwise run, modify and propagate the contents of this -implementation of GRPC, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of GRPC. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of GRPC or any code incorporated within this -implementation of GRPC constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of GRPC -shall terminate as of the date such litigation is filed. diff --git a/vendor/github.com/digitalocean/godo/util/droplet.go b/vendor/github.com/digitalocean/godo/util/droplet.go deleted file mode 100644 index 4a016bc68..000000000 --- a/vendor/github.com/digitalocean/godo/util/droplet.go +++ /dev/null @@ -1,47 +0,0 @@ -package util - -import ( - "fmt" - "time" - - "github.com/digitalocean/godo" -) - -const ( - // activeFailure is the amount of times we can fail before deciding - // the check for active is a total failure. This can help account - // for servers randomly not answering. - activeFailure = 3 -) - -// WaitForActive waits for a droplet to become active -func WaitForActive(client *godo.Client, monitorURI string) error { - if len(monitorURI) == 0 { - return fmt.Errorf("create had no monitor uri") - } - - completed := false - failCount := 0 - for !completed { - action, _, err := client.DropletActions.GetByURI(monitorURI) - - if err != nil { - if failCount <= activeFailure { - failCount++ - continue - } - return err - } - - switch action.Status { - case godo.ActionInProgress: - time.Sleep(5 * time.Second) - case godo.ActionCompleted: - completed = true - default: - return fmt.Errorf("unknown status: [%s]", action.Status) - } - } - - return nil -} diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/LICENSE b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/LICENSE deleted file mode 100644 index 0e5fb8728..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 Rodrigo Moraes. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/README.md b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/README.md deleted file mode 100644 index c60a31b05..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/README.md +++ /dev/null @@ -1,7 +0,0 @@ -context -======= -[![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) - -gorilla/context is a general purpose registry for global request variables. - -Read the full documentation here: http://www.gorillatoolkit.org/pkg/context diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/context.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/context.go deleted file mode 100644 index 81cb128b1..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/context.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package context - -import ( - "net/http" - "sync" - "time" -) - -var ( - mutex sync.RWMutex - data = make(map[*http.Request]map[interface{}]interface{}) - datat = make(map[*http.Request]int64) -) - -// Set stores a value for a given key in a given request. -func Set(r *http.Request, key, val interface{}) { - mutex.Lock() - if data[r] == nil { - data[r] = make(map[interface{}]interface{}) - datat[r] = time.Now().Unix() - } - data[r][key] = val - mutex.Unlock() -} - -// Get returns a value stored for a given key in a given request. -func Get(r *http.Request, key interface{}) interface{} { - mutex.RLock() - if ctx := data[r]; ctx != nil { - value := ctx[key] - mutex.RUnlock() - return value - } - mutex.RUnlock() - return nil -} - -// GetOk returns stored value and presence state like multi-value return of map access. -func GetOk(r *http.Request, key interface{}) (interface{}, bool) { - mutex.RLock() - if _, ok := data[r]; ok { - value, ok := data[r][key] - mutex.RUnlock() - return value, ok - } - mutex.RUnlock() - return nil, false -} - -// GetAll returns all stored values for the request as a map. Nil is returned for invalid requests. -func GetAll(r *http.Request) map[interface{}]interface{} { - mutex.RLock() - if context, ok := data[r]; ok { - result := make(map[interface{}]interface{}, len(context)) - for k, v := range context { - result[k] = v - } - mutex.RUnlock() - return result - } - mutex.RUnlock() - return nil -} - -// GetAllOk returns all stored values for the request as a map and a boolean value that indicates if -// the request was registered. -func GetAllOk(r *http.Request) (map[interface{}]interface{}, bool) { - mutex.RLock() - context, ok := data[r] - result := make(map[interface{}]interface{}, len(context)) - for k, v := range context { - result[k] = v - } - mutex.RUnlock() - return result, ok -} - -// Delete removes a value stored for a given key in a given request. -func Delete(r *http.Request, key interface{}) { - mutex.Lock() - if data[r] != nil { - delete(data[r], key) - } - mutex.Unlock() -} - -// Clear removes all values stored for a given request. -// -// This is usually called by a handler wrapper to clean up request -// variables at the end of a request lifetime. See ClearHandler(). -func Clear(r *http.Request) { - mutex.Lock() - clear(r) - mutex.Unlock() -} - -// clear is Clear without the lock. -func clear(r *http.Request) { - delete(data, r) - delete(datat, r) -} - -// Purge removes request data stored for longer than maxAge, in seconds. -// It returns the amount of requests removed. -// -// If maxAge <= 0, all request data is removed. -// -// This is only used for sanity check: in case context cleaning was not -// properly set some request data can be kept forever, consuming an increasing -// amount of memory. In case this is detected, Purge() must be called -// periodically until the problem is fixed. -func Purge(maxAge int) int { - mutex.Lock() - count := 0 - if maxAge <= 0 { - count = len(data) - data = make(map[*http.Request]map[interface{}]interface{}) - datat = make(map[*http.Request]int64) - } else { - min := time.Now().Unix() - int64(maxAge) - for r := range data { - if datat[r] < min { - clear(r) - count++ - } - } - } - mutex.Unlock() - return count -} - -// ClearHandler wraps an http.Handler and clears request values at the end -// of a request lifetime. -func ClearHandler(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - defer Clear(r) - h.ServeHTTP(w, r) - }) -} diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/doc.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/doc.go deleted file mode 100644 index 73c740031..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/doc.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package context stores values shared during a request lifetime. - -For example, a router can set variables extracted from the URL and later -application handlers can access those values, or it can be used to store -sessions values to be saved at the end of a request. There are several -others common uses. - -The idea was posted by Brad Fitzpatrick to the go-nuts mailing list: - - http://groups.google.com/group/golang-nuts/msg/e2d679d303aa5d53 - -Here's the basic usage: first define the keys that you will need. The key -type is interface{} so a key can be of any type that supports equality. -Here we define a key using a custom int type to avoid name collisions: - - package foo - - import ( - "github.com/gorilla/context" - ) - - type key int - - const MyKey key = 0 - -Then set a variable. Variables are bound to an http.Request object, so you -need a request instance to set a value: - - context.Set(r, MyKey, "bar") - -The application can later access the variable using the same key you provided: - - func MyHandler(w http.ResponseWriter, r *http.Request) { - // val is "bar". - val := context.Get(r, foo.MyKey) - - // returns ("bar", true) - val, ok := context.GetOk(r, foo.MyKey) - // ... - } - -And that's all about the basic usage. We discuss some other ideas below. - -Any type can be stored in the context. To enforce a given type, make the key -private and wrap Get() and Set() to accept and return values of a specific -type: - - type key int - - const mykey key = 0 - - // GetMyKey returns a value for this package from the request values. - func GetMyKey(r *http.Request) SomeType { - if rv := context.Get(r, mykey); rv != nil { - return rv.(SomeType) - } - return nil - } - - // SetMyKey sets a value for this package in the request values. - func SetMyKey(r *http.Request, val SomeType) { - context.Set(r, mykey, val) - } - -Variables must be cleared at the end of a request, to remove all values -that were stored. This can be done in an http.Handler, after a request was -served. Just call Clear() passing the request: - - context.Clear(r) - -...or use ClearHandler(), which conveniently wraps an http.Handler to clear -variables at the end of a request lifetime. - -The Routers from the packages gorilla/mux and gorilla/pat call Clear() -so if you are using either of them you don't need to clear the context manually. -*/ -package context diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/LICENSE b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/LICENSE deleted file mode 100644 index 0e5fb8728..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 Rodrigo Moraes. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/README.md b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/README.md deleted file mode 100644 index b987c9e5d..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/README.md +++ /dev/null @@ -1,240 +0,0 @@ -mux -=== -[![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux) -[![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux) - -Package `gorilla/mux` implements a request router and dispatcher. - -The name mux stands for "HTTP request multiplexer". Like the standard `http.ServeMux`, `mux.Router` matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions. The main features are: - -* Requests can be matched based on URL host, path, path prefix, schemes, header and query values, HTTP methods or using custom matchers. -* URL hosts and paths can have variables with an optional regular expression. -* Registered URLs can be built, or "reversed", which helps maintaining references to resources. -* Routes can be used as subrouters: nested routes are only tested if the parent route matches. This is useful to define groups of routes that share common conditions like a host, a path prefix or other repeated attributes. As a bonus, this optimizes request matching. -* It implements the `http.Handler` interface so it is compatible with the standard `http.ServeMux`. - -Let's start registering a couple of URL paths and handlers: - -```go -func main() { - r := mux.NewRouter() - r.HandleFunc("/", HomeHandler) - r.HandleFunc("/products", ProductsHandler) - r.HandleFunc("/articles", ArticlesHandler) - http.Handle("/", r) -} -``` - -Here we register three routes mapping URL paths to handlers. This is equivalent to how `http.HandleFunc()` works: if an incoming request URL matches one of the paths, the corresponding handler is called passing (`http.ResponseWriter`, `*http.Request`) as parameters. - -Paths can have variables. They are defined using the format `{name}` or `{name:pattern}`. If a regular expression pattern is not defined, the matched variable will be anything until the next slash. For example: - -```go -r := mux.NewRouter() -r.HandleFunc("/products/{key}", ProductHandler) -r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler) -r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) -``` - -The names are used to create a map of route variables which can be retrieved calling `mux.Vars()`: - -```go -vars := mux.Vars(request) -category := vars["category"] -``` - -And this is all you need to know about the basic usage. More advanced options are explained below. - -Routes can also be restricted to a domain or subdomain. Just define a host pattern to be matched. They can also have variables: - -```go -r := mux.NewRouter() -// Only matches if domain is "www.example.com". -r.Host("www.example.com") -// Matches a dynamic subdomain. -r.Host("{subdomain:[a-z]+}.domain.com") -``` - -There are several other matchers that can be added. To match path prefixes: - -```go -r.PathPrefix("/products/") -``` - -...or HTTP methods: - -```go -r.Methods("GET", "POST") -``` - -...or URL schemes: - -```go -r.Schemes("https") -``` - -...or header values: - -```go -r.Headers("X-Requested-With", "XMLHttpRequest") -``` - -...or query values: - -```go -r.Queries("key", "value") -``` - -...or to use a custom matcher function: - -```go -r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool { - return r.ProtoMajor == 0 -}) -``` - -...and finally, it is possible to combine several matchers in a single route: - -```go -r.HandleFunc("/products", ProductsHandler). - Host("www.example.com"). - Methods("GET"). - Schemes("http") -``` - -Setting the same matching conditions again and again can be boring, so we have a way to group several routes that share the same requirements. We call it "subrouting". - -For example, let's say we have several URLs that should only match when the host is `www.example.com`. Create a route for that host and get a "subrouter" from it: - -```go -r := mux.NewRouter() -s := r.Host("www.example.com").Subrouter() -``` - -Then register routes in the subrouter: - -```go -s.HandleFunc("/products/", ProductsHandler) -s.HandleFunc("/products/{key}", ProductHandler) -s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler) -``` - -The three URL paths we registered above will only be tested if the domain is `www.example.com`, because the subrouter is tested first. This is not only convenient, but also optimizes request matching. You can create subrouters combining any attribute matchers accepted by a route. - -Subrouters can be used to create domain or path "namespaces": you define subrouters in a central place and then parts of the app can register its paths relatively to a given subrouter. - -There's one more thing about subroutes. When a subrouter has a path prefix, the inner routes use it as base for their paths: - -```go -r := mux.NewRouter() -s := r.PathPrefix("/products").Subrouter() -// "/products/" -s.HandleFunc("/", ProductsHandler) -// "/products/{key}/" -s.HandleFunc("/{key}/", ProductHandler) -// "/products/{key}/details" -s.HandleFunc("/{key}/details", ProductDetailsHandler) -``` - -Now let's see how to build registered URLs. - -Routes can be named. All routes that define a name can have their URLs built, or "reversed". We define a name calling `Name()` on a route. For example: - -```go -r := mux.NewRouter() -r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). - Name("article") -``` - -To build a URL, get the route and call the `URL()` method, passing a sequence of key/value pairs for the route variables. For the previous route, we would do: - -```go -url, err := r.Get("article").URL("category", "technology", "id", "42") -``` - -...and the result will be a `url.URL` with the following path: - -``` -"/articles/technology/42" -``` - -This also works for host variables: - -```go -r := mux.NewRouter() -r.Host("{subdomain}.domain.com"). - Path("/articles/{category}/{id:[0-9]+}"). - HandlerFunc(ArticleHandler). - Name("article") - -// url.String() will be "http://news.domain.com/articles/technology/42" -url, err := r.Get("article").URL("subdomain", "news", - "category", "technology", - "id", "42") -``` - -All variables defined in the route are required, and their values must conform to the corresponding patterns. These requirements guarantee that a generated URL will always match a registered route -- the only exception is for explicitly defined "build-only" routes which never match. - -Regex support also exists for matching Headers within a route. For example, we could do: - -```go -r.HeadersRegexp("Content-Type", "application/(text|json)") -``` - -...and the route will match both requests with a Content-Type of `application/json` as well as `application/text` - -There's also a way to build only the URL host or path for a route: use the methods `URLHost()` or `URLPath()` instead. For the previous route, we would do: - -```go -// "http://news.domain.com/" -host, err := r.Get("article").URLHost("subdomain", "news") - -// "/articles/technology/42" -path, err := r.Get("article").URLPath("category", "technology", "id", "42") -``` - -And if you use subrouters, host and path defined separately can be built as well: - -```go -r := mux.NewRouter() -s := r.Host("{subdomain}.domain.com").Subrouter() -s.Path("/articles/{category}/{id:[0-9]+}"). - HandlerFunc(ArticleHandler). - Name("article") - -// "http://news.domain.com/articles/technology/42" -url, err := r.Get("article").URL("subdomain", "news", - "category", "technology", - "id", "42") -``` - -## Full Example - -Here's a complete, runnable example of a small `mux` based server: - -```go -package main - -import ( - "net/http" - - "github.com/gorilla/mux" -) - -func YourHandler(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("Gorilla!\n")) -} - -func main() { - r := mux.NewRouter() - // Routes consist of a path and a handler function. - r.HandleFunc("/", YourHandler) - - // Bind to a port and pass our router in - http.ListenAndServe(":8000", r) -} -``` - -## License - -BSD licensed. See the LICENSE file for details. diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/doc.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/doc.go deleted file mode 100644 index 49798cb5c..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/doc.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package gorilla/mux implements a request router and dispatcher. - -The name mux stands for "HTTP request multiplexer". Like the standard -http.ServeMux, mux.Router matches incoming requests against a list of -registered routes and calls a handler for the route that matches the URL -or other conditions. The main features are: - - * Requests can be matched based on URL host, path, path prefix, schemes, - header and query values, HTTP methods or using custom matchers. - * URL hosts and paths can have variables with an optional regular - expression. - * Registered URLs can be built, or "reversed", which helps maintaining - references to resources. - * Routes can be used as subrouters: nested routes are only tested if the - parent route matches. This is useful to define groups of routes that - share common conditions like a host, a path prefix or other repeated - attributes. As a bonus, this optimizes request matching. - * It implements the http.Handler interface so it is compatible with the - standard http.ServeMux. - -Let's start registering a couple of URL paths and handlers: - - func main() { - r := mux.NewRouter() - r.HandleFunc("/", HomeHandler) - r.HandleFunc("/products", ProductsHandler) - r.HandleFunc("/articles", ArticlesHandler) - http.Handle("/", r) - } - -Here we register three routes mapping URL paths to handlers. This is -equivalent to how http.HandleFunc() works: if an incoming request URL matches -one of the paths, the corresponding handler is called passing -(http.ResponseWriter, *http.Request) as parameters. - -Paths can have variables. They are defined using the format {name} or -{name:pattern}. If a regular expression pattern is not defined, the matched -variable will be anything until the next slash. For example: - - r := mux.NewRouter() - r.HandleFunc("/products/{key}", ProductHandler) - r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler) - r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) - -The names are used to create a map of route variables which can be retrieved -calling mux.Vars(): - - vars := mux.Vars(request) - category := vars["category"] - -And this is all you need to know about the basic usage. More advanced options -are explained below. - -Routes can also be restricted to a domain or subdomain. Just define a host -pattern to be matched. They can also have variables: - - r := mux.NewRouter() - // Only matches if domain is "www.example.com". - r.Host("www.example.com") - // Matches a dynamic subdomain. - r.Host("{subdomain:[a-z]+}.domain.com") - -There are several other matchers that can be added. To match path prefixes: - - r.PathPrefix("/products/") - -...or HTTP methods: - - r.Methods("GET", "POST") - -...or URL schemes: - - r.Schemes("https") - -...or header values: - - r.Headers("X-Requested-With", "XMLHttpRequest") - -...or query values: - - r.Queries("key", "value") - -...or to use a custom matcher function: - - r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool { - return r.ProtoMajor == 0 - }) - -...and finally, it is possible to combine several matchers in a single route: - - r.HandleFunc("/products", ProductsHandler). - Host("www.example.com"). - Methods("GET"). - Schemes("http") - -Setting the same matching conditions again and again can be boring, so we have -a way to group several routes that share the same requirements. -We call it "subrouting". - -For example, let's say we have several URLs that should only match when the -host is "www.example.com". Create a route for that host and get a "subrouter" -from it: - - r := mux.NewRouter() - s := r.Host("www.example.com").Subrouter() - -Then register routes in the subrouter: - - s.HandleFunc("/products/", ProductsHandler) - s.HandleFunc("/products/{key}", ProductHandler) - s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler) - -The three URL paths we registered above will only be tested if the domain is -"www.example.com", because the subrouter is tested first. This is not -only convenient, but also optimizes request matching. You can create -subrouters combining any attribute matchers accepted by a route. - -Subrouters can be used to create domain or path "namespaces": you define -subrouters in a central place and then parts of the app can register its -paths relatively to a given subrouter. - -There's one more thing about subroutes. When a subrouter has a path prefix, -the inner routes use it as base for their paths: - - r := mux.NewRouter() - s := r.PathPrefix("/products").Subrouter() - // "/products/" - s.HandleFunc("/", ProductsHandler) - // "/products/{key}/" - s.HandleFunc("/{key}/", ProductHandler) - // "/products/{key}/details" - s.HandleFunc("/{key}/details", ProductDetailsHandler) - -Now let's see how to build registered URLs. - -Routes can be named. All routes that define a name can have their URLs built, -or "reversed". We define a name calling Name() on a route. For example: - - r := mux.NewRouter() - r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). - Name("article") - -To build a URL, get the route and call the URL() method, passing a sequence of -key/value pairs for the route variables. For the previous route, we would do: - - url, err := r.Get("article").URL("category", "technology", "id", "42") - -...and the result will be a url.URL with the following path: - - "/articles/technology/42" - -This also works for host variables: - - r := mux.NewRouter() - r.Host("{subdomain}.domain.com"). - Path("/articles/{category}/{id:[0-9]+}"). - HandlerFunc(ArticleHandler). - Name("article") - - // url.String() will be "http://news.domain.com/articles/technology/42" - url, err := r.Get("article").URL("subdomain", "news", - "category", "technology", - "id", "42") - -All variables defined in the route are required, and their values must -conform to the corresponding patterns. These requirements guarantee that a -generated URL will always match a registered route -- the only exception is -for explicitly defined "build-only" routes which never match. - -Regex support also exists for matching Headers within a route. For example, we could do: - - r.HeadersRegexp("Content-Type", "application/(text|json)") - -...and the route will match both requests with a Content-Type of `application/json` as well as -`application/text` - -There's also a way to build only the URL host or path for a route: -use the methods URLHost() or URLPath() instead. For the previous route, -we would do: - - // "http://news.domain.com/" - host, err := r.Get("article").URLHost("subdomain", "news") - - // "/articles/technology/42" - path, err := r.Get("article").URLPath("category", "technology", "id", "42") - -And if you use subrouters, host and path defined separately can be built -as well: - - r := mux.NewRouter() - s := r.Host("{subdomain}.domain.com").Subrouter() - s.Path("/articles/{category}/{id:[0-9]+}"). - HandlerFunc(ArticleHandler). - Name("article") - - // "http://news.domain.com/articles/technology/42" - url, err := r.Get("article").URL("subdomain", "news", - "category", "technology", - "id", "42") -*/ -package mux diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/mux.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/mux.go deleted file mode 100644 index cb03ddfe5..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/mux.go +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mux - -import ( - "errors" - "fmt" - "net/http" - "path" - "regexp" - - "github.com/fsouza/go-dockerclient/external/github.com/gorilla/context" -) - -// NewRouter returns a new router instance. -func NewRouter() *Router { - return &Router{namedRoutes: make(map[string]*Route), KeepContext: false} -} - -// Router registers routes to be matched and dispatches a handler. -// -// It implements the http.Handler interface, so it can be registered to serve -// requests: -// -// var router = mux.NewRouter() -// -// func main() { -// http.Handle("/", router) -// } -// -// Or, for Google App Engine, register it in a init() function: -// -// func init() { -// http.Handle("/", router) -// } -// -// This will send all incoming requests to the router. -type Router struct { - // Configurable Handler to be used when no route matches. - NotFoundHandler http.Handler - // Parent route, if this is a subrouter. - parent parentRoute - // Routes to be matched, in order. - routes []*Route - // Routes by name for URL building. - namedRoutes map[string]*Route - // See Router.StrictSlash(). This defines the flag for new routes. - strictSlash bool - // If true, do not clear the request context after handling the request - KeepContext bool -} - -// Match matches registered routes against the request. -func (r *Router) Match(req *http.Request, match *RouteMatch) bool { - for _, route := range r.routes { - if route.Match(req, match) { - return true - } - } - - // Closest match for a router (includes sub-routers) - if r.NotFoundHandler != nil { - match.Handler = r.NotFoundHandler - return true - } - return false -} - -// ServeHTTP dispatches the handler registered in the matched route. -// -// When there is a match, the route variables can be retrieved calling -// mux.Vars(request). -func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) { - // Clean path to canonical form and redirect. - if p := cleanPath(req.URL.Path); p != req.URL.Path { - - // Added 3 lines (Philip Schlump) - It was dropping the query string and #whatever from query. - // This matches with fix in go 1.2 r.c. 4 for same problem. Go Issue: - // http://code.google.com/p/go/issues/detail?id=5252 - url := *req.URL - url.Path = p - p = url.String() - - w.Header().Set("Location", p) - w.WriteHeader(http.StatusMovedPermanently) - return - } - var match RouteMatch - var handler http.Handler - if r.Match(req, &match) { - handler = match.Handler - setVars(req, match.Vars) - setCurrentRoute(req, match.Route) - } - if handler == nil { - handler = http.NotFoundHandler() - } - if !r.KeepContext { - defer context.Clear(req) - } - handler.ServeHTTP(w, req) -} - -// Get returns a route registered with the given name. -func (r *Router) Get(name string) *Route { - return r.getNamedRoutes()[name] -} - -// GetRoute returns a route registered with the given name. This method -// was renamed to Get() and remains here for backwards compatibility. -func (r *Router) GetRoute(name string) *Route { - return r.getNamedRoutes()[name] -} - -// StrictSlash defines the trailing slash behavior for new routes. The initial -// value is false. -// -// When true, if the route path is "/path/", accessing "/path" will redirect -// to the former and vice versa. In other words, your application will always -// see the path as specified in the route. -// -// When false, if the route path is "/path", accessing "/path/" will not match -// this route and vice versa. -// -// Special case: when a route sets a path prefix using the PathPrefix() method, -// strict slash is ignored for that route because the redirect behavior can't -// be determined from a prefix alone. However, any subrouters created from that -// route inherit the original StrictSlash setting. -func (r *Router) StrictSlash(value bool) *Router { - r.strictSlash = value - return r -} - -// ---------------------------------------------------------------------------- -// parentRoute -// ---------------------------------------------------------------------------- - -// getNamedRoutes returns the map where named routes are registered. -func (r *Router) getNamedRoutes() map[string]*Route { - if r.namedRoutes == nil { - if r.parent != nil { - r.namedRoutes = r.parent.getNamedRoutes() - } else { - r.namedRoutes = make(map[string]*Route) - } - } - return r.namedRoutes -} - -// getRegexpGroup returns regexp definitions from the parent route, if any. -func (r *Router) getRegexpGroup() *routeRegexpGroup { - if r.parent != nil { - return r.parent.getRegexpGroup() - } - return nil -} - -func (r *Router) buildVars(m map[string]string) map[string]string { - if r.parent != nil { - m = r.parent.buildVars(m) - } - return m -} - -// ---------------------------------------------------------------------------- -// Route factories -// ---------------------------------------------------------------------------- - -// NewRoute registers an empty route. -func (r *Router) NewRoute() *Route { - route := &Route{parent: r, strictSlash: r.strictSlash} - r.routes = append(r.routes, route) - return route -} - -// Handle registers a new route with a matcher for the URL path. -// See Route.Path() and Route.Handler(). -func (r *Router) Handle(path string, handler http.Handler) *Route { - return r.NewRoute().Path(path).Handler(handler) -} - -// HandleFunc registers a new route with a matcher for the URL path. -// See Route.Path() and Route.HandlerFunc(). -func (r *Router) HandleFunc(path string, f func(http.ResponseWriter, - *http.Request)) *Route { - return r.NewRoute().Path(path).HandlerFunc(f) -} - -// Headers registers a new route with a matcher for request header values. -// See Route.Headers(). -func (r *Router) Headers(pairs ...string) *Route { - return r.NewRoute().Headers(pairs...) -} - -// Host registers a new route with a matcher for the URL host. -// See Route.Host(). -func (r *Router) Host(tpl string) *Route { - return r.NewRoute().Host(tpl) -} - -// MatcherFunc registers a new route with a custom matcher function. -// See Route.MatcherFunc(). -func (r *Router) MatcherFunc(f MatcherFunc) *Route { - return r.NewRoute().MatcherFunc(f) -} - -// Methods registers a new route with a matcher for HTTP methods. -// See Route.Methods(). -func (r *Router) Methods(methods ...string) *Route { - return r.NewRoute().Methods(methods...) -} - -// Path registers a new route with a matcher for the URL path. -// See Route.Path(). -func (r *Router) Path(tpl string) *Route { - return r.NewRoute().Path(tpl) -} - -// PathPrefix registers a new route with a matcher for the URL path prefix. -// See Route.PathPrefix(). -func (r *Router) PathPrefix(tpl string) *Route { - return r.NewRoute().PathPrefix(tpl) -} - -// Queries registers a new route with a matcher for URL query values. -// See Route.Queries(). -func (r *Router) Queries(pairs ...string) *Route { - return r.NewRoute().Queries(pairs...) -} - -// Schemes registers a new route with a matcher for URL schemes. -// See Route.Schemes(). -func (r *Router) Schemes(schemes ...string) *Route { - return r.NewRoute().Schemes(schemes...) -} - -// BuildVars registers a new route with a custom function for modifying -// route variables before building a URL. -func (r *Router) BuildVarsFunc(f BuildVarsFunc) *Route { - return r.NewRoute().BuildVarsFunc(f) -} - -// Walk walks the router and all its sub-routers, calling walkFn for each route -// in the tree. The routes are walked in the order they were added. Sub-routers -// are explored depth-first. -func (r *Router) Walk(walkFn WalkFunc) error { - return r.walk(walkFn, []*Route{}) -} - -// SkipRouter is used as a return value from WalkFuncs to indicate that the -// router that walk is about to descend down to should be skipped. -var SkipRouter = errors.New("skip this router") - -// WalkFunc is the type of the function called for each route visited by Walk. -// At every invocation, it is given the current route, and the current router, -// and a list of ancestor routes that lead to the current route. -type WalkFunc func(route *Route, router *Router, ancestors []*Route) error - -func (r *Router) walk(walkFn WalkFunc, ancestors []*Route) error { - for _, t := range r.routes { - if t.regexp == nil || t.regexp.path == nil || t.regexp.path.template == "" { - continue - } - - err := walkFn(t, r, ancestors) - if err == SkipRouter { - continue - } - for _, sr := range t.matchers { - if h, ok := sr.(*Router); ok { - err := h.walk(walkFn, ancestors) - if err != nil { - return err - } - } - } - if h, ok := t.handler.(*Router); ok { - ancestors = append(ancestors, t) - err := h.walk(walkFn, ancestors) - if err != nil { - return err - } - ancestors = ancestors[:len(ancestors)-1] - } - } - return nil -} - -// ---------------------------------------------------------------------------- -// Context -// ---------------------------------------------------------------------------- - -// RouteMatch stores information about a matched route. -type RouteMatch struct { - Route *Route - Handler http.Handler - Vars map[string]string -} - -type contextKey int - -const ( - varsKey contextKey = iota - routeKey -) - -// Vars returns the route variables for the current request, if any. -func Vars(r *http.Request) map[string]string { - if rv := context.Get(r, varsKey); rv != nil { - return rv.(map[string]string) - } - return nil -} - -// CurrentRoute returns the matched route for the current request, if any. -// This only works when called inside the handler of the matched route -// because the matched route is stored in the request context which is cleared -// after the handler returns, unless the KeepContext option is set on the -// Router. -func CurrentRoute(r *http.Request) *Route { - if rv := context.Get(r, routeKey); rv != nil { - return rv.(*Route) - } - return nil -} - -func setVars(r *http.Request, val interface{}) { - if val != nil { - context.Set(r, varsKey, val) - } -} - -func setCurrentRoute(r *http.Request, val interface{}) { - if val != nil { - context.Set(r, routeKey, val) - } -} - -// ---------------------------------------------------------------------------- -// Helpers -// ---------------------------------------------------------------------------- - -// cleanPath returns the canonical path for p, eliminating . and .. elements. -// Borrowed from the net/http package. -func cleanPath(p string) string { - if p == "" { - return "/" - } - if p[0] != '/' { - p = "/" + p - } - np := path.Clean(p) - // path.Clean removes trailing slash except for root; - // put the trailing slash back if necessary. - if p[len(p)-1] == '/' && np != "/" { - np += "/" - } - return np -} - -// uniqueVars returns an error if two slices contain duplicated strings. -func uniqueVars(s1, s2 []string) error { - for _, v1 := range s1 { - for _, v2 := range s2 { - if v1 == v2 { - return fmt.Errorf("mux: duplicated route variable %q", v2) - } - } - } - return nil -} - -// checkPairs returns the count of strings passed in, and an error if -// the count is not an even number. -func checkPairs(pairs ...string) (int, error) { - length := len(pairs) - if length%2 != 0 { - return length, fmt.Errorf( - "mux: number of parameters must be multiple of 2, got %v", pairs) - } - return length, nil -} - -// mapFromPairsToString converts variadic string parameters to a -// string to string map. -func mapFromPairsToString(pairs ...string) (map[string]string, error) { - length, err := checkPairs(pairs...) - if err != nil { - return nil, err - } - m := make(map[string]string, length/2) - for i := 0; i < length; i += 2 { - m[pairs[i]] = pairs[i+1] - } - return m, nil -} - -// mapFromPairsToRegex converts variadic string paramers to a -// string to regex map. -func mapFromPairsToRegex(pairs ...string) (map[string]*regexp.Regexp, error) { - length, err := checkPairs(pairs...) - if err != nil { - return nil, err - } - m := make(map[string]*regexp.Regexp, length/2) - for i := 0; i < length; i += 2 { - regex, err := regexp.Compile(pairs[i+1]) - if err != nil { - return nil, err - } - m[pairs[i]] = regex - } - return m, nil -} - -// matchInArray returns true if the given string value is in the array. -func matchInArray(arr []string, value string) bool { - for _, v := range arr { - if v == value { - return true - } - } - return false -} - -// matchMapWithString returns true if the given key/value pairs exist in a given map. -func matchMapWithString(toCheck map[string]string, toMatch map[string][]string, canonicalKey bool) bool { - for k, v := range toCheck { - // Check if key exists. - if canonicalKey { - k = http.CanonicalHeaderKey(k) - } - if values := toMatch[k]; values == nil { - return false - } else if v != "" { - // If value was defined as an empty string we only check that the - // key exists. Otherwise we also check for equality. - valueExists := false - for _, value := range values { - if v == value { - valueExists = true - break - } - } - if !valueExists { - return false - } - } - } - return true -} - -// matchMapWithRegex returns true if the given key/value pairs exist in a given map compiled against -// the given regex -func matchMapWithRegex(toCheck map[string]*regexp.Regexp, toMatch map[string][]string, canonicalKey bool) bool { - for k, v := range toCheck { - // Check if key exists. - if canonicalKey { - k = http.CanonicalHeaderKey(k) - } - if values := toMatch[k]; values == nil { - return false - } else if v != nil { - // If value was defined as an empty string we only check that the - // key exists. Otherwise we also check for equality. - valueExists := false - for _, value := range values { - if v.MatchString(value) { - valueExists = true - break - } - } - if !valueExists { - return false - } - } - } - return true -} diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/regexp.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/regexp.go deleted file mode 100644 index 06728dd54..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/regexp.go +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mux - -import ( - "bytes" - "fmt" - "net/http" - "net/url" - "regexp" - "strconv" - "strings" -) - -// newRouteRegexp parses a route template and returns a routeRegexp, -// used to match a host, a path or a query string. -// -// It will extract named variables, assemble a regexp to be matched, create -// a "reverse" template to build URLs and compile regexps to validate variable -// values used in URL building. -// -// Previously we accepted only Python-like identifiers for variable -// names ([a-zA-Z_][a-zA-Z0-9_]*), but currently the only restriction is that -// name and pattern can't be empty, and names can't contain a colon. -func newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash bool) (*routeRegexp, error) { - // Check if it is well-formed. - idxs, errBraces := braceIndices(tpl) - if errBraces != nil { - return nil, errBraces - } - // Backup the original. - template := tpl - // Now let's parse it. - defaultPattern := "[^/]+" - if matchQuery { - defaultPattern = "[^?&]*" - } else if matchHost { - defaultPattern = "[^.]+" - matchPrefix = false - } - // Only match strict slash if not matching - if matchPrefix || matchHost || matchQuery { - strictSlash = false - } - // Set a flag for strictSlash. - endSlash := false - if strictSlash && strings.HasSuffix(tpl, "/") { - tpl = tpl[:len(tpl)-1] - endSlash = true - } - varsN := make([]string, len(idxs)/2) - varsR := make([]*regexp.Regexp, len(idxs)/2) - pattern := bytes.NewBufferString("") - pattern.WriteByte('^') - reverse := bytes.NewBufferString("") - var end int - var err error - for i := 0; i < len(idxs); i += 2 { - // Set all values we are interested in. - raw := tpl[end:idxs[i]] - end = idxs[i+1] - parts := strings.SplitN(tpl[idxs[i]+1:end-1], ":", 2) - name := parts[0] - patt := defaultPattern - if len(parts) == 2 { - patt = parts[1] - } - // Name or pattern can't be empty. - if name == "" || patt == "" { - return nil, fmt.Errorf("mux: missing name or pattern in %q", - tpl[idxs[i]:end]) - } - // Build the regexp pattern. - varIdx := i / 2 - fmt.Fprintf(pattern, "%s(?P<%s>%s)", regexp.QuoteMeta(raw), varGroupName(varIdx), patt) - // Build the reverse template. - fmt.Fprintf(reverse, "%s%%s", raw) - - // Append variable name and compiled pattern. - varsN[varIdx] = name - varsR[varIdx], err = regexp.Compile(fmt.Sprintf("^%s$", patt)) - if err != nil { - return nil, err - } - } - // Add the remaining. - raw := tpl[end:] - pattern.WriteString(regexp.QuoteMeta(raw)) - if strictSlash { - pattern.WriteString("[/]?") - } - if matchQuery { - // Add the default pattern if the query value is empty - if queryVal := strings.SplitN(template, "=", 2)[1]; queryVal == "" { - pattern.WriteString(defaultPattern) - } - } - if !matchPrefix { - pattern.WriteByte('$') - } - reverse.WriteString(raw) - if endSlash { - reverse.WriteByte('/') - } - // Compile full regexp. - reg, errCompile := regexp.Compile(pattern.String()) - if errCompile != nil { - return nil, errCompile - } - // Done! - return &routeRegexp{ - template: template, - matchHost: matchHost, - matchQuery: matchQuery, - strictSlash: strictSlash, - regexp: reg, - reverse: reverse.String(), - varsN: varsN, - varsR: varsR, - }, nil -} - -// routeRegexp stores a regexp to match a host or path and information to -// collect and validate route variables. -type routeRegexp struct { - // The unmodified template. - template string - // True for host match, false for path or query string match. - matchHost bool - // True for query string match, false for path and host match. - matchQuery bool - // The strictSlash value defined on the route, but disabled if PathPrefix was used. - strictSlash bool - // Expanded regexp. - regexp *regexp.Regexp - // Reverse template. - reverse string - // Variable names. - varsN []string - // Variable regexps (validators). - varsR []*regexp.Regexp -} - -// Match matches the regexp against the URL host or path. -func (r *routeRegexp) Match(req *http.Request, match *RouteMatch) bool { - if !r.matchHost { - if r.matchQuery { - return r.matchQueryString(req) - } else { - return r.regexp.MatchString(req.URL.Path) - } - } - return r.regexp.MatchString(getHost(req)) -} - -// url builds a URL part using the given values. -func (r *routeRegexp) url(values map[string]string) (string, error) { - urlValues := make([]interface{}, len(r.varsN)) - for k, v := range r.varsN { - value, ok := values[v] - if !ok { - return "", fmt.Errorf("mux: missing route variable %q", v) - } - urlValues[k] = value - } - rv := fmt.Sprintf(r.reverse, urlValues...) - if !r.regexp.MatchString(rv) { - // The URL is checked against the full regexp, instead of checking - // individual variables. This is faster but to provide a good error - // message, we check individual regexps if the URL doesn't match. - for k, v := range r.varsN { - if !r.varsR[k].MatchString(values[v]) { - return "", fmt.Errorf( - "mux: variable %q doesn't match, expected %q", values[v], - r.varsR[k].String()) - } - } - } - return rv, nil -} - -// getUrlQuery returns a single query parameter from a request URL. -// For a URL with foo=bar&baz=ding, we return only the relevant key -// value pair for the routeRegexp. -func (r *routeRegexp) getUrlQuery(req *http.Request) string { - if !r.matchQuery { - return "" - } - templateKey := strings.SplitN(r.template, "=", 2)[0] - for key, vals := range req.URL.Query() { - if key == templateKey && len(vals) > 0 { - return key + "=" + vals[0] - } - } - return "" -} - -func (r *routeRegexp) matchQueryString(req *http.Request) bool { - return r.regexp.MatchString(r.getUrlQuery(req)) -} - -// braceIndices returns the first level curly brace indices from a string. -// It returns an error in case of unbalanced braces. -func braceIndices(s string) ([]int, error) { - var level, idx int - idxs := make([]int, 0) - for i := 0; i < len(s); i++ { - switch s[i] { - case '{': - if level++; level == 1 { - idx = i - } - case '}': - if level--; level == 0 { - idxs = append(idxs, idx, i+1) - } else if level < 0 { - return nil, fmt.Errorf("mux: unbalanced braces in %q", s) - } - } - } - if level != 0 { - return nil, fmt.Errorf("mux: unbalanced braces in %q", s) - } - return idxs, nil -} - -// varGroupName builds a capturing group name for the indexed variable. -func varGroupName(idx int) string { - return "v" + strconv.Itoa(idx) -} - -// ---------------------------------------------------------------------------- -// routeRegexpGroup -// ---------------------------------------------------------------------------- - -// routeRegexpGroup groups the route matchers that carry variables. -type routeRegexpGroup struct { - host *routeRegexp - path *routeRegexp - queries []*routeRegexp -} - -// setMatch extracts the variables from the URL once a route matches. -func (v *routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) { - // Store host variables. - if v.host != nil { - hostVars := v.host.regexp.FindStringSubmatch(getHost(req)) - if hostVars != nil { - subexpNames := v.host.regexp.SubexpNames() - varName := 0 - for i, name := range subexpNames[1:] { - if name != "" && name == varGroupName(varName) { - m.Vars[v.host.varsN[varName]] = hostVars[i+1] - varName++ - } - } - } - } - // Store path variables. - if v.path != nil { - pathVars := v.path.regexp.FindStringSubmatch(req.URL.Path) - if pathVars != nil { - subexpNames := v.path.regexp.SubexpNames() - varName := 0 - for i, name := range subexpNames[1:] { - if name != "" && name == varGroupName(varName) { - m.Vars[v.path.varsN[varName]] = pathVars[i+1] - varName++ - } - } - // Check if we should redirect. - if v.path.strictSlash { - p1 := strings.HasSuffix(req.URL.Path, "/") - p2 := strings.HasSuffix(v.path.template, "/") - if p1 != p2 { - u, _ := url.Parse(req.URL.String()) - if p1 { - u.Path = u.Path[:len(u.Path)-1] - } else { - u.Path += "/" - } - m.Handler = http.RedirectHandler(u.String(), 301) - } - } - } - } - // Store query string variables. - for _, q := range v.queries { - queryVars := q.regexp.FindStringSubmatch(q.getUrlQuery(req)) - if queryVars != nil { - subexpNames := q.regexp.SubexpNames() - varName := 0 - for i, name := range subexpNames[1:] { - if name != "" && name == varGroupName(varName) { - m.Vars[q.varsN[varName]] = queryVars[i+1] - varName++ - } - } - } - } -} - -// getHost tries its best to return the request host. -func getHost(r *http.Request) string { - if r.URL.IsAbs() { - return r.URL.Host - } - host := r.Host - // Slice off any port information. - if i := strings.Index(host, ":"); i != -1 { - host = host[:i] - } - return host - -} diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/route.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/route.go deleted file mode 100644 index 913432c1c..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/route.go +++ /dev/null @@ -1,595 +0,0 @@ -// Copyright 2012 The Gorilla Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mux - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - "strings" -) - -// Route stores information to match a request and build URLs. -type Route struct { - // Parent where the route was registered (a Router). - parent parentRoute - // Request handler for the route. - handler http.Handler - // List of matchers. - matchers []matcher - // Manager for the variables from host and path. - regexp *routeRegexpGroup - // If true, when the path pattern is "/path/", accessing "/path" will - // redirect to the former and vice versa. - strictSlash bool - // If true, this route never matches: it is only used to build URLs. - buildOnly bool - // The name used to build URLs. - name string - // Error resulted from building a route. - err error - - buildVarsFunc BuildVarsFunc -} - -// Match matches the route against the request. -func (r *Route) Match(req *http.Request, match *RouteMatch) bool { - if r.buildOnly || r.err != nil { - return false - } - // Match everything. - for _, m := range r.matchers { - if matched := m.Match(req, match); !matched { - return false - } - } - // Yay, we have a match. Let's collect some info about it. - if match.Route == nil { - match.Route = r - } - if match.Handler == nil { - match.Handler = r.handler - } - if match.Vars == nil { - match.Vars = make(map[string]string) - } - // Set variables. - if r.regexp != nil { - r.regexp.setMatch(req, match, r) - } - return true -} - -// ---------------------------------------------------------------------------- -// Route attributes -// ---------------------------------------------------------------------------- - -// GetError returns an error resulted from building the route, if any. -func (r *Route) GetError() error { - return r.err -} - -// BuildOnly sets the route to never match: it is only used to build URLs. -func (r *Route) BuildOnly() *Route { - r.buildOnly = true - return r -} - -// Handler -------------------------------------------------------------------- - -// Handler sets a handler for the route. -func (r *Route) Handler(handler http.Handler) *Route { - if r.err == nil { - r.handler = handler - } - return r -} - -// HandlerFunc sets a handler function for the route. -func (r *Route) HandlerFunc(f func(http.ResponseWriter, *http.Request)) *Route { - return r.Handler(http.HandlerFunc(f)) -} - -// GetHandler returns the handler for the route, if any. -func (r *Route) GetHandler() http.Handler { - return r.handler -} - -// Name ----------------------------------------------------------------------- - -// Name sets the name for the route, used to build URLs. -// If the name was registered already it will be overwritten. -func (r *Route) Name(name string) *Route { - if r.name != "" { - r.err = fmt.Errorf("mux: route already has name %q, can't set %q", - r.name, name) - } - if r.err == nil { - r.name = name - r.getNamedRoutes()[name] = r - } - return r -} - -// GetName returns the name for the route, if any. -func (r *Route) GetName() string { - return r.name -} - -// ---------------------------------------------------------------------------- -// Matchers -// ---------------------------------------------------------------------------- - -// matcher types try to match a request. -type matcher interface { - Match(*http.Request, *RouteMatch) bool -} - -// addMatcher adds a matcher to the route. -func (r *Route) addMatcher(m matcher) *Route { - if r.err == nil { - r.matchers = append(r.matchers, m) - } - return r -} - -// addRegexpMatcher adds a host or path matcher and builder to a route. -func (r *Route) addRegexpMatcher(tpl string, matchHost, matchPrefix, matchQuery bool) error { - if r.err != nil { - return r.err - } - r.regexp = r.getRegexpGroup() - if !matchHost && !matchQuery { - if len(tpl) == 0 || tpl[0] != '/' { - return fmt.Errorf("mux: path must start with a slash, got %q", tpl) - } - if r.regexp.path != nil { - tpl = strings.TrimRight(r.regexp.path.template, "/") + tpl - } - } - rr, err := newRouteRegexp(tpl, matchHost, matchPrefix, matchQuery, r.strictSlash) - if err != nil { - return err - } - for _, q := range r.regexp.queries { - if err = uniqueVars(rr.varsN, q.varsN); err != nil { - return err - } - } - if matchHost { - if r.regexp.path != nil { - if err = uniqueVars(rr.varsN, r.regexp.path.varsN); err != nil { - return err - } - } - r.regexp.host = rr - } else { - if r.regexp.host != nil { - if err = uniqueVars(rr.varsN, r.regexp.host.varsN); err != nil { - return err - } - } - if matchQuery { - r.regexp.queries = append(r.regexp.queries, rr) - } else { - r.regexp.path = rr - } - } - r.addMatcher(rr) - return nil -} - -// Headers -------------------------------------------------------------------- - -// headerMatcher matches the request against header values. -type headerMatcher map[string]string - -func (m headerMatcher) Match(r *http.Request, match *RouteMatch) bool { - return matchMapWithString(m, r.Header, true) -} - -// Headers adds a matcher for request header values. -// It accepts a sequence of key/value pairs to be matched. For example: -// -// r := mux.NewRouter() -// r.Headers("Content-Type", "application/json", -// "X-Requested-With", "XMLHttpRequest") -// -// The above route will only match if both request header values match. -// If the value is an empty string, it will match any value if the key is set. -func (r *Route) Headers(pairs ...string) *Route { - if r.err == nil { - var headers map[string]string - headers, r.err = mapFromPairsToString(pairs...) - return r.addMatcher(headerMatcher(headers)) - } - return r -} - -// headerRegexMatcher matches the request against the route given a regex for the header -type headerRegexMatcher map[string]*regexp.Regexp - -func (m headerRegexMatcher) Match(r *http.Request, match *RouteMatch) bool { - return matchMapWithRegex(m, r.Header, true) -} - -// Regular expressions can be used with headers as well. -// It accepts a sequence of key/value pairs, where the value has regex support. For example -// r := mux.NewRouter() -// r.HeadersRegexp("Content-Type", "application/(text|json)", -// "X-Requested-With", "XMLHttpRequest") -// -// The above route will only match if both the request header matches both regular expressions. -// It the value is an empty string, it will match any value if the key is set. -func (r *Route) HeadersRegexp(pairs ...string) *Route { - if r.err == nil { - var headers map[string]*regexp.Regexp - headers, r.err = mapFromPairsToRegex(pairs...) - return r.addMatcher(headerRegexMatcher(headers)) - } - return r -} - -// Host ----------------------------------------------------------------------- - -// Host adds a matcher for the URL host. -// It accepts a template with zero or more URL variables enclosed by {}. -// Variables can define an optional regexp pattern to be matched: -// -// - {name} matches anything until the next dot. -// -// - {name:pattern} matches the given regexp pattern. -// -// For example: -// -// r := mux.NewRouter() -// r.Host("www.example.com") -// r.Host("{subdomain}.domain.com") -// r.Host("{subdomain:[a-z]+}.domain.com") -// -// Variable names must be unique in a given route. They can be retrieved -// calling mux.Vars(request). -func (r *Route) Host(tpl string) *Route { - r.err = r.addRegexpMatcher(tpl, true, false, false) - return r -} - -// MatcherFunc ---------------------------------------------------------------- - -// MatcherFunc is the function signature used by custom matchers. -type MatcherFunc func(*http.Request, *RouteMatch) bool - -func (m MatcherFunc) Match(r *http.Request, match *RouteMatch) bool { - return m(r, match) -} - -// MatcherFunc adds a custom function to be used as request matcher. -func (r *Route) MatcherFunc(f MatcherFunc) *Route { - return r.addMatcher(f) -} - -// Methods -------------------------------------------------------------------- - -// methodMatcher matches the request against HTTP methods. -type methodMatcher []string - -func (m methodMatcher) Match(r *http.Request, match *RouteMatch) bool { - return matchInArray(m, r.Method) -} - -// Methods adds a matcher for HTTP methods. -// It accepts a sequence of one or more methods to be matched, e.g.: -// "GET", "POST", "PUT". -func (r *Route) Methods(methods ...string) *Route { - for k, v := range methods { - methods[k] = strings.ToUpper(v) - } - return r.addMatcher(methodMatcher(methods)) -} - -// Path ----------------------------------------------------------------------- - -// Path adds a matcher for the URL path. -// It accepts a template with zero or more URL variables enclosed by {}. The -// template must start with a "/". -// Variables can define an optional regexp pattern to be matched: -// -// - {name} matches anything until the next slash. -// -// - {name:pattern} matches the given regexp pattern. -// -// For example: -// -// r := mux.NewRouter() -// r.Path("/products/").Handler(ProductsHandler) -// r.Path("/products/{key}").Handler(ProductsHandler) -// r.Path("/articles/{category}/{id:[0-9]+}"). -// Handler(ArticleHandler) -// -// Variable names must be unique in a given route. They can be retrieved -// calling mux.Vars(request). -func (r *Route) Path(tpl string) *Route { - r.err = r.addRegexpMatcher(tpl, false, false, false) - return r -} - -// PathPrefix ----------------------------------------------------------------- - -// PathPrefix adds a matcher for the URL path prefix. This matches if the given -// template is a prefix of the full URL path. See Route.Path() for details on -// the tpl argument. -// -// Note that it does not treat slashes specially ("/foobar/" will be matched by -// the prefix "/foo") so you may want to use a trailing slash here. -// -// Also note that the setting of Router.StrictSlash() has no effect on routes -// with a PathPrefix matcher. -func (r *Route) PathPrefix(tpl string) *Route { - r.err = r.addRegexpMatcher(tpl, false, true, false) - return r -} - -// Query ---------------------------------------------------------------------- - -// Queries adds a matcher for URL query values. -// It accepts a sequence of key/value pairs. Values may define variables. -// For example: -// -// r := mux.NewRouter() -// r.Queries("foo", "bar", "id", "{id:[0-9]+}") -// -// The above route will only match if the URL contains the defined queries -// values, e.g.: ?foo=bar&id=42. -// -// It the value is an empty string, it will match any value if the key is set. -// -// Variables can define an optional regexp pattern to be matched: -// -// - {name} matches anything until the next slash. -// -// - {name:pattern} matches the given regexp pattern. -func (r *Route) Queries(pairs ...string) *Route { - length := len(pairs) - if length%2 != 0 { - r.err = fmt.Errorf( - "mux: number of parameters must be multiple of 2, got %v", pairs) - return nil - } - for i := 0; i < length; i += 2 { - if r.err = r.addRegexpMatcher(pairs[i]+"="+pairs[i+1], false, false, true); r.err != nil { - return r - } - } - - return r -} - -// Schemes -------------------------------------------------------------------- - -// schemeMatcher matches the request against URL schemes. -type schemeMatcher []string - -func (m schemeMatcher) Match(r *http.Request, match *RouteMatch) bool { - return matchInArray(m, r.URL.Scheme) -} - -// Schemes adds a matcher for URL schemes. -// It accepts a sequence of schemes to be matched, e.g.: "http", "https". -func (r *Route) Schemes(schemes ...string) *Route { - for k, v := range schemes { - schemes[k] = strings.ToLower(v) - } - return r.addMatcher(schemeMatcher(schemes)) -} - -// BuildVarsFunc -------------------------------------------------------------- - -// BuildVarsFunc is the function signature used by custom build variable -// functions (which can modify route variables before a route's URL is built). -type BuildVarsFunc func(map[string]string) map[string]string - -// BuildVarsFunc adds a custom function to be used to modify build variables -// before a route's URL is built. -func (r *Route) BuildVarsFunc(f BuildVarsFunc) *Route { - r.buildVarsFunc = f - return r -} - -// Subrouter ------------------------------------------------------------------ - -// Subrouter creates a subrouter for the route. -// -// It will test the inner routes only if the parent route matched. For example: -// -// r := mux.NewRouter() -// s := r.Host("www.example.com").Subrouter() -// s.HandleFunc("/products/", ProductsHandler) -// s.HandleFunc("/products/{key}", ProductHandler) -// s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler) -// -// Here, the routes registered in the subrouter won't be tested if the host -// doesn't match. -func (r *Route) Subrouter() *Router { - router := &Router{parent: r, strictSlash: r.strictSlash} - r.addMatcher(router) - return router -} - -// ---------------------------------------------------------------------------- -// URL building -// ---------------------------------------------------------------------------- - -// URL builds a URL for the route. -// -// It accepts a sequence of key/value pairs for the route variables. For -// example, given this route: -// -// r := mux.NewRouter() -// r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). -// Name("article") -// -// ...a URL for it can be built using: -// -// url, err := r.Get("article").URL("category", "technology", "id", "42") -// -// ...which will return an url.URL with the following path: -// -// "/articles/technology/42" -// -// This also works for host variables: -// -// r := mux.NewRouter() -// r.Host("{subdomain}.domain.com"). -// HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). -// Name("article") -// -// // url.String() will be "http://news.domain.com/articles/technology/42" -// url, err := r.Get("article").URL("subdomain", "news", -// "category", "technology", -// "id", "42") -// -// All variables defined in the route are required, and their values must -// conform to the corresponding patterns. -func (r *Route) URL(pairs ...string) (*url.URL, error) { - if r.err != nil { - return nil, r.err - } - if r.regexp == nil { - return nil, errors.New("mux: route doesn't have a host or path") - } - values, err := r.prepareVars(pairs...) - if err != nil { - return nil, err - } - var scheme, host, path string - if r.regexp.host != nil { - // Set a default scheme. - scheme = "http" - if host, err = r.regexp.host.url(values); err != nil { - return nil, err - } - } - if r.regexp.path != nil { - if path, err = r.regexp.path.url(values); err != nil { - return nil, err - } - } - return &url.URL{ - Scheme: scheme, - Host: host, - Path: path, - }, nil -} - -// URLHost builds the host part of the URL for a route. See Route.URL(). -// -// The route must have a host defined. -func (r *Route) URLHost(pairs ...string) (*url.URL, error) { - if r.err != nil { - return nil, r.err - } - if r.regexp == nil || r.regexp.host == nil { - return nil, errors.New("mux: route doesn't have a host") - } - values, err := r.prepareVars(pairs...) - if err != nil { - return nil, err - } - host, err := r.regexp.host.url(values) - if err != nil { - return nil, err - } - return &url.URL{ - Scheme: "http", - Host: host, - }, nil -} - -// URLPath builds the path part of the URL for a route. See Route.URL(). -// -// The route must have a path defined. -func (r *Route) URLPath(pairs ...string) (*url.URL, error) { - if r.err != nil { - return nil, r.err - } - if r.regexp == nil || r.regexp.path == nil { - return nil, errors.New("mux: route doesn't have a path") - } - values, err := r.prepareVars(pairs...) - if err != nil { - return nil, err - } - path, err := r.regexp.path.url(values) - if err != nil { - return nil, err - } - return &url.URL{ - Path: path, - }, nil -} - -// prepareVars converts the route variable pairs into a map. If the route has a -// BuildVarsFunc, it is invoked. -func (r *Route) prepareVars(pairs ...string) (map[string]string, error) { - m, err := mapFromPairsToString(pairs...) - if err != nil { - return nil, err - } - return r.buildVars(m), nil -} - -func (r *Route) buildVars(m map[string]string) map[string]string { - if r.parent != nil { - m = r.parent.buildVars(m) - } - if r.buildVarsFunc != nil { - m = r.buildVarsFunc(m) - } - return m -} - -// ---------------------------------------------------------------------------- -// parentRoute -// ---------------------------------------------------------------------------- - -// parentRoute allows routes to know about parent host and path definitions. -type parentRoute interface { - getNamedRoutes() map[string]*Route - getRegexpGroup() *routeRegexpGroup - buildVars(map[string]string) map[string]string -} - -// getNamedRoutes returns the map where named routes are registered. -func (r *Route) getNamedRoutes() map[string]*Route { - if r.parent == nil { - // During tests router is not always set. - r.parent = NewRouter() - } - return r.parent.getNamedRoutes() -} - -// getRegexpGroup returns regexp definitions from this route. -func (r *Route) getRegexpGroup() *routeRegexpGroup { - if r.regexp == nil { - if r.parent == nil { - // During tests router is not always set. - r.parent = NewRouter() - } - regexp := r.parent.getRegexpGroup() - if regexp == nil { - r.regexp = new(routeRegexpGroup) - } else { - // Copy. - r.regexp = &routeRegexpGroup{ - host: regexp.host, - path: regexp.path, - queries: regexp.queries, - } - } - } - return r.regexp -} diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/.dockerignore b/vendor/github.com/fsouza/go-dockerclient/testing/data/.dockerignore deleted file mode 100644 index 027e8c20e..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -container.tar -dockerfile.tar -foofile diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/Dockerfile b/vendor/github.com/fsouza/go-dockerclient/testing/data/Dockerfile deleted file mode 100644 index 0948dcfa8..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# this file describes how to build tsuru python image -# to run it: -# 1- install docker -# 2- run: $ docker build -t tsuru/python https://raw.github.com/tsuru/basebuilder/master/python/Dockerfile - -from base:ubuntu-quantal -run apt-get install wget -y --force-yes -run wget http://github.com/tsuru/basebuilder/tarball/master -O basebuilder.tar.gz --no-check-certificate -run mkdir /var/lib/tsuru -run tar -xvf basebuilder.tar.gz -C /var/lib/tsuru --strip 1 -run cp /var/lib/tsuru/python/deploy /var/lib/tsuru -run cp /var/lib/tsuru/base/restart /var/lib/tsuru -run cp /var/lib/tsuru/base/start /var/lib/tsuru -run /var/lib/tsuru/base/install -run /var/lib/tsuru/base/setup diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/barfile b/vendor/github.com/fsouza/go-dockerclient/testing/data/barfile deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/ca.pem b/vendor/github.com/fsouza/go-dockerclient/testing/data/ca.pem deleted file mode 100644 index 8e38bba13..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/ca.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC1TCCAb+gAwIBAgIQJ9MsNxrUxumNbAytGi3GEDALBgkqhkiG9w0BAQswFjEU -MBIGA1UEChMLQm9vdDJEb2NrZXIwHhcNMTQxMDE2MjAyMTM4WhcNMTcwOTMwMjAy -MTM4WjAWMRQwEgYDVQQKEwtCb290MkRvY2tlcjCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBALpFCSARjG+5yXoqr7UMzuE0df7RRZfeRZI06lJ02ZqV4Iii -rgL7ML9yPxX50NbLnjiilSDTUhnyocYFItokzUzz8qpX/nlYhuN2Iqwh4d0aWS8z -f5y248F+H1z+HY2W8NPl/6DVlVwYaNW1/k+RPMlHS0INLR6j+3Ievew7RNE0NnM2 -znELW6NetekDt3GUcz0Z95vDUDfdPnIk1eIFMmYvLxZh23xOca4Q37a3S8F3d+dN -+OOpwjdgY9Qme0NQUaXpgp58jWuQfB8q7mZrdnLlLqRa8gx1HeDSotX7UmWtWPkb -vd9EdlKLYw5PVpxMV1rkwf2t4TdgD5NfkpXlXkkCAwEAAaMjMCEwDgYDVR0PAQH/ -BAQDAgCkMA8GA1UdEwEB/wQFMAMBAf8wCwYJKoZIhvcNAQELA4IBAQBxYjHVSKqE -MJw7CW0GddesULtXXVWGJuZdWJLQlPvPMfIfjIvlcZyS4cdVNiQ3sREFIZz8TpII -CT0/Pg3sgv/FcOQe1CN0xZYZcyiAZHK1z0fJQq2qVpdv7+tJcjI2vvU6NI24iQCo -W1wz25trJz9QbdB2MRLMjyz7TSWuafztIvcfEzaIdQ0Whqund/cSuPGQx5IwF83F -rvlkOyJSH2+VIEBTCIuykJeL0DLTt8cePBQR5L1ISXb4RUMK9ZtqRscBRv8sn7o2 -ixG3wtL0gYF4xLtsQWVxI3iFVrU3WzOH/3c5shVRkWBd+AQRSwCJI4mKH7penJCF -i3/zzlkvOnjV ------END CERTIFICATE----- diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/cert.pem b/vendor/github.com/fsouza/go-dockerclient/testing/data/cert.pem deleted file mode 100644 index 5e7244b24..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/cert.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC6DCCAdKgAwIBAgIRANO6ymxQAjp66KmEka1G6b0wCwYJKoZIhvcNAQELMBYx -FDASBgNVBAoTC0Jvb3QyRG9ja2VyMB4XDTE0MTAxNjIwMjE1MloXDTE3MDkzMDIw -MjE1MlowFjEUMBIGA1UEChMLQm9vdDJEb2NrZXIwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDGA1mAhSOpZspD1dpZ7qVEQrIJw4Xo8252jHaORnEdDiFm -b6brEmr6jw8t4P3IGxbqBc/TqRV+SSXxwYEVvfpeQKH+SmqStoMNtD3Ura161az4 -V0BcxMtSlsUGpoz+//QCAq8qiaxMwgiyc5253mkQm88anj2cNt7xbewiu/KFWuf7 -BVpNK1+ltpJmlukfcj/G+I1bw7j1KxBjDrFqe5cyDuuZcDL2tmUXP/ZWDyXwSv+H -AOckqn44z6aXlBkVvOXDBZJqY76d/vWVDNCuZeXRnqlhP3t1kH4V0RQXo+JD2tgt -JgdU0unzyoFOSWNUBPm73tqmjUGGAmGHBmeegJr/AgMBAAGjNTAzMA4GA1UdDwEB -/wQEAwIAgDATBgNVHSUEDDAKBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMAsGCSqG -SIb3DQEBCwOCAQEABVTWl5SmBP+j5He5bQsgnIXjviSKqe40/10V4LJAOmilycRF -zLrzM+YMwfjg6PLIs8CldAMWHw9y9ktZY4MxkgCktaiaN/QmMTMwFWEcN4wy5IpM -U5l93eAg7xsnY430h3QBBADujX4wdF3fs8rSL8zAAQFL0ihurwU124K3yXKsrwpb -CiVUGfIN4sPwjy8Ws9oxHFDC9/P8lgjHZ1nBIf8KSHnMzlxDGj7isQfhtH+7mcCL -cM1qO2NirS2v7uaEPPY+MJstAz+W7EJCW9dfMSmHna2SDC37Xkin7uEY9z+qaKFL -8d/XxOB/L8Ucy8VZhdsv0dsBq5KfJntITM0ksQ== ------END CERTIFICATE----- diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/container.tar b/vendor/github.com/fsouza/go-dockerclient/testing/data/container.tar deleted file mode 100644 index e4b066e3b..000000000 Binary files a/vendor/github.com/fsouza/go-dockerclient/testing/data/container.tar and /dev/null differ diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/dockerfile.tar b/vendor/github.com/fsouza/go-dockerclient/testing/data/dockerfile.tar deleted file mode 100644 index 32c9ce647..000000000 Binary files a/vendor/github.com/fsouza/go-dockerclient/testing/data/dockerfile.tar and /dev/null differ diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/foofile b/vendor/github.com/fsouza/go-dockerclient/testing/data/foofile deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/key.pem b/vendor/github.com/fsouza/go-dockerclient/testing/data/key.pem deleted file mode 100644 index a9346bcf4..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAxgNZgIUjqWbKQ9XaWe6lREKyCcOF6PNudox2jkZxHQ4hZm+m -6xJq+o8PLeD9yBsW6gXP06kVfkkl8cGBFb36XkCh/kpqkraDDbQ91K2tetWs+FdA -XMTLUpbFBqaM/v/0AgKvKomsTMIIsnOdud5pEJvPGp49nDbe8W3sIrvyhVrn+wVa -TStfpbaSZpbpH3I/xviNW8O49SsQYw6xanuXMg7rmXAy9rZlFz/2Vg8l8Er/hwDn -JKp+OM+ml5QZFbzlwwWSamO+nf71lQzQrmXl0Z6pYT97dZB+FdEUF6PiQ9rYLSYH -VNLp88qBTkljVAT5u97apo1BhgJhhwZnnoCa/wIDAQABAoIBAQCaGy9EC9pmU95l -DwGh7k5nIrUnTilg1FwLHWSDdCVCZKXv8ENrPelOWZqJrUo1u4eI2L8XTsewgkNq -tJu/DRzWz9yDaO0qg6rZNobMh+K076lvmZA44twOydJLS8H+D7ua+PXU2FLlZjmY -kMyXRJZmW6zCXZc7haTbJx6ZJccoquk/DkS4FcFurJP177u1YrWS9TTw9kensUtU -jQ63uf56UTN1i+0+Rxl7OW1TZlqwlri5I4njg5249+FxwwHzIq8+l7zD7K9pl8c/ -nG1HuulvU2bVlDlRdyslMPAH34vw9Sku1BD8furrJLr1na5lRSLKJODEaIPEsLwv -CdEUwP9JAoGBAO76ZW80RyNB2fA+wbTq70Sr8CwrXxYemXrez5LKDC7SsohKFCPE -IedpO/n+nmymiiJvMm874EExoG6BVrbkWkeb+2vinEfOQNlDMsDx7WLjPekP3t6i -rXHO3CjFooVFq2z3mZa/Nc5NZqu8fNWNCKJxZDJphdoj6sORNJIUvZVjAoGBANQd -++J+ITcu3/+A6JrGcgLunBFQYPqkiItk0J4QKYKuX5ik9rWcQDN8TTtfW2mDuiQ4 -NrCwuVPq1V1kB16JzH017SsYLo9g8I20YjnBZge9pKTeUaLVTb3C50LW8FBylop0 -Bnm597dNbtSjphjoTMg0XyC19o3Esf2YeWG0QNS1AoGAWWDfFRNJU99qIldmXULM -0DM6NVrXSk+ReYnhunXEzrJQwXZrR+EwCPurydk36Uz0NuK9yypquhdUeF/5TZfk -SAoHo5byekyipl9imRUigqyY2BTudvgCxKDoaHtaSFwBPFTyZZYICquaLbrmOXxw -8UhVgCFFRYvPXuts7QHC0h8CgYBWEvy9gfU0kV7wLX02IUTuj6jhFb7ktpN6DSTi -nyhZES1VoctDEu6ydcRZTW6ouH12aSE4Pd5WgTqntQmQgVZrkNB25k8ue2Xh+srJ -KQOgLIJ9LIHwE6KCWG7DnrjRzE3uTPq7to0g4tkQjH/AJ7PQof/gJDayfJjFkXPg -A+cy6QKBgEPbKpiqscm03gT2QanBut5pg4dqPOxp0SlErA3kSFNTRK3oYBQPC+LH -qA5nD5brdkeNBB58Rll8Zpzxiff50bcvLP/7/Sb3NjaXFTEY0gVbdRof3n6N0YP3 -Hu5XDNJ9RNkNzE5RIG1g86KE+aKlcrKMaigqAiuIy2PSnjkQeGk8 ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/server.pem b/vendor/github.com/fsouza/go-dockerclient/testing/data/server.pem deleted file mode 100644 index 89cc445e1..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/server.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC/DCCAeagAwIBAgIQMUILcXtvmSOK63zEBo0VXzALBgkqhkiG9w0BAQswFjEU -MBIGA1UEChMLQm9vdDJEb2NrZXIwHhcNMTQxMDE2MjAyMTQ2WhcNMTcwOTMwMjAy -MTQ2WjAWMRQwEgYDVQQKEwtCb290MkRvY2tlcjCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBANxUOUhNnqFnrTlLsBYzfFRZWQo268l+4K4lOJCVbfDonP3g -Mz0vGi9fcyFqEWSA8Y+ShXna625HTnReCwFdsu0861qCIq7v95hFFCyOe0iIxpd0 -AKLnl90d+1vonE7andgFgoobbTiMly4UK4H6z8D148fFNIihoteOG3PIF89TFxP7 -CJ/3wXnx/IKpdlO8PAnub3tBPJHvGDj7KORLy4IBxRX5VBAdfGNybE66fcrehEva -rLA4m9pgiaR/Nnr9FdKhPyqYdjflLNvzydxNvMIV4M0hFlhXmYvpMjA5/XsTnsyV -t9JHJa5Upwqsbne08t7rsm7liZNxZlko8xPOTQcCAwEAAaNKMEgwDgYDVR0PAQH/ -BAQDAgCgMAwGA1UdEwEB/wQCMAAwKAYDVR0RBCEwH4ILYm9vdDJkb2NrZXKHBH8A -AAGHBAoAAg+HBMCoO2cwCwYJKoZIhvcNAQELA4IBAQAYoYcDkDWkl73FZ0WnPmAj -LiF7HU95Qg3KyEpFsAJeShSLPPbQntmwhdekEzY4tQ3eKQB/+zHFjzsCr/lmDUmH -Ea/ryQ17C+jyH+Ykg0IWW6L6veZhvRDg6Z9focVtPVBRxPTqC/Qhb54blWRASV+W -UreMuXQ5+1dQptAM7ixOeLVHjBi/bd9TL3jvwBVCr9QedteMjjK4TCF9Tbcou+MF -2w3OJJZMDhcD+YwoK9uJDqlKmcTm/vVMbSsp/pTMcnQ7jxCeR8/XyX+VwTZwaHAa -o92Q/eg3THAiWhvyT/SzyH9dHHBAyXynUwGCggKawHktfvW4QXRPuLxLrJ7iB5cy ------END CERTIFICATE----- diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/data/serverkey.pem b/vendor/github.com/fsouza/go-dockerclient/testing/data/serverkey.pem deleted file mode 100644 index c897e5da5..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/data/serverkey.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEoAIBAAKCAQEA3FQ5SE2eoWetOUuwFjN8VFlZCjbryX7griU4kJVt8Oic/eAz -PS8aL19zIWoRZIDxj5KFedrrbkdOdF4LAV2y7TzrWoIiru/3mEUULI57SIjGl3QA -oueX3R37W+icTtqd2AWCihttOIyXLhQrgfrPwPXjx8U0iKGi144bc8gXz1MXE/sI -n/fBefH8gql2U7w8Ce5ve0E8ke8YOPso5EvLggHFFflUEB18Y3JsTrp9yt6ES9qs -sDib2mCJpH82ev0V0qE/Kph2N+Us2/PJ3E28whXgzSEWWFeZi+kyMDn9exOezJW3 -0kclrlSnCqxud7Ty3uuybuWJk3FmWSjzE85NBwIDAQABAoIBAG0ak+cW8LeShHf7 -3+2Of0GxoOLrAWWdG5uAuPr31CJYve0FybnBimDtDjD8ujIfm/7xmoEWBEFutA3x -x9dcU88gvJbsHEqub9gKVQwfXjMz78tt2SbSMiR/xUnk7QorPcCMMfE71aEMFYzu -1gCed6Rg3vO81t/V0rKVH0j9S7UQz5v/oX15eVDV5LOqyCHwAi6K0eXXbqnbI0TH -SOQ/nexM2msVXWbO9t6ra6f5V7FXziDK5Xi+rPxRbX9mkrDzxDAevfuRqYBx5vtL -W2Q2hKjUAHFgXFniNSZBS7dCdAtz0el/3ct+cNmpuTMhhs7M6wC1CuYiZ/DxLiFh -Si73VckCgYEA+/ceh3+VjtQ0rgEw8sD9bqYEA8IaBiObjneIoFnKBYRG7yZd8JMm -HD4M/aQ1qhcRLPN7GR03YQULgQJURbKSjJHnhfTXHyeHC3NN4gMVHQXewu2MHCh6 -7FCQ9CfK0KcYLgegVVvL3PrF3hyWGnmTu+G0UkDQRYVnaNrB7snrW6UCgYEA39tq -+MCQdu0moJ5szSZf02undg9EeW6isk9qzi7TId3/MLci2eH7PEnipipPUK3+DERq -aba0y0TKgBR2EXvXLFJA/+kfdo2loIEHOfox85HVfxgUaFRti63ZI0uF8D0QT2Yy -oJal+RFghVoSnv4LjhRKEPbIkScTXGjdK+7wFjsCfz79iKRXQQx0ALd/lL0bgkAn -QNmvrNHcFQeI2p8700WNzC39aX67SsvEt3qxkrjzC1gxhpTAuReIK1gVPPwvqHN8 -BmV20FD5kMlMCix2mNCopwgUWvKvLAvoGFTxncKMA39+aJbuXAjiqJTekKgNvOE7 -i9kEWw0GTNPp3JHV6QECgYAPwb0M11kT1euDIMOdyRazpf86kyaJuZzgGjD1ZFxe -JOcigbGFTp/FhZnbglzk2+pm6KXo3QBq0mPCki4hWusxZnTGzpz1VlETNCHTFeZQ -M7KoaIR/N3oie9Et59H8r/+m5xWnMhNqratyl316DX24uXrhKM3DUdHODl+LCR2D -IwKBgE1MbHuwolUPEw3HeO4R7NMFVTFei7E/fpUsimPfArGg8UydwvloNT1myJos -N2JzfGGjN2KPVcBk9fOs71mJ6VcK3C3g5JIccplk6h9VNaw55+zdQvKPTzoBoTvy -A+Fwx2AlF61KeRF87DL2YTRJ6B9MHmWgf7+GVZOxomLgEAcZ ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/fsouza/go-dockerclient/testing/server.go b/vendor/github.com/fsouza/go-dockerclient/testing/server.go deleted file mode 100644 index b16e71367..000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/server.go +++ /dev/null @@ -1,1246 +0,0 @@ -// Copyright 2015 go-dockerclient authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package testing provides a fake implementation of the Docker API, useful for -// testing purpose. -package testing - -import ( - "archive/tar" - "crypto/rand" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - mathrand "math/rand" - "net" - "net/http" - "regexp" - "strconv" - "strings" - "sync" - "time" - - "github.com/fsouza/go-dockerclient" - "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy" - "github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux" -) - -var nameRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]+$`) - -// DockerServer represents a programmable, concurrent (not much), HTTP server -// implementing a fake version of the Docker remote API. -// -// It can used in standalone mode, listening for connections or as an arbitrary -// HTTP handler. -// -// For more details on the remote API, check http://goo.gl/G3plxW. -type DockerServer struct { - containers []*docker.Container - uploadedFiles map[string]string - execs []*docker.ExecInspect - execMut sync.RWMutex - cMut sync.RWMutex - images []docker.Image - iMut sync.RWMutex - imgIDs map[string]string - networks []*docker.Network - netMut sync.RWMutex - listener net.Listener - mux *mux.Router - hook func(*http.Request) - failures map[string]string - multiFailures []map[string]string - execCallbacks map[string]func() - statsCallbacks map[string]func(string) docker.Stats - customHandlers map[string]http.Handler - handlerMutex sync.RWMutex - cChan chan<- *docker.Container - volStore map[string]*volumeCounter - volMut sync.RWMutex -} - -type volumeCounter struct { - volume docker.Volume - count int -} - -// NewServer returns a new instance of the fake server, in standalone mode. Use -// the method URL to get the URL of the server. -// -// It receives the bind address (use 127.0.0.1:0 for getting an available port -// on the host), a channel of containers and a hook function, that will be -// called on every request. -// -// The fake server will send containers in the channel whenever the container -// changes its state, via the HTTP API (i.e.: create, start and stop). This -// channel may be nil, which means that the server won't notify on state -// changes. -func NewServer(bind string, containerChan chan<- *docker.Container, hook func(*http.Request)) (*DockerServer, error) { - listener, err := net.Listen("tcp", bind) - if err != nil { - return nil, err - } - server := DockerServer{ - listener: listener, - imgIDs: make(map[string]string), - hook: hook, - failures: make(map[string]string), - execCallbacks: make(map[string]func()), - statsCallbacks: make(map[string]func(string) docker.Stats), - customHandlers: make(map[string]http.Handler), - uploadedFiles: make(map[string]string), - cChan: containerChan, - } - server.buildMuxer() - go http.Serve(listener, &server) - return &server, nil -} - -func (s *DockerServer) notify(container *docker.Container) { - if s.cChan != nil { - s.cChan <- container - } -} - -func (s *DockerServer) buildMuxer() { - s.mux = mux.NewRouter() - s.mux.Path("/commit").Methods("POST").HandlerFunc(s.handlerWrapper(s.commitContainer)) - s.mux.Path("/containers/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.listContainers)) - s.mux.Path("/containers/create").Methods("POST").HandlerFunc(s.handlerWrapper(s.createContainer)) - s.mux.Path("/containers/{id:.*}/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.inspectContainer)) - s.mux.Path("/containers/{id:.*}/rename").Methods("POST").HandlerFunc(s.handlerWrapper(s.renameContainer)) - s.mux.Path("/containers/{id:.*}/top").Methods("GET").HandlerFunc(s.handlerWrapper(s.topContainer)) - s.mux.Path("/containers/{id:.*}/start").Methods("POST").HandlerFunc(s.handlerWrapper(s.startContainer)) - s.mux.Path("/containers/{id:.*}/kill").Methods("POST").HandlerFunc(s.handlerWrapper(s.stopContainer)) - s.mux.Path("/containers/{id:.*}/stop").Methods("POST").HandlerFunc(s.handlerWrapper(s.stopContainer)) - s.mux.Path("/containers/{id:.*}/pause").Methods("POST").HandlerFunc(s.handlerWrapper(s.pauseContainer)) - s.mux.Path("/containers/{id:.*}/unpause").Methods("POST").HandlerFunc(s.handlerWrapper(s.unpauseContainer)) - s.mux.Path("/containers/{id:.*}/wait").Methods("POST").HandlerFunc(s.handlerWrapper(s.waitContainer)) - s.mux.Path("/containers/{id:.*}/attach").Methods("POST").HandlerFunc(s.handlerWrapper(s.attachContainer)) - s.mux.Path("/containers/{id:.*}").Methods("DELETE").HandlerFunc(s.handlerWrapper(s.removeContainer)) - s.mux.Path("/containers/{id:.*}/exec").Methods("POST").HandlerFunc(s.handlerWrapper(s.createExecContainer)) - s.mux.Path("/containers/{id:.*}/stats").Methods("GET").HandlerFunc(s.handlerWrapper(s.statsContainer)) - s.mux.Path("/containers/{id:.*}/archive").Methods("PUT").HandlerFunc(s.handlerWrapper(s.uploadToContainer)) - s.mux.Path("/exec/{id:.*}/resize").Methods("POST").HandlerFunc(s.handlerWrapper(s.resizeExecContainer)) - s.mux.Path("/exec/{id:.*}/start").Methods("POST").HandlerFunc(s.handlerWrapper(s.startExecContainer)) - s.mux.Path("/exec/{id:.*}/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.inspectExecContainer)) - s.mux.Path("/images/create").Methods("POST").HandlerFunc(s.handlerWrapper(s.pullImage)) - s.mux.Path("/build").Methods("POST").HandlerFunc(s.handlerWrapper(s.buildImage)) - s.mux.Path("/images/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.listImages)) - s.mux.Path("/images/{id:.*}").Methods("DELETE").HandlerFunc(s.handlerWrapper(s.removeImage)) - s.mux.Path("/images/{name:.*}/json").Methods("GET").HandlerFunc(s.handlerWrapper(s.inspectImage)) - s.mux.Path("/images/{name:.*}/push").Methods("POST").HandlerFunc(s.handlerWrapper(s.pushImage)) - s.mux.Path("/images/{name:.*}/tag").Methods("POST").HandlerFunc(s.handlerWrapper(s.tagImage)) - s.mux.Path("/events").Methods("GET").HandlerFunc(s.listEvents) - s.mux.Path("/_ping").Methods("GET").HandlerFunc(s.handlerWrapper(s.pingDocker)) - s.mux.Path("/images/load").Methods("POST").HandlerFunc(s.handlerWrapper(s.loadImage)) - s.mux.Path("/images/{id:.*}/get").Methods("GET").HandlerFunc(s.handlerWrapper(s.getImage)) - s.mux.Path("/networks").Methods("GET").HandlerFunc(s.handlerWrapper(s.listNetworks)) - s.mux.Path("/networks/{id:.*}").Methods("GET").HandlerFunc(s.handlerWrapper(s.networkInfo)) - s.mux.Path("/networks").Methods("POST").HandlerFunc(s.handlerWrapper(s.createNetwork)) - s.mux.Path("/volumes").Methods("GET").HandlerFunc(s.handlerWrapper(s.listVolumes)) - s.mux.Path("/volumes/create").Methods("POST").HandlerFunc(s.handlerWrapper(s.createVolume)) - s.mux.Path("/volumes/{name:.*}").Methods("GET").HandlerFunc(s.handlerWrapper(s.inspectVolume)) - s.mux.Path("/volumes/{name:.*}").Methods("DELETE").HandlerFunc(s.handlerWrapper(s.removeVolume)) -} - -// SetHook changes the hook function used by the server. -// -// The hook function is a function called on every request. -func (s *DockerServer) SetHook(hook func(*http.Request)) { - s.hook = hook -} - -// PrepareExec adds a callback to a container exec in the fake server. -// -// This function will be called whenever the given exec id is started, and the -// given exec id will remain in the "Running" start while the function is -// running, so it's useful for emulating an exec that runs for two seconds, for -// example: -// -// opts := docker.CreateExecOptions{ -// AttachStdin: true, -// AttachStdout: true, -// AttachStderr: true, -// Tty: true, -// Cmd: []string{"/bin/bash", "-l"}, -// } -// // Client points to a fake server. -// exec, err := client.CreateExec(opts) -// // handle error -// server.PrepareExec(exec.ID, func() {time.Sleep(2 * time.Second)}) -// err = client.StartExec(exec.ID, docker.StartExecOptions{Tty: true}) // will block for 2 seconds -// // handle error -func (s *DockerServer) PrepareExec(id string, callback func()) { - s.execCallbacks[id] = callback -} - -// PrepareStats adds a callback that will be called for each container stats -// call. -// -// This callback function will be called multiple times if stream is set to -// true when stats is called. -func (s *DockerServer) PrepareStats(id string, callback func(string) docker.Stats) { - s.statsCallbacks[id] = callback -} - -// PrepareFailure adds a new expected failure based on a URL regexp it receives -// an id for the failure. -func (s *DockerServer) PrepareFailure(id string, urlRegexp string) { - s.failures[id] = urlRegexp -} - -// PrepareMultiFailures enqueues a new expected failure based on a URL regexp -// it receives an id for the failure. -func (s *DockerServer) PrepareMultiFailures(id string, urlRegexp string) { - s.multiFailures = append(s.multiFailures, map[string]string{"error": id, "url": urlRegexp}) -} - -// ResetFailure removes an expected failure identified by the given id. -func (s *DockerServer) ResetFailure(id string) { - delete(s.failures, id) -} - -// ResetMultiFailures removes all enqueued failures. -func (s *DockerServer) ResetMultiFailures() { - s.multiFailures = []map[string]string{} -} - -// CustomHandler registers a custom handler for a specific path. -// -// For example: -// -// server.CustomHandler("/containers/json", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { -// http.Error(w, "Something wrong is not right", http.StatusInternalServerError) -// })) -func (s *DockerServer) CustomHandler(path string, handler http.Handler) { - s.handlerMutex.Lock() - s.customHandlers[path] = handler - s.handlerMutex.Unlock() -} - -// MutateContainer changes the state of a container, returning an error if the -// given id does not match to any container "running" in the server. -func (s *DockerServer) MutateContainer(id string, state docker.State) error { - for _, container := range s.containers { - if container.ID == id { - container.State = state - return nil - } - } - return errors.New("container not found") -} - -// Stop stops the server. -func (s *DockerServer) Stop() { - if s.listener != nil { - s.listener.Close() - } -} - -// URL returns the HTTP URL of the server. -func (s *DockerServer) URL() string { - if s.listener == nil { - return "" - } - return "http://" + s.listener.Addr().String() + "/" -} - -// ServeHTTP handles HTTP requests sent to the server. -func (s *DockerServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { - s.handlerMutex.RLock() - defer s.handlerMutex.RUnlock() - for re, handler := range s.customHandlers { - if m, _ := regexp.MatchString(re, r.URL.Path); m { - handler.ServeHTTP(w, r) - return - } - } - s.mux.ServeHTTP(w, r) - if s.hook != nil { - s.hook(r) - } -} - -// DefaultHandler returns default http.Handler mux, it allows customHandlers to -// call the default behavior if wanted. -func (s *DockerServer) DefaultHandler() http.Handler { - return s.mux -} - -func (s *DockerServer) handlerWrapper(f func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - for errorID, urlRegexp := range s.failures { - matched, err := regexp.MatchString(urlRegexp, r.URL.Path) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - if !matched { - continue - } - http.Error(w, errorID, http.StatusBadRequest) - return - } - for i, failure := range s.multiFailures { - matched, err := regexp.MatchString(failure["url"], r.URL.Path) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - if !matched { - continue - } - http.Error(w, failure["error"], http.StatusBadRequest) - s.multiFailures = append(s.multiFailures[:i], s.multiFailures[i+1:]...) - return - } - f(w, r) - } -} - -func (s *DockerServer) listContainers(w http.ResponseWriter, r *http.Request) { - all := r.URL.Query().Get("all") - s.cMut.RLock() - result := make([]docker.APIContainers, 0, len(s.containers)) - for _, container := range s.containers { - if all == "1" || container.State.Running { - result = append(result, docker.APIContainers{ - ID: container.ID, - Image: container.Image, - Command: fmt.Sprintf("%s %s", container.Path, strings.Join(container.Args, " ")), - Created: container.Created.Unix(), - Status: container.State.String(), - Ports: container.NetworkSettings.PortMappingAPI(), - Names: []string{fmt.Sprintf("/%s", container.Name)}, - }) - } - } - s.cMut.RUnlock() - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(result) -} - -func (s *DockerServer) listImages(w http.ResponseWriter, r *http.Request) { - s.cMut.RLock() - result := make([]docker.APIImages, len(s.images)) - for i, image := range s.images { - result[i] = docker.APIImages{ - ID: image.ID, - Created: image.Created.Unix(), - } - for tag, id := range s.imgIDs { - if id == image.ID { - result[i].RepoTags = append(result[i].RepoTags, tag) - } - } - } - s.cMut.RUnlock() - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(result) -} - -func (s *DockerServer) findImage(id string) (string, error) { - s.iMut.RLock() - defer s.iMut.RUnlock() - image, ok := s.imgIDs[id] - if ok { - return image, nil - } - image, _, err := s.findImageByID(id) - return image, err -} - -func (s *DockerServer) findImageByID(id string) (string, int, error) { - s.iMut.RLock() - defer s.iMut.RUnlock() - for i, image := range s.images { - if image.ID == id { - return image.ID, i, nil - } - } - return "", -1, errors.New("No such image") -} - -func (s *DockerServer) createContainer(w http.ResponseWriter, r *http.Request) { - var config struct { - *docker.Config - HostConfig *docker.HostConfig - } - defer r.Body.Close() - err := json.NewDecoder(r.Body).Decode(&config) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - name := r.URL.Query().Get("name") - if name != "" && !nameRegexp.MatchString(name) { - http.Error(w, "Invalid container name", http.StatusInternalServerError) - return - } - if _, err := s.findImage(config.Image); err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - ports := map[docker.Port][]docker.PortBinding{} - for port := range config.ExposedPorts { - ports[port] = []docker.PortBinding{{ - HostIP: "0.0.0.0", - HostPort: strconv.Itoa(mathrand.Int() % 0xffff), - }} - } - - //the container may not have cmd when using a Dockerfile - var path string - var args []string - if len(config.Cmd) == 1 { - path = config.Cmd[0] - } else if len(config.Cmd) > 1 { - path = config.Cmd[0] - args = config.Cmd[1:] - } - - generatedID := s.generateID() - config.Config.Hostname = generatedID[:12] - container := docker.Container{ - Name: name, - ID: generatedID, - Created: time.Now(), - Path: path, - Args: args, - Config: config.Config, - HostConfig: config.HostConfig, - State: docker.State{ - Running: false, - Pid: mathrand.Int() % 50000, - ExitCode: 0, - StartedAt: time.Now(), - }, - Image: config.Image, - NetworkSettings: &docker.NetworkSettings{ - IPAddress: fmt.Sprintf("172.16.42.%d", mathrand.Int()%250+2), - IPPrefixLen: 24, - Gateway: "172.16.42.1", - Bridge: "docker0", - Ports: ports, - }, - } - s.cMut.Lock() - if container.Name != "" { - for _, c := range s.containers { - if c.Name == container.Name { - defer s.cMut.Unlock() - http.Error(w, "there's already a container with this name", http.StatusConflict) - return - } - } - } - s.containers = append(s.containers, &container) - s.cMut.Unlock() - w.WriteHeader(http.StatusCreated) - s.notify(&container) - - json.NewEncoder(w).Encode(container) -} - -func (s *DockerServer) generateID() string { - var buf [16]byte - rand.Read(buf[:]) - return fmt.Sprintf("%x", buf) -} - -func (s *DockerServer) renameContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, index, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - copy := *container - copy.Name = r.URL.Query().Get("name") - s.cMut.Lock() - defer s.cMut.Unlock() - if s.containers[index].ID == copy.ID { - s.containers[index] = © - } - w.WriteHeader(http.StatusNoContent) -} - -func (s *DockerServer) inspectContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(container) -} - -func (s *DockerServer) statsContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - _, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - stream, _ := strconv.ParseBool(r.URL.Query().Get("stream")) - callback := s.statsCallbacks[id] - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - encoder := json.NewEncoder(w) - for { - var stats docker.Stats - if callback != nil { - stats = callback(id) - } - encoder.Encode(stats) - if !stream { - break - } - } -} - -func (s *DockerServer) uploadToContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - if !container.State.Running { - w.WriteHeader(http.StatusInternalServerError) - fmt.Fprintf(w, "Container %s is not running", id) - return - } - path := r.URL.Query().Get("path") - s.uploadedFiles[id] = path - w.WriteHeader(http.StatusOK) -} - -func (s *DockerServer) topContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - if !container.State.Running { - w.WriteHeader(http.StatusInternalServerError) - fmt.Fprintf(w, "Container %s is not running", id) - return - } - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - result := docker.TopResult{ - Titles: []string{"UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD"}, - Processes: [][]string{ - {"root", "7535", "7516", "0", "03:20", "?", "00:00:00", container.Path + " " + strings.Join(container.Args, " ")}, - }, - } - json.NewEncoder(w).Encode(result) -} - -func (s *DockerServer) startContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - s.cMut.Lock() - defer s.cMut.Unlock() - defer r.Body.Close() - var hostConfig docker.HostConfig - err = json.NewDecoder(r.Body).Decode(&hostConfig) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - container.HostConfig = &hostConfig - if len(hostConfig.PortBindings) > 0 { - ports := map[docker.Port][]docker.PortBinding{} - for key, items := range hostConfig.PortBindings { - bindings := make([]docker.PortBinding, len(items)) - for i := range items { - binding := docker.PortBinding{ - HostIP: items[i].HostIP, - HostPort: items[i].HostPort, - } - if binding.HostIP == "" { - binding.HostIP = "0.0.0.0" - } - if binding.HostPort == "" { - binding.HostPort = strconv.Itoa(mathrand.Int() % 0xffff) - } - bindings[i] = binding - } - ports[key] = bindings - } - container.NetworkSettings.Ports = ports - } - if container.State.Running { - http.Error(w, "", http.StatusNotModified) - return - } - container.State.Running = true - s.notify(container) -} - -func (s *DockerServer) stopContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - s.cMut.Lock() - defer s.cMut.Unlock() - if !container.State.Running { - http.Error(w, "Container not running", http.StatusBadRequest) - return - } - w.WriteHeader(http.StatusNoContent) - container.State.Running = false - s.notify(container) -} - -func (s *DockerServer) pauseContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - s.cMut.Lock() - defer s.cMut.Unlock() - if container.State.Paused { - http.Error(w, "Container already paused", http.StatusBadRequest) - return - } - w.WriteHeader(http.StatusNoContent) - container.State.Paused = true -} - -func (s *DockerServer) unpauseContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - s.cMut.Lock() - defer s.cMut.Unlock() - if !container.State.Paused { - http.Error(w, "Container not paused", http.StatusBadRequest) - return - } - w.WriteHeader(http.StatusNoContent) - container.State.Paused = false -} - -func (s *DockerServer) attachContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - hijacker, ok := w.(http.Hijacker) - if !ok { - http.Error(w, "cannot hijack connection", http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/vnd.docker.raw-stream") - w.WriteHeader(http.StatusOK) - conn, _, err := hijacker.Hijack() - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - wg := sync.WaitGroup{} - if r.URL.Query().Get("stdin") == "1" { - wg.Add(1) - go func() { - ioutil.ReadAll(conn) - wg.Done() - }() - } - outStream := stdcopy.NewStdWriter(conn, stdcopy.Stdout) - if container.State.Running { - fmt.Fprintf(outStream, "Container is running\n") - } else { - fmt.Fprintf(outStream, "Container is not running\n") - } - fmt.Fprintln(outStream, "What happened?") - fmt.Fprintln(outStream, "Something happened") - wg.Wait() - if r.URL.Query().Get("stream") == "1" { - for { - time.Sleep(1e6) - s.cMut.RLock() - if !container.State.Running { - s.cMut.RUnlock() - break - } - s.cMut.RUnlock() - } - } - conn.Close() -} - -func (s *DockerServer) waitContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - for { - time.Sleep(1e6) - s.cMut.RLock() - if !container.State.Running { - s.cMut.RUnlock() - break - } - s.cMut.RUnlock() - } - result := map[string]int{"StatusCode": container.State.ExitCode} - json.NewEncoder(w).Encode(result) -} - -func (s *DockerServer) removeContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - force := r.URL.Query().Get("force") - container, index, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - if container.State.Running && force != "1" { - msg := "Error: API error (406): Impossible to remove a running container, please stop it first" - http.Error(w, msg, http.StatusInternalServerError) - return - } - w.WriteHeader(http.StatusNoContent) - s.cMut.Lock() - defer s.cMut.Unlock() - if s.containers[index].ID == id || s.containers[index].Name == id { - s.containers[index] = s.containers[len(s.containers)-1] - s.containers = s.containers[:len(s.containers)-1] - } -} - -func (s *DockerServer) commitContainer(w http.ResponseWriter, r *http.Request) { - id := r.URL.Query().Get("container") - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - var config *docker.Config - runConfig := r.URL.Query().Get("run") - if runConfig != "" { - config = new(docker.Config) - err = json.Unmarshal([]byte(runConfig), config) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - } - w.WriteHeader(http.StatusOK) - image := docker.Image{ - ID: "img-" + container.ID, - Parent: container.Image, - Container: container.ID, - Comment: r.URL.Query().Get("m"), - Author: r.URL.Query().Get("author"), - Config: config, - } - repository := r.URL.Query().Get("repo") - tag := r.URL.Query().Get("tag") - s.iMut.Lock() - s.images = append(s.images, image) - if repository != "" { - if tag != "" { - repository += ":" + tag - } - s.imgIDs[repository] = image.ID - } - s.iMut.Unlock() - fmt.Fprintf(w, `{"ID":%q}`, image.ID) -} - -func (s *DockerServer) findContainer(idOrName string) (*docker.Container, int, error) { - s.cMut.RLock() - defer s.cMut.RUnlock() - for i, container := range s.containers { - if container.ID == idOrName || container.Name == idOrName { - return container, i, nil - } - } - return nil, -1, errors.New("No such container") -} - -func (s *DockerServer) buildImage(w http.ResponseWriter, r *http.Request) { - if ct := r.Header.Get("Content-Type"); ct == "application/tar" { - gotDockerFile := false - tr := tar.NewReader(r.Body) - for { - header, err := tr.Next() - if err != nil { - break - } - if header.Name == "Dockerfile" { - gotDockerFile = true - } - } - if !gotDockerFile { - w.WriteHeader(http.StatusBadRequest) - w.Write([]byte("miss Dockerfile")) - return - } - } - //we did not use that Dockerfile to build image cause we are a fake Docker daemon - image := docker.Image{ - ID: s.generateID(), - Created: time.Now(), - } - - query := r.URL.Query() - repository := image.ID - if t := query.Get("t"); t != "" { - repository = t - } - s.iMut.Lock() - s.images = append(s.images, image) - s.imgIDs[repository] = image.ID - s.iMut.Unlock() - w.Write([]byte(fmt.Sprintf("Successfully built %s", image.ID))) -} - -func (s *DockerServer) pullImage(w http.ResponseWriter, r *http.Request) { - fromImageName := r.URL.Query().Get("fromImage") - tag := r.URL.Query().Get("tag") - image := docker.Image{ - ID: s.generateID(), - } - s.iMut.Lock() - s.images = append(s.images, image) - if fromImageName != "" { - if tag != "" { - fromImageName = fmt.Sprintf("%s:%s", fromImageName, tag) - } - s.imgIDs[fromImageName] = image.ID - } - s.iMut.Unlock() -} - -func (s *DockerServer) pushImage(w http.ResponseWriter, r *http.Request) { - name := mux.Vars(r)["name"] - tag := r.URL.Query().Get("tag") - if tag != "" { - name += ":" + tag - } - s.iMut.RLock() - if _, ok := s.imgIDs[name]; !ok { - s.iMut.RUnlock() - http.Error(w, "No such image", http.StatusNotFound) - return - } - s.iMut.RUnlock() - fmt.Fprintln(w, "Pushing...") - fmt.Fprintln(w, "Pushed") -} - -func (s *DockerServer) tagImage(w http.ResponseWriter, r *http.Request) { - name := mux.Vars(r)["name"] - s.iMut.RLock() - if _, ok := s.imgIDs[name]; !ok { - s.iMut.RUnlock() - http.Error(w, "No such image", http.StatusNotFound) - return - } - s.iMut.RUnlock() - s.iMut.Lock() - defer s.iMut.Unlock() - newRepo := r.URL.Query().Get("repo") - newTag := r.URL.Query().Get("tag") - if newTag != "" { - newRepo += ":" + newTag - } - s.imgIDs[newRepo] = s.imgIDs[name] - w.WriteHeader(http.StatusCreated) -} - -func (s *DockerServer) removeImage(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - s.iMut.RLock() - var tag string - if img, ok := s.imgIDs[id]; ok { - id, tag = img, id - } - var tags []string - for tag, taggedID := range s.imgIDs { - if taggedID == id { - tags = append(tags, tag) - } - } - s.iMut.RUnlock() - _, index, err := s.findImageByID(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - w.WriteHeader(http.StatusNoContent) - s.iMut.Lock() - defer s.iMut.Unlock() - if len(tags) < 2 { - s.images[index] = s.images[len(s.images)-1] - s.images = s.images[:len(s.images)-1] - } - if tag != "" { - delete(s.imgIDs, tag) - } -} - -func (s *DockerServer) inspectImage(w http.ResponseWriter, r *http.Request) { - name := mux.Vars(r)["name"] - s.iMut.RLock() - defer s.iMut.RUnlock() - if id, ok := s.imgIDs[name]; ok { - for _, img := range s.images { - if img.ID == id { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(img) - return - } - } - } - http.Error(w, "not found", http.StatusNotFound) -} - -func (s *DockerServer) listEvents(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - var events [][]byte - count := mathrand.Intn(20) - for i := 0; i < count; i++ { - data, err := json.Marshal(s.generateEvent()) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - events = append(events, data) - } - w.WriteHeader(http.StatusOK) - for _, d := range events { - fmt.Fprintln(w, d) - time.Sleep(time.Duration(mathrand.Intn(200)) * time.Millisecond) - } -} - -func (s *DockerServer) pingDocker(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) -} - -func (s *DockerServer) generateEvent() *docker.APIEvents { - var eventType string - switch mathrand.Intn(4) { - case 0: - eventType = "create" - case 1: - eventType = "start" - case 2: - eventType = "stop" - case 3: - eventType = "destroy" - } - return &docker.APIEvents{ - ID: s.generateID(), - Status: eventType, - From: "mybase:latest", - Time: time.Now().Unix(), - } -} - -func (s *DockerServer) loadImage(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) -} - -func (s *DockerServer) getImage(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.Header().Set("Content-Type", "application/tar") -} - -func (s *DockerServer) createExecContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - container, _, err := s.findContainer(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - - execID := s.generateID() - container.ExecIDs = append(container.ExecIDs, execID) - - exec := docker.ExecInspect{ - ID: execID, - Container: *container, - } - - var params docker.CreateExecOptions - err = json.NewDecoder(r.Body).Decode(¶ms) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - if len(params.Cmd) > 0 { - exec.ProcessConfig.EntryPoint = params.Cmd[0] - if len(params.Cmd) > 1 { - exec.ProcessConfig.Arguments = params.Cmd[1:] - } - } - - exec.ProcessConfig.User = params.User - exec.ProcessConfig.Tty = params.Tty - - s.execMut.Lock() - s.execs = append(s.execs, &exec) - s.execMut.Unlock() - w.WriteHeader(http.StatusOK) - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(map[string]string{"Id": exec.ID}) -} - -func (s *DockerServer) startExecContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - if exec, err := s.getExec(id, false); err == nil { - s.execMut.Lock() - exec.Running = true - s.execMut.Unlock() - if callback, ok := s.execCallbacks[id]; ok { - callback() - delete(s.execCallbacks, id) - } else if callback, ok := s.execCallbacks["*"]; ok { - callback() - delete(s.execCallbacks, "*") - } - s.execMut.Lock() - exec.Running = false - s.execMut.Unlock() - w.WriteHeader(http.StatusOK) - return - } - w.WriteHeader(http.StatusNotFound) -} - -func (s *DockerServer) resizeExecContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - if _, err := s.getExec(id, false); err == nil { - w.WriteHeader(http.StatusOK) - return - } - w.WriteHeader(http.StatusNotFound) -} - -func (s *DockerServer) inspectExecContainer(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - if exec, err := s.getExec(id, true); err == nil { - w.WriteHeader(http.StatusOK) - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(exec) - return - } - w.WriteHeader(http.StatusNotFound) -} - -func (s *DockerServer) getExec(id string, copy bool) (*docker.ExecInspect, error) { - s.execMut.RLock() - defer s.execMut.RUnlock() - for _, exec := range s.execs { - if exec.ID == id { - if copy { - cp := *exec - exec = &cp - } - return exec, nil - } - } - return nil, errors.New("exec not found") -} - -func (s *DockerServer) findNetwork(idOrName string) (*docker.Network, int, error) { - s.netMut.RLock() - defer s.netMut.RUnlock() - for i, network := range s.networks { - if network.ID == idOrName || network.Name == idOrName { - return network, i, nil - } - } - return nil, -1, errors.New("No such network") -} - -func (s *DockerServer) listNetworks(w http.ResponseWriter, r *http.Request) { - s.netMut.RLock() - result := make([]docker.Network, 0, len(s.networks)) - for _, network := range s.networks { - result = append(result, *network) - } - s.netMut.RUnlock() - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(result) -} - -func (s *DockerServer) networkInfo(w http.ResponseWriter, r *http.Request) { - id := mux.Vars(r)["id"] - network, _, err := s.findNetwork(id) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(network) -} - -// isValidName validates configuration objects supported by libnetwork -func isValidName(name string) bool { - if name == "" || strings.Contains(name, ".") { - return false - } - return true -} - -func (s *DockerServer) createNetwork(w http.ResponseWriter, r *http.Request) { - var config *docker.CreateNetworkOptions - defer r.Body.Close() - err := json.NewDecoder(r.Body).Decode(&config) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - if !isValidName(config.Name) { - http.Error(w, "Invalid network name", http.StatusBadRequest) - return - } - if n, _, _ := s.findNetwork(config.Name); n != nil { - http.Error(w, "network already exists", http.StatusForbidden) - return - } - - generatedID := s.generateID() - network := docker.Network{ - Name: config.Name, - ID: generatedID, - Driver: config.Driver, - } - s.netMut.Lock() - s.networks = append(s.networks, &network) - s.netMut.Unlock() - w.WriteHeader(http.StatusCreated) - var c = struct{ ID string }{ID: network.ID} - json.NewEncoder(w).Encode(c) -} - -func (s *DockerServer) listVolumes(w http.ResponseWriter, r *http.Request) { - s.volMut.RLock() - result := make([]docker.Volume, 0, len(s.volStore)) - for _, volumeCounter := range s.volStore { - result = append(result, volumeCounter.volume) - } - s.volMut.RUnlock() - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(result) -} - -func (s *DockerServer) createVolume(w http.ResponseWriter, r *http.Request) { - var data struct { - *docker.CreateVolumeOptions - } - defer r.Body.Close() - err := json.NewDecoder(r.Body).Decode(&data) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - volume := &docker.Volume{ - Name: data.CreateVolumeOptions.Name, - Driver: data.CreateVolumeOptions.Driver, - } - // If the name is not specified, generate one. Just using generateID for now - if len(volume.Name) == 0 { - volume.Name = s.generateID() - } - // If driver is not specified, use local - if len(volume.Driver) == 0 { - volume.Driver = "local" - } - // Mount point is a default one with name - volume.Mountpoint = "/var/lib/docker/volumes/" + volume.Name - - // If the volume already exists, don't re-add it. - exists := false - s.volMut.Lock() - if s.volStore != nil { - _, exists = s.volStore[volume.Name] - } else { - // No volumes, create volStore - s.volStore = make(map[string]*volumeCounter) - } - if !exists { - s.volStore[volume.Name] = &volumeCounter{ - volume: *volume, - count: 0, - } - } - s.volMut.Unlock() - w.WriteHeader(http.StatusCreated) - json.NewEncoder(w).Encode(volume) -} - -func (s *DockerServer) inspectVolume(w http.ResponseWriter, r *http.Request) { - s.volMut.RLock() - defer s.volMut.RUnlock() - name := mux.Vars(r)["name"] - vol, err := s.findVolume(name) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(vol.volume) -} - -func (s *DockerServer) findVolume(name string) (*volumeCounter, error) { - vol, ok := s.volStore[name] - if !ok { - return nil, errors.New("no such volume") - } - return vol, nil -} - -func (s *DockerServer) removeVolume(w http.ResponseWriter, r *http.Request) { - s.volMut.Lock() - defer s.volMut.Unlock() - name := mux.Vars(r)["name"] - vol, err := s.findVolume(name) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) - return - } - if vol.count != 0 { - http.Error(w, "volume in use and cannot be removed", http.StatusConflict) - return - } - s.volStore[vol.volume.Name] = nil - w.WriteHeader(http.StatusNoContent) -} diff --git a/vendor/github.com/go-chef/chef/examples/cookbooks/cookbooks.go b/vendor/github.com/go-chef/chef/examples/cookbooks/cookbooks.go deleted file mode 100644 index d9cb1ebcc..000000000 --- a/vendor/github.com/go-chef/chef/examples/cookbooks/cookbooks.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "os" - - "github.com/go-chef/chef" -) - -func main() { - // simple arg parsing - //cookPath := flag.String("cookbook", "c", "Path to cookbook for upload") - // flag.Parse() - - // read a client key - key, err := ioutil.ReadFile("key.pem") - if err != nil { - fmt.Println("Couldn't read key.pem:", err) - os.Exit(1) - } - - // build a client - client, err := chef.NewClient(&chef.Config{ - Name: "foo", - Key: string(key), - // goiardi is on port 4545 by default. chef-zero is 8889 - BaseURL: "http://localhost:8443", - }) - if err != nil { - fmt.Println("Issue setting up client:", err) - os.Exit(1) - } - - // List Cookbooks - cookList, err := client.Cookbooks.List() - if err != nil { - fmt.Println("Issue listing cookbooks:", err) - } - - // Print out the list - fmt.Println(cookList) - /* - *'parse' metadata... - this would prefer .json over .rb - if it's .rb lets maybe try to eval it ? - otherwise just extract name/version if they exist - */ - - /* - - - * generate sums - * create sandbox - * upload to sandbox - * - */ - -} diff --git a/vendor/github.com/go-chef/chef/examples/cookbooks/key.pem b/vendor/github.com/go-chef/chef/examples/cookbooks/key.pem deleted file mode 100644 index f44ac76ec..000000000 --- a/vendor/github.com/go-chef/chef/examples/cookbooks/key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAx12nDxxOwSPHRSJEDz67a0folBqElzlu2oGMiUTS+dqtj3FU -h5lJc1MjcprRVxcDVwhsSSo9948XEkk39IdblUCLohucqNMzOnIcdZn8zblN7Cnp -W03UwRM0iWX1HuwHnGvm6PKeqKGqplyIXYO0qlDWCzC+VaxFTwOUk31MfOHJQn4y -fTrfuE7h3FTElLBu065SFp3dPICIEmWCl9DadnxbnZ8ASxYQ9xG7hmZduDgjNW5l -3x6/EFkpym+//D6AbWDcVJ1ovCsJL3CfH/NZC3ekeJ/aEeLxP/vaCSH1VYC5VsYK -5Qg7SIa6Nth3+RZz1hYOoBJulEzwljznwoZYRQIDAQABAoIBADPQol+qAsnty5er -PTcdHcbXLJp5feZz1dzSeL0gdxja/erfEJIhg9aGUBs0I55X69VN6h7l7K8PsHZf -MzzJhUL4QJJETOYP5iuVhtIF0I+DTr5Hck/5nYcEv83KAvgjbiL4ZE486IF5awnL -2OE9HtJ5KfhEleNcX7MWgiIHGb8G1jCqu/tH0GI8Z4cNgUrXMbczGwfbN/5Wc0zo -Dtpe0Tec/Fd0DLFwRiAuheakPjlVWb7AGMDX4TyzCXfMpS1ul2jk6nGFk77uQozF -PQUawCRp+mVS4qecgq/WqfTZZbBlW2L18/kpafvsxG8kJ7OREtrb0SloZNFHEc2Q -70GbgKECgYEA6c/eOrI3Uour1gKezEBFmFKFH6YS/NZNpcSG5PcoqF6AVJwXg574 -Qy6RatC47e92be2TT1Oyplntj4vkZ3REv81yfz/tuXmtG0AylH7REbxubxAgYmUT -18wUAL4s3TST2AlK4R29KwBadwUAJeOLNW+Rc4xht1galsqQRb4pUzkCgYEA2kj2 -vUhKAB7QFCPST45/5q+AATut8WeHnI+t1UaiZoK41Jre8TwlYqUgcJ16Q0H6KIbJ -jlEZAu0IsJxjQxkD4oJgv8n5PFXdc14HcSQ512FmgCGNwtDY/AT7SQP3kOj0Rydg -N02uuRb/55NJ07Bh+yTQNGA+M5SSnUyaRPIAMW0CgYBgVU7grDDzB60C/g1jZk/G -VKmYwposJjfTxsc1a0gLJvSE59MgXc04EOXFNr4a+oC3Bh2dn4SJ2Z9xd1fh8Bur -UwCLwVE3DBTwl2C/ogiN4C83/1L4d2DXlrPfInvloBYR+rIpUlFweDLNuve2pKvk -llU9YGeaXOiHnGoY8iKgsQKBgQDZKMOHtZYhHoZlsul0ylCGAEz5bRT0V8n7QJlw -12+TSjN1F4n6Npr+00Y9ov1SUh38GXQFiLq4RXZitYKu6wEJZCm6Q8YXd1jzgDUp -IyAEHNsrV7Y/fSSRPKd9kVvGp2r2Kr825aqQasg16zsERbKEdrBHmwPmrsVZhi7n -rlXw1QKBgQDBOyUJKQOgDE2u9EHybhCIbfowyIE22qn9a3WjQgfxFJ+aAL9Bg124 -fJIEzz43fJ91fe5lTOgyMF5TtU5ClAOPGtlWnXU0e5j3L4LjbcqzEbeyxvP3sn1z -dYkX7NdNQ5E6tcJZuJCGq0HxIAQeKPf3x9DRKzMnLply6BEzyuAC4g== ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/go-chef/chef/examples/nodes/key.pem b/vendor/github.com/go-chef/chef/examples/nodes/key.pem deleted file mode 100644 index f44ac76ec..000000000 --- a/vendor/github.com/go-chef/chef/examples/nodes/key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAx12nDxxOwSPHRSJEDz67a0folBqElzlu2oGMiUTS+dqtj3FU -h5lJc1MjcprRVxcDVwhsSSo9948XEkk39IdblUCLohucqNMzOnIcdZn8zblN7Cnp -W03UwRM0iWX1HuwHnGvm6PKeqKGqplyIXYO0qlDWCzC+VaxFTwOUk31MfOHJQn4y -fTrfuE7h3FTElLBu065SFp3dPICIEmWCl9DadnxbnZ8ASxYQ9xG7hmZduDgjNW5l -3x6/EFkpym+//D6AbWDcVJ1ovCsJL3CfH/NZC3ekeJ/aEeLxP/vaCSH1VYC5VsYK -5Qg7SIa6Nth3+RZz1hYOoBJulEzwljznwoZYRQIDAQABAoIBADPQol+qAsnty5er -PTcdHcbXLJp5feZz1dzSeL0gdxja/erfEJIhg9aGUBs0I55X69VN6h7l7K8PsHZf -MzzJhUL4QJJETOYP5iuVhtIF0I+DTr5Hck/5nYcEv83KAvgjbiL4ZE486IF5awnL -2OE9HtJ5KfhEleNcX7MWgiIHGb8G1jCqu/tH0GI8Z4cNgUrXMbczGwfbN/5Wc0zo -Dtpe0Tec/Fd0DLFwRiAuheakPjlVWb7AGMDX4TyzCXfMpS1ul2jk6nGFk77uQozF -PQUawCRp+mVS4qecgq/WqfTZZbBlW2L18/kpafvsxG8kJ7OREtrb0SloZNFHEc2Q -70GbgKECgYEA6c/eOrI3Uour1gKezEBFmFKFH6YS/NZNpcSG5PcoqF6AVJwXg574 -Qy6RatC47e92be2TT1Oyplntj4vkZ3REv81yfz/tuXmtG0AylH7REbxubxAgYmUT -18wUAL4s3TST2AlK4R29KwBadwUAJeOLNW+Rc4xht1galsqQRb4pUzkCgYEA2kj2 -vUhKAB7QFCPST45/5q+AATut8WeHnI+t1UaiZoK41Jre8TwlYqUgcJ16Q0H6KIbJ -jlEZAu0IsJxjQxkD4oJgv8n5PFXdc14HcSQ512FmgCGNwtDY/AT7SQP3kOj0Rydg -N02uuRb/55NJ07Bh+yTQNGA+M5SSnUyaRPIAMW0CgYBgVU7grDDzB60C/g1jZk/G -VKmYwposJjfTxsc1a0gLJvSE59MgXc04EOXFNr4a+oC3Bh2dn4SJ2Z9xd1fh8Bur -UwCLwVE3DBTwl2C/ogiN4C83/1L4d2DXlrPfInvloBYR+rIpUlFweDLNuve2pKvk -llU9YGeaXOiHnGoY8iKgsQKBgQDZKMOHtZYhHoZlsul0ylCGAEz5bRT0V8n7QJlw -12+TSjN1F4n6Npr+00Y9ov1SUh38GXQFiLq4RXZitYKu6wEJZCm6Q8YXd1jzgDUp -IyAEHNsrV7Y/fSSRPKd9kVvGp2r2Kr825aqQasg16zsERbKEdrBHmwPmrsVZhi7n -rlXw1QKBgQDBOyUJKQOgDE2u9EHybhCIbfowyIE22qn9a3WjQgfxFJ+aAL9Bg124 -fJIEzz43fJ91fe5lTOgyMF5TtU5ClAOPGtlWnXU0e5j3L4LjbcqzEbeyxvP3sn1z -dYkX7NdNQ5E6tcJZuJCGq0HxIAQeKPf3x9DRKzMnLply6BEzyuAC4g== ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/go-chef/chef/examples/nodes/nodes.go b/vendor/github.com/go-chef/chef/examples/nodes/nodes.go deleted file mode 100644 index 9262bec18..000000000 --- a/vendor/github.com/go-chef/chef/examples/nodes/nodes.go +++ /dev/null @@ -1,86 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "os" - - "github.com/go-chef/chef" -) - -func main() { - // read a client key - key, err := ioutil.ReadFile("key.pem") - if err != nil { - fmt.Println("Couldn't read key.pem:", err) - os.Exit(1) - } - - // build a client - client, err := chef.NewClient(&chef.Config{ - Name: "foo", - Key: string(key), - // goiardi is on port 4545 by default. chef-zero is 8889 - BaseURL: "http://localhost:4545", - }) - if err != nil { - fmt.Println("Issue setting up client:", err) - os.Exit(1) - } - - // Create a Node object - // TOOD: should have a constructor for this - ranjib := chef.Node{ - Name: "ranjib", - Environment: "_default", - ChefType: "node", - JsonClass: "Chef::Node", - RunList: []string{"pwn"}, - } - - // Delete node ignoring errors :) - client.Nodes.Delete(ranjib.Name) - - // Create - _, err = client.Nodes.Post(ranjib) - if err != nil { - log.Fatal("Couldn't create node. ", err) - } - - // List nodes - nodeList, err := client.Nodes.List() - if err != nil { - log.Fatal("Couldn't list nodes: ", err) - } - - // dump the node list in Json - jsonData, err := json.MarshalIndent(nodeList, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - - // dump the ranjib node we got from server in JSON! - serverNode, _ := client.Nodes.Get("ranjib") - if err != nil { - log.Fatal("Couldn't get node: ", err) - } - jsonData, err = json.MarshalIndent(serverNode, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - - // update node - ranjib.RunList = append(ranjib.RunList, "recipe[works]") - jsonData, err = json.MarshalIndent(ranjib, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - - _, err = client.Nodes.Put(ranjib) - if err != nil { - log.Fatal("Couldn't update node: ", err) - } - - // Delete node ignoring errors :) - client.Nodes.Delete(ranjib.Name) - -} diff --git a/vendor/github.com/go-chef/chef/examples/sandboxes/key.pem b/vendor/github.com/go-chef/chef/examples/sandboxes/key.pem deleted file mode 100644 index f44ac76ec..000000000 --- a/vendor/github.com/go-chef/chef/examples/sandboxes/key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAx12nDxxOwSPHRSJEDz67a0folBqElzlu2oGMiUTS+dqtj3FU -h5lJc1MjcprRVxcDVwhsSSo9948XEkk39IdblUCLohucqNMzOnIcdZn8zblN7Cnp -W03UwRM0iWX1HuwHnGvm6PKeqKGqplyIXYO0qlDWCzC+VaxFTwOUk31MfOHJQn4y -fTrfuE7h3FTElLBu065SFp3dPICIEmWCl9DadnxbnZ8ASxYQ9xG7hmZduDgjNW5l -3x6/EFkpym+//D6AbWDcVJ1ovCsJL3CfH/NZC3ekeJ/aEeLxP/vaCSH1VYC5VsYK -5Qg7SIa6Nth3+RZz1hYOoBJulEzwljznwoZYRQIDAQABAoIBADPQol+qAsnty5er -PTcdHcbXLJp5feZz1dzSeL0gdxja/erfEJIhg9aGUBs0I55X69VN6h7l7K8PsHZf -MzzJhUL4QJJETOYP5iuVhtIF0I+DTr5Hck/5nYcEv83KAvgjbiL4ZE486IF5awnL -2OE9HtJ5KfhEleNcX7MWgiIHGb8G1jCqu/tH0GI8Z4cNgUrXMbczGwfbN/5Wc0zo -Dtpe0Tec/Fd0DLFwRiAuheakPjlVWb7AGMDX4TyzCXfMpS1ul2jk6nGFk77uQozF -PQUawCRp+mVS4qecgq/WqfTZZbBlW2L18/kpafvsxG8kJ7OREtrb0SloZNFHEc2Q -70GbgKECgYEA6c/eOrI3Uour1gKezEBFmFKFH6YS/NZNpcSG5PcoqF6AVJwXg574 -Qy6RatC47e92be2TT1Oyplntj4vkZ3REv81yfz/tuXmtG0AylH7REbxubxAgYmUT -18wUAL4s3TST2AlK4R29KwBadwUAJeOLNW+Rc4xht1galsqQRb4pUzkCgYEA2kj2 -vUhKAB7QFCPST45/5q+AATut8WeHnI+t1UaiZoK41Jre8TwlYqUgcJ16Q0H6KIbJ -jlEZAu0IsJxjQxkD4oJgv8n5PFXdc14HcSQ512FmgCGNwtDY/AT7SQP3kOj0Rydg -N02uuRb/55NJ07Bh+yTQNGA+M5SSnUyaRPIAMW0CgYBgVU7grDDzB60C/g1jZk/G -VKmYwposJjfTxsc1a0gLJvSE59MgXc04EOXFNr4a+oC3Bh2dn4SJ2Z9xd1fh8Bur -UwCLwVE3DBTwl2C/ogiN4C83/1L4d2DXlrPfInvloBYR+rIpUlFweDLNuve2pKvk -llU9YGeaXOiHnGoY8iKgsQKBgQDZKMOHtZYhHoZlsul0ylCGAEz5bRT0V8n7QJlw -12+TSjN1F4n6Npr+00Y9ov1SUh38GXQFiLq4RXZitYKu6wEJZCm6Q8YXd1jzgDUp -IyAEHNsrV7Y/fSSRPKd9kVvGp2r2Kr825aqQasg16zsERbKEdrBHmwPmrsVZhi7n -rlXw1QKBgQDBOyUJKQOgDE2u9EHybhCIbfowyIE22qn9a3WjQgfxFJ+aAL9Bg124 -fJIEzz43fJ91fe5lTOgyMF5TtU5ClAOPGtlWnXU0e5j3L4LjbcqzEbeyxvP3sn1z -dYkX7NdNQ5E6tcJZuJCGq0HxIAQeKPf3x9DRKzMnLply6BEzyuAC4g== ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/go-chef/chef/examples/sandboxes/sandboxes.go b/vendor/github.com/go-chef/chef/examples/sandboxes/sandboxes.go deleted file mode 100644 index 21d06b5b0..000000000 --- a/vendor/github.com/go-chef/chef/examples/sandboxes/sandboxes.go +++ /dev/null @@ -1,103 +0,0 @@ -package main - -import ( - "bytes" - "crypto/md5" - "crypto/rand" - "encoding/json" - "fmt" - "io/ioutil" - "os" - - "github.com/cenkalti/backoff" - "github.com/davecgh/go-spew/spew" - "github.com/go-chef/chef" -) - -//random_data makes random byte slice for building junk sandbox data -func random_data(size int) (b []byte) { - b = make([]byte, size) - rand.Read(b) - return -} - -func main() { - // read a client key - key, err := ioutil.ReadFile("key.pem") - if err != nil { - fmt.Println("Couldn't read key.pem:", err) - os.Exit(1) - } - - // build a client - client, err := chef.NewClient(&chef.Config{ - Name: "foo", - Key: string(key), - // goiardi is on port 4545 by default. chef-zero is 8889 - BaseURL: "http://localhost:4545", - }) - if err != nil { - fmt.Println("Issue setting up client:", err) - os.Exit(1) - } - - // create junk files and sums - files := make(map[string][]byte) - sums := make([]string, 10) - for i := 0; i < 10; i++ { - data := random_data(1024) - hashstr := fmt.Sprintf("%x", md5.Sum(data)) - files[hashstr] = data - sums[i] = hashstr - } - - // post the new sums/files to the sandbox - postResp, err := client.Sandboxes.Post(sums) - if err != nil { - fmt.Println("error making request: ", err) - os.Exit(1) - } - - // Dump the the server response data - j, err := json.MarshalIndent(postResp, "", " ") - fmt.Printf("%s", j) - - // Let's upload the files that postRep thinks we should upload - for hash, item := range postResp.Checksums { - if item.Upload == true { - if hash == "" { - continue - } - // If you were writing this in your own tool you could just use the FH and let the Reader interface suck out the content instead of doing the convert. - fmt.Printf("\nUploading: %s ---> %v\n\n", hash, item) - req, err := client.NewRequest("PUT", item.Url, bytes.NewReader(files[hash])) - if err != nil { - fmt.Println("This shouldn't happen:", err.Error()) - os.Exit(1) - } - - // post the files - upload := func() error { - _, err = client.Do(req, nil) - return err - } - - // with exp backoff ! - err = backoff.Retry(upload, backoff.NewExponentialBackOff()) - if err != nil { - fmt.Println("error posting files to the sandbox: ", err.Error()) - } - } - } - - // Now lets tell the server we have uploaded all the things. - sandbox, err := client.Sandboxes.Put(postResp.ID) - if err != nil { - fmt.Println("Error commiting sandbox: ", err.Error()) - os.Exit(1) - } - - // and heres yer commited sandbox - spew.Dump(sandbox) - -} diff --git a/vendor/github.com/go-chef/chef/examples/search/key.pem b/vendor/github.com/go-chef/chef/examples/search/key.pem deleted file mode 100644 index f44ac76ec..000000000 --- a/vendor/github.com/go-chef/chef/examples/search/key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAx12nDxxOwSPHRSJEDz67a0folBqElzlu2oGMiUTS+dqtj3FU -h5lJc1MjcprRVxcDVwhsSSo9948XEkk39IdblUCLohucqNMzOnIcdZn8zblN7Cnp -W03UwRM0iWX1HuwHnGvm6PKeqKGqplyIXYO0qlDWCzC+VaxFTwOUk31MfOHJQn4y -fTrfuE7h3FTElLBu065SFp3dPICIEmWCl9DadnxbnZ8ASxYQ9xG7hmZduDgjNW5l -3x6/EFkpym+//D6AbWDcVJ1ovCsJL3CfH/NZC3ekeJ/aEeLxP/vaCSH1VYC5VsYK -5Qg7SIa6Nth3+RZz1hYOoBJulEzwljznwoZYRQIDAQABAoIBADPQol+qAsnty5er -PTcdHcbXLJp5feZz1dzSeL0gdxja/erfEJIhg9aGUBs0I55X69VN6h7l7K8PsHZf -MzzJhUL4QJJETOYP5iuVhtIF0I+DTr5Hck/5nYcEv83KAvgjbiL4ZE486IF5awnL -2OE9HtJ5KfhEleNcX7MWgiIHGb8G1jCqu/tH0GI8Z4cNgUrXMbczGwfbN/5Wc0zo -Dtpe0Tec/Fd0DLFwRiAuheakPjlVWb7AGMDX4TyzCXfMpS1ul2jk6nGFk77uQozF -PQUawCRp+mVS4qecgq/WqfTZZbBlW2L18/kpafvsxG8kJ7OREtrb0SloZNFHEc2Q -70GbgKECgYEA6c/eOrI3Uour1gKezEBFmFKFH6YS/NZNpcSG5PcoqF6AVJwXg574 -Qy6RatC47e92be2TT1Oyplntj4vkZ3REv81yfz/tuXmtG0AylH7REbxubxAgYmUT -18wUAL4s3TST2AlK4R29KwBadwUAJeOLNW+Rc4xht1galsqQRb4pUzkCgYEA2kj2 -vUhKAB7QFCPST45/5q+AATut8WeHnI+t1UaiZoK41Jre8TwlYqUgcJ16Q0H6KIbJ -jlEZAu0IsJxjQxkD4oJgv8n5PFXdc14HcSQ512FmgCGNwtDY/AT7SQP3kOj0Rydg -N02uuRb/55NJ07Bh+yTQNGA+M5SSnUyaRPIAMW0CgYBgVU7grDDzB60C/g1jZk/G -VKmYwposJjfTxsc1a0gLJvSE59MgXc04EOXFNr4a+oC3Bh2dn4SJ2Z9xd1fh8Bur -UwCLwVE3DBTwl2C/ogiN4C83/1L4d2DXlrPfInvloBYR+rIpUlFweDLNuve2pKvk -llU9YGeaXOiHnGoY8iKgsQKBgQDZKMOHtZYhHoZlsul0ylCGAEz5bRT0V8n7QJlw -12+TSjN1F4n6Npr+00Y9ov1SUh38GXQFiLq4RXZitYKu6wEJZCm6Q8YXd1jzgDUp -IyAEHNsrV7Y/fSSRPKd9kVvGp2r2Kr825aqQasg16zsERbKEdrBHmwPmrsVZhi7n -rlXw1QKBgQDBOyUJKQOgDE2u9EHybhCIbfowyIE22qn9a3WjQgfxFJ+aAL9Bg124 -fJIEzz43fJ91fe5lTOgyMF5TtU5ClAOPGtlWnXU0e5j3L4LjbcqzEbeyxvP3sn1z -dYkX7NdNQ5E6tcJZuJCGq0HxIAQeKPf3x9DRKzMnLply6BEzyuAC4g== ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/go-chef/chef/examples/search/search.go b/vendor/github.com/go-chef/chef/examples/search/search.go deleted file mode 100644 index 0f1e16ad7..000000000 --- a/vendor/github.com/go-chef/chef/examples/search/search.go +++ /dev/null @@ -1,89 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "os" - - "github.com/davecgh/go-spew/spew" - "github.com/go-chef/chef" -) - -func main() { - // read a client key - key, err := ioutil.ReadFile("key.pem") - if err != nil { - fmt.Println("Couldn't read key.pem:", err) - os.Exit(1) - } - - // build a client - client, err := chef.NewClient(&chef.Config{ - Name: "foo", - Key: string(key), - // goiardi is on port 4545 by default. chef-zero is 8889 - BaseURL: "http://localhost:4545", - }) - if err != nil { - fmt.Println("Issue setting up client:", err) - os.Exit(1) - } - - // List Indexes - indexes, err := client.Search.Indexes() - if err != nil { - log.Fatal("Couldn't list nodes: ", err) - } - - // dump the Index list in Json - jsonData, err := json.MarshalIndent(indexes, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - - // build a seach query - query, err := client.Search.NewQuery("node", "name:*") - if err != nil { - log.Fatal("Error building query ", err) - } - - // Run the query - res, err := query.Do(client) - if err != nil { - log.Fatal("Error running query ", err) - } - - // <3 spew - spew.Dump(res) - - // dump out results back in json for fun - jsonData, err = json.MarshalIndent(res, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - - // You can also use the service to run a query - res, err = client.Search.Exec("node", "name:*") - if err != nil { - log.Fatal("Error running Search.Exec() ", err) - } - - // dump out results back in json for fun - jsonData, err = json.MarshalIndent(res, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - - // Partial search - log.Print("Partial Search") - part := make(map[string]interface{}) - part["name"] = []string{"name"} - pres, err := client.Search.PartialExec("node", "*:*", part) - if err != nil { - log.Fatal("Error running Search.PartialExec()", err) - } - - jsonData, err = json.MarshalIndent(pres, "", "\t") - os.Stdout.Write(jsonData) - os.Stdout.WriteString("\n") - -} diff --git a/vendor/github.com/go-chef/chef/test/client.json b/vendor/github.com/go-chef/chef/test/client.json deleted file mode 100644 index 1129917d1..000000000 --- a/vendor/github.com/go-chef/chef/test/client.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "clientname": "client_name", - "orgname": "org_name", - "validator": false, - "certificate": "-----BEGIN CERTIFICATE-----\nMIIDOjCCAqOgAwIBAgIE47eOmDANBgkqhkiG9w0BAQUFADCBnjELMAkGA1UEBhMC\nVVMxEzARBgNVBAgMCldhc2hpbmd0b24xfrsgbg@VBAcMB1NlYXR0bGUxFjAUBgNV\nBAoMDU9wc2NvZGUsIEluYy4xHDAaBgNVBAsME0NlcnRpZmljYXRlIFNlcnZpY2Ux\nMjAwBgNVBAMMKW9wc2NvZGUuY29tL2VtYWlsQWRkcmVzcz1hdXRoQG9wc2NvZGUu\nY29tMCAXDTEyMDkwNzE4MDUwOFo1234g5ghdcDAzMTgwNTA4WjCBnTEQMA4GA1UE\nBxMHU2VhdHRsZTETMBEGA1UECBMKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMxHDAa\nBgNVBAsTE0NlcnRpZmljYXRlIFNlcnZpY2UxFjAUBgNVBAoTDU9wc2NvZGUsIElu\nYy4xMTAvBgNVBAMUKFVSSTpodHRwOi8vb3BzY29kZS5jb20vR1VJRFMvY2xpZW50\nX2d1aWQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDJhwXHuq96iHpv\nSDkDdpSAWa3O81o1ZkG1/H1GmRKc3NDp9KfL/eg/itJeVT5BJ2DXenhbP0M8BHQG\narObwx6vXm+H/Q2sdfbbhdFt5y6wQZI4Dqnv7Hk/H95jUb+MJoXpJkB7zYSqrrei\nLBjjPg2p+M9+EUklelLeXDJDdj1xL5RNdDfv3yxyESTdYYVboQwgqbP3yGy7ITQc\nvg11qmDzg7L17q6uQevVap6aECuGS7//CcDcKJwuBYQukJi7QFs5V4ayq6GlgfT/h\nb/yjEAcfcqvBBDOO8K34fExnWTO7fdghh4btddPayHbud8dW0m3KdzhUaIh9BlGz\nxFTdI8/lAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAZlvDZWmw0u0VS4mapSxuKPAz\n4qhB8yttbZj8H9hUNfMdHMpyE3jJGFcLokRXdfxOsFNoPUj0hn+5BKTqtmdd6T1u\niDVoFfJ3nVPfGJMdPXZyi62pNCwPe/va13dLqTG92AGNDjjOxmMma9/OQ8Ty0eBu\nHWOxaK6VpV8pqZPq/Fg=\n-----END CERTIFICATE-----\n", - "name": "node_name" -} \ No newline at end of file diff --git a/vendor/github.com/go-chef/chef/test/cookbooks_response.json b/vendor/github.com/go-chef/chef/test/cookbooks_response.json deleted file mode 100644 index a9ced6898..000000000 --- a/vendor/github.com/go-chef/chef/test/cookbooks_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "apache2": { - "url": "http://localhost:4000/cookbooks/apache2", - "versions": [ - {"url": "http://localhost:4000/cookbooks/apache2/5.1.0", - "version": "5.1.0"}, - {"url": "http://localhost:4000/cookbooks/apache2/4.2.0", - "version": "4.2.0"} - ] - }, - "nginx": { - "url": "http://localhost:4000/cookbooks/nginx", - "versions": [ - {"url": "http://localhost:4000/cookbooks/nginx/1.0.0", - "version": "1.0.0"}, - {"url": "http://localhost:4000/cookbooks/nginx/0.3.0", - "version": "0.3.0"} - ] - } -} diff --git a/vendor/github.com/go-chef/chef/test/environment.json b/vendor/github.com/go-chef/chef/test/environment.json deleted file mode 100644 index 939bb60a8..000000000 --- a/vendor/github.com/go-chef/chef/test/environment.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "testenvironment", - "json_class": "Chef::Environment", - "default_attributes": { - "openssh": { - "server": { - "permit_root_login": "no", - "max_auth_tries": "3", - "password_authentication": "no", - "x11_forwarding": "yes", - "subsystem": "sftp /usr/lib/openssh/sftp-server" - }, - "client": { - "forward_x11": "yes", - "forward_agent": "yes" - } - } - }, - "chef_type": "environment", - "override_attributes": {}, - "cookbook_versions": { - "couchdb": "= 11.0.0", - "my_rails_app": "~> 1.2.0" - }, - "cookbook": { - "couchdb": "= 11.0.0" - } -} diff --git a/vendor/github.com/go-chef/chef/test/node.json b/vendor/github.com/go-chef/chef/test/node.json deleted file mode 100644 index 1456f5b12..000000000 --- a/vendor/github.com/go-chef/chef/test/node.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "testnode", - "chef_environment": "_default", - "json_class": "Chef::Node", - "automatic": {}, - "normal": { - "tags": [], - "openssh": { - "server": { - "permit_root_login": "no", - "max_auth_tries": "3", - "password_authentication": "no", - "x11_forwarding": "yes", - "subsystem": "sftp /usr/lib/openssh/sftp-server" - }, - "client": { - "forward_x11": "yes", - "forward_agent": "yes" - } - } - }, - "chef_type": "node", - "default": {}, - "override": {}, - "run_list": [] -} diff --git a/vendor/github.com/go-chef/chef/test/role.json b/vendor/github.com/go-chef/chef/test/role.json deleted file mode 100644 index d89e1f6b4..000000000 --- a/vendor/github.com/go-chef/chef/test/role.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "testrole", - "chef_environment": "_default", - "json_class": "Chef::Role", - "default_attributes": { - "openssh": { - "server": { - "permit_root_login": "no", - "max_auth_tries": "3", - "password_authentication": "no", - "x11_forwarding": "yes", - "subsystem": "sftp /usr/lib/openssh/sftp-server" - }, - "client": { - "forward_x11": "yes", - "forward_agent": "yes" - } - } - }, - "chef_type": "role", - "override": {}, - "run_list": [] -} diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go deleted file mode 100644 index 37c778209..000000000 --- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by protoc-gen-go. -// source: proto3_proto/proto3.proto -// DO NOT EDIT! - -/* -Package proto3_proto is a generated protocol buffer package. - -It is generated from these files: - proto3_proto/proto3.proto - -It has these top-level messages: - Message - Nested - MessageWithMap -*/ -package proto3_proto - -import proto "github.com/golang/protobuf/proto" -import testdata "github.com/golang/protobuf/proto/testdata" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -type Message_Humour int32 - -const ( - Message_UNKNOWN Message_Humour = 0 - Message_PUNS Message_Humour = 1 - Message_SLAPSTICK Message_Humour = 2 - Message_BILL_BAILEY Message_Humour = 3 -) - -var Message_Humour_name = map[int32]string{ - 0: "UNKNOWN", - 1: "PUNS", - 2: "SLAPSTICK", - 3: "BILL_BAILEY", -} -var Message_Humour_value = map[string]int32{ - "UNKNOWN": 0, - "PUNS": 1, - "SLAPSTICK": 2, - "BILL_BAILEY": 3, -} - -func (x Message_Humour) String() string { - return proto.EnumName(Message_Humour_name, int32(x)) -} - -type Message struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"` - HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm" json:"height_in_cm,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - ResultCount int64 `protobuf:"varint,7,opt,name=result_count" json:"result_count,omitempty"` - TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman" json:"true_scotsman,omitempty"` - Score float32 `protobuf:"fixed32,9,opt,name=score" json:"score,omitempty"` - Key []uint64 `protobuf:"varint,5,rep,name=key" json:"key,omitempty"` - Nested *Nested `protobuf:"bytes,6,opt,name=nested" json:"nested,omitempty"` - Terrain map[string]*Nested `protobuf:"bytes,10,rep,name=terrain" json:"terrain,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Proto2Field *testdata.SubDefaults `protobuf:"bytes,11,opt,name=proto2_field" json:"proto2_field,omitempty"` - Proto2Value map[string]*testdata.SubDefaults `protobuf:"bytes,13,rep,name=proto2_value" json:"proto2_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} - -func (m *Message) GetNested() *Nested { - if m != nil { - return m.Nested - } - return nil -} - -func (m *Message) GetTerrain() map[string]*Nested { - if m != nil { - return m.Terrain - } - return nil -} - -func (m *Message) GetProto2Field() *testdata.SubDefaults { - if m != nil { - return m.Proto2Field - } - return nil -} - -func (m *Message) GetProto2Value() map[string]*testdata.SubDefaults { - if m != nil { - return m.Proto2Value - } - return nil -} - -type Nested struct { - Bunny string `protobuf:"bytes,1,opt,name=bunny" json:"bunny,omitempty"` -} - -func (m *Nested) Reset() { *m = Nested{} } -func (m *Nested) String() string { return proto.CompactTextString(m) } -func (*Nested) ProtoMessage() {} - -type MessageWithMap struct { - ByteMapping map[bool][]byte `protobuf:"bytes,1,rep,name=byte_mapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } -func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } -func (*MessageWithMap) ProtoMessage() {} - -func (m *MessageWithMap) GetByteMapping() map[bool][]byte { - if m != nil { - return m.ByteMapping - } - return nil -} - -func init() { - proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value) -} diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto deleted file mode 100644 index e2311d929..000000000 --- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto +++ /dev/null @@ -1,68 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2014 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -import "testdata/test.proto"; - -package proto3_proto; - -message Message { - enum Humour { - UNKNOWN = 0; - PUNS = 1; - SLAPSTICK = 2; - BILL_BAILEY = 3; - } - - string name = 1; - Humour hilarity = 2; - uint32 height_in_cm = 3; - bytes data = 4; - int64 result_count = 7; - bool true_scotsman = 8; - float score = 9; - - repeated uint64 key = 5; - Nested nested = 6; - - map terrain = 10; - testdata.SubDefaults proto2_field = 11; - map proto2_value = 13; -} - -message Nested { - string bunny = 1; -} - -message MessageWithMap { - map byte_mapping = 1; -} diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-dir-mode/file.txt b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-dir-mode/file.txt deleted file mode 100644 index dc2507e82..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-dir-mode/file.txt +++ /dev/null @@ -1 +0,0 @@ -I should be mode 0777 diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-file-compressed/file.tar.gz b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-file-compressed/file.tar.gz deleted file mode 100644 index bed30fb48..000000000 Binary files a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-file-compressed/file.tar.gz and /dev/null differ diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-file/foo.txt b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-file/foo.txt deleted file mode 100644 index 257cc5642..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-file/foo.txt +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-flat/baz.txt b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-flat/baz.txt deleted file mode 100644 index 76018072e..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-flat/baz.txt +++ /dev/null @@ -1 +0,0 @@ -baz diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-flat/foo.txt b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-flat/foo.txt deleted file mode 100644 index 257cc5642..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-flat/foo.txt +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/COMMIT_EDITMSG b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/COMMIT_EDITMSG deleted file mode 100644 index e7e768a4a..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/COMMIT_EDITMSG +++ /dev/null @@ -1,12 +0,0 @@ -Those files tho -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# On branch master -# -# Initial commit -# -# Changes to be committed: -# new file: bar.txt -# new file: foo.txt -# new file: subdir/hello.txt -# diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/HEAD b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/config b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/config deleted file mode 100644 index 252f2e347..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = https://github.com/hashicorp/origin.git - fetch = +refs/heads/*:refs/remotes/origin/* -[remote "upstream"] - url = https://github.com/hashicorp/upstream.git - fetch = +refs/heads/*:refs/remotes/upstream/* diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/description b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/description deleted file mode 100644 index 498b267a8..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/applypatch-msg.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/applypatch-msg.sample deleted file mode 100644 index 8b2a2fe84..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -test -x "$GIT_DIR/hooks/commit-msg" && - exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/commit-msg.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/post-update.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-applypatch.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-applypatch.sample deleted file mode 100644 index b1f187c2e..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-commit.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-push.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-push.sample deleted file mode 100644 index 1f3bcebfd..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-push.sample +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -IFS=' ' -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-rebase.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-rebase.sample deleted file mode 100644 index 9773ed4cb..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up-to-date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -exit 0 - -################################################################ - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/prepare-commit-msg.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/prepare-commit-msg.sample deleted file mode 100644 index f093a02ec..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first comments out the -# "Conflicts:" part of a merge commit. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -case "$2,$3" in - merge,) - /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; - -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$1" ;; - - *) ;; -esac - -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/update.sample b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/update.sample deleted file mode 100644 index d84758373..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to blocks unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/index b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/index deleted file mode 100644 index b96996849..000000000 Binary files a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/index and /dev/null differ diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/info/exclude b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/logs/HEAD b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/logs/HEAD deleted file mode 100644 index 1c469022b..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 7525d17cbbb56f3253a20903ffddc07c6c935c76 Mitchell Hashimoto 1414446684 -0700 commit (initial): Those files tho diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/logs/refs/heads/master b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/logs/refs/heads/master deleted file mode 100644 index 1c469022b..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 7525d17cbbb56f3253a20903ffddc07c6c935c76 Mitchell Hashimoto 1414446684 -0700 commit (initial): Those files tho diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 deleted file mode 100644 index bdcf704c9..000000000 Binary files a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 and /dev/null differ diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/57/16ca5987cbf97d6bb54920bea6adde242d87e6 b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/57/16ca5987cbf97d6bb54920bea6adde242d87e6 deleted file mode 100644 index cfc3920fb..000000000 Binary files a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/57/16ca5987cbf97d6bb54920bea6adde242d87e6 and /dev/null differ diff --git a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/75/25d17cbbb56f3253a20903ffddc07c6c935c76 b/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/75/25d17cbbb56f3253a20903ffddc07c6c935c76 deleted file mode 100644 index f625c1d76..000000000 --- a/vendor/github.com/hashicorp/atlas-go/archive/test-fixtures/archive-git/DOTgit/objects/75/25d17cbbb56f3253a20903ffddc07c6c935c76 +++ /dev/null @@ -1,4 +0,0 @@ -x­ÎM -Â0†a×9Å\À’I‡L ".ݸóù™š@B ÷7ÞÀíßËZ­¹ƒA:õ]xcÒ&p4Î -cpsô³˜ÙêueFVûÅETîÝSÛá‘{HR -ÜÝ‘rm½Áe¿6¥ŸÝ^Õå2…V¯€„DdíBpÖ¬µ:]þSÏÔ-9`\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/post-update.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-applypatch.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-applypatch.sample deleted file mode 100644 index b1f187c2e..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-commit.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-push.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-push.sample deleted file mode 100644 index 1f3bcebfd..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-push.sample +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -IFS=' ' -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-rebase.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-rebase.sample deleted file mode 100644 index 9773ed4cb..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up-to-date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -exit 0 - -################################################################ - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/prepare-commit-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/prepare-commit-msg.sample deleted file mode 100644 index f093a02ec..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first comments out the -# "Conflicts:" part of a merge commit. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -case "$2,$3" in - merge,) - /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; - -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$1" ;; - - *) ;; -esac - -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/update.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/update.sample deleted file mode 100644 index d84758373..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to blocks unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/index b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/index deleted file mode 100644 index 9586d960f..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/index and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/info/exclude b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/HEAD b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/HEAD deleted file mode 100644 index 9ab6aac9c..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/HEAD +++ /dev/null @@ -1,8 +0,0 @@ -0000000000000000000000000000000000000000 497bc37401eb3c9b11865b1768725b64066eccee Mitchell Hashimoto 1410850637 -0700 commit (initial): A commit -497bc37401eb3c9b11865b1768725b64066eccee 243f0fc5c4e586d1a3daa54c981b6f34e9ab1085 Mitchell Hashimoto 1410886526 -0700 commit: tag1 -243f0fc5c4e586d1a3daa54c981b6f34e9ab1085 1f31e97f053caeb5d6b7bffa3faf82941c99efa2 Mitchell Hashimoto 1410886536 -0700 commit: remove tag1 -1f31e97f053caeb5d6b7bffa3faf82941c99efa2 1f31e97f053caeb5d6b7bffa3faf82941c99efa2 Mitchell Hashimoto 1410886909 -0700 checkout: moving from master to test-branch -1f31e97f053caeb5d6b7bffa3faf82941c99efa2 7b7614f8759ac8b5e4b02be65ad8e2667be6dd87 Mitchell Hashimoto 1410886913 -0700 commit: Branch -7b7614f8759ac8b5e4b02be65ad8e2667be6dd87 1f31e97f053caeb5d6b7bffa3faf82941c99efa2 Mitchell Hashimoto 1410886916 -0700 checkout: moving from test-branch to master -1f31e97f053caeb5d6b7bffa3faf82941c99efa2 146492b04efe0aae2b8288c5c0aef6a951030fde Mitchell Hashimoto 1411767116 -0700 commit: add subdir -146492b04efe0aae2b8288c5c0aef6a951030fde 25851303ab930fdacfdb7df91adbf626a483df48 Mitchell Hashimoto 1444775178 -0700 commit: add a file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/refs/heads/master b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/refs/heads/master deleted file mode 100644 index ca4c77dd8..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/refs/heads/master +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 497bc37401eb3c9b11865b1768725b64066eccee Mitchell Hashimoto 1410850637 -0700 commit (initial): A commit -497bc37401eb3c9b11865b1768725b64066eccee 243f0fc5c4e586d1a3daa54c981b6f34e9ab1085 Mitchell Hashimoto 1410886526 -0700 commit: tag1 -243f0fc5c4e586d1a3daa54c981b6f34e9ab1085 1f31e97f053caeb5d6b7bffa3faf82941c99efa2 Mitchell Hashimoto 1410886536 -0700 commit: remove tag1 -1f31e97f053caeb5d6b7bffa3faf82941c99efa2 146492b04efe0aae2b8288c5c0aef6a951030fde Mitchell Hashimoto 1411767116 -0700 commit: add subdir -146492b04efe0aae2b8288c5c0aef6a951030fde 25851303ab930fdacfdb7df91adbf626a483df48 Mitchell Hashimoto 1444775178 -0700 commit: add a file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/refs/heads/test-branch b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/refs/heads/test-branch deleted file mode 100644 index 937067a2a..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/logs/refs/heads/test-branch +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 1f31e97f053caeb5d6b7bffa3faf82941c99efa2 Mitchell Hashimoto 1410886909 -0700 branch: Created from HEAD -1f31e97f053caeb5d6b7bffa3faf82941c99efa2 7b7614f8759ac8b5e4b02be65ad8e2667be6dd87 Mitchell Hashimoto 1410886913 -0700 commit: Branch diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/14/6492b04efe0aae2b8288c5c0aef6a951030fde b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/14/6492b04efe0aae2b8288c5c0aef6a951030fde deleted file mode 100644 index 2a713ec7c..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/14/6492b04efe0aae2b8288c5c0aef6a951030fde and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/1d/3d6744266642cb7623e2c678c33c77b075c49f b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/1d/3d6744266642cb7623e2c678c33c77b075c49f deleted file mode 100644 index 2518fd6ac..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/1d/3d6744266642cb7623e2c678c33c77b075c49f and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/1f/31e97f053caeb5d6b7bffa3faf82941c99efa2 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/1f/31e97f053caeb5d6b7bffa3faf82941c99efa2 deleted file mode 100644 index 5793a840b..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/1f/31e97f053caeb5d6b7bffa3faf82941c99efa2 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/24/3f0fc5c4e586d1a3daa54c981b6f34e9ab1085 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/24/3f0fc5c4e586d1a3daa54c981b6f34e9ab1085 deleted file mode 100644 index 19819238b..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/24/3f0fc5c4e586d1a3daa54c981b6f34e9ab1085 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/25/851303ab930fdacfdb7df91adbf626a483df48 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/25/851303ab930fdacfdb7df91adbf626a483df48 deleted file mode 100644 index 80de4b622..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/25/851303ab930fdacfdb7df91adbf626a483df48 +++ /dev/null @@ -1 +0,0 @@ -x­ÎK `לb.`3P(ãÒ‡`°$ELÅûKL¼Û/ù±ÕZ:(c}g†¤æÅ‘EíX²—ž9%Ež”5Aº}ÔÒIñ¤¤^´W5gF"VÁ)碉HœòFâŒ9± w_Û·ÒãÊÛWz­¥¶Þà4|mZv¹W*Û[=­­5Ò:8¢ECG¢ó_Ê¥¹l,>ÝÖT2 \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/38/30637158f774a20edcc0bf1c4d07b0bf87c43d b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/38/30637158f774a20edcc0bf1c4d07b0bf87c43d deleted file mode 100644 index ef8ebf728..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/38/30637158f774a20edcc0bf1c4d07b0bf87c43d and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/40/4618c9d96dfa0a5d365b518e0dfbb5a387c649 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/40/4618c9d96dfa0a5d365b518e0dfbb5a387c649 deleted file mode 100644 index 434fcab20..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/40/4618c9d96dfa0a5d365b518e0dfbb5a387c649 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/49/7bc37401eb3c9b11865b1768725b64066eccee b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/49/7bc37401eb3c9b11865b1768725b64066eccee deleted file mode 100644 index ebf34c65d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/49/7bc37401eb3c9b11865b1768725b64066eccee +++ /dev/null @@ -1,2 +0,0 @@ -x­ÌM -1 @a×=E.àþMZÑkǦÆx‹â Ü>x_ê­Uƒ´“-gˆ³³‚&—çx»G EBöyA >ÅÅÅ/)}ƒk•TòºÂ…Ÿ¥¶.ü´©üÚéѸ®SêíÚéàl öHˆjÔqHþ ¦ÎðõÔ%øD‡ \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/7b/7614f8759ac8b5e4b02be65ad8e2667be6dd87 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/7b/7614f8759ac8b5e4b02be65ad8e2667be6dd87 deleted file mode 100644 index abe281a74..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/7b/7614f8759ac8b5e4b02be65ad8e2667be6dd87 +++ /dev/null @@ -1,2 +0,0 @@ -x­ÎK -Â0…aÇYE6`Iš7ˆˆ#'.â&¹×šFbÜ¿EpN?ø'µZ—Ág££#r-´•>…l&`²²&éQdŠÑ€ò.YØ:nƒKRƒ#aTŒ&Ûè"(òsÐ2…€3ƒ÷(­óû2RÁuå7x•¥¶Ñøi?ðµ©üìò¨°¬SjõÌ¥–Â{¤âGá„`»îÅÀ¿Œ±k‡-öÛS„ \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/8c/1a79ca1f98b6d00f5bf5c6cc9e8d3c092dd3ba b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/8c/1a79ca1f98b6d00f5bf5c6cc9e8d3c092dd3ba deleted file mode 100644 index 656ae8e33..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/8c/1a79ca1f98b6d00f5bf5c6cc9e8d3c092dd3ba and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/96/43088174e25a9bd91c27970a580af0085c9f32 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/96/43088174e25a9bd91c27970a580af0085c9f32 deleted file mode 100644 index 387943288..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/96/43088174e25a9bd91c27970a580af0085c9f32 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/b7/757b6a3696ad036e9aa2f5b4856d09e7f17993 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/b7/757b6a3696ad036e9aa2f5b4856d09e7f17993 deleted file mode 100644 index 101925665..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/b7/757b6a3696ad036e9aa2f5b4856d09e7f17993 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/d2/368a7048e1e919eebaad2a9a275b18cc9c4181 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/d2/368a7048e1e919eebaad2a9a275b18cc9c4181 deleted file mode 100644 index 10e19bed9..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/d2/368a7048e1e919eebaad2a9a275b18cc9c4181 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/e9/65047ad7c57865823c7d992b1d046ea66edf78 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/e9/65047ad7c57865823c7d992b1d046ea66edf78 deleted file mode 100644 index 341688abf..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/objects/e9/65047ad7c57865823c7d992b1d046ea66edf78 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/heads/master b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/heads/master deleted file mode 100644 index e0087df7c..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -25851303ab930fdacfdb7df91adbf626a483df48 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/heads/test-branch b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/heads/test-branch deleted file mode 100644 index a5f298b83..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/heads/test-branch +++ /dev/null @@ -1 +0,0 @@ -7b7614f8759ac8b5e4b02be65ad8e2667be6dd87 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/tags/v1.0 b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/tags/v1.0 deleted file mode 100644 index ada519059..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/DOTgit/refs/tags/v1.0 +++ /dev/null @@ -1 +0,0 @@ -243f0fc5c4e586d1a3daa54c981b6f34e9ab1085 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/foo.txt b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/foo.txt deleted file mode 100644 index e965047ad..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/foo.txt +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/main.tf deleted file mode 100644 index 383063715..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/subdir/sub.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-git/subdir/sub.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-hg/foo.txt b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-hg/foo.txt deleted file mode 100644 index e965047ad..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-hg/foo.txt +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-hg/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-hg/main.tf deleted file mode 100644 index 383063715..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-hg/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/a/a.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/a/a.tf deleted file mode 100644 index b9b44f464..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/a/a.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "b" { - source = "../c" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/c/c.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/c/c.tf deleted file mode 100644 index fec56017d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/c/c.tf +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/main.tf deleted file mode 100644 index 2326ee22a..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-parent/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "a" { - source = "./a" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/foo/sub/baz/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/foo/sub/baz/main.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/foo/sub/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/foo/sub/main.tf deleted file mode 100644 index 22905dd53..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/foo/sub/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "bar" { - source = "./baz" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/main.tf deleted file mode 100644 index 19fb5dde7..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic-subdir/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "foo" { - source = "./foo//sub" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/foo/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/foo/main.tf deleted file mode 100644 index fec56017d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/foo/main.tf +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/main.tf deleted file mode 100644 index 383063715..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/subdir/sub.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/basic/subdir/sub.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/child/foo/bar/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/child/foo/bar/main.tf deleted file mode 100644 index df5927501..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/child/foo/bar/main.tf +++ /dev/null @@ -1,2 +0,0 @@ -# Hello - diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/child/foo/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/child/foo/main.tf deleted file mode 100644 index 548d21b99..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/child/foo/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "bar" { - source = "./bar" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/child/main.tf deleted file mode 100644 index 383063715..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/child/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-bz2/single.bz2 b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-bz2/single.bz2 deleted file mode 100644 index 63d21a073..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-bz2/single.bz2 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-gz/single.gz b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-gz/single.gz deleted file mode 100644 index 00754d02d..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-gz/single.gz and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/empty.tar.bz2 b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/empty.tar.bz2 deleted file mode 100644 index a70463740..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/empty.tar.bz2 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/multiple.tar.bz2 b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/multiple.tar.bz2 deleted file mode 100644 index 1d59e6ad2..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/multiple.tar.bz2 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/single.tar.bz2 b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/single.tar.bz2 deleted file mode 100644 index 115f9a4ae..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tbz2/single.tar.bz2 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/empty.tar.gz b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/empty.tar.gz deleted file mode 100644 index ad184e904..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/empty.tar.gz and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/multiple.tar.gz b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/multiple.tar.gz deleted file mode 100644 index 400123957..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/multiple.tar.gz and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/single.tar.gz b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/single.tar.gz deleted file mode 100644 index 921bdacc6..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-tgz/single.tar.gz and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/empty.zip b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/empty.zip deleted file mode 100644 index 15cb0ecb3..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/empty.zip and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/multiple.zip b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/multiple.zip deleted file mode 100644 index a032181d4..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/multiple.zip and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/single.zip b/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/single.zip deleted file mode 100644 index 90687fde1..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/single.zip and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/dup/foo/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/dup/foo/main.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/dup/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/dup/main.tf deleted file mode 100644 index 98efd6e4f..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/dup/main.tf +++ /dev/null @@ -1,7 +0,0 @@ -module "foo" { - source = "./foo" -} - -module "foo" { - source = "./foo" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/COMMIT_EDITMSG b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/COMMIT_EDITMSG deleted file mode 100644 index d5297f6c9..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/COMMIT_EDITMSG +++ /dev/null @@ -1,7 +0,0 @@ -Initial branch -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# On branch test-branch -# Changes to be committed: -# new file: main_branch.tf -# diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/HEAD b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/HEAD deleted file mode 100644 index b04b97d48..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/test-branch diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/config b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/config deleted file mode 100644 index 6c9406b7d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/description b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/description deleted file mode 100644 index 498b267a8..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/applypatch-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/applypatch-msg.sample deleted file mode 100644 index 8b2a2fe84..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -test -x "$GIT_DIR/hooks/commit-msg" && - exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/commit-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/post-update.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-applypatch.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-applypatch.sample deleted file mode 100644 index b1f187c2e..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-commit.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-push.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-rebase.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-rebase.sample deleted file mode 100644 index 9773ed4cb..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up-to-date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -exit 0 - -################################################################ - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/prepare-commit-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/prepare-commit-msg.sample deleted file mode 100644 index f093a02ec..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first comments out the -# "Conflicts:" part of a merge commit. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -case "$2,$3" in - merge,) - /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; - -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$1" ;; - - *) ;; -esac - -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/update.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/update.sample deleted file mode 100644 index d84758373..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to blocks unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/index b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/index deleted file mode 100644 index a295ccf1b..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/index and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/info/exclude b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/HEAD b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/HEAD deleted file mode 100644 index 701918b7c..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730077 -0700 commit (initial): Initial -9a311b181c4ec0fe4d8856b9fc935a191855742a 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730083 -0700 checkout: moving from master to test-branch -9a311b181c4ec0fe4d8856b9fc935a191855742a ae4fc53ed172182cf8ab07d2f087994950a2ccdf Mitchell Hashimoto 1445730106 -0700 commit: Initial branch diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/refs/heads/master b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/refs/heads/master deleted file mode 100644 index c6181dfa6..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730077 -0700 commit (initial): Initial diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/refs/heads/test-branch b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/refs/heads/test-branch deleted file mode 100644 index 8c2a94efa..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/logs/refs/heads/test-branch +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730083 -0700 branch: Created from HEAD -9a311b181c4ec0fe4d8856b9fc935a191855742a ae4fc53ed172182cf8ab07d2f087994950a2ccdf Mitchell Hashimoto 1445730106 -0700 commit: Initial branch diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/29/5c5449283c0fe38c75ae73144513240e5626a6 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/29/5c5449283c0fe38c75ae73144513240e5626a6 deleted file mode 100644 index e6653c083..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/29/5c5449283c0fe38c75ae73144513240e5626a6 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/3e/655aa57060b300052ca598ba18b5752f8c0958 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/3e/655aa57060b300052ca598ba18b5752f8c0958 deleted file mode 100644 index 518e6ab78..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/3e/655aa57060b300052ca598ba18b5752f8c0958 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/9a/311b181c4ec0fe4d8856b9fc935a191855742a b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/9a/311b181c4ec0fe4d8856b9fc935a191855742a deleted file mode 100644 index e116abba7..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/9a/311b181c4ec0fe4d8856b9fc935a191855742a +++ /dev/null @@ -1,2 +0,0 @@ -x­ÌA -Â0@Q×9Å\À2t:D\êÂC¤cj‰:Þß"x·þ×Vk6 w¶Æaê'ýp ‘˜ˆãTÑË"BʤóøÎ.¼-µnÙ4ÅRà^)×f ŽÛðk]úÙùQC.¶z‚~X<¢ìQݦ[añ/3w}fË¡¸XÙE \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/a9/193e348262522550ebacc037f772c52cbfa5d5 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/a9/193e348262522550ebacc037f772c52cbfa5d5 deleted file mode 100644 index a6230cdf3..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/a9/193e348262522550ebacc037f772c52cbfa5d5 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/ae/4fc53ed172182cf8ab07d2f087994950a2ccdf b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/ae/4fc53ed172182cf8ab07d2f087994950a2ccdf deleted file mode 100644 index 57fd1016c..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/ae/4fc53ed172182cf8ab07d2f087994950a2ccdf and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/be/fe5fe7626f1850e202fb35ac375c61e1f27f95 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/be/fe5fe7626f1850e202fb35ac375c61e1f27f95 deleted file mode 100644 index 61c8d6ad7..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/objects/be/fe5fe7626f1850e202fb35ac375c61e1f27f95 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/refs/heads/master b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/refs/heads/master deleted file mode 100644 index 204b49b4b..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -9a311b181c4ec0fe4d8856b9fc935a191855742a diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/refs/heads/test-branch b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/refs/heads/test-branch deleted file mode 100644 index cebc59c41..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-1/refs/heads/test-branch +++ /dev/null @@ -1 +0,0 @@ -ae4fc53ed172182cf8ab07d2f087994950a2ccdf diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/COMMIT_EDITMSG b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/COMMIT_EDITMSG deleted file mode 100644 index 78e35a0b5..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/COMMIT_EDITMSG +++ /dev/null @@ -1,10 +0,0 @@ -Branch update -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# On branch test-branch -# Changes to be committed: -# new file: main_branch_update.tf -# -# Untracked files: -# DOTgit-1/ -# diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/HEAD b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/HEAD deleted file mode 100644 index b04b97d48..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/test-branch diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/config b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/config deleted file mode 100644 index 6c9406b7d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/config +++ /dev/null @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/description b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/description deleted file mode 100644 index 498b267a8..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/applypatch-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/applypatch-msg.sample deleted file mode 100644 index 8b2a2fe84..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -test -x "$GIT_DIR/hooks/commit-msg" && - exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/commit-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/commit-msg.sample deleted file mode 100644 index b58d1184a..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/post-update.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/post-update.sample deleted file mode 100644 index ec17ec193..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-applypatch.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-applypatch.sample deleted file mode 100644 index b1f187c2e..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} -: diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-commit.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-commit.sample deleted file mode 100644 index 68d62d544..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-push.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-push.sample deleted file mode 100644 index 6187dbf43..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo >&2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-rebase.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-rebase.sample deleted file mode 100644 index 9773ed4cb..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up-to-date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -exit 0 - -################################################################ - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/prepare-commit-msg.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/prepare-commit-msg.sample deleted file mode 100644 index f093a02ec..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first comments out the -# "Conflicts:" part of a merge commit. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -case "$2,$3" in - merge,) - /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; - -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$1" ;; - - *) ;; -esac - -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/update.sample b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/update.sample deleted file mode 100644 index d84758373..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to blocks unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/index b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/index deleted file mode 100644 index 44211b1a6..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/index and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/info/exclude b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/HEAD b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/HEAD deleted file mode 100644 index 5c7cd637d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/HEAD +++ /dev/null @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730077 -0700 commit (initial): Initial -9a311b181c4ec0fe4d8856b9fc935a191855742a 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730083 -0700 checkout: moving from master to test-branch -9a311b181c4ec0fe4d8856b9fc935a191855742a ae4fc53ed172182cf8ab07d2f087994950a2ccdf Mitchell Hashimoto 1445730106 -0700 commit: Initial branch -ae4fc53ed172182cf8ab07d2f087994950a2ccdf 34fa5e1fb706dc77cc0b0cf622c82e67ba84e297 Mitchell Hashimoto 1445730148 -0700 commit: Branch update diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/refs/heads/master b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/refs/heads/master deleted file mode 100644 index c6181dfa6..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730077 -0700 commit (initial): Initial diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/refs/heads/test-branch b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/refs/heads/test-branch deleted file mode 100644 index 349f98deb..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/logs/refs/heads/test-branch +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 9a311b181c4ec0fe4d8856b9fc935a191855742a Mitchell Hashimoto 1445730083 -0700 branch: Created from HEAD -9a311b181c4ec0fe4d8856b9fc935a191855742a ae4fc53ed172182cf8ab07d2f087994950a2ccdf Mitchell Hashimoto 1445730106 -0700 commit: Initial branch -ae4fc53ed172182cf8ab07d2f087994950a2ccdf 34fa5e1fb706dc77cc0b0cf622c82e67ba84e297 Mitchell Hashimoto 1445730148 -0700 commit: Branch update diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/20/9cbd800810a2a1559ba33c48bc75860e967e07 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/20/9cbd800810a2a1559ba33c48bc75860e967e07 deleted file mode 100644 index 23b6ef272..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/20/9cbd800810a2a1559ba33c48bc75860e967e07 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/29/5c5449283c0fe38c75ae73144513240e5626a6 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/29/5c5449283c0fe38c75ae73144513240e5626a6 deleted file mode 100644 index e6653c083..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/29/5c5449283c0fe38c75ae73144513240e5626a6 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/34/fa5e1fb706dc77cc0b0cf622c82e67ba84e297 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/34/fa5e1fb706dc77cc0b0cf622c82e67ba84e297 deleted file mode 100644 index 535edfde2..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/34/fa5e1fb706dc77cc0b0cf622c82e67ba84e297 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/3e/655aa57060b300052ca598ba18b5752f8c0958 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/3e/655aa57060b300052ca598ba18b5752f8c0958 deleted file mode 100644 index 518e6ab78..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/3e/655aa57060b300052ca598ba18b5752f8c0958 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/8a/2dfe46d4eb9b54f5aa0e4e536346bdafee3467 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/8a/2dfe46d4eb9b54f5aa0e4e536346bdafee3467 deleted file mode 100644 index 5123c4b74..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/8a/2dfe46d4eb9b54f5aa0e4e536346bdafee3467 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/9a/311b181c4ec0fe4d8856b9fc935a191855742a b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/9a/311b181c4ec0fe4d8856b9fc935a191855742a deleted file mode 100644 index e116abba7..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/9a/311b181c4ec0fe4d8856b9fc935a191855742a +++ /dev/null @@ -1,2 +0,0 @@ -x­ÌA -Â0@Q×9Å\À2t:D\êÂC¤cj‰:Þß"x·þ×Vk6 w¶Æaê'ýp ‘˜ˆãTÑË"BʤóøÎ.¼-µnÙ4ÅRà^)×f ŽÛðk]úÙùQC.¶z‚~X<¢ìQݦ[añ/3w}fË¡¸XÙE \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/a9/193e348262522550ebacc037f772c52cbfa5d5 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/a9/193e348262522550ebacc037f772c52cbfa5d5 deleted file mode 100644 index a6230cdf3..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/a9/193e348262522550ebacc037f772c52cbfa5d5 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/ae/4fc53ed172182cf8ab07d2f087994950a2ccdf b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/ae/4fc53ed172182cf8ab07d2f087994950a2ccdf deleted file mode 100644 index 57fd1016c..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/ae/4fc53ed172182cf8ab07d2f087994950a2ccdf and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/be/fe5fe7626f1850e202fb35ac375c61e1f27f95 b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/be/fe5fe7626f1850e202fb35ac375c61e1f27f95 deleted file mode 100644 index 61c8d6ad7..000000000 Binary files a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/objects/be/fe5fe7626f1850e202fb35ac375c61e1f27f95 and /dev/null differ diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/refs/heads/master b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/refs/heads/master deleted file mode 100644 index 204b49b4b..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -9a311b181c4ec0fe4d8856b9fc935a191855742a diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/refs/heads/test-branch b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/refs/heads/test-branch deleted file mode 100644 index 0825c194e..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/DOTgit-2/refs/heads/test-branch +++ /dev/null @@ -1 +0,0 @@ -34fa5e1fb706dc77cc0b0cf622c82e67ba84e297 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main.tf deleted file mode 100644 index befe5fe76..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main.tf +++ /dev/null @@ -1 +0,0 @@ -# MAIN diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main_branch.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main_branch.tf deleted file mode 100644 index 3e655aa57..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main_branch.tf +++ /dev/null @@ -1 +0,0 @@ -# Branch diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main_branch_update.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main_branch_update.tf deleted file mode 100644 index 8a2dfe46d..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/git-branch-update/main_branch_update.tf +++ /dev/null @@ -1 +0,0 @@ -# Branch update diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output-to-module/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output-to-module/child/main.tf deleted file mode 100644 index 4d68c80b3..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output-to-module/child/main.tf +++ /dev/null @@ -1 +0,0 @@ -variable "memory" { default = "foo" } diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output-to-module/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output-to-module/main.tf deleted file mode 100644 index 4b627bbe5..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output-to-module/main.tf +++ /dev/null @@ -1,8 +0,0 @@ -module "child" { - source = "./child" -} - -module "child2" { - source = "./child" - memory = "${module.child.memory_max}" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output/child/main.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output/main.tf deleted file mode 100644 index a19233e12..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-output/main.tf +++ /dev/null @@ -1,7 +0,0 @@ -module "child" { - source = "./child" -} - -resource "aws_instance" "foo" { - memory = "${module.child.memory}" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-var/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-var/child/main.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-var/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-var/main.tf deleted file mode 100644 index 7cc785d17..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-bad-var/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -module "child" { - source = "./child" - - memory = "foo" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-bad/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-bad/child/main.tf deleted file mode 100644 index 93b365403..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-bad/child/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -# Duplicate resources -resource "aws_instance" "foo" {} -resource "aws_instance" "foo" {} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-bad/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-bad/main.tf deleted file mode 100644 index 813f7ef8e..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-bad/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "foo" { - source = "./child" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-good/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-good/child/main.tf deleted file mode 100644 index 2cfd2a80f..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-good/child/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -variable "memory" {} - -output "result" {} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-good/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-good/main.tf deleted file mode 100644 index 5f3ad8da5..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-child-good/main.tf +++ /dev/null @@ -1,8 +0,0 @@ -module "child" { - source = "./child" - memory = "1G" -} - -resource "aws_instance" "foo" { - memory = "${module.child.result}" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-required-var/child/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-required-var/child/main.tf deleted file mode 100644 index 618ae3c42..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-required-var/child/main.tf +++ /dev/null @@ -1 +0,0 @@ -variable "memory" {} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-required-var/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-required-var/main.tf deleted file mode 100644 index 0f6991c53..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-required-var/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "child" { - source = "./child" -} diff --git a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-root-bad/main.tf b/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-root-bad/main.tf deleted file mode 100644 index 93b365403..000000000 --- a/vendor/github.com/hashicorp/go-getter/test-fixtures/validate-root-bad/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -# Duplicate resources -resource "aws_instance" "foo" {} -resource "aws_instance" "foo" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment.hcl deleted file mode 100644 index 78c267582..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = [ - "1", - "2", # comment -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment_2.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment_2.hcl deleted file mode 100644 index f91667738..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment_2.hcl +++ /dev/null @@ -1,6 +0,0 @@ -provisioner "remote-exec" { - scripts = [ - "${path.module}/scripts/install-consul.sh" // missing comma - "${path.module}/scripts/install-haproxy.sh" - ] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_colon.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_colon.hcl deleted file mode 100644 index eb5a99a69..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_colon.hcl +++ /dev/null @@ -1,6 +0,0 @@ -resource = [{ - "foo": { - "bar": {}, - "baz": [1, 2, "foo"], - } -}] diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_deep.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_deep.hcl deleted file mode 100644 index dd3151cb7..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_deep.hcl +++ /dev/null @@ -1,5 +0,0 @@ -resource = [{ - foo = [{ - bar = {} - }] -}] diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl deleted file mode 100644 index 1ff7f29fd..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl +++ /dev/null @@ -1,15 +0,0 @@ -// Foo - -/* Bar */ - -/* -/* -Baz -*/ - -# Another - -# Multiple -# Lines - -foo = "bar" diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_lastline.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_lastline.hcl deleted file mode 100644 index 5529b9b4c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_lastline.hcl +++ /dev/null @@ -1 +0,0 @@ -#foo \ No newline at end of file diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_single.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_single.hcl deleted file mode 100644 index fec56017d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_single.hcl +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex.hcl deleted file mode 100644 index 13b3c2726..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex.hcl +++ /dev/null @@ -1,42 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -variable "groups" { } - -provider "aws" { - access_key = "foo" - secret_key = "bar" -} - -provider "do" { - api_key = "${var.foo}" -} - -resource "aws_security_group" "firewall" { - count = 5 -} - -resource aws_instance "web" { - ami = "${var.foo}" - security_groups = [ - "foo", - "${aws_security_group.firewall.foo}", - "${element(split(\",\", var.groups)}", - ] - network_interface = { - device_index = 0 - description = "Main network interface" - } -} - -resource "aws_instance" "db" { - security_groups = "${aws_security_group.firewall.*.id}" - VPC = "foo" - depends_on = ["aws_instance.web"] -} - -output "web_ip" { - value = "${aws_instance.web.private_ip}" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_key.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_key.hcl deleted file mode 100644 index 0007aaf5f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_key.hcl +++ /dev/null @@ -1 +0,0 @@ -foo.bar = "baz" diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/empty.hcl deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list.hcl deleted file mode 100644 index 059d4ce65..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo"] diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list_comma.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list_comma.hcl deleted file mode 100644 index 50f4218ac..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list_comma.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo",] diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/missing_braces.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/missing_braces.hcl deleted file mode 100644 index 68e7274e6..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/missing_braces.hcl +++ /dev/null @@ -1,4 +0,0 @@ -# should error, but not crash -resource "template_file" "cloud_config" { - template = "$file("${path.module}/some/path")" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/multiple.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/multiple.hcl deleted file mode 100644 index 029c54b0c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/multiple.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -key = 7 diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/old.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/old.hcl deleted file mode 100644 index e9f77cae9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/old.hcl +++ /dev/null @@ -1,3 +0,0 @@ -default = { - "eu-west-1": "ami-b1cf19c6", -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure.hcl deleted file mode 100644 index 92592fbb3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure.hcl +++ /dev/null @@ -1,5 +0,0 @@ -// This is a test structure for the lexer -foo bar "baz" { - key = 7 - foo = "bar" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_basic.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_basic.hcl deleted file mode 100644 index 7229a1f01..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_basic.hcl +++ /dev/null @@ -1,5 +0,0 @@ -foo { - value = 7 - "value" = 8 - "complex::value" = 9 -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_empty.hcl deleted file mode 100644 index 4d156ddea..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" "bar" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/types.hcl b/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/types.hcl deleted file mode 100644 index cf2747ea1..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/types.hcl +++ /dev/null @@ -1,7 +0,0 @@ -foo = "bar" -bar = 7 -baz = [1,2,3] -foo = -12 -bar = 3.14159 -foo = true -bar = false diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go b/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go deleted file mode 100644 index 1f17af024..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/nodes.go +++ /dev/null @@ -1,573 +0,0 @@ -package printer - -import ( - "bytes" - "fmt" - "sort" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/token" -) - -const ( - blank = byte(' ') - newline = byte('\n') - tab = byte('\t') - infinity = 1 << 30 // offset or line -) - -var ( - unindent = []byte("\uE123") // in the private use space -) - -type printer struct { - cfg Config - prev token.Pos - - comments []*ast.CommentGroup // may be nil, contains all comments - standaloneComments []*ast.CommentGroup // contains all standalone comments (not assigned to any node) - - enableTrace bool - indentTrace int -} - -type ByPosition []*ast.CommentGroup - -func (b ByPosition) Len() int { return len(b) } -func (b ByPosition) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b ByPosition) Less(i, j int) bool { return b[i].Pos().Before(b[j].Pos()) } - -// collectComments comments all standalone comments which are not lead or line -// comment -func (p *printer) collectComments(node ast.Node) { - // first collect all comments. This is already stored in - // ast.File.(comments) - ast.Walk(node, func(nn ast.Node) (ast.Node, bool) { - switch t := nn.(type) { - case *ast.File: - p.comments = t.Comments - return nn, false - } - return nn, true - }) - - standaloneComments := make(map[token.Pos]*ast.CommentGroup, 0) - for _, c := range p.comments { - standaloneComments[c.Pos()] = c - } - - // next remove all lead and line comments from the overall comment map. - // This will give us comments which are standalone, comments which are not - // assigned to any kind of node. - ast.Walk(node, func(nn ast.Node) (ast.Node, bool) { - switch t := nn.(type) { - case *ast.LiteralType: - if t.LineComment != nil { - for _, comment := range t.LineComment.List { - if _, ok := standaloneComments[comment.Pos()]; ok { - delete(standaloneComments, comment.Pos()) - } - } - } - case *ast.ObjectItem: - if t.LeadComment != nil { - for _, comment := range t.LeadComment.List { - if _, ok := standaloneComments[comment.Pos()]; ok { - delete(standaloneComments, comment.Pos()) - } - } - } - - if t.LineComment != nil { - for _, comment := range t.LineComment.List { - if _, ok := standaloneComments[comment.Pos()]; ok { - delete(standaloneComments, comment.Pos()) - } - } - } - } - - return nn, true - }) - - for _, c := range standaloneComments { - p.standaloneComments = append(p.standaloneComments, c) - } - - sort.Sort(ByPosition(p.standaloneComments)) - -} - -// output prints creates b printable HCL output and returns it. -func (p *printer) output(n interface{}) []byte { - var buf bytes.Buffer - - switch t := n.(type) { - case *ast.File: - return p.output(t.Node) - case *ast.ObjectList: - var index int - var nextItem token.Pos - var commented bool - for { - // TODO(arslan): refactor below comment printing, we have the same in objectType - for _, c := range p.standaloneComments { - for _, comment := range c.List { - if index != len(t.Items) { - nextItem = t.Items[index].Pos() - } else { - nextItem = token.Pos{Offset: infinity, Line: infinity} - } - - if comment.Pos().After(p.prev) && comment.Pos().Before(nextItem) { - // if we hit the end add newlines so we can print the comment - if index == len(t.Items) { - buf.Write([]byte{newline, newline}) - } - - buf.WriteString(comment.Text) - - buf.WriteByte(newline) - if index != len(t.Items) { - buf.WriteByte(newline) - } - } - } - } - - if index == len(t.Items) { - break - } - - buf.Write(p.output(t.Items[index])) - if !commented && index != len(t.Items)-1 { - buf.Write([]byte{newline, newline}) - } - index++ - } - case *ast.ObjectKey: - buf.WriteString(t.Token.Text) - case *ast.ObjectItem: - p.prev = t.Pos() - buf.Write(p.objectItem(t)) - case *ast.LiteralType: - buf.Write(p.literalType(t)) - case *ast.ListType: - buf.Write(p.list(t)) - case *ast.ObjectType: - buf.Write(p.objectType(t)) - default: - fmt.Printf(" unknown type: %T\n", n) - } - - return buf.Bytes() -} - -func (p *printer) literalType(lit *ast.LiteralType) []byte { - result := []byte(lit.Token.Text) - if lit.Token.Type == token.HEREDOC { - // Clear the trailing newline from heredocs - if result[len(result)-1] == '\n' { - result = result[:len(result)-1] - } - - // Poison lines 2+ so that we don't indent them - result = p.heredocIndent(result) - } - - return result -} - -// objectItem returns the printable HCL form of an object item. An object type -// starts with one/multiple keys and has a value. The value might be of any -// type. -func (p *printer) objectItem(o *ast.ObjectItem) []byte { - defer un(trace(p, fmt.Sprintf("ObjectItem: %s", o.Keys[0].Token.Text))) - var buf bytes.Buffer - - if o.LeadComment != nil { - for _, comment := range o.LeadComment.List { - buf.WriteString(comment.Text) - buf.WriteByte(newline) - } - } - - for i, k := range o.Keys { - buf.WriteString(k.Token.Text) - buf.WriteByte(blank) - - // reach end of key - if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 { - buf.WriteString("=") - buf.WriteByte(blank) - } - } - - buf.Write(p.output(o.Val)) - - if o.Val.Pos().Line == o.Keys[0].Pos().Line && o.LineComment != nil { - buf.WriteByte(blank) - for _, comment := range o.LineComment.List { - buf.WriteString(comment.Text) - } - } - - return buf.Bytes() -} - -// objectType returns the printable HCL form of an object type. An object type -// begins with a brace and ends with a brace. -func (p *printer) objectType(o *ast.ObjectType) []byte { - defer un(trace(p, "ObjectType")) - var buf bytes.Buffer - buf.WriteString("{") - buf.WriteByte(newline) - - var index int - var nextItem token.Pos - var commented bool - for { - // Print stand alone comments - for _, c := range p.standaloneComments { - for _, comment := range c.List { - // if we hit the end, last item should be the brace - if index != len(o.List.Items) { - nextItem = o.List.Items[index].Pos() - } else { - nextItem = o.Rbrace - } - - if comment.Pos().After(p.prev) && comment.Pos().Before(nextItem) { - // add newline if it's between other printed nodes - if index > 0 { - commented = true - buf.WriteByte(newline) - } - - buf.Write(p.indent([]byte(comment.Text))) - buf.WriteByte(newline) - if index != len(o.List.Items) { - buf.WriteByte(newline) // do not print on the end - } - } - } - } - - if index == len(o.List.Items) { - p.prev = o.Rbrace - break - } - - // check if we have adjacent one liner items. If yes we'll going to align - // the comments. - var aligned []*ast.ObjectItem - for _, item := range o.List.Items[index:] { - // we don't group one line lists - if len(o.List.Items) == 1 { - break - } - - // one means a oneliner with out any lead comment - // two means a oneliner with lead comment - // anything else might be something else - cur := lines(string(p.objectItem(item))) - if cur > 2 { - break - } - - curPos := item.Pos() - - nextPos := token.Pos{} - if index != len(o.List.Items)-1 { - nextPos = o.List.Items[index+1].Pos() - } - - prevPos := token.Pos{} - if index != 0 { - prevPos = o.List.Items[index-1].Pos() - } - - // fmt.Println("DEBUG ----------------") - // fmt.Printf("prev = %+v prevPos: %s\n", prev, prevPos) - // fmt.Printf("cur = %+v curPos: %s\n", cur, curPos) - // fmt.Printf("next = %+v nextPos: %s\n", next, nextPos) - - if curPos.Line+1 == nextPos.Line { - aligned = append(aligned, item) - index++ - continue - } - - if curPos.Line-1 == prevPos.Line { - aligned = append(aligned, item) - index++ - - // finish if we have a new line or comment next. This happens - // if the next item is not adjacent - if curPos.Line+1 != nextPos.Line { - break - } - continue - } - - break - } - - // put newlines if the items are between other non aligned items. - // newlines are also added if there is a standalone comment already, so - // check it too - if !commented && index != len(aligned) { - buf.WriteByte(newline) - } - - if len(aligned) >= 1 { - p.prev = aligned[len(aligned)-1].Pos() - - items := p.alignedItems(aligned) - buf.Write(p.indent(items)) - } else { - p.prev = o.List.Items[index].Pos() - - buf.Write(p.indent(p.objectItem(o.List.Items[index]))) - index++ - } - - buf.WriteByte(newline) - } - - buf.WriteString("}") - return buf.Bytes() -} - -func (p *printer) alignedItems(items []*ast.ObjectItem) []byte { - var buf bytes.Buffer - - // find the longest key and value length, needed for alignment - var longestKeyLen int // longest key length - var longestValLen int // longest value length - for _, item := range items { - key := len(item.Keys[0].Token.Text) - val := len(p.output(item.Val)) - - if key > longestKeyLen { - longestKeyLen = key - } - - if val > longestValLen { - longestValLen = val - } - } - - for i, item := range items { - if item.LeadComment != nil { - for _, comment := range item.LeadComment.List { - buf.WriteString(comment.Text) - buf.WriteByte(newline) - } - } - - for i, k := range item.Keys { - keyLen := len(k.Token.Text) - buf.WriteString(k.Token.Text) - for i := 0; i < longestKeyLen-keyLen+1; i++ { - buf.WriteByte(blank) - } - - // reach end of key - if i == len(item.Keys)-1 && len(item.Keys) == 1 { - buf.WriteString("=") - buf.WriteByte(blank) - } - } - - val := p.output(item.Val) - valLen := len(val) - buf.Write(val) - - if item.Val.Pos().Line == item.Keys[0].Pos().Line && item.LineComment != nil { - for i := 0; i < longestValLen-valLen+1; i++ { - buf.WriteByte(blank) - } - - for _, comment := range item.LineComment.List { - buf.WriteString(comment.Text) - } - } - - // do not print for the last item - if i != len(items)-1 { - buf.WriteByte(newline) - } - } - - return buf.Bytes() -} - -// list returns the printable HCL form of an list type. -func (p *printer) list(l *ast.ListType) []byte { - var buf bytes.Buffer - buf.WriteString("[") - - var longestLine int - for _, item := range l.List { - // for now we assume that the list only contains literal types - if lit, ok := item.(*ast.LiteralType); ok { - lineLen := len(lit.Token.Text) - if lineLen > longestLine { - longestLine = lineLen - } - } - } - - for i, item := range l.List { - if item.Pos().Line != l.Lbrack.Line { - // multiline list, add newline before we add each item - buf.WriteByte(newline) - // also indent each line - val := p.output(item) - curLen := len(val) - buf.Write(p.indent(val)) - buf.WriteString(",") - - if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { - // if the next item doesn't have any comments, do not align - buf.WriteByte(blank) // align one space - if i != len(l.List)-1 { - if lit, ok := l.List[i+1].(*ast.LiteralType); ok && lit.LineComment != nil { - for i := 0; i < longestLine-curLen; i++ { - buf.WriteByte(blank) - } - } - } - - for _, comment := range lit.LineComment.List { - buf.WriteString(comment.Text) - } - } - - if i == len(l.List)-1 { - buf.WriteByte(newline) - } - } else { - buf.Write(p.output(item)) - if i != len(l.List)-1 { - buf.WriteString(",") - buf.WriteByte(blank) - } - } - - } - - buf.WriteString("]") - return buf.Bytes() -} - -// indent indents the lines of the given buffer for each non-empty line -func (p *printer) indent(buf []byte) []byte { - var prefix []byte - if p.cfg.SpacesWidth != 0 { - for i := 0; i < p.cfg.SpacesWidth; i++ { - prefix = append(prefix, blank) - } - } else { - prefix = []byte{tab} - } - - var res []byte - bol := true - for _, c := range buf { - if bol && c != '\n' { - res = append(res, prefix...) - } - - res = append(res, c) - bol = c == '\n' - } - return res -} - -// unindent removes all the indentation from the tombstoned lines -func (p *printer) unindent(buf []byte) []byte { - var res []byte - for i := 0; i < len(buf); i++ { - skip := len(buf)-i <= len(unindent) - if !skip { - skip = !bytes.Equal(unindent, buf[i:i+len(unindent)]) - } - if skip { - res = append(res, buf[i]) - continue - } - - // We have a marker. we have to backtrace here and clean out - // any whitespace ahead of our tombstone up to a \n - for j := len(res) - 1; j >= 0; j-- { - if res[j] == '\n' { - break - } - - res = res[:j] - } - - // Skip the entire unindent marker - i += len(unindent) - 1 - } - - return res -} - -// heredocIndent marks all the 2nd and further lines as unindentable -func (p *printer) heredocIndent(buf []byte) []byte { - var res []byte - bol := false - for _, c := range buf { - if bol && c != '\n' { - res = append(res, unindent...) - } - res = append(res, c) - bol = c == '\n' - } - return res -} - -func lines(txt string) int { - endline := 1 - for i := 0; i < len(txt); i++ { - if txt[i] == '\n' { - endline++ - } - } - return endline -} - -// ---------------------------------------------------------------------------- -// Tracing support - -func (p *printer) printTrace(a ...interface{}) { - if !p.enableTrace { - return - } - - const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " - const n = len(dots) - i := 2 * p.indentTrace - for i > n { - fmt.Print(dots) - i -= n - } - // i <= n - fmt.Print(dots[0:i]) - fmt.Println(a...) -} - -func trace(p *printer, msg string) *printer { - p.printTrace(msg, "(") - p.indentTrace++ - return p -} - -// Usage pattern: defer un(trace(p, "...")) -func un(p *printer) { - p.indentTrace-- - p.printTrace(")") -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/printer.go b/vendor/github.com/hashicorp/hcl/hcl/printer/printer.go deleted file mode 100644 index fb9df58d4..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/printer.go +++ /dev/null @@ -1,64 +0,0 @@ -// Package printer implements printing of AST nodes to HCL format. -package printer - -import ( - "bytes" - "io" - "text/tabwriter" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/parser" -) - -var DefaultConfig = Config{ - SpacesWidth: 2, -} - -// A Config node controls the output of Fprint. -type Config struct { - SpacesWidth int // if set, it will use spaces instead of tabs for alignment -} - -func (c *Config) Fprint(output io.Writer, node ast.Node) error { - p := &printer{ - cfg: *c, - comments: make([]*ast.CommentGroup, 0), - standaloneComments: make([]*ast.CommentGroup, 0), - // enableTrace: true, - } - - p.collectComments(node) - - if _, err := output.Write(p.unindent(p.output(node))); err != nil { - return err - } - - // flush tabwriter, if any - var err error - if tw, _ := output.(*tabwriter.Writer); tw != nil { - err = tw.Flush() - } - - return err -} - -// Fprint "pretty-prints" an HCL node to output -// It calls Config.Fprint with default settings. -func Fprint(output io.Writer, node ast.Node) error { - return DefaultConfig.Fprint(output, node) -} - -// Format formats src HCL and returns the result. -func Format(src []byte) ([]byte, error) { - node, err := parser.Parse(src) - if err != nil { - return nil, err - } - - var buf bytes.Buffer - if err := DefaultConfig.Fprint(&buf, node); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl deleted file mode 100644 index 78c267582..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = [ - "1", - "2", # comment -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl deleted file mode 100644 index eb5a99a69..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl +++ /dev/null @@ -1,6 +0,0 @@ -resource = [{ - "foo": { - "bar": {}, - "baz": [1, 2, "foo"], - } -}] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_deep.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_deep.hcl deleted file mode 100644 index dd3151cb7..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_deep.hcl +++ /dev/null @@ -1,5 +0,0 @@ -resource = [{ - foo = [{ - bar = {} - }] -}] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl deleted file mode 100644 index 1ff7f29fd..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl +++ /dev/null @@ -1,15 +0,0 @@ -// Foo - -/* Bar */ - -/* -/* -Baz -*/ - -# Another - -# Multiple -# Lines - -foo = "bar" diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl deleted file mode 100644 index fec56017d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl deleted file mode 100644 index cccb5b06f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl +++ /dev/null @@ -1,42 +0,0 @@ -// This comes from Terraform, as a test -variable "foo" { - default = "bar" - description = "bar" -} - -provider "aws" { - access_key = "foo" - secret_key = "bar" -} - -provider "do" { - api_key = "${var.foo}" -} - -resource "aws_security_group" "firewall" { - count = 5 -} - -resource aws_instance "web" { - ami = "${var.foo}" - security_groups = [ - "foo", - "${aws_security_group.firewall.foo}" - ] - - network_interface { - device_index = 0 - description = "Main network interface" - } -} - -resource "aws_instance" "db" { - security_groups = "${aws_security_group.firewall.*.id}" - VPC = "foo" - - depends_on = ["aws_instance.web"] -} - -output "web_ip" { - value = "${aws_instance.web.private_ip}" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl deleted file mode 100644 index 0007aaf5f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl +++ /dev/null @@ -1 +0,0 @@ -foo.bar = "baz" diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl deleted file mode 100644 index 059d4ce65..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo"] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl deleted file mode 100644 index 50f4218ac..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo",] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl deleted file mode 100644 index 029c54b0c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -key = 7 diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl deleted file mode 100644 index e9f77cae9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl +++ /dev/null @@ -1,3 +0,0 @@ -default = { - "eu-west-1": "ami-b1cf19c6", -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl deleted file mode 100644 index 92592fbb3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl +++ /dev/null @@ -1,5 +0,0 @@ -// This is a test structure for the lexer -foo bar "baz" { - key = 7 - foo = "bar" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl deleted file mode 100644 index 7229a1f01..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl +++ /dev/null @@ -1,5 +0,0 @@ -foo { - value = 7 - "value" = 8 - "complex::value" = 9 -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl deleted file mode 100644 index 4d156ddea..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" "bar" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl deleted file mode 100644 index cf2747ea1..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl +++ /dev/null @@ -1,7 +0,0 @@ -foo = "bar" -bar = 7 -baz = [1,2,3] -foo = -12 -bar = 3.14159 -foo = true -bar = false diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json deleted file mode 100644 index e320f17ab..000000000 --- a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": [1, 2, "bar"], - "bar": "baz" -} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json deleted file mode 100644 index b54bde96c..000000000 --- a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "bar" -} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json deleted file mode 100644 index 72168a3cc..000000000 --- a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": { - "bar": [1,2] - } -} diff --git a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json b/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json deleted file mode 100644 index 9a142a6ca..000000000 --- a/vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": "bar", - "bar": 7, - "baz": [1,2,3], - "foo": -12, - "bar": 3.14159, - "foo": true, - "bar": false, - "foo": null -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json deleted file mode 100644 index e320f17ab..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": [1, 2, "bar"], - "bar": "baz" -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json deleted file mode 100644 index b54bde96c..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "bar" -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json deleted file mode 100644 index 72168a3cc..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": { - "bar": [1,2] - } -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json deleted file mode 100644 index 9a142a6ca..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": "bar", - "bar": 7, - "baz": [1,2,3], - "foo": -12, - "bar": 3.14159, - "foo": true, - "bar": false, - "foo": null -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl deleted file mode 100644 index 949994487..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -bar = "${file("bing/bong.txt")}" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json deleted file mode 100644 index 7bdddc84b..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}" -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl deleted file mode 100644 index 4e415da20..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl +++ /dev/null @@ -1 +0,0 @@ -count = "3" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl deleted file mode 100644 index 363697b49..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl +++ /dev/null @@ -1,3 +0,0 @@ -foo="bar" -bar="${file("bing/bong.txt")}" -foo-bar="baz" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl deleted file mode 100644 index 5b185cc91..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl +++ /dev/null @@ -1,15 +0,0 @@ -key "" { - policy = "read" -} - -key "foo/" { - policy = "write" -} - -key "foo/bar/" { - policy = "read" -} - -key "foo/bar/baz" { - policy = "deny" -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json deleted file mode 100644 index 151864ee8..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "key": { - "": { - "policy": "read" - }, - - "foo/": { - "policy": "write" - }, - - "foo/bar/": { - "policy": "read" - }, - - "foo/bar/baz": { - "policy": "deny" - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl deleted file mode 100644 index 52dcaa1bc..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl +++ /dev/null @@ -1,10 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -variable "amis" { - default = { - east = "foo" - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json deleted file mode 100644 index 49f921ed0..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "variable": { - "foo": { - "default": "bar", - "description": "bar" - }, - - "amis": { - "default": { - "east": "foo" - } - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl deleted file mode 100644 index 5be1b2315..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" {} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl deleted file mode 100644 index ead1b8b99..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = "bar\"baz\\n" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl deleted file mode 100644 index 9bca551f8..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -Key = 7 diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl deleted file mode 100644 index eed44e542..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl +++ /dev/null @@ -1 +0,0 @@ -a = 1.02 diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/float.json b/vendor/github.com/hashicorp/hcl/test-fixtures/float.json deleted file mode 100644 index a9d1ab4b0..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/float.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "a": 1.02 -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl deleted file mode 100644 index 7b9539138..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl +++ /dev/null @@ -1 +0,0 @@ -foo="${file(\"bing/bong.txt\")}" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl deleted file mode 100644 index f883bd707..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = <"$profile" - grep -h -v "^mode:" "$workdir"/*.cover >>"$profile" -} - -show_cover_report() { - go tool cover -${1}="$profile" -} - -push_to_coveralls() { - echo "Pushing coverage statistics to coveralls.io" -} - -generate_cover_data $(go list ./...) -show_cover_report func -case "$1" in -"") - ;; ---html) - show_cover_report html ;; ---coveralls) - push_to_coveralls ;; -*) - echo >&2 "error: invalid option: $1"; exit 1 ;; -esac diff --git a/vendor/github.com/hmrc/vmware-govcd/testutil/http.go b/vendor/github.com/hmrc/vmware-govcd/testutil/http.go deleted file mode 100644 index 5ce9e66c5..000000000 --- a/vendor/github.com/hmrc/vmware-govcd/testutil/http.go +++ /dev/null @@ -1,186 +0,0 @@ -// -// The software in this package is published under the terms of the Mozilla -// Public License, version 2.0 a copy of which has been included with this -// distribution in the LICENSE file. -// - -package testutil - -import ( - "bytes" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "time" -) - -type HTTPServer struct { - URL string - Timeout time.Duration - started bool - request chan *http.Request - response chan ResponseFunc -} - -type Response struct { - Status int - Headers map[string]string - Body string -} - -var DefaultClient = &http.Client{ - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - }, -} - -func NewHTTPServer() *HTTPServer { - return &HTTPServer{URL: "http://localhost:4444", Timeout: 5 * time.Second} -} - -type ResponseFunc func(path string) Response - -func (s *HTTPServer) Start() { - if s.started { - return - } - s.started = true - s.request = make(chan *http.Request, 1024) - s.response = make(chan ResponseFunc, 1024) - u, err := url.Parse(s.URL) - if err != nil { - panic(err) - } - l, err := net.Listen("tcp", u.Host) - if err != nil { - panic(err) - } - go http.Serve(l, s) - - s.Response(203, nil, "") - for { - // Wait for it to be up. - resp, err := http.Get(s.URL) - if err == nil && resp.StatusCode == 203 { - break - } - time.Sleep(1e8) - } - s.WaitRequest() // Consume dummy request. -} - -// Flush discards all pending requests and responses. -func (s *HTTPServer) Flush() { - for { - select { - case <-s.request: - case <-s.response: - default: - return - } - } -} - -func body(req *http.Request) string { - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - return string(data) -} - -func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - req.ParseMultipartForm(1e6) - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - req.Body = ioutil.NopCloser(bytes.NewBuffer(data)) - s.request <- req - var resp Response - select { - case respFunc := <-s.response: - resp = respFunc(req.URL.Path) - case <-time.After(s.Timeout): - const msg = "ERROR: Timeout waiting for test to prepare a response\n" - fmt.Fprintf(os.Stderr, msg) - resp = Response{500, nil, msg} - } - if resp.Headers != nil { - h := w.Header() - for k, v := range resp.Headers { - h.Set(k, v) - } - } - if resp.Status != 0 { - w.WriteHeader(resp.Status) - } - w.Write([]byte(resp.Body)) -} - -// WaitRequests returns the next n requests made to the http server from -// the queue. If not enough requests were previously made, it waits until -// the timeout value for them to be made. -func (s *HTTPServer) WaitRequests(n int) []*http.Request { - reqs := make([]*http.Request, 0, n) - for i := 0; i < n; i++ { - select { - case req := <-s.request: - reqs = append(reqs, req) - case <-time.After(s.Timeout): - panic("Timeout waiting for request") - } - } - return reqs -} - -// WaitRequest returns the next request made to the http server from -// the queue. If no requests were previously made, it waits until the -// timeout value for one to be made. -func (s *HTTPServer) WaitRequest() *http.Request { - return s.WaitRequests(1)[0] -} - -// ResponseFunc prepares the test server to respond the following n -// requests using f to build each response. -func (s *HTTPServer) ResponseFunc(n int, f ResponseFunc) { - for i := 0; i < n; i++ { - s.response <- f - } -} - -// ResponseMap maps request paths to responses. -type ResponseMap map[string]Response - -// ResponseMap prepares the test server to respond the following n -// requests using the m to obtain the responses. -func (s *HTTPServer) ResponseMap(n int, m ResponseMap) { - f := func(path string) Response { - for rpath, resp := range m { - if rpath == path { - return resp - } - } - body := "Path not found in response map: " + path - return Response{Status: 500, Body: body} - } - s.ResponseFunc(n, f) -} - -// Responses prepares the test server to respond the following n requests -// using the provided response parameters. -func (s *HTTPServer) Responses(n int, status int, headers map[string]string, body string) { - f := func(path string) Response { - return Response{status, headers, body} - } - s.ResponseFunc(n, f) -} - -// Response prepares the test server to respond the following request -// using the provided response parameters. -func (s *HTTPServer) Response(status int, headers map[string]string, body string) { - s.Responses(1, status, headers, body) -} diff --git a/vendor/github.com/jmespath/go-jmespath/cmd/jpgo/main.go b/vendor/github.com/jmespath/go-jmespath/cmd/jpgo/main.go deleted file mode 100644 index 1c53cfc86..000000000 --- a/vendor/github.com/jmespath/go-jmespath/cmd/jpgo/main.go +++ /dev/null @@ -1,96 +0,0 @@ -/*Basic command line interface for debug and testing purposes. - -Examples: - -Only print the AST for the expression: - - jp.go -ast "foo.bar.baz" - -Evaluate the JMESPath expression against JSON data from a file: - - jp.go -input /tmp/data.json "foo.bar.baz" - -This program can also be used as an executable to the jp-compliance -runner (github.com/jmespath/jmespath.test). - -*/ -package main - -import ( - "flag" - "fmt" - "io/ioutil" - "os" -) - -import ( - "encoding/json" - - "github.com/jmespath/go-jmespath" -) - -func errMsg(msg string, a ...interface{}) int { - fmt.Fprintf(os.Stderr, msg, a...) - fmt.Fprintln(os.Stderr) - return 1 -} - -func run() int { - - astOnly := flag.Bool("ast", false, "Print the AST for the input expression and exit.") - inputFile := flag.String("input", "", "Filename containing JSON data to search. If not provided, data is read from stdin.") - - flag.Parse() - args := flag.Args() - if len(args) != 1 { - fmt.Fprintf(os.Stderr, "Usage:\n\n") - flag.PrintDefaults() - return errMsg("\nError: expected a single argument (the JMESPath expression).") - } - - expression := args[0] - parser := jmespath.NewParser() - parsed, err := parser.Parse(expression) - if err != nil { - if syntaxError, ok := err.(jmespath.SyntaxError); ok { - return errMsg("%s\n%s\n", syntaxError, syntaxError.HighlightLocation()) - } - return errMsg("%s", err) - } - if *astOnly { - fmt.Println("") - fmt.Printf("%s\n", parsed) - return 0 - } - - var inputData []byte - if *inputFile != "" { - inputData, err = ioutil.ReadFile(*inputFile) - if err != nil { - return errMsg("Error loading file %s: %s", *inputFile, err) - } - } else { - // If an input data file is not provided then we read the - // data from stdin. - inputData, err = ioutil.ReadAll(os.Stdin) - if err != nil { - return errMsg("Error reading from stdin: %s", err) - } - } - var data interface{} - json.Unmarshal(inputData, &data) - result, err := jmespath.Search(expression, data) - if err != nil { - return errMsg("Error executing expression: %s", err) - } - toJSON, err := json.MarshalIndent(result, "", " ") - if err != nil { - return errMsg("Error serializing result to JSON: %s", err) - } - fmt.Println(string(toJSON)) - return 0 -} - -func main() { - os.Exit(run()) -} diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/basic.json b/vendor/github.com/jmespath/go-jmespath/compliance/basic.json deleted file mode 100644 index d550e9695..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/basic.json +++ /dev/null @@ -1,96 +0,0 @@ -[{ - "given": - {"foo": {"bar": {"baz": "correct"}}}, - "cases": [ - { - "expression": "foo", - "result": {"bar": {"baz": "correct"}} - }, - { - "expression": "foo.bar", - "result": {"baz": "correct"} - }, - { - "expression": "foo.bar.baz", - "result": "correct" - }, - { - "expression": "foo\n.\nbar\n.baz", - "result": "correct" - }, - { - "expression": "foo.bar.baz.bad", - "result": null - }, - { - "expression": "foo.bar.bad", - "result": null - }, - { - "expression": "foo.bad", - "result": null - }, - { - "expression": "bad", - "result": null - }, - { - "expression": "bad.morebad.morebad", - "result": null - } - ] -}, -{ - "given": - {"foo": {"bar": ["one", "two", "three"]}}, - "cases": [ - { - "expression": "foo", - "result": {"bar": ["one", "two", "three"]} - }, - { - "expression": "foo.bar", - "result": ["one", "two", "three"] - } - ] -}, -{ - "given": ["one", "two", "three"], - "cases": [ - { - "expression": "one", - "result": null - }, - { - "expression": "two", - "result": null - }, - { - "expression": "three", - "result": null - }, - { - "expression": "one.two", - "result": null - } - ] -}, -{ - "given": - {"foo": {"1": ["one", "two", "three"], "-1": "bar"}}, - "cases": [ - { - "expression": "foo.\"1\"", - "result": ["one", "two", "three"] - }, - { - "expression": "foo.\"1\"[0]", - "result": "one" - }, - { - "expression": "foo.\"-1\"", - "result": "bar" - } - ] -} -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/boolean.json b/vendor/github.com/jmespath/go-jmespath/compliance/boolean.json deleted file mode 100644 index e3fa196b1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/boolean.json +++ /dev/null @@ -1,257 +0,0 @@ -[ - { - "given": { - "outer": { - "foo": "foo", - "bar": "bar", - "baz": "baz" - } - }, - "cases": [ - { - "expression": "outer.foo || outer.bar", - "result": "foo" - }, - { - "expression": "outer.foo||outer.bar", - "result": "foo" - }, - { - "expression": "outer.bar || outer.baz", - "result": "bar" - }, - { - "expression": "outer.bar||outer.baz", - "result": "bar" - }, - { - "expression": "outer.bad || outer.foo", - "result": "foo" - }, - { - "expression": "outer.bad||outer.foo", - "result": "foo" - }, - { - "expression": "outer.foo || outer.bad", - "result": "foo" - }, - { - "expression": "outer.foo||outer.bad", - "result": "foo" - }, - { - "expression": "outer.bad || outer.alsobad", - "result": null - }, - { - "expression": "outer.bad||outer.alsobad", - "result": null - } - ] - }, - { - "given": { - "outer": { - "foo": "foo", - "bool": false, - "empty_list": [], - "empty_string": "" - } - }, - "cases": [ - { - "expression": "outer.empty_string || outer.foo", - "result": "foo" - }, - { - "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo", - "result": "foo" - } - ] - }, - { - "given": { - "True": true, - "False": false, - "Number": 5, - "EmptyList": [], - "Zero": 0 - }, - "cases": [ - { - "expression": "True && False", - "result": false - }, - { - "expression": "False && True", - "result": false - }, - { - "expression": "True && True", - "result": true - }, - { - "expression": "False && False", - "result": false - }, - { - "expression": "True && Number", - "result": 5 - }, - { - "expression": "Number && True", - "result": true - }, - { - "expression": "Number && False", - "result": false - }, - { - "expression": "Number && EmptyList", - "result": [] - }, - { - "expression": "Number && True", - "result": true - }, - { - "expression": "EmptyList && True", - "result": [] - }, - { - "expression": "EmptyList && False", - "result": [] - }, - { - "expression": "True || False", - "result": true - }, - { - "expression": "True || True", - "result": true - }, - { - "expression": "False || True", - "result": true - }, - { - "expression": "False || False", - "result": false - }, - { - "expression": "Number || EmptyList", - "result": 5 - }, - { - "expression": "Number || True", - "result": 5 - }, - { - "expression": "Number || True && False", - "result": 5 - }, - { - "expression": "(Number || True) && False", - "result": false - }, - { - "expression": "Number || (True && False)", - "result": 5 - }, - { - "expression": "!True", - "result": false - }, - { - "expression": "!False", - "result": true - }, - { - "expression": "!Number", - "result": false - }, - { - "expression": "!EmptyList", - "result": true - }, - { - "expression": "True && !False", - "result": true - }, - { - "expression": "True && !EmptyList", - "result": true - }, - { - "expression": "!False && !EmptyList", - "result": true - }, - { - "expression": "!(True && False)", - "result": true - }, - { - "expression": "!Zero", - "result": false - }, - { - "expression": "!!Zero", - "result": true - } - ] - }, - { - "given": { - "one": 1, - "two": 2, - "three": 3 - }, - "cases": [ - { - "expression": "one < two", - "result": true - }, - { - "expression": "one <= two", - "result": true - }, - { - "expression": "one == one", - "result": true - }, - { - "expression": "one == two", - "result": false - }, - { - "expression": "one > two", - "result": false - }, - { - "expression": "one >= two", - "result": false - }, - { - "expression": "one != two", - "result": true - }, - { - "expression": "one < two && three > one", - "result": true - }, - { - "expression": "one < two || three > one", - "result": true - }, - { - "expression": "one < two || three < one", - "result": true - }, - { - "expression": "two < one || three < one", - "result": false - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/current.json b/vendor/github.com/jmespath/go-jmespath/compliance/current.json deleted file mode 100644 index 0c26248d0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/current.json +++ /dev/null @@ -1,25 +0,0 @@ -[ - { - "given": { - "foo": [{"name": "a"}, {"name": "b"}], - "bar": {"baz": "qux"} - }, - "cases": [ - { - "expression": "@", - "result": { - "foo": [{"name": "a"}, {"name": "b"}], - "bar": {"baz": "qux"} - } - }, - { - "expression": "@.bar", - "result": {"baz": "qux"} - }, - { - "expression": "@.foo[0]", - "result": {"name": "a"} - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/escape.json b/vendor/github.com/jmespath/go-jmespath/compliance/escape.json deleted file mode 100644 index 4a62d951a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/escape.json +++ /dev/null @@ -1,46 +0,0 @@ -[{ - "given": { - "foo.bar": "dot", - "foo bar": "space", - "foo\nbar": "newline", - "foo\"bar": "doublequote", - "c:\\\\windows\\path": "windows", - "/unix/path": "unix", - "\"\"\"": "threequotes", - "bar": {"baz": "qux"} - }, - "cases": [ - { - "expression": "\"foo.bar\"", - "result": "dot" - }, - { - "expression": "\"foo bar\"", - "result": "space" - }, - { - "expression": "\"foo\\nbar\"", - "result": "newline" - }, - { - "expression": "\"foo\\\"bar\"", - "result": "doublequote" - }, - { - "expression": "\"c:\\\\\\\\windows\\\\path\"", - "result": "windows" - }, - { - "expression": "\"/unix/path\"", - "result": "unix" - }, - { - "expression": "\"\\\"\\\"\\\"\"", - "result": "threequotes" - }, - { - "expression": "\"bar\".\"baz\"", - "result": "qux" - } - ] -}] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/filters.json b/vendor/github.com/jmespath/go-jmespath/compliance/filters.json deleted file mode 100644 index 5b9f52b11..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/filters.json +++ /dev/null @@ -1,468 +0,0 @@ -[ - { - "given": {"foo": [{"name": "a"}, {"name": "b"}]}, - "cases": [ - { - "comment": "Matching a literal", - "expression": "foo[?name == 'a']", - "result": [{"name": "a"}] - } - ] - }, - { - "given": {"foo": [0, 1], "bar": [2, 3]}, - "cases": [ - { - "comment": "Matching a literal", - "expression": "*[?[0] == `0`]", - "result": [[], []] - } - ] - }, - { - "given": {"foo": [{"first": "foo", "last": "bar"}, - {"first": "foo", "last": "foo"}, - {"first": "foo", "last": "baz"}]}, - "cases": [ - { - "comment": "Matching an expression", - "expression": "foo[?first == last]", - "result": [{"first": "foo", "last": "foo"}] - }, - { - "comment": "Verify projection created from filter", - "expression": "foo[?first == last].first", - "result": ["foo"] - } - ] - }, - { - "given": {"foo": [{"age": 20}, - {"age": 25}, - {"age": 30}]}, - "cases": [ - { - "comment": "Greater than with a number", - "expression": "foo[?age > `25`]", - "result": [{"age": 30}] - }, - { - "expression": "foo[?age >= `25`]", - "result": [{"age": 25}, {"age": 30}] - }, - { - "comment": "Greater than with a number", - "expression": "foo[?age > `30`]", - "result": [] - }, - { - "comment": "Greater than with a number", - "expression": "foo[?age < `25`]", - "result": [{"age": 20}] - }, - { - "comment": "Greater than with a number", - "expression": "foo[?age <= `25`]", - "result": [{"age": 20}, {"age": 25}] - }, - { - "comment": "Greater than with a number", - "expression": "foo[?age < `20`]", - "result": [] - }, - { - "expression": "foo[?age == `20`]", - "result": [{"age": 20}] - }, - { - "expression": "foo[?age != `20`]", - "result": [{"age": 25}, {"age": 30}] - } - ] - }, - { - "given": {"foo": [{"top": {"name": "a"}}, - {"top": {"name": "b"}}]}, - "cases": [ - { - "comment": "Filter with subexpression", - "expression": "foo[?top.name == 'a']", - "result": [{"top": {"name": "a"}}] - } - ] - }, - { - "given": {"foo": [{"top": {"first": "foo", "last": "bar"}}, - {"top": {"first": "foo", "last": "foo"}}, - {"top": {"first": "foo", "last": "baz"}}]}, - "cases": [ - { - "comment": "Matching an expression", - "expression": "foo[?top.first == top.last]", - "result": [{"top": {"first": "foo", "last": "foo"}}] - }, - { - "comment": "Matching a JSON array", - "expression": "foo[?top == `{\"first\": \"foo\", \"last\": \"bar\"}`]", - "result": [{"top": {"first": "foo", "last": "bar"}}] - } - ] - }, - { - "given": {"foo": [ - {"key": true}, - {"key": false}, - {"key": 0}, - {"key": 1}, - {"key": [0]}, - {"key": {"bar": [0]}}, - {"key": null}, - {"key": [1]}, - {"key": {"a":2}} - ]}, - "cases": [ - { - "expression": "foo[?key == `true`]", - "result": [{"key": true}] - }, - { - "expression": "foo[?key == `false`]", - "result": [{"key": false}] - }, - { - "expression": "foo[?key == `0`]", - "result": [{"key": 0}] - }, - { - "expression": "foo[?key == `1`]", - "result": [{"key": 1}] - }, - { - "expression": "foo[?key == `[0]`]", - "result": [{"key": [0]}] - }, - { - "expression": "foo[?key == `{\"bar\": [0]}`]", - "result": [{"key": {"bar": [0]}}] - }, - { - "expression": "foo[?key == `null`]", - "result": [{"key": null}] - }, - { - "expression": "foo[?key == `[1]`]", - "result": [{"key": [1]}] - }, - { - "expression": "foo[?key == `{\"a\":2}`]", - "result": [{"key": {"a":2}}] - }, - { - "expression": "foo[?`true` == key]", - "result": [{"key": true}] - }, - { - "expression": "foo[?`false` == key]", - "result": [{"key": false}] - }, - { - "expression": "foo[?`0` == key]", - "result": [{"key": 0}] - }, - { - "expression": "foo[?`1` == key]", - "result": [{"key": 1}] - }, - { - "expression": "foo[?`[0]` == key]", - "result": [{"key": [0]}] - }, - { - "expression": "foo[?`{\"bar\": [0]}` == key]", - "result": [{"key": {"bar": [0]}}] - }, - { - "expression": "foo[?`null` == key]", - "result": [{"key": null}] - }, - { - "expression": "foo[?`[1]` == key]", - "result": [{"key": [1]}] - }, - { - "expression": "foo[?`{\"a\":2}` == key]", - "result": [{"key": {"a":2}}] - }, - { - "expression": "foo[?key != `true`]", - "result": [{"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?key != `false`]", - "result": [{"key": true}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?key != `0`]", - "result": [{"key": true}, {"key": false}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?key != `1`]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?key != `null`]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?key != `[1]`]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": {"a":2}}] - }, - { - "expression": "foo[?key != `{\"a\":2}`]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}] - }, - { - "expression": "foo[?`true` != key]", - "result": [{"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?`false` != key]", - "result": [{"key": true}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?`0` != key]", - "result": [{"key": true}, {"key": false}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?`1` != key]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?`null` != key]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": [1]}, {"key": {"a":2}}] - }, - { - "expression": "foo[?`[1]` != key]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": {"a":2}}] - }, - { - "expression": "foo[?`{\"a\":2}` != key]", - "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, - {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}] - } - ] - }, - { - "given": {"reservations": [ - {"instances": [ - {"foo": 1, "bar": 2}, {"foo": 1, "bar": 3}, - {"foo": 1, "bar": 2}, {"foo": 2, "bar": 1}]}]}, - "cases": [ - { - "expression": "reservations[].instances[?bar==`1`]", - "result": [[{"foo": 2, "bar": 1}]] - }, - { - "expression": "reservations[*].instances[?bar==`1`]", - "result": [[{"foo": 2, "bar": 1}]] - }, - { - "expression": "reservations[].instances[?bar==`1`][]", - "result": [{"foo": 2, "bar": 1}] - } - ] - }, - { - "given": { - "baz": "other", - "foo": [ - {"bar": 1}, {"bar": 2}, {"bar": 3}, {"bar": 4}, {"bar": 1, "baz": 2} - ] - }, - "cases": [ - { - "expression": "foo[?bar==`1`].bar[0]", - "result": [] - } - ] - }, - { - "given": { - "foo": [ - {"a": 1, "b": {"c": "x"}}, - {"a": 1, "b": {"c": "y"}}, - {"a": 1, "b": {"c": "z"}}, - {"a": 2, "b": {"c": "z"}}, - {"a": 1, "baz": 2} - ] - }, - "cases": [ - { - "expression": "foo[?a==`1`].b.c", - "result": ["x", "y", "z"] - } - ] - }, - { - "given": {"foo": [{"name": "a"}, {"name": "b"}, {"name": "c"}]}, - "cases": [ - { - "comment": "Filter with or expression", - "expression": "foo[?name == 'a' || name == 'b']", - "result": [{"name": "a"}, {"name": "b"}] - }, - { - "expression": "foo[?name == 'a' || name == 'e']", - "result": [{"name": "a"}] - }, - { - "expression": "foo[?name == 'a' || name == 'b' || name == 'c']", - "result": [{"name": "a"}, {"name": "b"}, {"name": "c"}] - } - ] - }, - { - "given": {"foo": [{"a": 1, "b": 2}, {"a": 1, "b": 3}]}, - "cases": [ - { - "comment": "Filter with and expression", - "expression": "foo[?a == `1` && b == `2`]", - "result": [{"a": 1, "b": 2}] - }, - { - "expression": "foo[?a == `1` && b == `4`]", - "result": [] - } - ] - }, - { - "given": {"foo": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]}, - "cases": [ - { - "comment": "Filter with Or and And expressions", - "expression": "foo[?c == `3` || a == `1` && b == `4`]", - "result": [{"a": 1, "b": 2, "c": 3}] - }, - { - "expression": "foo[?b == `2` || a == `3` && b == `4`]", - "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] - }, - { - "expression": "foo[?a == `3` && b == `4` || b == `2`]", - "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] - }, - { - "expression": "foo[?(a == `3` && b == `4`) || b == `2`]", - "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] - }, - { - "expression": "foo[?((a == `3` && b == `4`)) || b == `2`]", - "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] - }, - { - "expression": "foo[?a == `3` && (b == `4` || b == `2`)]", - "result": [{"a": 3, "b": 4}] - }, - { - "expression": "foo[?a == `3` && ((b == `4` || b == `2`))]", - "result": [{"a": 3, "b": 4}] - } - ] - }, - { - "given": {"foo": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]}, - "cases": [ - { - "comment": "Verify precedence of or/and expressions", - "expression": "foo[?a == `1` || b ==`2` && c == `5`]", - "result": [{"a": 1, "b": 2, "c": 3}] - }, - { - "comment": "Parentheses can alter precedence", - "expression": "foo[?(a == `1` || b ==`2`) && c == `5`]", - "result": [] - }, - { - "comment": "Not expressions combined with and/or", - "expression": "foo[?!(a == `1` || b ==`2`)]", - "result": [{"a": 3, "b": 4}] - } - ] - }, - { - "given": { - "foo": [ - {"key": true}, - {"key": false}, - {"key": []}, - {"key": {}}, - {"key": [0]}, - {"key": {"a": "b"}}, - {"key": 0}, - {"key": 1}, - {"key": null}, - {"notkey": true} - ] - }, - "cases": [ - { - "comment": "Unary filter expression", - "expression": "foo[?key]", - "result": [ - {"key": true}, {"key": [0]}, {"key": {"a": "b"}}, - {"key": 0}, {"key": 1} - ] - }, - { - "comment": "Unary not filter expression", - "expression": "foo[?!key]", - "result": [ - {"key": false}, {"key": []}, {"key": {}}, - {"key": null}, {"notkey": true} - ] - }, - { - "comment": "Equality with null RHS", - "expression": "foo[?key == `null`]", - "result": [ - {"key": null}, {"notkey": true} - ] - } - ] - }, - { - "given": { - "foo": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - "cases": [ - { - "comment": "Using @ in a filter expression", - "expression": "foo[?@ < `5`]", - "result": [0, 1, 2, 3, 4] - }, - { - "comment": "Using @ in a filter expression", - "expression": "foo[?`5` > @]", - "result": [0, 1, 2, 3, 4] - }, - { - "comment": "Using @ in a filter expression", - "expression": "foo[?@ == @]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/functions.json b/vendor/github.com/jmespath/go-jmespath/compliance/functions.json deleted file mode 100644 index 8b8db363a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/functions.json +++ /dev/null @@ -1,825 +0,0 @@ -[{ - "given": - { - "foo": -1, - "zero": 0, - "numbers": [-1, 3, 4, 5], - "array": [-1, 3, 4, 5, "a", "100"], - "strings": ["a", "b", "c"], - "decimals": [1.01, 1.2, -1.5], - "str": "Str", - "false": false, - "empty_list": [], - "empty_hash": {}, - "objects": {"foo": "bar", "bar": "baz"}, - "null_key": null - }, - "cases": [ - { - "expression": "abs(foo)", - "result": 1 - }, - { - "expression": "abs(foo)", - "result": 1 - }, - { - "expression": "abs(str)", - "error": "invalid-type" - }, - { - "expression": "abs(array[1])", - "result": 3 - }, - { - "expression": "abs(array[1])", - "result": 3 - }, - { - "expression": "abs(`false`)", - "error": "invalid-type" - }, - { - "expression": "abs(`-24`)", - "result": 24 - }, - { - "expression": "abs(`-24`)", - "result": 24 - }, - { - "expression": "abs(`1`, `2`)", - "error": "invalid-arity" - }, - { - "expression": "abs()", - "error": "invalid-arity" - }, - { - "expression": "unknown_function(`1`, `2`)", - "error": "unknown-function" - }, - { - "expression": "avg(numbers)", - "result": 2.75 - }, - { - "expression": "avg(array)", - "error": "invalid-type" - }, - { - "expression": "avg('abc')", - "error": "invalid-type" - }, - { - "expression": "avg(foo)", - "error": "invalid-type" - }, - { - "expression": "avg(@)", - "error": "invalid-type" - }, - { - "expression": "avg(strings)", - "error": "invalid-type" - }, - { - "expression": "ceil(`1.2`)", - "result": 2 - }, - { - "expression": "ceil(decimals[0])", - "result": 2 - }, - { - "expression": "ceil(decimals[1])", - "result": 2 - }, - { - "expression": "ceil(decimals[2])", - "result": -1 - }, - { - "expression": "ceil('string')", - "error": "invalid-type" - }, - { - "expression": "contains('abc', 'a')", - "result": true - }, - { - "expression": "contains('abc', 'd')", - "result": false - }, - { - "expression": "contains(`false`, 'd')", - "error": "invalid-type" - }, - { - "expression": "contains(strings, 'a')", - "result": true - }, - { - "expression": "contains(decimals, `1.2`)", - "result": true - }, - { - "expression": "contains(decimals, `false`)", - "result": false - }, - { - "expression": "ends_with(str, 'r')", - "result": true - }, - { - "expression": "ends_with(str, 'tr')", - "result": true - }, - { - "expression": "ends_with(str, 'Str')", - "result": true - }, - { - "expression": "ends_with(str, 'SStr')", - "result": false - }, - { - "expression": "ends_with(str, 'foo')", - "result": false - }, - { - "expression": "ends_with(str, `0`)", - "error": "invalid-type" - }, - { - "expression": "floor(`1.2`)", - "result": 1 - }, - { - "expression": "floor('string')", - "error": "invalid-type" - }, - { - "expression": "floor(decimals[0])", - "result": 1 - }, - { - "expression": "floor(foo)", - "result": -1 - }, - { - "expression": "floor(str)", - "error": "invalid-type" - }, - { - "expression": "length('abc')", - "result": 3 - }, - { - "expression": "length('✓foo')", - "result": 4 - }, - { - "expression": "length('')", - "result": 0 - }, - { - "expression": "length(@)", - "result": 12 - }, - { - "expression": "length(strings[0])", - "result": 1 - }, - { - "expression": "length(str)", - "result": 3 - }, - { - "expression": "length(array)", - "result": 6 - }, - { - "expression": "length(objects)", - "result": 2 - }, - { - "expression": "length(`false`)", - "error": "invalid-type" - }, - { - "expression": "length(foo)", - "error": "invalid-type" - }, - { - "expression": "length(strings[0])", - "result": 1 - }, - { - "expression": "max(numbers)", - "result": 5 - }, - { - "expression": "max(decimals)", - "result": 1.2 - }, - { - "expression": "max(strings)", - "result": "c" - }, - { - "expression": "max(abc)", - "error": "invalid-type" - }, - { - "expression": "max(array)", - "error": "invalid-type" - }, - { - "expression": "max(decimals)", - "result": 1.2 - }, - { - "expression": "max(empty_list)", - "result": null - }, - { - "expression": "merge(`{}`)", - "result": {} - }, - { - "expression": "merge(`{}`, `{}`)", - "result": {} - }, - { - "expression": "merge(`{\"a\": 1}`, `{\"b\": 2}`)", - "result": {"a": 1, "b": 2} - }, - { - "expression": "merge(`{\"a\": 1}`, `{\"a\": 2}`)", - "result": {"a": 2} - }, - { - "expression": "merge(`{\"a\": 1, \"b\": 2}`, `{\"a\": 2, \"c\": 3}`, `{\"d\": 4}`)", - "result": {"a": 2, "b": 2, "c": 3, "d": 4} - }, - { - "expression": "min(numbers)", - "result": -1 - }, - { - "expression": "min(decimals)", - "result": -1.5 - }, - { - "expression": "min(abc)", - "error": "invalid-type" - }, - { - "expression": "min(array)", - "error": "invalid-type" - }, - { - "expression": "min(empty_list)", - "result": null - }, - { - "expression": "min(decimals)", - "result": -1.5 - }, - { - "expression": "min(strings)", - "result": "a" - }, - { - "expression": "type('abc')", - "result": "string" - }, - { - "expression": "type(`1.0`)", - "result": "number" - }, - { - "expression": "type(`2`)", - "result": "number" - }, - { - "expression": "type(`true`)", - "result": "boolean" - }, - { - "expression": "type(`false`)", - "result": "boolean" - }, - { - "expression": "type(`null`)", - "result": "null" - }, - { - "expression": "type(`[0]`)", - "result": "array" - }, - { - "expression": "type(`{\"a\": \"b\"}`)", - "result": "object" - }, - { - "expression": "type(@)", - "result": "object" - }, - { - "expression": "sort(keys(objects))", - "result": ["bar", "foo"] - }, - { - "expression": "keys(foo)", - "error": "invalid-type" - }, - { - "expression": "keys(strings)", - "error": "invalid-type" - }, - { - "expression": "keys(`false`)", - "error": "invalid-type" - }, - { - "expression": "sort(values(objects))", - "result": ["bar", "baz"] - }, - { - "expression": "keys(empty_hash)", - "result": [] - }, - { - "expression": "values(foo)", - "error": "invalid-type" - }, - { - "expression": "join(', ', strings)", - "result": "a, b, c" - }, - { - "expression": "join(', ', strings)", - "result": "a, b, c" - }, - { - "expression": "join(',', `[\"a\", \"b\"]`)", - "result": "a,b" - }, - { - "expression": "join(',', `[\"a\", 0]`)", - "error": "invalid-type" - }, - { - "expression": "join(', ', str)", - "error": "invalid-type" - }, - { - "expression": "join('|', strings)", - "result": "a|b|c" - }, - { - "expression": "join(`2`, strings)", - "error": "invalid-type" - }, - { - "expression": "join('|', decimals)", - "error": "invalid-type" - }, - { - "expression": "join('|', decimals[].to_string(@))", - "result": "1.01|1.2|-1.5" - }, - { - "expression": "join('|', empty_list)", - "result": "" - }, - { - "expression": "reverse(numbers)", - "result": [5, 4, 3, -1] - }, - { - "expression": "reverse(array)", - "result": ["100", "a", 5, 4, 3, -1] - }, - { - "expression": "reverse(`[]`)", - "result": [] - }, - { - "expression": "reverse('')", - "result": "" - }, - { - "expression": "reverse('hello world')", - "result": "dlrow olleh" - }, - { - "expression": "starts_with(str, 'S')", - "result": true - }, - { - "expression": "starts_with(str, 'St')", - "result": true - }, - { - "expression": "starts_with(str, 'Str')", - "result": true - }, - { - "expression": "starts_with(str, 'String')", - "result": false - }, - { - "expression": "starts_with(str, `0`)", - "error": "invalid-type" - }, - { - "expression": "sum(numbers)", - "result": 11 - }, - { - "expression": "sum(decimals)", - "result": 0.71 - }, - { - "expression": "sum(array)", - "error": "invalid-type" - }, - { - "expression": "sum(array[].to_number(@))", - "result": 111 - }, - { - "expression": "sum(`[]`)", - "result": 0 - }, - { - "expression": "to_array('foo')", - "result": ["foo"] - }, - { - "expression": "to_array(`0`)", - "result": [0] - }, - { - "expression": "to_array(objects)", - "result": [{"foo": "bar", "bar": "baz"}] - }, - { - "expression": "to_array(`[1, 2, 3]`)", - "result": [1, 2, 3] - }, - { - "expression": "to_array(false)", - "result": [false] - }, - { - "expression": "to_string('foo')", - "result": "foo" - }, - { - "expression": "to_string(`1.2`)", - "result": "1.2" - }, - { - "expression": "to_string(`[0, 1]`)", - "result": "[0,1]" - }, - { - "expression": "to_number('1.0')", - "result": 1.0 - }, - { - "expression": "to_number('1.1')", - "result": 1.1 - }, - { - "expression": "to_number('4')", - "result": 4 - }, - { - "expression": "to_number('notanumber')", - "result": null - }, - { - "expression": "to_number(`false`)", - "result": null - }, - { - "expression": "to_number(`null`)", - "result": null - }, - { - "expression": "to_number(`[0]`)", - "result": null - }, - { - "expression": "to_number(`{\"foo\": 0}`)", - "result": null - }, - { - "expression": "\"to_string\"(`1.0`)", - "error": "syntax" - }, - { - "expression": "sort(numbers)", - "result": [-1, 3, 4, 5] - }, - { - "expression": "sort(strings)", - "result": ["a", "b", "c"] - }, - { - "expression": "sort(decimals)", - "result": [-1.5, 1.01, 1.2] - }, - { - "expression": "sort(array)", - "error": "invalid-type" - }, - { - "expression": "sort(abc)", - "error": "invalid-type" - }, - { - "expression": "sort(empty_list)", - "result": [] - }, - { - "expression": "sort(@)", - "error": "invalid-type" - }, - { - "expression": "not_null(unknown_key, str)", - "result": "Str" - }, - { - "expression": "not_null(unknown_key, foo.bar, empty_list, str)", - "result": [] - }, - { - "expression": "not_null(unknown_key, null_key, empty_list, str)", - "result": [] - }, - { - "expression": "not_null(all, expressions, are_null)", - "result": null - }, - { - "expression": "not_null()", - "error": "invalid-arity" - }, - { - "description": "function projection on single arg function", - "expression": "numbers[].to_string(@)", - "result": ["-1", "3", "4", "5"] - }, - { - "description": "function projection on single arg function", - "expression": "array[].to_number(@)", - "result": [-1, 3, 4, 5, 100] - } - ] -}, { - "given": - { - "foo": [ - {"b": "b", "a": "a"}, - {"c": "c", "b": "b"}, - {"d": "d", "c": "c"}, - {"e": "e", "d": "d"}, - {"f": "f", "e": "e"} - ] - }, - "cases": [ - { - "description": "function projection on variadic function", - "expression": "foo[].not_null(f, e, d, c, b, a)", - "result": ["b", "c", "d", "e", "f"] - } - ] -}, { - "given": - { - "people": [ - {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, - {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, - {"age": 30, "age_str": "30", "bool": true, "name": "c"}, - {"age": 50, "age_str": "50", "bool": false, "name": "d"}, - {"age": 10, "age_str": "10", "bool": true, "name": 3} - ] - }, - "cases": [ - { - "description": "sort by field expression", - "expression": "sort_by(people, &age)", - "result": [ - {"age": 10, "age_str": "10", "bool": true, "name": 3}, - {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, - {"age": 30, "age_str": "30", "bool": true, "name": "c"}, - {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, - {"age": 50, "age_str": "50", "bool": false, "name": "d"} - ] - }, - { - "expression": "sort_by(people, &age_str)", - "result": [ - {"age": 10, "age_str": "10", "bool": true, "name": 3}, - {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, - {"age": 30, "age_str": "30", "bool": true, "name": "c"}, - {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, - {"age": 50, "age_str": "50", "bool": false, "name": "d"} - ] - }, - { - "description": "sort by function expression", - "expression": "sort_by(people, &to_number(age_str))", - "result": [ - {"age": 10, "age_str": "10", "bool": true, "name": 3}, - {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, - {"age": 30, "age_str": "30", "bool": true, "name": "c"}, - {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, - {"age": 50, "age_str": "50", "bool": false, "name": "d"} - ] - }, - { - "description": "function projection on sort_by function", - "expression": "sort_by(people, &age)[].name", - "result": [3, "a", "c", "b", "d"] - }, - { - "expression": "sort_by(people, &extra)", - "error": "invalid-type" - }, - { - "expression": "sort_by(people, &bool)", - "error": "invalid-type" - }, - { - "expression": "sort_by(people, &name)", - "error": "invalid-type" - }, - { - "expression": "sort_by(people, name)", - "error": "invalid-type" - }, - { - "expression": "sort_by(people, &age)[].extra", - "result": ["foo", "bar"] - }, - { - "expression": "sort_by(`[]`, &age)", - "result": [] - }, - { - "expression": "max_by(people, &age)", - "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"} - }, - { - "expression": "max_by(people, &age_str)", - "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"} - }, - { - "expression": "max_by(people, &bool)", - "error": "invalid-type" - }, - { - "expression": "max_by(people, &extra)", - "error": "invalid-type" - }, - { - "expression": "max_by(people, &to_number(age_str))", - "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"} - }, - { - "expression": "min_by(people, &age)", - "result": {"age": 10, "age_str": "10", "bool": true, "name": 3} - }, - { - "expression": "min_by(people, &age_str)", - "result": {"age": 10, "age_str": "10", "bool": true, "name": 3} - }, - { - "expression": "min_by(people, &bool)", - "error": "invalid-type" - }, - { - "expression": "min_by(people, &extra)", - "error": "invalid-type" - }, - { - "expression": "min_by(people, &to_number(age_str))", - "result": {"age": 10, "age_str": "10", "bool": true, "name": 3} - } - ] -}, { - "given": - { - "people": [ - {"age": 10, "order": "1"}, - {"age": 10, "order": "2"}, - {"age": 10, "order": "3"}, - {"age": 10, "order": "4"}, - {"age": 10, "order": "5"}, - {"age": 10, "order": "6"}, - {"age": 10, "order": "7"}, - {"age": 10, "order": "8"}, - {"age": 10, "order": "9"}, - {"age": 10, "order": "10"}, - {"age": 10, "order": "11"} - ] - }, - "cases": [ - { - "description": "stable sort order", - "expression": "sort_by(people, &age)", - "result": [ - {"age": 10, "order": "1"}, - {"age": 10, "order": "2"}, - {"age": 10, "order": "3"}, - {"age": 10, "order": "4"}, - {"age": 10, "order": "5"}, - {"age": 10, "order": "6"}, - {"age": 10, "order": "7"}, - {"age": 10, "order": "8"}, - {"age": 10, "order": "9"}, - {"age": 10, "order": "10"}, - {"age": 10, "order": "11"} - ] - } - ] -}, { - "given": - { - "people": [ - {"a": 10, "b": 1, "c": "z"}, - {"a": 10, "b": 2, "c": null}, - {"a": 10, "b": 3}, - {"a": 10, "b": 4, "c": "z"}, - {"a": 10, "b": 5, "c": null}, - {"a": 10, "b": 6}, - {"a": 10, "b": 7, "c": "z"}, - {"a": 10, "b": 8, "c": null}, - {"a": 10, "b": 9} - ], - "empty": [] - }, - "cases": [ - { - "expression": "map(&a, people)", - "result": [10, 10, 10, 10, 10, 10, 10, 10, 10] - }, - { - "expression": "map(&c, people)", - "result": ["z", null, null, "z", null, null, "z", null, null] - }, - { - "expression": "map(&a, badkey)", - "error": "invalid-type" - }, - { - "expression": "map(&foo, empty)", - "result": [] - } - ] -}, { - "given": { - "array": [ - { - "foo": {"bar": "yes1"} - }, - { - "foo": {"bar": "yes2"} - }, - { - "foo1": {"bar": "no"} - } - ]}, - "cases": [ - { - "expression": "map(&foo.bar, array)", - "result": ["yes1", "yes2", null] - }, - { - "expression": "map(&foo1.bar, array)", - "result": [null, null, "no"] - }, - { - "expression": "map(&foo.bar.baz, array)", - "result": [null, null, null] - } - ] -}, { - "given": { - "array": [[1, 2, 3, [4]], [5, 6, 7, [8, 9]]] - }, - "cases": [ - { - "expression": "map(&[], array)", - "result": [[1, 2, 3, 4], [5, 6, 7, 8, 9]] - } - ] -} -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/identifiers.json b/vendor/github.com/jmespath/go-jmespath/compliance/identifiers.json deleted file mode 100644 index 7998a41ac..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/identifiers.json +++ /dev/null @@ -1,1377 +0,0 @@ -[ - { - "given": { - "__L": true - }, - "cases": [ - { - "expression": "__L", - "result": true - } - ] - }, - { - "given": { - "!\r": true - }, - "cases": [ - { - "expression": "\"!\\r\"", - "result": true - } - ] - }, - { - "given": { - "Y_1623": true - }, - "cases": [ - { - "expression": "Y_1623", - "result": true - } - ] - }, - { - "given": { - "x": true - }, - "cases": [ - { - "expression": "x", - "result": true - } - ] - }, - { - "given": { - "\tF\uCebb": true - }, - "cases": [ - { - "expression": "\"\\tF\\uCebb\"", - "result": true - } - ] - }, - { - "given": { - " \t": true - }, - "cases": [ - { - "expression": "\" \\t\"", - "result": true - } - ] - }, - { - "given": { - " ": true - }, - "cases": [ - { - "expression": "\" \"", - "result": true - } - ] - }, - { - "given": { - "v2": true - }, - "cases": [ - { - "expression": "v2", - "result": true - } - ] - }, - { - "given": { - "\t": true - }, - "cases": [ - { - "expression": "\"\\t\"", - "result": true - } - ] - }, - { - "given": { - "_X": true - }, - "cases": [ - { - "expression": "_X", - "result": true - } - ] - }, - { - "given": { - "\t4\ud9da\udd15": true - }, - "cases": [ - { - "expression": "\"\\t4\\ud9da\\udd15\"", - "result": true - } - ] - }, - { - "given": { - "v24_W": true - }, - "cases": [ - { - "expression": "v24_W", - "result": true - } - ] - }, - { - "given": { - "H": true - }, - "cases": [ - { - "expression": "\"H\"", - "result": true - } - ] - }, - { - "given": { - "\f": true - }, - "cases": [ - { - "expression": "\"\\f\"", - "result": true - } - ] - }, - { - "given": { - "E4": true - }, - "cases": [ - { - "expression": "\"E4\"", - "result": true - } - ] - }, - { - "given": { - "!": true - }, - "cases": [ - { - "expression": "\"!\"", - "result": true - } - ] - }, - { - "given": { - "tM": true - }, - "cases": [ - { - "expression": "tM", - "result": true - } - ] - }, - { - "given": { - " [": true - }, - "cases": [ - { - "expression": "\" [\"", - "result": true - } - ] - }, - { - "given": { - "R!": true - }, - "cases": [ - { - "expression": "\"R!\"", - "result": true - } - ] - }, - { - "given": { - "_6W": true - }, - "cases": [ - { - "expression": "_6W", - "result": true - } - ] - }, - { - "given": { - "\uaBA1\r": true - }, - "cases": [ - { - "expression": "\"\\uaBA1\\r\"", - "result": true - } - ] - }, - { - "given": { - "tL7": true - }, - "cases": [ - { - "expression": "tL7", - "result": true - } - ] - }, - { - "given": { - "<": true - }, - "cases": [ - { - "expression": "\">\"", - "result": true - } - ] - }, - { - "given": { - "hvu": true - }, - "cases": [ - { - "expression": "hvu", - "result": true - } - ] - }, - { - "given": { - "; !": true - }, - "cases": [ - { - "expression": "\"; !\"", - "result": true - } - ] - }, - { - "given": { - "hU": true - }, - "cases": [ - { - "expression": "hU", - "result": true - } - ] - }, - { - "given": { - "!I\n\/": true - }, - "cases": [ - { - "expression": "\"!I\\n\\/\"", - "result": true - } - ] - }, - { - "given": { - "\uEEbF": true - }, - "cases": [ - { - "expression": "\"\\uEEbF\"", - "result": true - } - ] - }, - { - "given": { - "U)\t": true - }, - "cases": [ - { - "expression": "\"U)\\t\"", - "result": true - } - ] - }, - { - "given": { - "fa0_9": true - }, - "cases": [ - { - "expression": "fa0_9", - "result": true - } - ] - }, - { - "given": { - "/": true - }, - "cases": [ - { - "expression": "\"/\"", - "result": true - } - ] - }, - { - "given": { - "Gy": true - }, - "cases": [ - { - "expression": "Gy", - "result": true - } - ] - }, - { - "given": { - "\b": true - }, - "cases": [ - { - "expression": "\"\\b\"", - "result": true - } - ] - }, - { - "given": { - "<": true - }, - "cases": [ - { - "expression": "\"<\"", - "result": true - } - ] - }, - { - "given": { - "\t": true - }, - "cases": [ - { - "expression": "\"\\t\"", - "result": true - } - ] - }, - { - "given": { - "\t&\\\r": true - }, - "cases": [ - { - "expression": "\"\\t&\\\\\\r\"", - "result": true - } - ] - }, - { - "given": { - "#": true - }, - "cases": [ - { - "expression": "\"#\"", - "result": true - } - ] - }, - { - "given": { - "B__": true - }, - "cases": [ - { - "expression": "B__", - "result": true - } - ] - }, - { - "given": { - "\nS \n": true - }, - "cases": [ - { - "expression": "\"\\nS \\n\"", - "result": true - } - ] - }, - { - "given": { - "Bp": true - }, - "cases": [ - { - "expression": "Bp", - "result": true - } - ] - }, - { - "given": { - ",\t;": true - }, - "cases": [ - { - "expression": "\",\\t;\"", - "result": true - } - ] - }, - { - "given": { - "B_q": true - }, - "cases": [ - { - "expression": "B_q", - "result": true - } - ] - }, - { - "given": { - "\/+\t\n\b!Z": true - }, - "cases": [ - { - "expression": "\"\\/+\\t\\n\\b!Z\"", - "result": true - } - ] - }, - { - "given": { - "\udadd\udfc7\\ueFAc": true - }, - "cases": [ - { - "expression": "\"\udadd\udfc7\\\\ueFAc\"", - "result": true - } - ] - }, - { - "given": { - ":\f": true - }, - "cases": [ - { - "expression": "\":\\f\"", - "result": true - } - ] - }, - { - "given": { - "\/": true - }, - "cases": [ - { - "expression": "\"\\/\"", - "result": true - } - ] - }, - { - "given": { - "_BW_6Hg_Gl": true - }, - "cases": [ - { - "expression": "_BW_6Hg_Gl", - "result": true - } - ] - }, - { - "given": { - "\udbcf\udc02": true - }, - "cases": [ - { - "expression": "\"\udbcf\udc02\"", - "result": true - } - ] - }, - { - "given": { - "zs1DC": true - }, - "cases": [ - { - "expression": "zs1DC", - "result": true - } - ] - }, - { - "given": { - "__434": true - }, - "cases": [ - { - "expression": "__434", - "result": true - } - ] - }, - { - "given": { - "\udb94\udd41": true - }, - "cases": [ - { - "expression": "\"\udb94\udd41\"", - "result": true - } - ] - }, - { - "given": { - "Z_5": true - }, - "cases": [ - { - "expression": "Z_5", - "result": true - } - ] - }, - { - "given": { - "z_M_": true - }, - "cases": [ - { - "expression": "z_M_", - "result": true - } - ] - }, - { - "given": { - "YU_2": true - }, - "cases": [ - { - "expression": "YU_2", - "result": true - } - ] - }, - { - "given": { - "_0": true - }, - "cases": [ - { - "expression": "_0", - "result": true - } - ] - }, - { - "given": { - "\b+": true - }, - "cases": [ - { - "expression": "\"\\b+\"", - "result": true - } - ] - }, - { - "given": { - "\"": true - }, - "cases": [ - { - "expression": "\"\\\"\"", - "result": true - } - ] - }, - { - "given": { - "D7": true - }, - "cases": [ - { - "expression": "D7", - "result": true - } - ] - }, - { - "given": { - "_62L": true - }, - "cases": [ - { - "expression": "_62L", - "result": true - } - ] - }, - { - "given": { - "\tK\t": true - }, - "cases": [ - { - "expression": "\"\\tK\\t\"", - "result": true - } - ] - }, - { - "given": { - "\n\\\f": true - }, - "cases": [ - { - "expression": "\"\\n\\\\\\f\"", - "result": true - } - ] - }, - { - "given": { - "I_": true - }, - "cases": [ - { - "expression": "I_", - "result": true - } - ] - }, - { - "given": { - "W_a0_": true - }, - "cases": [ - { - "expression": "W_a0_", - "result": true - } - ] - }, - { - "given": { - "BQ": true - }, - "cases": [ - { - "expression": "BQ", - "result": true - } - ] - }, - { - "given": { - "\tX$\uABBb": true - }, - "cases": [ - { - "expression": "\"\\tX$\\uABBb\"", - "result": true - } - ] - }, - { - "given": { - "Z9": true - }, - "cases": [ - { - "expression": "Z9", - "result": true - } - ] - }, - { - "given": { - "\b%\"\uda38\udd0f": true - }, - "cases": [ - { - "expression": "\"\\b%\\\"\uda38\udd0f\"", - "result": true - } - ] - }, - { - "given": { - "_F": true - }, - "cases": [ - { - "expression": "_F", - "result": true - } - ] - }, - { - "given": { - "!,": true - }, - "cases": [ - { - "expression": "\"!,\"", - "result": true - } - ] - }, - { - "given": { - "\"!": true - }, - "cases": [ - { - "expression": "\"\\\"!\"", - "result": true - } - ] - }, - { - "given": { - "Hh": true - }, - "cases": [ - { - "expression": "Hh", - "result": true - } - ] - }, - { - "given": { - "&": true - }, - "cases": [ - { - "expression": "\"&\"", - "result": true - } - ] - }, - { - "given": { - "9\r\\R": true - }, - "cases": [ - { - "expression": "\"9\\r\\\\R\"", - "result": true - } - ] - }, - { - "given": { - "M_k": true - }, - "cases": [ - { - "expression": "M_k", - "result": true - } - ] - }, - { - "given": { - "!\b\n\udb06\ude52\"\"": true - }, - "cases": [ - { - "expression": "\"!\\b\\n\udb06\ude52\\\"\\\"\"", - "result": true - } - ] - }, - { - "given": { - "6": true - }, - "cases": [ - { - "expression": "\"6\"", - "result": true - } - ] - }, - { - "given": { - "_7": true - }, - "cases": [ - { - "expression": "_7", - "result": true - } - ] - }, - { - "given": { - "0": true - }, - "cases": [ - { - "expression": "\"0\"", - "result": true - } - ] - }, - { - "given": { - "\\8\\": true - }, - "cases": [ - { - "expression": "\"\\\\8\\\\\"", - "result": true - } - ] - }, - { - "given": { - "b7eo": true - }, - "cases": [ - { - "expression": "b7eo", - "result": true - } - ] - }, - { - "given": { - "xIUo9": true - }, - "cases": [ - { - "expression": "xIUo9", - "result": true - } - ] - }, - { - "given": { - "5": true - }, - "cases": [ - { - "expression": "\"5\"", - "result": true - } - ] - }, - { - "given": { - "?": true - }, - "cases": [ - { - "expression": "\"?\"", - "result": true - } - ] - }, - { - "given": { - "sU": true - }, - "cases": [ - { - "expression": "sU", - "result": true - } - ] - }, - { - "given": { - "VH2&H\\\/": true - }, - "cases": [ - { - "expression": "\"VH2&H\\\\\\/\"", - "result": true - } - ] - }, - { - "given": { - "_C": true - }, - "cases": [ - { - "expression": "_C", - "result": true - } - ] - }, - { - "given": { - "_": true - }, - "cases": [ - { - "expression": "_", - "result": true - } - ] - }, - { - "given": { - "<\t": true - }, - "cases": [ - { - "expression": "\"<\\t\"", - "result": true - } - ] - }, - { - "given": { - "\uD834\uDD1E": true - }, - "cases": [ - { - "expression": "\"\\uD834\\uDD1E\"", - "result": true - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/indices.json b/vendor/github.com/jmespath/go-jmespath/compliance/indices.json deleted file mode 100644 index aa03b35dd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/indices.json +++ /dev/null @@ -1,346 +0,0 @@ -[{ - "given": - {"foo": {"bar": ["zero", "one", "two"]}}, - "cases": [ - { - "expression": "foo.bar[0]", - "result": "zero" - }, - { - "expression": "foo.bar[1]", - "result": "one" - }, - { - "expression": "foo.bar[2]", - "result": "two" - }, - { - "expression": "foo.bar[3]", - "result": null - }, - { - "expression": "foo.bar[-1]", - "result": "two" - }, - { - "expression": "foo.bar[-2]", - "result": "one" - }, - { - "expression": "foo.bar[-3]", - "result": "zero" - }, - { - "expression": "foo.bar[-4]", - "result": null - } - ] -}, -{ - "given": - {"foo": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]}, - "cases": [ - { - "expression": "foo.bar", - "result": null - }, - { - "expression": "foo[0].bar", - "result": "one" - }, - { - "expression": "foo[1].bar", - "result": "two" - }, - { - "expression": "foo[2].bar", - "result": "three" - }, - { - "expression": "foo[3].notbar", - "result": "four" - }, - { - "expression": "foo[3].bar", - "result": null - }, - { - "expression": "foo[0]", - "result": {"bar": "one"} - }, - { - "expression": "foo[1]", - "result": {"bar": "two"} - }, - { - "expression": "foo[2]", - "result": {"bar": "three"} - }, - { - "expression": "foo[3]", - "result": {"notbar": "four"} - }, - { - "expression": "foo[4]", - "result": null - } - ] -}, -{ - "given": [ - "one", "two", "three" - ], - "cases": [ - { - "expression": "[0]", - "result": "one" - }, - { - "expression": "[1]", - "result": "two" - }, - { - "expression": "[2]", - "result": "three" - }, - { - "expression": "[-1]", - "result": "three" - }, - { - "expression": "[-2]", - "result": "two" - }, - { - "expression": "[-3]", - "result": "one" - } - ] -}, -{ - "given": {"reservations": [ - {"instances": [{"foo": 1}, {"foo": 2}]} - ]}, - "cases": [ - { - "expression": "reservations[].instances[].foo", - "result": [1, 2] - }, - { - "expression": "reservations[].instances[].bar", - "result": [] - }, - { - "expression": "reservations[].notinstances[].foo", - "result": [] - }, - { - "expression": "reservations[].notinstances[].foo", - "result": [] - } - ] -}, -{ - "given": {"reservations": [{ - "instances": [ - {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]}, - {"foo": [{"bar": 5}, {"bar": 6}, {"notbar": [7]}, {"bar": 8}]}, - {"foo": "bar"}, - {"notfoo": [{"bar": 20}, {"bar": 21}, {"notbar": [7]}, {"bar": 22}]}, - {"bar": [{"baz": [1]}, {"baz": [2]}, {"baz": [3]}, {"baz": [4]}]}, - {"baz": [{"baz": [1, 2]}, {"baz": []}, {"baz": []}, {"baz": [3, 4]}]}, - {"qux": [{"baz": []}, {"baz": [1, 2, 3]}, {"baz": [4]}, {"baz": []}]} - ], - "otherkey": {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]} - }, { - "instances": [ - {"a": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]}, - {"b": [{"bar": 5}, {"bar": 6}, {"notbar": [7]}, {"bar": 8}]}, - {"c": "bar"}, - {"notfoo": [{"bar": 23}, {"bar": 24}, {"notbar": [7]}, {"bar": 25}]}, - {"qux": [{"baz": []}, {"baz": [1, 2, 3]}, {"baz": [4]}, {"baz": []}]} - ], - "otherkey": {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]} - } - ]}, - "cases": [ - { - "expression": "reservations[].instances[].foo[].bar", - "result": [1, 2, 4, 5, 6, 8] - }, - { - "expression": "reservations[].instances[].foo[].baz", - "result": [] - }, - { - "expression": "reservations[].instances[].notfoo[].bar", - "result": [20, 21, 22, 23, 24, 25] - }, - { - "expression": "reservations[].instances[].notfoo[].notbar", - "result": [[7], [7]] - }, - { - "expression": "reservations[].notinstances[].foo", - "result": [] - }, - { - "expression": "reservations[].instances[].foo[].notbar", - "result": [3, [7]] - }, - { - "expression": "reservations[].instances[].bar[].baz", - "result": [[1], [2], [3], [4]] - }, - { - "expression": "reservations[].instances[].baz[].baz", - "result": [[1, 2], [], [], [3, 4]] - }, - { - "expression": "reservations[].instances[].qux[].baz", - "result": [[], [1, 2, 3], [4], [], [], [1, 2, 3], [4], []] - }, - { - "expression": "reservations[].instances[].qux[].baz[]", - "result": [1, 2, 3, 4, 1, 2, 3, 4] - } - ] -}, -{ - "given": { - "foo": [ - [["one", "two"], ["three", "four"]], - [["five", "six"], ["seven", "eight"]], - [["nine"], ["ten"]] - ] - }, - "cases": [ - { - "expression": "foo[]", - "result": [["one", "two"], ["three", "four"], ["five", "six"], - ["seven", "eight"], ["nine"], ["ten"]] - }, - { - "expression": "foo[][0]", - "result": ["one", "three", "five", "seven", "nine", "ten"] - }, - { - "expression": "foo[][1]", - "result": ["two", "four", "six", "eight"] - }, - { - "expression": "foo[][0][0]", - "result": [] - }, - { - "expression": "foo[][2][2]", - "result": [] - }, - { - "expression": "foo[][0][0][100]", - "result": [] - } - ] -}, -{ - "given": { - "foo": [{ - "bar": [ - { - "qux": 2, - "baz": 1 - }, - { - "qux": 4, - "baz": 3 - } - ] - }, - { - "bar": [ - { - "qux": 6, - "baz": 5 - }, - { - "qux": 8, - "baz": 7 - } - ] - } - ] - }, - "cases": [ - { - "expression": "foo", - "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, - {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] - }, - { - "expression": "foo[]", - "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, - {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] - }, - { - "expression": "foo[].bar", - "result": [[{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}], - [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]] - }, - { - "expression": "foo[].bar[]", - "result": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}, - {"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}] - }, - { - "expression": "foo[].bar[].baz", - "result": [1, 3, 5, 7] - } - ] -}, -{ - "given": { - "string": "string", - "hash": {"foo": "bar", "bar": "baz"}, - "number": 23, - "nullvalue": null - }, - "cases": [ - { - "expression": "string[]", - "result": null - }, - { - "expression": "hash[]", - "result": null - }, - { - "expression": "number[]", - "result": null - }, - { - "expression": "nullvalue[]", - "result": null - }, - { - "expression": "string[].foo", - "result": null - }, - { - "expression": "hash[].foo", - "result": null - }, - { - "expression": "number[].foo", - "result": null - }, - { - "expression": "nullvalue[].foo", - "result": null - }, - { - "expression": "nullvalue[].foo[].bar", - "result": null - } - ] -} -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/literal.json b/vendor/github.com/jmespath/go-jmespath/compliance/literal.json deleted file mode 100644 index c6706b971..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/literal.json +++ /dev/null @@ -1,185 +0,0 @@ -[ - { - "given": { - "foo": [{"name": "a"}, {"name": "b"}], - "bar": {"baz": "qux"} - }, - "cases": [ - { - "expression": "`\"foo\"`", - "result": "foo" - }, - { - "comment": "Interpret escaped unicode.", - "expression": "`\"\\u03a6\"`", - "result": "Φ" - }, - { - "expression": "`\"✓\"`", - "result": "✓" - }, - { - "expression": "`[1, 2, 3]`", - "result": [1, 2, 3] - }, - { - "expression": "`{\"a\": \"b\"}`", - "result": {"a": "b"} - }, - { - "expression": "`true`", - "result": true - }, - { - "expression": "`false`", - "result": false - }, - { - "expression": "`null`", - "result": null - }, - { - "expression": "`0`", - "result": 0 - }, - { - "expression": "`1`", - "result": 1 - }, - { - "expression": "`2`", - "result": 2 - }, - { - "expression": "`3`", - "result": 3 - }, - { - "expression": "`4`", - "result": 4 - }, - { - "expression": "`5`", - "result": 5 - }, - { - "expression": "`6`", - "result": 6 - }, - { - "expression": "`7`", - "result": 7 - }, - { - "expression": "`8`", - "result": 8 - }, - { - "expression": "`9`", - "result": 9 - }, - { - "comment": "Escaping a backtick in quotes", - "expression": "`\"foo\\`bar\"`", - "result": "foo`bar" - }, - { - "comment": "Double quote in literal", - "expression": "`\"foo\\\"bar\"`", - "result": "foo\"bar" - }, - { - "expression": "`\"1\\`\"`", - "result": "1`" - }, - { - "comment": "Multiple literal expressions with escapes", - "expression": "`\"\\\\\"`.{a:`\"b\"`}", - "result": {"a": "b"} - }, - { - "comment": "literal . identifier", - "expression": "`{\"a\": \"b\"}`.a", - "result": "b" - }, - { - "comment": "literal . identifier . identifier", - "expression": "`{\"a\": {\"b\": \"c\"}}`.a.b", - "result": "c" - }, - { - "comment": "literal . identifier bracket-expr", - "expression": "`[0, 1, 2]`[1]", - "result": 1 - } - ] - }, - { - "comment": "Literals", - "given": {"type": "object"}, - "cases": [ - { - "comment": "Literal with leading whitespace", - "expression": "` {\"foo\": true}`", - "result": {"foo": true} - }, - { - "comment": "Literal with trailing whitespace", - "expression": "`{\"foo\": true} `", - "result": {"foo": true} - }, - { - "comment": "Literal on RHS of subexpr not allowed", - "expression": "foo.`\"bar\"`", - "error": "syntax" - } - ] - }, - { - "comment": "Raw String Literals", - "given": {}, - "cases": [ - { - "expression": "'foo'", - "result": "foo" - }, - { - "expression": "' foo '", - "result": " foo " - }, - { - "expression": "'0'", - "result": "0" - }, - { - "expression": "'newline\n'", - "result": "newline\n" - }, - { - "expression": "'\n'", - "result": "\n" - }, - { - "expression": "'✓'", - "result": "✓" - }, - { - "expression": "'ð„ž'", - "result": "ð„ž" - }, - { - "expression": "' [foo] '", - "result": " [foo] " - }, - { - "expression": "'[foo]'", - "result": "[foo]" - }, - { - "comment": "Do not interpret escaped unicode.", - "expression": "'\\u03a6'", - "result": "\\u03a6" - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/multiselect.json b/vendor/github.com/jmespath/go-jmespath/compliance/multiselect.json deleted file mode 100644 index 8f2a481ed..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/multiselect.json +++ /dev/null @@ -1,393 +0,0 @@ -[{ - "given": { - "foo": { - "bar": "bar", - "baz": "baz", - "qux": "qux", - "nested": { - "one": { - "a": "first", - "b": "second", - "c": "third" - }, - "two": { - "a": "first", - "b": "second", - "c": "third" - }, - "three": { - "a": "first", - "b": "second", - "c": {"inner": "third"} - } - } - }, - "bar": 1, - "baz": 2, - "qux\"": 3 - }, - "cases": [ - { - "expression": "foo.{bar: bar}", - "result": {"bar": "bar"} - }, - { - "expression": "foo.{\"bar\": bar}", - "result": {"bar": "bar"} - }, - { - "expression": "foo.{\"foo.bar\": bar}", - "result": {"foo.bar": "bar"} - }, - { - "expression": "foo.{bar: bar, baz: baz}", - "result": {"bar": "bar", "baz": "baz"} - }, - { - "expression": "foo.{\"bar\": bar, \"baz\": baz}", - "result": {"bar": "bar", "baz": "baz"} - }, - { - "expression": "{\"baz\": baz, \"qux\\\"\": \"qux\\\"\"}", - "result": {"baz": 2, "qux\"": 3} - }, - { - "expression": "foo.{bar:bar,baz:baz}", - "result": {"bar": "bar", "baz": "baz"} - }, - { - "expression": "foo.{bar: bar,qux: qux}", - "result": {"bar": "bar", "qux": "qux"} - }, - { - "expression": "foo.{bar: bar, noexist: noexist}", - "result": {"bar": "bar", "noexist": null} - }, - { - "expression": "foo.{noexist: noexist, alsonoexist: alsonoexist}", - "result": {"noexist": null, "alsonoexist": null} - }, - { - "expression": "foo.badkey.{nokey: nokey, alsonokey: alsonokey}", - "result": null - }, - { - "expression": "foo.nested.*.{a: a,b: b}", - "result": [{"a": "first", "b": "second"}, - {"a": "first", "b": "second"}, - {"a": "first", "b": "second"}] - }, - { - "expression": "foo.nested.three.{a: a, cinner: c.inner}", - "result": {"a": "first", "cinner": "third"} - }, - { - "expression": "foo.nested.three.{a: a, c: c.inner.bad.key}", - "result": {"a": "first", "c": null} - }, - { - "expression": "foo.{a: nested.one.a, b: nested.two.b}", - "result": {"a": "first", "b": "second"} - }, - { - "expression": "{bar: bar, baz: baz}", - "result": {"bar": 1, "baz": 2} - }, - { - "expression": "{bar: bar}", - "result": {"bar": 1} - }, - { - "expression": "{otherkey: bar}", - "result": {"otherkey": 1} - }, - { - "expression": "{no: no, exist: exist}", - "result": {"no": null, "exist": null} - }, - { - "expression": "foo.[bar]", - "result": ["bar"] - }, - { - "expression": "foo.[bar,baz]", - "result": ["bar", "baz"] - }, - { - "expression": "foo.[bar,qux]", - "result": ["bar", "qux"] - }, - { - "expression": "foo.[bar,noexist]", - "result": ["bar", null] - }, - { - "expression": "foo.[noexist,alsonoexist]", - "result": [null, null] - } - ] -}, { - "given": { - "foo": {"bar": 1, "baz": [2, 3, 4]} - }, - "cases": [ - { - "expression": "foo.{bar:bar,baz:baz}", - "result": {"bar": 1, "baz": [2, 3, 4]} - }, - { - "expression": "foo.[bar,baz[0]]", - "result": [1, 2] - }, - { - "expression": "foo.[bar,baz[1]]", - "result": [1, 3] - }, - { - "expression": "foo.[bar,baz[2]]", - "result": [1, 4] - }, - { - "expression": "foo.[bar,baz[3]]", - "result": [1, null] - }, - { - "expression": "foo.[bar[0],baz[3]]", - "result": [null, null] - } - ] -}, { - "given": { - "foo": {"bar": 1, "baz": 2} - }, - "cases": [ - { - "expression": "foo.{bar: bar, baz: baz}", - "result": {"bar": 1, "baz": 2} - }, - { - "expression": "foo.[bar,baz]", - "result": [1, 2] - } - ] -}, { - "given": { - "foo": { - "bar": {"baz": [{"common": "first", "one": 1}, - {"common": "second", "two": 2}]}, - "ignoreme": 1, - "includeme": true - } - }, - "cases": [ - { - "expression": "foo.{bar: bar.baz[1],includeme: includeme}", - "result": {"bar": {"common": "second", "two": 2}, "includeme": true} - }, - { - "expression": "foo.{\"bar.baz.two\": bar.baz[1].two, includeme: includeme}", - "result": {"bar.baz.two": 2, "includeme": true} - }, - { - "expression": "foo.[includeme, bar.baz[*].common]", - "result": [true, ["first", "second"]] - }, - { - "expression": "foo.[includeme, bar.baz[*].none]", - "result": [true, []] - }, - { - "expression": "foo.[includeme, bar.baz[].common]", - "result": [true, ["first", "second"]] - } - ] -}, { - "given": { - "reservations": [{ - "instances": [ - {"id": "id1", - "name": "first"}, - {"id": "id2", - "name": "second"} - ]}, { - "instances": [ - {"id": "id3", - "name": "third"}, - {"id": "id4", - "name": "fourth"} - ]} - ]}, - "cases": [ - { - "expression": "reservations[*].instances[*].{id: id, name: name}", - "result": [[{"id": "id1", "name": "first"}, {"id": "id2", "name": "second"}], - [{"id": "id3", "name": "third"}, {"id": "id4", "name": "fourth"}]] - }, - { - "expression": "reservations[].instances[].{id: id, name: name}", - "result": [{"id": "id1", "name": "first"}, - {"id": "id2", "name": "second"}, - {"id": "id3", "name": "third"}, - {"id": "id4", "name": "fourth"}] - }, - { - "expression": "reservations[].instances[].[id, name]", - "result": [["id1", "first"], - ["id2", "second"], - ["id3", "third"], - ["id4", "fourth"]] - } - ] -}, -{ - "given": { - "foo": [{ - "bar": [ - { - "qux": 2, - "baz": 1 - }, - { - "qux": 4, - "baz": 3 - } - ] - }, - { - "bar": [ - { - "qux": 6, - "baz": 5 - }, - { - "qux": 8, - "baz": 7 - } - ] - } - ] - }, - "cases": [ - { - "expression": "foo", - "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, - {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] - }, - { - "expression": "foo[]", - "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, - {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] - }, - { - "expression": "foo[].bar", - "result": [[{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}], - [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]] - }, - { - "expression": "foo[].bar[]", - "result": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}, - {"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}] - }, - { - "expression": "foo[].bar[].[baz, qux]", - "result": [[1, 2], [3, 4], [5, 6], [7, 8]] - }, - { - "expression": "foo[].bar[].[baz]", - "result": [[1], [3], [5], [7]] - }, - { - "expression": "foo[].bar[].[baz, qux][]", - "result": [1, 2, 3, 4, 5, 6, 7, 8] - } - ] -}, -{ - "given": { - "foo": { - "baz": [ - { - "bar": "abc" - }, { - "bar": "def" - } - ], - "qux": ["zero"] - } - }, - "cases": [ - { - "expression": "foo.[baz[*].bar, qux[0]]", - "result": [["abc", "def"], "zero"] - } - ] -}, -{ - "given": { - "foo": { - "baz": [ - { - "bar": "a", - "bam": "b", - "boo": "c" - }, { - "bar": "d", - "bam": "e", - "boo": "f" - } - ], - "qux": ["zero"] - } - }, - "cases": [ - { - "expression": "foo.[baz[*].[bar, boo], qux[0]]", - "result": [[["a", "c" ], ["d", "f" ]], "zero"] - } - ] -}, -{ - "given": { - "foo": { - "baz": [ - { - "bar": "a", - "bam": "b", - "boo": "c" - }, { - "bar": "d", - "bam": "e", - "boo": "f" - } - ], - "qux": ["zero"] - } - }, - "cases": [ - { - "expression": "foo.[baz[*].not_there || baz[*].bar, qux[0]]", - "result": [["a", "d"], "zero"] - } - ] -}, -{ - "given": {"type": "object"}, - "cases": [ - { - "comment": "Nested multiselect", - "expression": "[[*],*]", - "result": [null, ["object"]] - } - ] -}, -{ - "given": [], - "cases": [ - { - "comment": "Nested multiselect", - "expression": "[[*]]", - "result": [[]] - } - ] -} -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/ormatch.json b/vendor/github.com/jmespath/go-jmespath/compliance/ormatch.json deleted file mode 100644 index 2127cf441..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/ormatch.json +++ /dev/null @@ -1,59 +0,0 @@ -[{ - "given": - {"outer": {"foo": "foo", "bar": "bar", "baz": "baz"}}, - "cases": [ - { - "expression": "outer.foo || outer.bar", - "result": "foo" - }, - { - "expression": "outer.foo||outer.bar", - "result": "foo" - }, - { - "expression": "outer.bar || outer.baz", - "result": "bar" - }, - { - "expression": "outer.bar||outer.baz", - "result": "bar" - }, - { - "expression": "outer.bad || outer.foo", - "result": "foo" - }, - { - "expression": "outer.bad||outer.foo", - "result": "foo" - }, - { - "expression": "outer.foo || outer.bad", - "result": "foo" - }, - { - "expression": "outer.foo||outer.bad", - "result": "foo" - }, - { - "expression": "outer.bad || outer.alsobad", - "result": null - }, - { - "expression": "outer.bad||outer.alsobad", - "result": null - } - ] -}, { - "given": - {"outer": {"foo": "foo", "bool": false, "empty_list": [], "empty_string": ""}}, - "cases": [ - { - "expression": "outer.empty_string || outer.foo", - "result": "foo" - }, - { - "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo", - "result": "foo" - } - ] -}] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/pipe.json b/vendor/github.com/jmespath/go-jmespath/compliance/pipe.json deleted file mode 100644 index b10c0a496..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/pipe.json +++ /dev/null @@ -1,131 +0,0 @@ -[{ - "given": { - "foo": { - "bar": { - "baz": "subkey" - }, - "other": { - "baz": "subkey" - }, - "other2": { - "baz": "subkey" - }, - "other3": { - "notbaz": ["a", "b", "c"] - }, - "other4": { - "notbaz": ["a", "b", "c"] - } - } - }, - "cases": [ - { - "expression": "foo.*.baz | [0]", - "result": "subkey" - }, - { - "expression": "foo.*.baz | [1]", - "result": "subkey" - }, - { - "expression": "foo.*.baz | [2]", - "result": "subkey" - }, - { - "expression": "foo.bar.* | [0]", - "result": "subkey" - }, - { - "expression": "foo.*.notbaz | [*]", - "result": [["a", "b", "c"], ["a", "b", "c"]] - }, - { - "expression": "{\"a\": foo.bar, \"b\": foo.other} | *.baz", - "result": ["subkey", "subkey"] - } - ] -}, { - "given": { - "foo": { - "bar": { - "baz": "one" - }, - "other": { - "baz": "two" - }, - "other2": { - "baz": "three" - }, - "other3": { - "notbaz": ["a", "b", "c"] - }, - "other4": { - "notbaz": ["d", "e", "f"] - } - } - }, - "cases": [ - { - "expression": "foo | bar", - "result": {"baz": "one"} - }, - { - "expression": "foo | bar | baz", - "result": "one" - }, - { - "expression": "foo|bar| baz", - "result": "one" - }, - { - "expression": "not_there | [0]", - "result": null - }, - { - "expression": "not_there | [0]", - "result": null - }, - { - "expression": "[foo.bar, foo.other] | [0]", - "result": {"baz": "one"} - }, - { - "expression": "{\"a\": foo.bar, \"b\": foo.other} | a", - "result": {"baz": "one"} - }, - { - "expression": "{\"a\": foo.bar, \"b\": foo.other} | b", - "result": {"baz": "two"} - }, - { - "expression": "foo.bam || foo.bar | baz", - "result": "one" - }, - { - "expression": "foo | not_there || bar", - "result": {"baz": "one"} - } - ] -}, { - "given": { - "foo": [{ - "bar": [{ - "baz": "one" - }, { - "baz": "two" - }] - }, { - "bar": [{ - "baz": "three" - }, { - "baz": "four" - }] - }] - }, - "cases": [ - { - "expression": "foo[*].bar[*] | [0][0]", - "result": {"baz": "one"} - } - ] -}] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/slice.json b/vendor/github.com/jmespath/go-jmespath/compliance/slice.json deleted file mode 100644 index 359477278..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/slice.json +++ /dev/null @@ -1,187 +0,0 @@ -[{ - "given": { - "foo": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - "bar": { - "baz": 1 - } - }, - "cases": [ - { - "expression": "bar[0:10]", - "result": null - }, - { - "expression": "foo[0:10:1]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[0:10]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[0:10:]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[0::1]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[0::]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[0:]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[:10:1]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[::1]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[:10:]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[::]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[:]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[1:9]", - "result": [1, 2, 3, 4, 5, 6, 7, 8] - }, - { - "expression": "foo[0:10:2]", - "result": [0, 2, 4, 6, 8] - }, - { - "expression": "foo[5:]", - "result": [5, 6, 7, 8, 9] - }, - { - "expression": "foo[5::2]", - "result": [5, 7, 9] - }, - { - "expression": "foo[::2]", - "result": [0, 2, 4, 6, 8] - }, - { - "expression": "foo[::-1]", - "result": [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] - }, - { - "expression": "foo[1::2]", - "result": [1, 3, 5, 7, 9] - }, - { - "expression": "foo[10:0:-1]", - "result": [9, 8, 7, 6, 5, 4, 3, 2, 1] - }, - { - "expression": "foo[10:5:-1]", - "result": [9, 8, 7, 6] - }, - { - "expression": "foo[8:2:-2]", - "result": [8, 6, 4] - }, - { - "expression": "foo[0:20]", - "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - }, - { - "expression": "foo[10:-20:-1]", - "result": [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] - }, - { - "expression": "foo[10:-20]", - "result": [] - }, - { - "expression": "foo[-4:-1]", - "result": [6, 7, 8] - }, - { - "expression": "foo[:-5:-1]", - "result": [9, 8, 7, 6] - }, - { - "expression": "foo[8:2:0]", - "error": "invalid-value" - }, - { - "expression": "foo[8:2:0:1]", - "error": "syntax" - }, - { - "expression": "foo[8:2&]", - "error": "syntax" - }, - { - "expression": "foo[2:a:3]", - "error": "syntax" - } - ] -}, { - "given": { - "foo": [{"a": 1}, {"a": 2}, {"a": 3}], - "bar": [{"a": {"b": 1}}, {"a": {"b": 2}}, - {"a": {"b": 3}}], - "baz": 50 - }, - "cases": [ - { - "expression": "foo[:2].a", - "result": [1, 2] - }, - { - "expression": "foo[:2].b", - "result": [] - }, - { - "expression": "foo[:2].a.b", - "result": [] - }, - { - "expression": "bar[::-1].a.b", - "result": [3, 2, 1] - }, - { - "expression": "bar[:2].a.b", - "result": [1, 2] - }, - { - "expression": "baz[:2].a", - "result": null - } - ] -}, { - "given": [{"a": 1}, {"a": 2}, {"a": 3}], - "cases": [ - { - "expression": "[:]", - "result": [{"a": 1}, {"a": 2}, {"a": 3}] - }, - { - "expression": "[:2].a", - "result": [1, 2] - }, - { - "expression": "[::-1].a", - "result": [3, 2, 1] - }, - { - "expression": "[:2].b", - "result": [] - } - ] -}] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/syntax.json b/vendor/github.com/jmespath/go-jmespath/compliance/syntax.json deleted file mode 100644 index 003c29458..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/syntax.json +++ /dev/null @@ -1,616 +0,0 @@ -[{ - "comment": "Dot syntax", - "given": {"type": "object"}, - "cases": [ - { - "expression": "foo.bar", - "result": null - }, - { - "expression": "foo.1", - "error": "syntax" - }, - { - "expression": "foo.-11", - "error": "syntax" - }, - { - "expression": "foo", - "result": null - }, - { - "expression": "foo.", - "error": "syntax" - }, - { - "expression": "foo.", - "error": "syntax" - }, - { - "expression": ".foo", - "error": "syntax" - }, - { - "expression": "foo..bar", - "error": "syntax" - }, - { - "expression": "foo.bar.", - "error": "syntax" - }, - { - "expression": "foo[.]", - "error": "syntax" - } - ] -}, - { - "comment": "Simple token errors", - "given": {"type": "object"}, - "cases": [ - { - "expression": ".", - "error": "syntax" - }, - { - "expression": ":", - "error": "syntax" - }, - { - "expression": ",", - "error": "syntax" - }, - { - "expression": "]", - "error": "syntax" - }, - { - "expression": "[", - "error": "syntax" - }, - { - "expression": "}", - "error": "syntax" - }, - { - "expression": "{", - "error": "syntax" - }, - { - "expression": ")", - "error": "syntax" - }, - { - "expression": "(", - "error": "syntax" - }, - { - "expression": "((&", - "error": "syntax" - }, - { - "expression": "a[", - "error": "syntax" - }, - { - "expression": "a]", - "error": "syntax" - }, - { - "expression": "a][", - "error": "syntax" - }, - { - "expression": "!", - "error": "syntax" - } - ] - }, - { - "comment": "Boolean syntax errors", - "given": {"type": "object"}, - "cases": [ - { - "expression": "![!(!", - "error": "syntax" - } - ] - }, - { - "comment": "Wildcard syntax", - "given": {"type": "object"}, - "cases": [ - { - "expression": "*", - "result": ["object"] - }, - { - "expression": "*.*", - "result": [] - }, - { - "expression": "*.foo", - "result": [] - }, - { - "expression": "*[0]", - "result": [] - }, - { - "expression": ".*", - "error": "syntax" - }, - { - "expression": "*foo", - "error": "syntax" - }, - { - "expression": "*0", - "error": "syntax" - }, - { - "expression": "foo[*]bar", - "error": "syntax" - }, - { - "expression": "foo[*]*", - "error": "syntax" - } - ] - }, - { - "comment": "Flatten syntax", - "given": {"type": "object"}, - "cases": [ - { - "expression": "[]", - "result": null - } - ] - }, - { - "comment": "Simple bracket syntax", - "given": {"type": "object"}, - "cases": [ - { - "expression": "[0]", - "result": null - }, - { - "expression": "[*]", - "result": null - }, - { - "expression": "*.[0]", - "error": "syntax" - }, - { - "expression": "*.[\"0\"]", - "result": [[null]] - }, - { - "expression": "[*].bar", - "result": null - }, - { - "expression": "[*][0]", - "result": null - }, - { - "expression": "foo[#]", - "error": "syntax" - } - ] - }, - { - "comment": "Multi-select list syntax", - "given": {"type": "object"}, - "cases": [ - { - "expression": "foo[0]", - "result": null - }, - { - "comment": "Valid multi-select of a list", - "expression": "foo[0, 1]", - "error": "syntax" - }, - { - "expression": "foo.[0]", - "error": "syntax" - }, - { - "expression": "foo.[*]", - "result": null - }, - { - "comment": "Multi-select of a list with trailing comma", - "expression": "foo[0, ]", - "error": "syntax" - }, - { - "comment": "Multi-select of a list with trailing comma and no close", - "expression": "foo[0,", - "error": "syntax" - }, - { - "comment": "Multi-select of a list with trailing comma and no close", - "expression": "foo.[a", - "error": "syntax" - }, - { - "comment": "Multi-select of a list with extra comma", - "expression": "foo[0,, 1]", - "error": "syntax" - }, - { - "comment": "Multi-select of a list using an identifier index", - "expression": "foo[abc]", - "error": "syntax" - }, - { - "comment": "Multi-select of a list using identifier indices", - "expression": "foo[abc, def]", - "error": "syntax" - }, - { - "comment": "Multi-select of a list using an identifier index", - "expression": "foo[abc, 1]", - "error": "syntax" - }, - { - "comment": "Multi-select of a list using an identifier index with trailing comma", - "expression": "foo[abc, ]", - "error": "syntax" - }, - { - "comment": "Valid multi-select of a hash using an identifier index", - "expression": "foo.[abc]", - "result": null - }, - { - "comment": "Valid multi-select of a hash", - "expression": "foo.[abc, def]", - "result": null - }, - { - "comment": "Multi-select of a hash using a numeric index", - "expression": "foo.[abc, 1]", - "error": "syntax" - }, - { - "comment": "Multi-select of a hash with a trailing comma", - "expression": "foo.[abc, ]", - "error": "syntax" - }, - { - "comment": "Multi-select of a hash with extra commas", - "expression": "foo.[abc,, def]", - "error": "syntax" - }, - { - "comment": "Multi-select of a hash using number indices", - "expression": "foo.[0, 1]", - "error": "syntax" - } - ] - }, - { - "comment": "Multi-select hash syntax", - "given": {"type": "object"}, - "cases": [ - { - "comment": "No key or value", - "expression": "a{}", - "error": "syntax" - }, - { - "comment": "No closing token", - "expression": "a{", - "error": "syntax" - }, - { - "comment": "Not a key value pair", - "expression": "a{foo}", - "error": "syntax" - }, - { - "comment": "Missing value and closing character", - "expression": "a{foo:", - "error": "syntax" - }, - { - "comment": "Missing closing character", - "expression": "a{foo: 0", - "error": "syntax" - }, - { - "comment": "Missing value", - "expression": "a{foo:}", - "error": "syntax" - }, - { - "comment": "Trailing comma and no closing character", - "expression": "a{foo: 0, ", - "error": "syntax" - }, - { - "comment": "Missing value with trailing comma", - "expression": "a{foo: ,}", - "error": "syntax" - }, - { - "comment": "Accessing Array using an identifier", - "expression": "a{foo: bar}", - "error": "syntax" - }, - { - "expression": "a{foo: 0}", - "error": "syntax" - }, - { - "comment": "Missing key-value pair", - "expression": "a.{}", - "error": "syntax" - }, - { - "comment": "Not a key-value pair", - "expression": "a.{foo}", - "error": "syntax" - }, - { - "comment": "Missing value", - "expression": "a.{foo:}", - "error": "syntax" - }, - { - "comment": "Missing value with trailing comma", - "expression": "a.{foo: ,}", - "error": "syntax" - }, - { - "comment": "Valid multi-select hash extraction", - "expression": "a.{foo: bar}", - "result": null - }, - { - "comment": "Valid multi-select hash extraction", - "expression": "a.{foo: bar, baz: bam}", - "result": null - }, - { - "comment": "Trailing comma", - "expression": "a.{foo: bar, }", - "error": "syntax" - }, - { - "comment": "Missing key in second key-value pair", - "expression": "a.{foo: bar, baz}", - "error": "syntax" - }, - { - "comment": "Missing value in second key-value pair", - "expression": "a.{foo: bar, baz:}", - "error": "syntax" - }, - { - "comment": "Trailing comma", - "expression": "a.{foo: bar, baz: bam, }", - "error": "syntax" - }, - { - "comment": "Nested multi select", - "expression": "{\"\\\\\":{\" \":*}}", - "result": {"\\": {" ": ["object"]}} - } - ] - }, - { - "comment": "Or expressions", - "given": {"type": "object"}, - "cases": [ - { - "expression": "foo || bar", - "result": null - }, - { - "expression": "foo ||", - "error": "syntax" - }, - { - "expression": "foo.|| bar", - "error": "syntax" - }, - { - "expression": " || foo", - "error": "syntax" - }, - { - "expression": "foo || || foo", - "error": "syntax" - }, - { - "expression": "foo.[a || b]", - "result": null - }, - { - "expression": "foo.[a ||]", - "error": "syntax" - }, - { - "expression": "\"foo", - "error": "syntax" - } - ] - }, - { - "comment": "Filter expressions", - "given": {"type": "object"}, - "cases": [ - { - "expression": "foo[?bar==`\"baz\"`]", - "result": null - }, - { - "expression": "foo[? bar == `\"baz\"` ]", - "result": null - }, - { - "expression": "foo[ ?bar==`\"baz\"`]", - "error": "syntax" - }, - { - "expression": "foo[?bar==]", - "error": "syntax" - }, - { - "expression": "foo[?==]", - "error": "syntax" - }, - { - "expression": "foo[?==bar]", - "error": "syntax" - }, - { - "expression": "foo[?bar==baz?]", - "error": "syntax" - }, - { - "expression": "foo[?a.b.c==d.e.f]", - "result": null - }, - { - "expression": "foo[?bar==`[0, 1, 2]`]", - "result": null - }, - { - "expression": "foo[?bar==`[\"a\", \"b\", \"c\"]`]", - "result": null - }, - { - "comment": "Literal char not escaped", - "expression": "foo[?bar==`[\"foo`bar\"]`]", - "error": "syntax" - }, - { - "comment": "Literal char escaped", - "expression": "foo[?bar==`[\"foo\\`bar\"]`]", - "result": null - }, - { - "comment": "Unknown comparator", - "expression": "foo[?bar<>baz]", - "error": "syntax" - }, - { - "comment": "Unknown comparator", - "expression": "foo[?bar^baz]", - "error": "syntax" - }, - { - "expression": "foo[bar==baz]", - "error": "syntax" - }, - { - "comment": "Quoted identifier in filter expression no spaces", - "expression": "[?\"\\\\\">`\"foo\"`]", - "result": null - }, - { - "comment": "Quoted identifier in filter expression with spaces", - "expression": "[?\"\\\\\" > `\"foo\"`]", - "result": null - } - ] - }, - { - "comment": "Filter expression errors", - "given": {"type": "object"}, - "cases": [ - { - "expression": "bar.`\"anything\"`", - "error": "syntax" - }, - { - "expression": "bar.baz.noexists.`\"literal\"`", - "error": "syntax" - }, - { - "comment": "Literal wildcard projection", - "expression": "foo[*].`\"literal\"`", - "error": "syntax" - }, - { - "expression": "foo[*].name.`\"literal\"`", - "error": "syntax" - }, - { - "expression": "foo[].name.`\"literal\"`", - "error": "syntax" - }, - { - "expression": "foo[].name.`\"literal\"`.`\"subliteral\"`", - "error": "syntax" - }, - { - "comment": "Projecting a literal onto an empty list", - "expression": "foo[*].name.noexist.`\"literal\"`", - "error": "syntax" - }, - { - "expression": "foo[].name.noexist.`\"literal\"`", - "error": "syntax" - }, - { - "expression": "twolen[*].`\"foo\"`", - "error": "syntax" - }, - { - "comment": "Two level projection of a literal", - "expression": "twolen[*].threelen[*].`\"bar\"`", - "error": "syntax" - }, - { - "comment": "Two level flattened projection of a literal", - "expression": "twolen[].threelen[].`\"bar\"`", - "error": "syntax" - } - ] - }, - { - "comment": "Identifiers", - "given": {"type": "object"}, - "cases": [ - { - "expression": "foo", - "result": null - }, - { - "expression": "\"foo\"", - "result": null - }, - { - "expression": "\"\\\\\"", - "result": null - } - ] - }, - { - "comment": "Combined syntax", - "given": [], - "cases": [ - { - "expression": "*||*|*|*", - "result": null - }, - { - "expression": "*[]||[*]", - "result": [] - }, - { - "expression": "[*.*]", - "result": [null] - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/unicode.json b/vendor/github.com/jmespath/go-jmespath/compliance/unicode.json deleted file mode 100644 index 6b07b0b6d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/unicode.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - { - "given": {"foo": [{"✓": "✓"}, {"✓": "✗"}]}, - "cases": [ - { - "expression": "foo[].\"✓\"", - "result": ["✓", "✗"] - } - ] - }, - { - "given": {"☯": true}, - "cases": [ - { - "expression": "\"☯\"", - "result": true - } - ] - }, - { - "given": {"♪♫•*¨*•.¸¸â¤Â¸Â¸.•*¨*•♫♪": true}, - "cases": [ - { - "expression": "\"♪♫•*¨*•.¸¸â¤Â¸Â¸.•*¨*•♫♪\"", - "result": true - } - ] - }, - { - "given": {"☃": true}, - "cases": [ - { - "expression": "\"☃\"", - "result": true - } - ] - } -] diff --git a/vendor/github.com/jmespath/go-jmespath/compliance/wildcard.json b/vendor/github.com/jmespath/go-jmespath/compliance/wildcard.json deleted file mode 100644 index 3bcec3028..000000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance/wildcard.json +++ /dev/null @@ -1,460 +0,0 @@ -[{ - "given": { - "foo": { - "bar": { - "baz": "val" - }, - "other": { - "baz": "val" - }, - "other2": { - "baz": "val" - }, - "other3": { - "notbaz": ["a", "b", "c"] - }, - "other4": { - "notbaz": ["a", "b", "c"] - }, - "other5": { - "other": { - "a": 1, - "b": 1, - "c": 1 - } - } - } - }, - "cases": [ - { - "expression": "foo.*.baz", - "result": ["val", "val", "val"] - }, - { - "expression": "foo.bar.*", - "result": ["val"] - }, - { - "expression": "foo.*.notbaz", - "result": [["a", "b", "c"], ["a", "b", "c"]] - }, - { - "expression": "foo.*.notbaz[0]", - "result": ["a", "a"] - }, - { - "expression": "foo.*.notbaz[-1]", - "result": ["c", "c"] - } - ] -}, { - "given": { - "foo": { - "first-1": { - "second-1": "val" - }, - "first-2": { - "second-1": "val" - }, - "first-3": { - "second-1": "val" - } - } - }, - "cases": [ - { - "expression": "foo.*", - "result": [{"second-1": "val"}, {"second-1": "val"}, - {"second-1": "val"}] - }, - { - "expression": "foo.*.*", - "result": [["val"], ["val"], ["val"]] - }, - { - "expression": "foo.*.*.*", - "result": [[], [], []] - }, - { - "expression": "foo.*.*.*.*", - "result": [[], [], []] - } - ] -}, { - "given": { - "foo": { - "bar": "one" - }, - "other": { - "bar": "one" - }, - "nomatch": { - "notbar": "three" - } - }, - "cases": [ - { - "expression": "*.bar", - "result": ["one", "one"] - } - ] -}, { - "given": { - "top1": { - "sub1": {"foo": "one"} - }, - "top2": { - "sub1": {"foo": "one"} - } - }, - "cases": [ - { - "expression": "*", - "result": [{"sub1": {"foo": "one"}}, - {"sub1": {"foo": "one"}}] - }, - { - "expression": "*.sub1", - "result": [{"foo": "one"}, - {"foo": "one"}] - }, - { - "expression": "*.*", - "result": [[{"foo": "one"}], - [{"foo": "one"}]] - }, - { - "expression": "*.*.foo[]", - "result": ["one", "one"] - }, - { - "expression": "*.sub1.foo", - "result": ["one", "one"] - } - ] -}, -{ - "given": - {"foo": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]}, - "cases": [ - { - "expression": "foo[*].bar", - "result": ["one", "two", "three"] - }, - { - "expression": "foo[*].notbar", - "result": ["four"] - } - ] -}, -{ - "given": - [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}], - "cases": [ - { - "expression": "[*]", - "result": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}] - }, - { - "expression": "[*].bar", - "result": ["one", "two", "three"] - }, - { - "expression": "[*].notbar", - "result": ["four"] - } - ] -}, -{ - "given": { - "foo": { - "bar": [ - {"baz": ["one", "two", "three"]}, - {"baz": ["four", "five", "six"]}, - {"baz": ["seven", "eight", "nine"]} - ] - } - }, - "cases": [ - { - "expression": "foo.bar[*].baz", - "result": [["one", "two", "three"], ["four", "five", "six"], ["seven", "eight", "nine"]] - }, - { - "expression": "foo.bar[*].baz[0]", - "result": ["one", "four", "seven"] - }, - { - "expression": "foo.bar[*].baz[1]", - "result": ["two", "five", "eight"] - }, - { - "expression": "foo.bar[*].baz[2]", - "result": ["three", "six", "nine"] - }, - { - "expression": "foo.bar[*].baz[3]", - "result": [] - } - ] -}, -{ - "given": { - "foo": { - "bar": [["one", "two"], ["three", "four"]] - } - }, - "cases": [ - { - "expression": "foo.bar[*]", - "result": [["one", "two"], ["three", "four"]] - }, - { - "expression": "foo.bar[0]", - "result": ["one", "two"] - }, - { - "expression": "foo.bar[0][0]", - "result": "one" - }, - { - "expression": "foo.bar[0][0][0]", - "result": null - }, - { - "expression": "foo.bar[0][0][0][0]", - "result": null - }, - { - "expression": "foo[0][0]", - "result": null - } - ] -}, -{ - "given": { - "foo": [ - {"bar": [{"kind": "basic"}, {"kind": "intermediate"}]}, - {"bar": [{"kind": "advanced"}, {"kind": "expert"}]}, - {"bar": "string"} - ] - - }, - "cases": [ - { - "expression": "foo[*].bar[*].kind", - "result": [["basic", "intermediate"], ["advanced", "expert"]] - }, - { - "expression": "foo[*].bar[0].kind", - "result": ["basic", "advanced"] - } - ] -}, -{ - "given": { - "foo": [ - {"bar": {"kind": "basic"}}, - {"bar": {"kind": "intermediate"}}, - {"bar": {"kind": "advanced"}}, - {"bar": {"kind": "expert"}}, - {"bar": "string"} - ] - }, - "cases": [ - { - "expression": "foo[*].bar.kind", - "result": ["basic", "intermediate", "advanced", "expert"] - } - ] -}, -{ - "given": { - "foo": [{"bar": ["one", "two"]}, {"bar": ["three", "four"]}, {"bar": ["five"]}] - }, - "cases": [ - { - "expression": "foo[*].bar[0]", - "result": ["one", "three", "five"] - }, - { - "expression": "foo[*].bar[1]", - "result": ["two", "four"] - }, - { - "expression": "foo[*].bar[2]", - "result": [] - } - ] -}, -{ - "given": { - "foo": [{"bar": []}, {"bar": []}, {"bar": []}] - }, - "cases": [ - { - "expression": "foo[*].bar[0]", - "result": [] - } - ] -}, -{ - "given": { - "foo": [["one", "two"], ["three", "four"], ["five"]] - }, - "cases": [ - { - "expression": "foo[*][0]", - "result": ["one", "three", "five"] - }, - { - "expression": "foo[*][1]", - "result": ["two", "four"] - } - ] -}, -{ - "given": { - "foo": [ - [ - ["one", "two"], ["three", "four"] - ], [ - ["five", "six"], ["seven", "eight"] - ], [ - ["nine"], ["ten"] - ] - ] - }, - "cases": [ - { - "expression": "foo[*][0]", - "result": [["one", "two"], ["five", "six"], ["nine"]] - }, - { - "expression": "foo[*][1]", - "result": [["three", "four"], ["seven", "eight"], ["ten"]] - }, - { - "expression": "foo[*][0][0]", - "result": ["one", "five", "nine"] - }, - { - "expression": "foo[*][1][0]", - "result": ["three", "seven", "ten"] - }, - { - "expression": "foo[*][0][1]", - "result": ["two", "six"] - }, - { - "expression": "foo[*][1][1]", - "result": ["four", "eight"] - }, - { - "expression": "foo[*][2]", - "result": [] - }, - { - "expression": "foo[*][2][2]", - "result": [] - }, - { - "expression": "bar[*]", - "result": null - }, - { - "expression": "bar[*].baz[*]", - "result": null - } - ] -}, -{ - "given": { - "string": "string", - "hash": {"foo": "bar", "bar": "baz"}, - "number": 23, - "nullvalue": null - }, - "cases": [ - { - "expression": "string[*]", - "result": null - }, - { - "expression": "hash[*]", - "result": null - }, - { - "expression": "number[*]", - "result": null - }, - { - "expression": "nullvalue[*]", - "result": null - }, - { - "expression": "string[*].foo", - "result": null - }, - { - "expression": "hash[*].foo", - "result": null - }, - { - "expression": "number[*].foo", - "result": null - }, - { - "expression": "nullvalue[*].foo", - "result": null - }, - { - "expression": "nullvalue[*].foo[*].bar", - "result": null - } - ] -}, -{ - "given": { - "string": "string", - "hash": {"foo": "val", "bar": "val"}, - "number": 23, - "array": [1, 2, 3], - "nullvalue": null - }, - "cases": [ - { - "expression": "string.*", - "result": null - }, - { - "expression": "hash.*", - "result": ["val", "val"] - }, - { - "expression": "number.*", - "result": null - }, - { - "expression": "array.*", - "result": null - }, - { - "expression": "nullvalue.*", - "result": null - } - ] -}, -{ - "given": { - "a": [0, 1, 2], - "b": [0, 1, 2] - }, - "cases": [ - { - "expression": "*[0]", - "result": [0, 0] - } - ] -} -] diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 deleted file mode 100644 index 191028156..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 deleted file mode 100644 index 4d5f9756e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 +++ /dev/null @@ -1 +0,0 @@ -foo.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 deleted file mode 100644 index bc4f6a3f4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 +++ /dev/null @@ -1 +0,0 @@ -ends_with(str, 'SStr') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 deleted file mode 100644 index 81bf07a7a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 +++ /dev/null @@ -1 +0,0 @@ -ends_with(str, 'foo') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 deleted file mode 100644 index 3225de913..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 +++ /dev/null @@ -1 +0,0 @@ -floor(`1.2`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 deleted file mode 100644 index 8cac95958..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 +++ /dev/null @@ -1 +0,0 @@ -floor(decimals[0]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 deleted file mode 100644 index bd76f47e2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 +++ /dev/null @@ -1 +0,0 @@ -floor(foo) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 deleted file mode 100644 index c719add3d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 +++ /dev/null @@ -1 +0,0 @@ -length('abc') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 deleted file mode 100644 index ff12f04f1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 +++ /dev/null @@ -1 +0,0 @@ -length('') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 deleted file mode 100644 index 0eccba1d3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 +++ /dev/null @@ -1 +0,0 @@ -length(@) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 deleted file mode 100644 index ab14b0fa8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 +++ /dev/null @@ -1 +0,0 @@ -length(strings[0]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 deleted file mode 100644 index f1514bb74..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 +++ /dev/null @@ -1 +0,0 @@ -length(str) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 deleted file mode 100644 index 09276059a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 +++ /dev/null @@ -1 +0,0 @@ -length(array) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 deleted file mode 100644 index ab14b0fa8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 +++ /dev/null @@ -1 +0,0 @@ -length(strings[0]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 deleted file mode 100644 index bfb41ae98..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 +++ /dev/null @@ -1 +0,0 @@ -max(strings) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 deleted file mode 100644 index 915ec172a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 +++ /dev/null @@ -1 +0,0 @@ -merge(`{}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 deleted file mode 100644 index 5b74e9b59..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 +++ /dev/null @@ -1 +0,0 @@ -merge(`{}`, `{}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 deleted file mode 100644 index 64c5e5885..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 +++ /dev/null @@ -1 +0,0 @@ -two \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 deleted file mode 100644 index f34dcd8fa..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 +++ /dev/null @@ -1 +0,0 @@ -merge(`{"a": 1}`, `{"b": 2}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 deleted file mode 100644 index e335dc96f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 +++ /dev/null @@ -1 +0,0 @@ -merge(`{"a": 1}`, `{"a": 2}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 deleted file mode 100644 index aac28fffe..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 +++ /dev/null @@ -1 +0,0 @@ -merge(`{"a": 1, "b": 2}`, `{"a": 2, "c": 3}`, `{"d": 4}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 deleted file mode 100644 index 1c6fd6719..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 +++ /dev/null @@ -1 +0,0 @@ -min(numbers) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 deleted file mode 100644 index 93e68db77..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 +++ /dev/null @@ -1 +0,0 @@ -min(decimals) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 deleted file mode 100644 index 554601ea4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 +++ /dev/null @@ -1 +0,0 @@ -type('abc') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 deleted file mode 100644 index 1ab2d9834..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 +++ /dev/null @@ -1 +0,0 @@ -type(`1.0`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 deleted file mode 100644 index 1d19714ff..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 +++ /dev/null @@ -1 +0,0 @@ -three \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 deleted file mode 100644 index 3cee2f56f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 +++ /dev/null @@ -1 +0,0 @@ -type(`2`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 deleted file mode 100644 index 4821f9aef..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 +++ /dev/null @@ -1 +0,0 @@ -type(`true`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 deleted file mode 100644 index 40b6913a6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 +++ /dev/null @@ -1 +0,0 @@ -type(`false`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 deleted file mode 100644 index c711252be..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 +++ /dev/null @@ -1 +0,0 @@ -type(`null`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 deleted file mode 100644 index ec5d07e95..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 +++ /dev/null @@ -1 +0,0 @@ -type(`[0]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 deleted file mode 100644 index 2080401e1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 +++ /dev/null @@ -1 +0,0 @@ -type(`{"a": "b"}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 deleted file mode 100644 index c5ee2ba5c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 +++ /dev/null @@ -1 +0,0 @@ -type(@) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 deleted file mode 100644 index 1814ca17b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 +++ /dev/null @@ -1 +0,0 @@ -keys(objects) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 deleted file mode 100644 index e03cdb0d6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 +++ /dev/null @@ -1 +0,0 @@ -values(objects) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 deleted file mode 100644 index 7fea8d2ce..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 +++ /dev/null @@ -1 +0,0 @@ -keys(empty_hash) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 deleted file mode 100644 index a17c92f59..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 +++ /dev/null @@ -1 +0,0 @@ -one.two \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 deleted file mode 100644 index 4f1d882a4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 +++ /dev/null @@ -1 +0,0 @@ -join(', ', strings) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 deleted file mode 100644 index 4f1d882a4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 +++ /dev/null @@ -1 +0,0 @@ -join(', ', strings) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 deleted file mode 100644 index 19ec1fe09..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 +++ /dev/null @@ -1 +0,0 @@ -join(',', `["a", "b"]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 deleted file mode 100644 index 761c68a6b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 +++ /dev/null @@ -1 +0,0 @@ -join('|', strings) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 deleted file mode 100644 index a0dd68eaa..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 +++ /dev/null @@ -1 +0,0 @@ -join('|', decimals[].to_string(@)) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 deleted file mode 100644 index a4190b2ba..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 +++ /dev/null @@ -1 +0,0 @@ -join('|', empty_list) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 deleted file mode 100644 index f5033c302..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 +++ /dev/null @@ -1 +0,0 @@ -reverse(numbers) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 deleted file mode 100644 index 822f054d5..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 +++ /dev/null @@ -1 +0,0 @@ -reverse(array) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 deleted file mode 100644 index a584adcc0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 +++ /dev/null @@ -1 +0,0 @@ -reverse(`[]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 deleted file mode 100644 index fb4cc5dc4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 +++ /dev/null @@ -1 +0,0 @@ -reverse('') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 deleted file mode 100644 index 693f95496..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 +++ /dev/null @@ -1 +0,0 @@ -foo."1" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 deleted file mode 100644 index aa260fabc..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 +++ /dev/null @@ -1 +0,0 @@ -reverse('hello world') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 deleted file mode 100644 index d8c58826a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 +++ /dev/null @@ -1 +0,0 @@ -starts_with(str, 'S') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 deleted file mode 100644 index 32e16b7bb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 +++ /dev/null @@ -1 +0,0 @@ -starts_with(str, 'St') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 deleted file mode 100644 index 5f575ae7f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 +++ /dev/null @@ -1 +0,0 @@ -starts_with(str, 'Str') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 deleted file mode 100644 index f31551c62..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 +++ /dev/null @@ -1 +0,0 @@ -sum(numbers) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 deleted file mode 100644 index 18b90446c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 +++ /dev/null @@ -1 +0,0 @@ -sum(decimals) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 deleted file mode 100644 index def4d0bc1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 +++ /dev/null @@ -1 +0,0 @@ -sum(array[].to_number(@)) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 deleted file mode 100644 index 48e4a7707..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 +++ /dev/null @@ -1 +0,0 @@ -sum(`[]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 deleted file mode 100644 index 9fb939a0b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 +++ /dev/null @@ -1 +0,0 @@ -to_array('foo') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 deleted file mode 100644 index 86155ed75..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 +++ /dev/null @@ -1 +0,0 @@ -foo."1"[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 deleted file mode 100644 index 74ba7cc67..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 +++ /dev/null @@ -1 +0,0 @@ -to_array(`0`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 deleted file mode 100644 index 57f8b983f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 +++ /dev/null @@ -1 +0,0 @@ -to_array(objects) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 deleted file mode 100644 index d17c7345f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 +++ /dev/null @@ -1 +0,0 @@ -to_array(`[1, 2, 3]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 deleted file mode 100644 index 15f70f783..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 +++ /dev/null @@ -1 +0,0 @@ -to_array(false) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 deleted file mode 100644 index 9b227529b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 +++ /dev/null @@ -1 +0,0 @@ -to_string('foo') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 deleted file mode 100644 index 489a42935..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 +++ /dev/null @@ -1 +0,0 @@ -to_string(`1.2`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 deleted file mode 100644 index d17106a00..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 +++ /dev/null @@ -1 +0,0 @@ -to_string(`[0, 1]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 deleted file mode 100644 index 4f4ae9e68..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 +++ /dev/null @@ -1 +0,0 @@ -to_number('1.0') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 deleted file mode 100644 index ce932e2e6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 +++ /dev/null @@ -1 +0,0 @@ -to_number('1.1') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 deleted file mode 100644 index e246fa4db..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 +++ /dev/null @@ -1 +0,0 @@ -to_number('4') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 deleted file mode 100644 index de0b4c39d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 +++ /dev/null @@ -1 +0,0 @@ -foo."-1" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 deleted file mode 100644 index f8c264747..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 +++ /dev/null @@ -1 +0,0 @@ -to_number('notanumber') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 deleted file mode 100644 index 7d423b1cd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 +++ /dev/null @@ -1 +0,0 @@ -to_number(`false`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 deleted file mode 100644 index 503716b68..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 +++ /dev/null @@ -1 +0,0 @@ -to_number(`null`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 deleted file mode 100644 index 7f61dfa15..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 +++ /dev/null @@ -1 +0,0 @@ -to_number(`[0]`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 deleted file mode 100644 index ee72a8c01..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 +++ /dev/null @@ -1 +0,0 @@ -to_number(`{"foo": 0}`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 deleted file mode 100644 index 8d8f1f759..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 +++ /dev/null @@ -1 +0,0 @@ -sort(numbers) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 deleted file mode 100644 index 8cb54ba47..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 +++ /dev/null @@ -1 +0,0 @@ -sort(empty_list) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 deleted file mode 100644 index cf2c9b1db..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 +++ /dev/null @@ -1 +0,0 @@ -not_null(unknown_key, str) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 deleted file mode 100644 index b516b2c48..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 +++ /dev/null @@ -1 +0,0 @@ -@ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 deleted file mode 100644 index e047d4866..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 +++ /dev/null @@ -1 +0,0 @@ -not_null(unknown_key, foo.bar, empty_list, str) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 deleted file mode 100644 index c4cc87b9c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 +++ /dev/null @@ -1 +0,0 @@ -not_null(unknown_key, null_key, empty_list, str) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 deleted file mode 100644 index 2c7fa0a9c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 +++ /dev/null @@ -1 +0,0 @@ -not_null(all, expressions, are_null) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 deleted file mode 100644 index eb096e61c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 +++ /dev/null @@ -1 +0,0 @@ -numbers[].to_string(@) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 deleted file mode 100644 index 4958abaec..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 +++ /dev/null @@ -1 +0,0 @@ -array[].to_number(@) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 deleted file mode 100644 index 102708472..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 +++ /dev/null @@ -1 +0,0 @@ -foo[].not_null(f, e, d, c, b, a) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 deleted file mode 100644 index 83cb91612..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 +++ /dev/null @@ -1 +0,0 @@ -sort_by(people, &age) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 deleted file mode 100644 index a494d6c4b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 +++ /dev/null @@ -1 +0,0 @@ -sort_by(people, &to_number(age_str)) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 deleted file mode 100644 index 2294fc54d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 +++ /dev/null @@ -1 +0,0 @@ -sort_by(people, &age)[].name \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 deleted file mode 100644 index bb8c2b46d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 +++ /dev/null @@ -1 +0,0 @@ -sort_by(people, &age)[].extra \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 deleted file mode 100644 index e3ed49ac6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 +++ /dev/null @@ -1 +0,0 @@ -@.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 deleted file mode 100644 index 3ab029034..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 +++ /dev/null @@ -1 +0,0 @@ -sort_by(`[]`, &age) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 deleted file mode 100644 index 97db56f7b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 +++ /dev/null @@ -1 +0,0 @@ -max_by(people, &age) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 deleted file mode 100644 index a7e648de9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 +++ /dev/null @@ -1 +0,0 @@ -max_by(people, &age_str) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 deleted file mode 100644 index be4348d0c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 +++ /dev/null @@ -1 +0,0 @@ -max_by(people, &to_number(age_str)) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 deleted file mode 100644 index a707283d4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 +++ /dev/null @@ -1 +0,0 @@ -min_by(people, &age) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 deleted file mode 100644 index 2cd6618d8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 +++ /dev/null @@ -1 +0,0 @@ -min_by(people, &age_str) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 deleted file mode 100644 index 833e68373..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 +++ /dev/null @@ -1 +0,0 @@ -min_by(people, &to_number(age_str)) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 deleted file mode 100644 index 706dbda89..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 +++ /dev/null @@ -1 +0,0 @@ -__L \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 deleted file mode 100644 index ca593ca93..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 +++ /dev/null @@ -1 +0,0 @@ -"!\r" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 deleted file mode 100644 index 4d5f9756e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 +++ /dev/null @@ -1 +0,0 @@ -foo.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 deleted file mode 100644 index f300ab917..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 +++ /dev/null @@ -1 +0,0 @@ -@.foo[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 deleted file mode 100644 index 9c9384354..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 +++ /dev/null @@ -1 +0,0 @@ -Y_1623 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 deleted file mode 100644 index c1b0730e0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 +++ /dev/null @@ -1 +0,0 @@ -x \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 deleted file mode 100644 index 1552ec63a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 +++ /dev/null @@ -1 +0,0 @@ -"\tF\uCebb" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 deleted file mode 100644 index 047041273..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 +++ /dev/null @@ -1 +0,0 @@ -" \t" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 deleted file mode 100644 index efd782cc3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 +++ /dev/null @@ -1 +0,0 @@ -" " \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 deleted file mode 100644 index 8494ac270..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 +++ /dev/null @@ -1 +0,0 @@ -v2 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 deleted file mode 100644 index c61f7f7eb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 +++ /dev/null @@ -1 +0,0 @@ -"\t" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 deleted file mode 100644 index f6055f189..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 +++ /dev/null @@ -1 +0,0 @@ -_X \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 deleted file mode 100644 index 4f58e0e7b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 +++ /dev/null @@ -1 +0,0 @@ -"\t4\ud9da\udd15" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 deleted file mode 100644 index f536bfbf6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 +++ /dev/null @@ -1 +0,0 @@ -v24_W \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 deleted file mode 100644 index ef47ff2c0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 +++ /dev/null @@ -1 +0,0 @@ -"foo.bar" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 deleted file mode 100644 index 69759281c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 +++ /dev/null @@ -1 +0,0 @@ -"H" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 deleted file mode 100644 index c3e8b5927..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 +++ /dev/null @@ -1 +0,0 @@ -"\f" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 deleted file mode 100644 index 24ecc222c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 +++ /dev/null @@ -1 +0,0 @@ -"E4" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 deleted file mode 100644 index 5693009d2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 +++ /dev/null @@ -1 +0,0 @@ -"!" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 deleted file mode 100644 index 62dd220e7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 +++ /dev/null @@ -1 +0,0 @@ -tM \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 deleted file mode 100644 index 3c1e81f55..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 +++ /dev/null @@ -1 +0,0 @@ -" [" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 deleted file mode 100644 index 493daa673..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 +++ /dev/null @@ -1 +0,0 @@ -"R!" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 deleted file mode 100644 index 116b50ab3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 +++ /dev/null @@ -1 +0,0 @@ -_6W \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 deleted file mode 100644 index 0073fac45..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 +++ /dev/null @@ -1 +0,0 @@ -"\uaBA1\r" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 deleted file mode 100644 index 00d8fa37e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 +++ /dev/null @@ -1 +0,0 @@ -tL7 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 deleted file mode 100644 index 661ebcfa3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 +++ /dev/null @@ -1 +0,0 @@ -"foo bar" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 deleted file mode 100644 index c14f16e02..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 +++ /dev/null @@ -1 +0,0 @@ -"<" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 deleted file mode 100644 index 8a2443e6e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 +++ /dev/null @@ -1 +0,0 @@ -hvu \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 deleted file mode 100644 index c9ddacbb6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 +++ /dev/null @@ -1 +0,0 @@ -"; !" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 deleted file mode 100644 index d0209c6df..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 +++ /dev/null @@ -1 +0,0 @@ -hU \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 deleted file mode 100644 index 82649bd24..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 +++ /dev/null @@ -1 +0,0 @@ -"/unix/path" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 deleted file mode 100644 index c07242aa4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 +++ /dev/null @@ -1 +0,0 @@ -"!I\n\/" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 deleted file mode 100644 index 7aae4effc..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 +++ /dev/null @@ -1 +0,0 @@ -"\uEEbF" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 deleted file mode 100644 index c1574f35f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 +++ /dev/null @@ -1 +0,0 @@ -"U)\t" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 deleted file mode 100644 index 5197e3a2b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 +++ /dev/null @@ -1 +0,0 @@ -fa0_9 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 deleted file mode 100644 index 320558b00..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 +++ /dev/null @@ -1 +0,0 @@ -"/" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 deleted file mode 100644 index 4a2cb0865..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 +++ /dev/null @@ -1 +0,0 @@ -Gy \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 deleted file mode 100644 index 9524c8381..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 +++ /dev/null @@ -1 +0,0 @@ -"\b" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 deleted file mode 100644 index 066b8d98b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 +++ /dev/null @@ -1 +0,0 @@ -"<" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 deleted file mode 100644 index c61f7f7eb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 +++ /dev/null @@ -1 +0,0 @@ -"\t" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 deleted file mode 100644 index a582f62d2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 +++ /dev/null @@ -1 +0,0 @@ -"\t&\\\r" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 deleted file mode 100644 index a1d50731c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 +++ /dev/null @@ -1 +0,0 @@ -"\"\"\"" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 deleted file mode 100644 index e3c5eedeb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 +++ /dev/null @@ -1 +0,0 @@ -"#" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 deleted file mode 100644 index e75309a52..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 +++ /dev/null @@ -1 +0,0 @@ -B__ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 deleted file mode 100644 index 027177272..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 +++ /dev/null @@ -1 +0,0 @@ -"\nS \n" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 deleted file mode 100644 index 99432276e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 +++ /dev/null @@ -1 +0,0 @@ -Bp \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 deleted file mode 100644 index d4f8a788b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 +++ /dev/null @@ -1 +0,0 @@ -",\t;" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 deleted file mode 100644 index 56c384f75..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 +++ /dev/null @@ -1 +0,0 @@ -B_q \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 deleted file mode 100644 index f093d2aa3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 +++ /dev/null @@ -1 +0,0 @@ -"\/+\t\n\b!Z" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 deleted file mode 100644 index 11e1229d9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 +++ /dev/null @@ -1 +0,0 @@ -"󇟇\\ueFAc" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 deleted file mode 100644 index 90dbfcfcd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 +++ /dev/null @@ -1 +0,0 @@ -":\f" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 deleted file mode 100644 index b06b83025..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 +++ /dev/null @@ -1 +0,0 @@ -"\/" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 deleted file mode 100644 index 5f55d73af..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 +++ /dev/null @@ -1 +0,0 @@ -"bar"."baz" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 deleted file mode 100644 index 0e4bf7c11..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 +++ /dev/null @@ -1 +0,0 @@ -_BW_6Hg_Gl \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 deleted file mode 100644 index 81bb45f80..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 +++ /dev/null @@ -1 +0,0 @@ -"ôƒ°‚" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 deleted file mode 100644 index d0b4de146..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 +++ /dev/null @@ -1 +0,0 @@ -zs1DC \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 deleted file mode 100644 index 68797580c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 +++ /dev/null @@ -1 +0,0 @@ -__434 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 deleted file mode 100644 index e61be91c4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 +++ /dev/null @@ -1 +0,0 @@ -"óµ…" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 deleted file mode 100644 index 026cb9cbb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 +++ /dev/null @@ -1 +0,0 @@ -Z_5 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 deleted file mode 100644 index ca9587d06..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 +++ /dev/null @@ -1 +0,0 @@ -z_M_ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 deleted file mode 100644 index 67f6d9c42..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 +++ /dev/null @@ -1 +0,0 @@ -YU_2 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 deleted file mode 100644 index 927ab653a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 +++ /dev/null @@ -1 +0,0 @@ -_0 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 deleted file mode 100644 index 39307ab93..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 +++ /dev/null @@ -1 +0,0 @@ -"\b+" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 deleted file mode 100644 index 8b0c5b41b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 +++ /dev/null @@ -1 +0,0 @@ -foo[?name == 'a'] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 deleted file mode 100644 index a3ec2ed7a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 +++ /dev/null @@ -1 +0,0 @@ -"\"" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 deleted file mode 100644 index 26bf7e122..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 +++ /dev/null @@ -1 +0,0 @@ -D7 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 deleted file mode 100644 index d595c9f43..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 +++ /dev/null @@ -1 +0,0 @@ -_62L \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 deleted file mode 100644 index f68696949..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 +++ /dev/null @@ -1 +0,0 @@ -"\tK\t" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 deleted file mode 100644 index f3a9b7edb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 +++ /dev/null @@ -1 +0,0 @@ -"\n\\\f" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 deleted file mode 100644 index 455f00ffc..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 +++ /dev/null @@ -1 +0,0 @@ -I_ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 deleted file mode 100644 index ccd5968f9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 +++ /dev/null @@ -1 +0,0 @@ -W_a0_ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 deleted file mode 100644 index ee55c16fc..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 +++ /dev/null @@ -1 +0,0 @@ -BQ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 deleted file mode 100644 index 0d1a169a6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 +++ /dev/null @@ -1 +0,0 @@ -"\tX$\uABBb" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 deleted file mode 100644 index 0573cfd73..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 +++ /dev/null @@ -1 +0,0 @@ -Z9 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 deleted file mode 100644 index f0fcbd8ea..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 +++ /dev/null @@ -1 +0,0 @@ -foo.bar.baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 deleted file mode 100644 index 4f8e6a17a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 +++ /dev/null @@ -1 +0,0 @@ -*[?[0] == `0`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 deleted file mode 100644 index a0db02beb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 +++ /dev/null @@ -1 +0,0 @@ -"\b%\"òž„" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 deleted file mode 100644 index 56032f7a2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 +++ /dev/null @@ -1 +0,0 @@ -_F \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 deleted file mode 100644 index 4a8a3cff3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 +++ /dev/null @@ -1 +0,0 @@ -"!," \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 deleted file mode 100644 index 7c1efac00..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 +++ /dev/null @@ -1 +0,0 @@ -"\"!" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 deleted file mode 100644 index a0f489d53..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 +++ /dev/null @@ -1 +0,0 @@ -Hh \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 deleted file mode 100644 index c64e8d5ac..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 +++ /dev/null @@ -1 +0,0 @@ -"&" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 deleted file mode 100644 index 0567e992f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 +++ /dev/null @@ -1 +0,0 @@ -"9\r\\R" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 deleted file mode 100644 index ce8245c5b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 +++ /dev/null @@ -1 +0,0 @@ -M_k \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 deleted file mode 100644 index 8f16a5ac0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 +++ /dev/null @@ -1 +0,0 @@ -"!\b\nó‘©’\"\"" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 deleted file mode 100644 index 504ff5ae3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 +++ /dev/null @@ -1 +0,0 @@ -"6" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 deleted file mode 100644 index 07fb57234..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 +++ /dev/null @@ -1 +0,0 @@ -foo[?first == last] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 deleted file mode 100644 index 533dd8e54..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 +++ /dev/null @@ -1 +0,0 @@ -_7 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 deleted file mode 100644 index 1e4a3a341..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 +++ /dev/null @@ -1 +0,0 @@ -"0" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 deleted file mode 100644 index 37961f6ca..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 +++ /dev/null @@ -1 +0,0 @@ -"\\8\\" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 deleted file mode 100644 index 23480cff1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 +++ /dev/null @@ -1 +0,0 @@ -b7eo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 deleted file mode 100644 index e609f81a3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 +++ /dev/null @@ -1 +0,0 @@ -xIUo9 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 deleted file mode 100644 index d89a25f0b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 +++ /dev/null @@ -1 +0,0 @@ -"5" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 deleted file mode 100644 index 5adcf5e7d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 +++ /dev/null @@ -1 +0,0 @@ -"?" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 deleted file mode 100644 index ace4a897d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 +++ /dev/null @@ -1 +0,0 @@ -sU \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 deleted file mode 100644 index feffb7061..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 +++ /dev/null @@ -1 +0,0 @@ -"VH2&H\\\/" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 deleted file mode 100644 index 8223f1e51..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 +++ /dev/null @@ -1 +0,0 @@ -_C \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 deleted file mode 100644 index 7e85c4bdf..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 +++ /dev/null @@ -1 +0,0 @@ -foo[?first == last].first \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 deleted file mode 100644 index c9cdc63b0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 +++ /dev/null @@ -1 +0,0 @@ -_ \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 deleted file mode 100644 index c82f7982e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 +++ /dev/null @@ -1 +0,0 @@ -"<\t" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 deleted file mode 100644 index dae65c515..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 +++ /dev/null @@ -1 +0,0 @@ -"\uD834\uDD1E" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 deleted file mode 100644 index b6b369543..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 deleted file mode 100644 index bf06e678c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 deleted file mode 100644 index 5d48e0205..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 deleted file mode 100644 index de3af7230..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[3] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 deleted file mode 100644 index a1c333508..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 deleted file mode 100644 index ad0fef91c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[-2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 deleted file mode 100644 index 3e83c6f73..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[-3] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 deleted file mode 100644 index 72fc0a53e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 +++ /dev/null @@ -1 +0,0 @@ -foo[?age > `25`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 deleted file mode 100644 index 433a737d6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[-4] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 deleted file mode 100644 index 4d5f9756e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 +++ /dev/null @@ -1 +0,0 @@ -foo.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 deleted file mode 100644 index 5e0d9b717..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 +++ /dev/null @@ -1 +0,0 @@ -foo[0].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 deleted file mode 100644 index 3cd7e9460..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 +++ /dev/null @@ -1 +0,0 @@ -foo[1].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 deleted file mode 100644 index 74cb17655..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 +++ /dev/null @@ -1 +0,0 @@ -foo[2].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 deleted file mode 100644 index 3cf2007f7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 +++ /dev/null @@ -1 +0,0 @@ -foo[3].notbar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 deleted file mode 100644 index 9674d8803..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 +++ /dev/null @@ -1 +0,0 @@ -foo[3].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 deleted file mode 100644 index 9b0b2f818..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 +++ /dev/null @@ -1 +0,0 @@ -foo[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 deleted file mode 100644 index 83c639a18..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 +++ /dev/null @@ -1 +0,0 @@ -foo[1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 deleted file mode 100644 index 3b76c9f64..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 +++ /dev/null @@ -1 +0,0 @@ -foo[2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 deleted file mode 100644 index 9a2b0184e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 +++ /dev/null @@ -1 +0,0 @@ -foo[?age >= `25`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 deleted file mode 100644 index ff99e045d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 +++ /dev/null @@ -1 +0,0 @@ -foo[3] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 deleted file mode 100644 index 040ecb240..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 +++ /dev/null @@ -1 +0,0 @@ -foo[4] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 deleted file mode 100644 index 6e7ea636e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 +++ /dev/null @@ -1 +0,0 @@ -[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 deleted file mode 100644 index bace2a0be..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 +++ /dev/null @@ -1 +0,0 @@ -[1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 deleted file mode 100644 index 5d50c80c0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 +++ /dev/null @@ -1 +0,0 @@ -[2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 deleted file mode 100644 index 99d21a2a0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 +++ /dev/null @@ -1 +0,0 @@ -[-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 deleted file mode 100644 index 133a9c627..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 +++ /dev/null @@ -1 +0,0 @@ -[-2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 deleted file mode 100644 index b7f78c5dc..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 +++ /dev/null @@ -1 +0,0 @@ -[-3] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 deleted file mode 100644 index bd9de815f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 deleted file mode 100644 index 55e625735..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 deleted file mode 100644 index fa83f1da3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 +++ /dev/null @@ -1 +0,0 @@ -foo[?age > `30`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 deleted file mode 100644 index 1661747c0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 +++ /dev/null @@ -1 +0,0 @@ -reservations[].notinstances[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 deleted file mode 100644 index 1661747c0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 +++ /dev/null @@ -1 +0,0 @@ -reservations[].notinstances[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 deleted file mode 100644 index 3debc70f8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].foo[].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 deleted file mode 100644 index 75af2fda0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].foo[].baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 deleted file mode 100644 index 4a70cd8a0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].notfoo[].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 deleted file mode 100644 index 987985b00..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].notfoo[].notbar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 deleted file mode 100644 index 1661747c0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 +++ /dev/null @@ -1 +0,0 @@ -reservations[].notinstances[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 deleted file mode 100644 index 634f937e5..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].foo[].notbar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 deleted file mode 100644 index 09cb7b8bb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].bar[].baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 deleted file mode 100644 index f5d9ac5b7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].baz[].baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 deleted file mode 100644 index 463a2a542..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 +++ /dev/null @@ -1 +0,0 @@ -foo[?age < `25`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 deleted file mode 100644 index d1016d6e7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].qux[].baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 deleted file mode 100644 index ef54cf52d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].qux[].baz[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 deleted file mode 100644 index bea506ff2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 +++ /dev/null @@ -1 +0,0 @@ -foo[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 deleted file mode 100644 index 20dd081e0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 +++ /dev/null @@ -1 +0,0 @@ -foo[][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 deleted file mode 100644 index 4803734b0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 +++ /dev/null @@ -1 +0,0 @@ -foo[][1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 deleted file mode 100644 index 1be565985..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 +++ /dev/null @@ -1 +0,0 @@ -foo[][0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 deleted file mode 100644 index d2cf6da59..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 +++ /dev/null @@ -1 +0,0 @@ -foo[][2][2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 deleted file mode 100644 index c609ca64b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 +++ /dev/null @@ -1 +0,0 @@ -foo[][0][0][100] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 deleted file mode 100644 index 191028156..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 deleted file mode 100644 index bea506ff2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 +++ /dev/null @@ -1 +0,0 @@ -foo[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 deleted file mode 100644 index 10ed5d3f6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 +++ /dev/null @@ -1 +0,0 @@ -foo[?age <= `25`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 deleted file mode 100644 index 13f2c4a0b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 deleted file mode 100644 index edf3d9277..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 deleted file mode 100644 index 2a3b993af..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar[].baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 deleted file mode 100644 index d5ca878a1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 +++ /dev/null @@ -1 +0,0 @@ -string[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 deleted file mode 100644 index fcd255f5d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 +++ /dev/null @@ -1 +0,0 @@ -hash[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 deleted file mode 100644 index 2d53bd7cd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 +++ /dev/null @@ -1 +0,0 @@ -number[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 deleted file mode 100644 index cb10d2497..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 +++ /dev/null @@ -1 +0,0 @@ -nullvalue[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 deleted file mode 100644 index f6c79ca84..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 +++ /dev/null @@ -1 +0,0 @@ -string[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 deleted file mode 100644 index 09bf36e8a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 +++ /dev/null @@ -1 +0,0 @@ -hash[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 deleted file mode 100644 index 4c3578189..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 +++ /dev/null @@ -1 +0,0 @@ -number[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 deleted file mode 100644 index 16a4c36ac..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 +++ /dev/null @@ -1 +0,0 @@ -foo[?age < `20`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 deleted file mode 100644 index 2dd8ae218..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 +++ /dev/null @@ -1 +0,0 @@ -nullvalue[].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 deleted file mode 100644 index dfed81603..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 +++ /dev/null @@ -1 +0,0 @@ -nullvalue[].foo[].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 deleted file mode 100644 index d7628e646..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 +++ /dev/null @@ -1 +0,0 @@ -`"foo"` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 deleted file mode 100644 index 49c5269b1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 +++ /dev/null @@ -1 +0,0 @@ -`"\u03a6"` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 deleted file mode 100644 index d5db721d0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 +++ /dev/null @@ -1 +0,0 @@ -`"✓"` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 deleted file mode 100644 index a2b6e4ec8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 +++ /dev/null @@ -1 +0,0 @@ -`[1, 2, 3]` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 deleted file mode 100644 index f5801bdd6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 +++ /dev/null @@ -1 +0,0 @@ -`{"a": "b"}` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 deleted file mode 100644 index f87db59a8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 +++ /dev/null @@ -1 +0,0 @@ -`true` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 deleted file mode 100644 index 3b20d905f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 +++ /dev/null @@ -1 +0,0 @@ -`false` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 deleted file mode 100644 index 70bcd29a7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 +++ /dev/null @@ -1 +0,0 @@ -`null` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 deleted file mode 100644 index 351054d3e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 +++ /dev/null @@ -1 +0,0 @@ -foo[?age == `20`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 deleted file mode 100644 index 0918d4155..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 +++ /dev/null @@ -1 +0,0 @@ -`0` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 deleted file mode 100644 index ef70c4c11..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 +++ /dev/null @@ -1 +0,0 @@ -`1` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 deleted file mode 100644 index b39a922f4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 +++ /dev/null @@ -1 +0,0 @@ -`2` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 deleted file mode 100644 index 7e65687db..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 +++ /dev/null @@ -1 +0,0 @@ -`3` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 deleted file mode 100644 index 770d1ece7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 +++ /dev/null @@ -1 +0,0 @@ -`4` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 deleted file mode 100644 index a8b81985c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 +++ /dev/null @@ -1 +0,0 @@ -`5` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 deleted file mode 100644 index 7f0861065..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 +++ /dev/null @@ -1 +0,0 @@ -`6` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 deleted file mode 100644 index 495114d91..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 +++ /dev/null @@ -1 +0,0 @@ -`7` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 deleted file mode 100644 index 94f355c46..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 +++ /dev/null @@ -1 +0,0 @@ -`8` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 deleted file mode 100644 index 600d2aa3f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 +++ /dev/null @@ -1 +0,0 @@ -`9` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 deleted file mode 100644 index 314852235..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 +++ /dev/null @@ -1 +0,0 @@ -foo.bar.baz.bad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 deleted file mode 100644 index 99d9258a6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 +++ /dev/null @@ -1 +0,0 @@ -foo[?age != `20`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 deleted file mode 100644 index 637015b5f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 +++ /dev/null @@ -1 +0,0 @@ -`"foo\`bar"` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 deleted file mode 100644 index 6fa7557b8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 +++ /dev/null @@ -1 +0,0 @@ -`"foo\"bar"` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 deleted file mode 100644 index 5aabeec34..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 +++ /dev/null @@ -1 +0,0 @@ -`"1\`"` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 deleted file mode 100644 index 8302ea198..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 +++ /dev/null @@ -1 +0,0 @@ -`"\\"`.{a:`"b"`} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 deleted file mode 100644 index d88d014a9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 +++ /dev/null @@ -1 +0,0 @@ -`{"a": "b"}`.a \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 deleted file mode 100644 index 47152dddb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 +++ /dev/null @@ -1 +0,0 @@ -`{"a": {"b": "c"}}`.a.b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 deleted file mode 100644 index 895d42938..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 +++ /dev/null @@ -1 +0,0 @@ -`[0, 1, 2]`[1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 deleted file mode 100644 index 42500a368..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 +++ /dev/null @@ -1 +0,0 @@ -` {"foo": true}` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 deleted file mode 100644 index 08b944dad..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 +++ /dev/null @@ -1 +0,0 @@ -`{"foo": true} ` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 deleted file mode 100644 index 6de163f80..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 +++ /dev/null @@ -1 +0,0 @@ -'foo' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 deleted file mode 100644 index 5bc357d9f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 +++ /dev/null @@ -1 +0,0 @@ -foo[?top.name == 'a'] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 deleted file mode 100644 index b84bbdb29..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 +++ /dev/null @@ -1 +0,0 @@ -' foo ' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 deleted file mode 100644 index bf6a07ace..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 +++ /dev/null @@ -1 +0,0 @@ -'0' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 deleted file mode 100644 index c742f5b0c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 +++ /dev/null @@ -1,2 +0,0 @@ -'newline -' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 deleted file mode 100644 index 04e9b3ade..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 +++ /dev/null @@ -1,2 +0,0 @@ -' -' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 deleted file mode 100644 index ebdaf120d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 +++ /dev/null @@ -1 +0,0 @@ -'✓' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 deleted file mode 100644 index d0ba5d7fa..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 +++ /dev/null @@ -1 +0,0 @@ -'ð„ž' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 deleted file mode 100644 index 19c2e2ef4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 +++ /dev/null @@ -1 +0,0 @@ -' [foo] ' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 deleted file mode 100644 index 5faa483b1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 +++ /dev/null @@ -1 +0,0 @@ -'[foo]' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 deleted file mode 100644 index e3c05c163..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 +++ /dev/null @@ -1 +0,0 @@ -'\u03a6' \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 deleted file mode 100644 index 7c13861ac..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar: bar} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 deleted file mode 100644 index d037a0a4d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 +++ /dev/null @@ -1 +0,0 @@ -foo[?top.first == top.last] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 deleted file mode 100644 index f795c2552..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 +++ /dev/null @@ -1 +0,0 @@ -foo.{"bar": bar} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 deleted file mode 100644 index 772c45639..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 +++ /dev/null @@ -1 +0,0 @@ -foo.{"foo.bar": bar} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 deleted file mode 100644 index 8808e92bf..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar: bar, baz: baz} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 deleted file mode 100644 index 3f13757a1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 +++ /dev/null @@ -1 +0,0 @@ -foo.{"bar": bar, "baz": baz} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 deleted file mode 100644 index 23cd8903e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 +++ /dev/null @@ -1 +0,0 @@ -{"baz": baz, "qux\"": "qux\""} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 deleted file mode 100644 index fabb6da4f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar:bar,baz:baz} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 deleted file mode 100644 index 4c3f615b1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar: bar,qux: qux} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 deleted file mode 100644 index 8bc46535a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar: bar, noexist: noexist} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 deleted file mode 100644 index 2024b6f11..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 +++ /dev/null @@ -1 +0,0 @@ -foo.{noexist: noexist, alsonoexist: alsonoexist} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 deleted file mode 100644 index b52191d10..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 +++ /dev/null @@ -1 +0,0 @@ -foo.badkey.{nokey: nokey, alsonokey: alsonokey} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 deleted file mode 100644 index 8534a5cae..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 +++ /dev/null @@ -1 +0,0 @@ -foo[?top == `{"first": "foo", "last": "bar"}`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 deleted file mode 100644 index 5cd310b6d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 +++ /dev/null @@ -1 +0,0 @@ -foo.nested.*.{a: a,b: b} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 deleted file mode 100644 index 0b24ef535..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 +++ /dev/null @@ -1 +0,0 @@ -foo.nested.three.{a: a, cinner: c.inner} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 deleted file mode 100644 index 473c1c351..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 +++ /dev/null @@ -1 +0,0 @@ -foo.nested.three.{a: a, c: c.inner.bad.key} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 deleted file mode 100644 index 44ba735ab..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 +++ /dev/null @@ -1 +0,0 @@ -foo.{a: nested.one.a, b: nested.two.b} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 deleted file mode 100644 index f5f89b12b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 +++ /dev/null @@ -1 +0,0 @@ -{bar: bar, baz: baz} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 deleted file mode 100644 index 697764cb3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 +++ /dev/null @@ -1 +0,0 @@ -{bar: bar} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 deleted file mode 100644 index 20447fb10..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 +++ /dev/null @@ -1 +0,0 @@ -{otherkey: bar} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 deleted file mode 100644 index 310b9b1dd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 +++ /dev/null @@ -1 +0,0 @@ -{no: no, exist: exist} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 deleted file mode 100644 index c79b2e240..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 deleted file mode 100644 index ab498ef65..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,baz] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 deleted file mode 100644 index 71307c409..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `true`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 deleted file mode 100644 index 4b8f39a46..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,qux] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 deleted file mode 100644 index b8f9020f8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,noexist] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 deleted file mode 100644 index b7c7b3f65..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 +++ /dev/null @@ -1 +0,0 @@ -foo.[noexist,alsonoexist] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 deleted file mode 100644 index fabb6da4f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar:bar,baz:baz} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 deleted file mode 100644 index c15c39f82..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,baz[0]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 deleted file mode 100644 index 9cebd8984..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,baz[1]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 deleted file mode 100644 index c5bbfbf84..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,baz[2]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 deleted file mode 100644 index d81cb2b90..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,baz[3]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 deleted file mode 100644 index 3a65aa7d6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar[0],baz[3]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 deleted file mode 100644 index 8808e92bf..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar: bar, baz: baz} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 deleted file mode 100644 index e142b22a2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `false`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 deleted file mode 100644 index ab498ef65..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 +++ /dev/null @@ -1 +0,0 @@ -foo.[bar,baz] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 deleted file mode 100644 index 8e3d22dc5..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 +++ /dev/null @@ -1 +0,0 @@ -foo.{bar: bar.baz[1],includeme: includeme} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 deleted file mode 100644 index 398c7f8b0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 +++ /dev/null @@ -1 +0,0 @@ -foo.{"bar.baz.two": bar.baz[1].two, includeme: includeme} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 deleted file mode 100644 index a17644487..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 +++ /dev/null @@ -1 +0,0 @@ -foo.[includeme, bar.baz[*].common] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 deleted file mode 100644 index da5225ddc..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 +++ /dev/null @@ -1 +0,0 @@ -foo.[includeme, bar.baz[*].none] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 deleted file mode 100644 index a8870b22b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 +++ /dev/null @@ -1 +0,0 @@ -foo.[includeme, bar.baz[].common] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 deleted file mode 100644 index 420b1a57c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 +++ /dev/null @@ -1 +0,0 @@ -reservations[*].instances[*].{id: id, name: name} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 deleted file mode 100644 index 0761ee16d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].{id: id, name: name} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 deleted file mode 100644 index aa1191a48..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[].[id, name] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 deleted file mode 100644 index 191028156..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 deleted file mode 100644 index 9a24a464e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `0`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 deleted file mode 100644 index bea506ff2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 +++ /dev/null @@ -1 +0,0 @@ -foo[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 deleted file mode 100644 index 13f2c4a0b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 deleted file mode 100644 index edf3d9277..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 deleted file mode 100644 index d965466e9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar[].[baz, qux] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 deleted file mode 100644 index f1822a174..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar[].[baz] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 deleted file mode 100644 index c6f77b80c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 +++ /dev/null @@ -1 +0,0 @@ -foo[].bar[].[baz, qux][] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 deleted file mode 100644 index db56262a4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 +++ /dev/null @@ -1 +0,0 @@ -foo.[baz[*].bar, qux[0]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 deleted file mode 100644 index b901067d2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 +++ /dev/null @@ -1 +0,0 @@ -foo.[baz[*].[bar, boo], qux[0]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 deleted file mode 100644 index 738479fa6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 +++ /dev/null @@ -1 +0,0 @@ -foo.[baz[*].not_there || baz[*].bar, qux[0]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 deleted file mode 100644 index 6926996a7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 +++ /dev/null @@ -1 +0,0 @@ -[[*],*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 deleted file mode 100644 index 6d33cc72c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `1`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 deleted file mode 100644 index 736be0a31..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 +++ /dev/null @@ -1 +0,0 @@ -[[*]] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 deleted file mode 100644 index 29e1fb20a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 +++ /dev/null @@ -1 +0,0 @@ -outer.foo || outer.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 deleted file mode 100644 index c0070ba78..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 +++ /dev/null @@ -1 +0,0 @@ -outer.foo||outer.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 deleted file mode 100644 index 661b0bec5..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 +++ /dev/null @@ -1 +0,0 @@ -outer.bar || outer.baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 deleted file mode 100644 index 296d5aeee..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 +++ /dev/null @@ -1 +0,0 @@ -outer.bar||outer.baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 deleted file mode 100644 index ca140f8aa..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 +++ /dev/null @@ -1 +0,0 @@ -outer.bad || outer.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 deleted file mode 100644 index 15d309242..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 +++ /dev/null @@ -1 +0,0 @@ -outer.bad||outer.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 deleted file mode 100644 index 56148d957..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 +++ /dev/null @@ -1 +0,0 @@ -outer.foo || outer.bad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 deleted file mode 100644 index 6d3cf6d90..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 +++ /dev/null @@ -1 +0,0 @@ -outer.foo||outer.bad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 deleted file mode 100644 index 100fa8339..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 +++ /dev/null @@ -1 +0,0 @@ -outer.bad || outer.alsobad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 deleted file mode 100644 index de56fc042..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `[0]`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 deleted file mode 100644 index 64490352b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 +++ /dev/null @@ -1 +0,0 @@ -outer.bad||outer.alsobad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 deleted file mode 100644 index af901bde1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 +++ /dev/null @@ -1 +0,0 @@ -outer.empty_string || outer.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 deleted file mode 100644 index 36b63e462..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 +++ /dev/null @@ -1 +0,0 @@ -outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 deleted file mode 100644 index aba584f99..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 +++ /dev/null @@ -1 +0,0 @@ -foo.*.baz | [0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 deleted file mode 100644 index 4234ac019..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 +++ /dev/null @@ -1 +0,0 @@ -foo.*.baz | [1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 deleted file mode 100644 index 12330d990..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 +++ /dev/null @@ -1 +0,0 @@ -foo.*.baz | [2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 deleted file mode 100644 index 1b2d93e19..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 +++ /dev/null @@ -1 +0,0 @@ -foo.bar.* | [0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 deleted file mode 100644 index c371fc645..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 +++ /dev/null @@ -1 +0,0 @@ -foo.*.notbaz | [*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 deleted file mode 100644 index 3c835642e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 +++ /dev/null @@ -1 +0,0 @@ -foo | bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 deleted file mode 100644 index decaa0421..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 +++ /dev/null @@ -1 +0,0 @@ -foo | bar | baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 deleted file mode 100644 index 49d9c63a3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `{"bar": [0]}`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 deleted file mode 100644 index b91068037..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 +++ /dev/null @@ -1 +0,0 @@ -foo|bar| baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 deleted file mode 100644 index 11df74d8b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 +++ /dev/null @@ -1 +0,0 @@ -not_there | [0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 deleted file mode 100644 index 11df74d8b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 +++ /dev/null @@ -1 +0,0 @@ -not_there | [0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 deleted file mode 100644 index 37da9fc0b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 +++ /dev/null @@ -1 +0,0 @@ -[foo.bar, foo.other] | [0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 deleted file mode 100644 index 1f4fc943d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 +++ /dev/null @@ -1 +0,0 @@ -{"a": foo.bar, "b": foo.other} | a \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 deleted file mode 100644 index 67c7ea9cf..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 +++ /dev/null @@ -1 +0,0 @@ -{"a": foo.bar, "b": foo.other} | b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 deleted file mode 100644 index d87f9bba4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 +++ /dev/null @@ -1 +0,0 @@ -{"a": foo.bar, "b": foo.other} | *.baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 deleted file mode 100644 index ebf8e2711..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 +++ /dev/null @@ -1 +0,0 @@ -foo.bam || foo.bar | baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 deleted file mode 100644 index f32bc6db5..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 +++ /dev/null @@ -1 +0,0 @@ -foo | not_there || bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 deleted file mode 100644 index d04459d90..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[*] | [0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 deleted file mode 100644 index b537264a1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 +++ /dev/null @@ -1 +0,0 @@ -foo.bar.bad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 deleted file mode 100644 index c17c1df17..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `null`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 deleted file mode 100644 index 3eb869f43..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 +++ /dev/null @@ -1 +0,0 @@ -bar[0:10] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 deleted file mode 100644 index aa5d6be52..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 +++ /dev/null @@ -1 +0,0 @@ -foo[0:10:1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 deleted file mode 100644 index 1a4d1682d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 +++ /dev/null @@ -1 +0,0 @@ -foo[0:10] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 deleted file mode 100644 index 5925a578b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 +++ /dev/null @@ -1 +0,0 @@ -foo[0:10:] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 deleted file mode 100644 index 081e93abd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 +++ /dev/null @@ -1 +0,0 @@ -foo[0::1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 deleted file mode 100644 index 922700149..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 +++ /dev/null @@ -1 +0,0 @@ -foo[0::] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 deleted file mode 100644 index fd2294d66..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 +++ /dev/null @@ -1 +0,0 @@ -foo[0:] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 deleted file mode 100644 index c6b551d5e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 +++ /dev/null @@ -1 +0,0 @@ -foo[:10:1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 deleted file mode 100644 index 503f58da6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 +++ /dev/null @@ -1 +0,0 @@ -foo[::1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 deleted file mode 100644 index f78bb770c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 +++ /dev/null @@ -1 +0,0 @@ -foo[:10:] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 deleted file mode 100644 index 589a214f4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `[1]`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 deleted file mode 100644 index eb9d2ba88..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 +++ /dev/null @@ -1 +0,0 @@ -foo[::] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 deleted file mode 100644 index 1921a3d98..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 +++ /dev/null @@ -1 +0,0 @@ -foo[:] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 deleted file mode 100644 index a87afcb1b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 +++ /dev/null @@ -1 +0,0 @@ -foo[1:9] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 deleted file mode 100644 index dbf51d8cd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 +++ /dev/null @@ -1 +0,0 @@ -foo[0:10:2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 deleted file mode 100644 index f7288763a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 +++ /dev/null @@ -1 +0,0 @@ -foo[5:] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 deleted file mode 100644 index 64395761d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 +++ /dev/null @@ -1 +0,0 @@ -foo[5::2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 deleted file mode 100644 index 706bb14dd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 +++ /dev/null @@ -1 +0,0 @@ -foo[::2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 deleted file mode 100644 index 8fcfaee95..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 +++ /dev/null @@ -1 +0,0 @@ -foo[::-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 deleted file mode 100644 index f6a00bf9b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 +++ /dev/null @@ -1 +0,0 @@ -foo[1::2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 deleted file mode 100644 index ea068ee06..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 +++ /dev/null @@ -1 +0,0 @@ -foo[10:0:-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 deleted file mode 100644 index 214917ac0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 +++ /dev/null @@ -1 +0,0 @@ -foo[?key == `{"a":2}`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 deleted file mode 100644 index 1fe14258e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 +++ /dev/null @@ -1 +0,0 @@ -foo[10:5:-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 deleted file mode 100644 index 4ba0e1302..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 +++ /dev/null @@ -1 +0,0 @@ -foo[8:2:-2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 deleted file mode 100644 index 25db439ff..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 +++ /dev/null @@ -1 +0,0 @@ -foo[0:20] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 deleted file mode 100644 index 8a965920a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 +++ /dev/null @@ -1 +0,0 @@ -foo[10:-20:-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 deleted file mode 100644 index b1e5ba373..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 +++ /dev/null @@ -1 +0,0 @@ -foo[10:-20] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 deleted file mode 100644 index 06253112e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 +++ /dev/null @@ -1 +0,0 @@ -foo[-4:-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 deleted file mode 100644 index 1e14a6a4c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 +++ /dev/null @@ -1 +0,0 @@ -foo[:-5:-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 deleted file mode 100644 index aef5c2747..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 +++ /dev/null @@ -1 +0,0 @@ -foo[:2].a \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 deleted file mode 100644 index 93c95fcf6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 +++ /dev/null @@ -1 +0,0 @@ -foo[:2].b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 deleted file mode 100644 index 7e0733e59..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 +++ /dev/null @@ -1 +0,0 @@ -foo[:2].a.b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 deleted file mode 100644 index 4c002ed80..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 +++ /dev/null @@ -1 +0,0 @@ -foo[?`true` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 deleted file mode 100644 index 2438b2576..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 +++ /dev/null @@ -1 +0,0 @@ -bar[::-1].a.b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 deleted file mode 100644 index 549994b6b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 +++ /dev/null @@ -1 +0,0 @@ -bar[:2].a.b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 deleted file mode 100644 index ab98292b4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 +++ /dev/null @@ -1 +0,0 @@ -baz[:2].a \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 deleted file mode 100644 index 65fca9687..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 +++ /dev/null @@ -1 +0,0 @@ -[:] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 deleted file mode 100644 index 18c5daf7b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 +++ /dev/null @@ -1 +0,0 @@ -[:2].a \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 deleted file mode 100644 index 1bb84f7d4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 +++ /dev/null @@ -1 +0,0 @@ -[::-1].a \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 deleted file mode 100644 index 7a0416f05..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 +++ /dev/null @@ -1 +0,0 @@ -[:2].b \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 deleted file mode 100644 index 4d5f9756e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 +++ /dev/null @@ -1 +0,0 @@ -foo.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 deleted file mode 100644 index 191028156..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 deleted file mode 100644 index f59ec20aa..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 deleted file mode 100644 index 23d27073e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 +++ /dev/null @@ -1 +0,0 @@ -foo[?`false` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 deleted file mode 100644 index dee569574..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 +++ /dev/null @@ -1 +0,0 @@ -*.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 deleted file mode 100644 index 1a16f7418..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 +++ /dev/null @@ -1 +0,0 @@ -*.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 deleted file mode 100644 index 7e8066d39..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 +++ /dev/null @@ -1 +0,0 @@ -*[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 deleted file mode 100644 index 0637a088a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 deleted file mode 100644 index 6e7ea636e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 +++ /dev/null @@ -1 +0,0 @@ -[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 deleted file mode 100644 index 5a5194647..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 +++ /dev/null @@ -1 +0,0 @@ -[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 deleted file mode 100644 index 416127425..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 +++ /dev/null @@ -1 +0,0 @@ -*.["0"] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 deleted file mode 100644 index cd9fb6ba7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 +++ /dev/null @@ -1 +0,0 @@ -[*].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 deleted file mode 100644 index 9f3ada480..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 +++ /dev/null @@ -1 +0,0 @@ -[*][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 deleted file mode 100644 index 9b0b2f818..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 +++ /dev/null @@ -1 +0,0 @@ -foo[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 deleted file mode 100644 index 6d840ee56..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 +++ /dev/null @@ -1 +0,0 @@ -foo[?`0` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 deleted file mode 100644 index b23413b92..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 +++ /dev/null @@ -1 +0,0 @@ -foo.[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 deleted file mode 100644 index 08ab2e1c4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 +++ /dev/null @@ -1 +0,0 @@ -foo.[abc] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 deleted file mode 100644 index 78b05a5c6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 +++ /dev/null @@ -1 +0,0 @@ -foo.[abc, def] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 deleted file mode 100644 index 1e7b886e7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 +++ /dev/null @@ -1 +0,0 @@ -a.{foo: bar} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 deleted file mode 100644 index 91b4c9896..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 +++ /dev/null @@ -1 +0,0 @@ -a.{foo: bar, baz: bam} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 deleted file mode 100644 index 8301ef981..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 +++ /dev/null @@ -1 +0,0 @@ -{"\\":{" ":*}} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 deleted file mode 100644 index 8f75cc913..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 +++ /dev/null @@ -1 +0,0 @@ -foo || bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 deleted file mode 100644 index e5f122c56..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 +++ /dev/null @@ -1 +0,0 @@ -foo.[a || b] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 deleted file mode 100644 index 39d191432..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 +++ /dev/null @@ -1 +0,0 @@ -foo[?bar==`"baz"`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 deleted file mode 100644 index d08bbe250..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 +++ /dev/null @@ -1 +0,0 @@ -foo[? bar == `"baz"` ] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 deleted file mode 100644 index addaf204c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 +++ /dev/null @@ -1 +0,0 @@ -foo[?`1` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 deleted file mode 100644 index a77f35581..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 +++ /dev/null @@ -1 +0,0 @@ -foo[?a.b.c==d.e.f] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 deleted file mode 100644 index c9697aa48..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 +++ /dev/null @@ -1 +0,0 @@ -foo[?bar==`[0, 1, 2]`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 deleted file mode 100644 index fd7064a08..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 +++ /dev/null @@ -1 +0,0 @@ -foo[?bar==`["a", "b", "c"]`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 deleted file mode 100644 index 61e5e1b8f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 +++ /dev/null @@ -1 +0,0 @@ -foo[?bar==`["foo\`bar"]`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 deleted file mode 100644 index bc9d8af1d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 +++ /dev/null @@ -1 +0,0 @@ -[?"\\">`"foo"`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 deleted file mode 100644 index 2dd54dc39..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 +++ /dev/null @@ -1 +0,0 @@ -[?"\\" > `"foo"`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 deleted file mode 100644 index 191028156..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 deleted file mode 100644 index 7e9668e78..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 +++ /dev/null @@ -1 +0,0 @@ -"foo" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 deleted file mode 100644 index d58ac16bf..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 +++ /dev/null @@ -1 +0,0 @@ -"\\" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 deleted file mode 100644 index 33ac9fba6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 +++ /dev/null @@ -1 +0,0 @@ -*||*|*|* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 deleted file mode 100644 index acf2435c7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 +++ /dev/null @@ -1 +0,0 @@ -foo[?`[0]` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 deleted file mode 100644 index 99e19638c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 +++ /dev/null @@ -1 +0,0 @@ -*[]||[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 deleted file mode 100644 index be0845011..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 +++ /dev/null @@ -1 +0,0 @@ -[*.*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 deleted file mode 100644 index a84b51e1c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 +++ /dev/null @@ -1 +0,0 @@ -foo[]."✓" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 deleted file mode 100644 index c2de55815..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 +++ /dev/null @@ -1 +0,0 @@ -"☯" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 deleted file mode 100644 index dc2dda0bb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 +++ /dev/null @@ -1 +0,0 @@ -"♪♫•*¨*•.¸¸â¤Â¸Â¸.•*¨*•♫♪" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 deleted file mode 100644 index a2d3d5f6a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 +++ /dev/null @@ -1 +0,0 @@ -"☃" \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 deleted file mode 100644 index 0971c37ea..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 +++ /dev/null @@ -1 +0,0 @@ -foo.*.baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 deleted file mode 100644 index 0e39dfd69..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 +++ /dev/null @@ -1 +0,0 @@ -foo.bar.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 deleted file mode 100644 index 89c1ce22d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 +++ /dev/null @@ -1 +0,0 @@ -foo.*.notbaz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 deleted file mode 100644 index 5199b9f95..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 +++ /dev/null @@ -1 +0,0 @@ -foo.*.notbaz[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 deleted file mode 100644 index 99fe382c6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 +++ /dev/null @@ -1 +0,0 @@ -foo[?`{"bar": [0]}` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 deleted file mode 100644 index 5bb6d4ae7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 +++ /dev/null @@ -1 +0,0 @@ -foo.*.notbaz[-1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 deleted file mode 100644 index edac73189..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 +++ /dev/null @@ -1 +0,0 @@ -foo.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 deleted file mode 100644 index 458d0a6dd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 +++ /dev/null @@ -1 +0,0 @@ -foo.*.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 deleted file mode 100644 index f757fd534..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 +++ /dev/null @@ -1 +0,0 @@ -foo.*.*.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 deleted file mode 100644 index 670049d96..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 +++ /dev/null @@ -1 +0,0 @@ -foo.*.*.*.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 deleted file mode 100644 index 3c88caafe..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 +++ /dev/null @@ -1 +0,0 @@ -*.bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 deleted file mode 100644 index f59ec20aa..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 deleted file mode 100644 index 0852fcc78..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 +++ /dev/null @@ -1 +0,0 @@ -*.sub1 \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 deleted file mode 100644 index dee569574..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 +++ /dev/null @@ -1 +0,0 @@ -*.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 deleted file mode 100644 index 66781bba4..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 +++ /dev/null @@ -1 +0,0 @@ -*.*.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 deleted file mode 100644 index 4aad20ae6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 +++ /dev/null @@ -1 +0,0 @@ -foo[?`null` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 deleted file mode 100644 index 0db15d97e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 +++ /dev/null @@ -1 +0,0 @@ -*.sub1.foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 deleted file mode 100644 index b24be9d7d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 deleted file mode 100644 index e6efe133f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 +++ /dev/null @@ -1 +0,0 @@ -foo[*].notbar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 deleted file mode 100644 index 5a5194647..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 +++ /dev/null @@ -1 +0,0 @@ -[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 deleted file mode 100644 index cd9fb6ba7..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 +++ /dev/null @@ -1 +0,0 @@ -[*].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 deleted file mode 100644 index cbf1a5d59..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 +++ /dev/null @@ -1 +0,0 @@ -[*].notbar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 deleted file mode 100644 index 8bd13b7eb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[*].baz \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 deleted file mode 100644 index 7239f3e88..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[*].baz[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 deleted file mode 100644 index f5e431d9e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[*].baz[1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 deleted file mode 100644 index d0c259539..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[*].baz[2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 deleted file mode 100644 index b9749b748..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 +++ /dev/null @@ -1 +0,0 @@ -foo.bad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 deleted file mode 100644 index dac67509b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 +++ /dev/null @@ -1 +0,0 @@ -foo[?`[1]` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 deleted file mode 100644 index a6388271e..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[*].baz[3] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 deleted file mode 100644 index 2a66ffe93..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 deleted file mode 100644 index b6b369543..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 deleted file mode 100644 index 7e57f9e74..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 deleted file mode 100644 index c5f8bef0b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[0][0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 deleted file mode 100644 index 3decf0803..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 +++ /dev/null @@ -1 +0,0 @@ -foo.bar[0][0][0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 deleted file mode 100644 index 655e2959b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 +++ /dev/null @@ -1 +0,0 @@ -foo[0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 deleted file mode 100644 index 2aa159718..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[*].kind \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 deleted file mode 100644 index 556b380ba..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[0].kind \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 deleted file mode 100644 index 0de3229b8..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar.kind \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 deleted file mode 100644 index 130ed3b37..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 +++ /dev/null @@ -1 +0,0 @@ -foo[?`{"a":2}` == key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 deleted file mode 100644 index 3b511f133..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 deleted file mode 100644 index c8dfa16e6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 deleted file mode 100644 index 69f04ee23..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 deleted file mode 100644 index 3b511f133..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 +++ /dev/null @@ -1 +0,0 @@ -foo[*].bar[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 deleted file mode 100644 index 03e0c0cb9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 +++ /dev/null @@ -1 +0,0 @@ -foo[*][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 deleted file mode 100644 index ac1c89668..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 +++ /dev/null @@ -1 +0,0 @@ -foo[*][1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 deleted file mode 100644 index 03e0c0cb9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 +++ /dev/null @@ -1 +0,0 @@ -foo[*][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 deleted file mode 100644 index ac1c89668..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 +++ /dev/null @@ -1 +0,0 @@ -foo[*][1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 deleted file mode 100644 index 6494cf1c6..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 +++ /dev/null @@ -1 +0,0 @@ -foo[*][0][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 deleted file mode 100644 index 1406be572..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 +++ /dev/null @@ -1 +0,0 @@ -foo[*][1][0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 deleted file mode 100644 index 3d15fcc16..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `true`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 deleted file mode 100644 index 72b5aa281..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 +++ /dev/null @@ -1 +0,0 @@ -foo[*][0][1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 deleted file mode 100644 index 02a26491a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 +++ /dev/null @@ -1 +0,0 @@ -foo[*][1][1] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 deleted file mode 100644 index cb08037e2..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 +++ /dev/null @@ -1 +0,0 @@ -foo[*][2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 deleted file mode 100644 index 91d695995..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 +++ /dev/null @@ -1 +0,0 @@ -foo[*][2][2] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 deleted file mode 100644 index f40f261ad..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 +++ /dev/null @@ -1 +0,0 @@ -bar[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 deleted file mode 100644 index 03904b1de..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 +++ /dev/null @@ -1 +0,0 @@ -bar[*].baz[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 deleted file mode 100644 index fd7c21c34..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 +++ /dev/null @@ -1 +0,0 @@ -string[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 deleted file mode 100644 index d7ca4719a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 +++ /dev/null @@ -1 +0,0 @@ -hash[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 deleted file mode 100644 index b3ddffe3c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 +++ /dev/null @@ -1 +0,0 @@ -number[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 deleted file mode 100644 index c03cd39eb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 +++ /dev/null @@ -1 +0,0 @@ -nullvalue[*] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 deleted file mode 100644 index 08731af69..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `false`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 deleted file mode 100644 index b3c40cd53..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 +++ /dev/null @@ -1 +0,0 @@ -string[*].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 deleted file mode 100644 index c5930d543..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 +++ /dev/null @@ -1 +0,0 @@ -hash[*].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 deleted file mode 100644 index cc0b1a489..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 +++ /dev/null @@ -1 +0,0 @@ -number[*].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 deleted file mode 100644 index d677b9658..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 +++ /dev/null @@ -1 +0,0 @@ -nullvalue[*].foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 deleted file mode 100644 index c11666401..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 +++ /dev/null @@ -1 +0,0 @@ -nullvalue[*].foo[*].bar \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 deleted file mode 100644 index e33997710..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 +++ /dev/null @@ -1 +0,0 @@ -string.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 deleted file mode 100644 index 76f53453a..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 +++ /dev/null @@ -1 +0,0 @@ -hash.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 deleted file mode 100644 index dd485072f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 +++ /dev/null @@ -1 +0,0 @@ -number.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 deleted file mode 100644 index 16000c003..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 +++ /dev/null @@ -1 +0,0 @@ -array.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 deleted file mode 100644 index 1d0d03ed3..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 +++ /dev/null @@ -1 +0,0 @@ -nullvalue.* \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 deleted file mode 100644 index b67aebe98..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `0`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 deleted file mode 100644 index 7e8066d39..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 +++ /dev/null @@ -1 +0,0 @@ -*[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 deleted file mode 100644 index 41ebe5ba9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 +++ /dev/null @@ -1 +0,0 @@ -`foo` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 deleted file mode 100644 index fe0397993..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 +++ /dev/null @@ -1 +0,0 @@ -`foo\"quote` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 deleted file mode 100644 index 1a27fd80c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 +++ /dev/null @@ -1 +0,0 @@ -`✓` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 deleted file mode 100644 index 559a13456..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 +++ /dev/null @@ -1 +0,0 @@ -`foo\"bar` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 deleted file mode 100644 index e31621b43..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 +++ /dev/null @@ -1 +0,0 @@ -`1\`` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 deleted file mode 100644 index 6bf7a1036..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 +++ /dev/null @@ -1 +0,0 @@ -`\\`.{a:`b`} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 deleted file mode 100644 index 41ebe5ba9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 +++ /dev/null @@ -1 +0,0 @@ -`foo` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 deleted file mode 100644 index 28b9bcbbb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 +++ /dev/null @@ -1 +0,0 @@ -` foo` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 deleted file mode 100644 index 41ebe5ba9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 +++ /dev/null @@ -1 +0,0 @@ -`foo` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 deleted file mode 100644 index d3ac793bb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `1`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 deleted file mode 100644 index fe0397993..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 +++ /dev/null @@ -1 +0,0 @@ -`foo\"quote` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 deleted file mode 100644 index 1a27fd80c..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 +++ /dev/null @@ -1 +0,0 @@ -`✓` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 deleted file mode 100644 index 559a13456..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 +++ /dev/null @@ -1 +0,0 @@ -`foo\"bar` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 deleted file mode 100644 index e31621b43..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 +++ /dev/null @@ -1 +0,0 @@ -`1\`` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 deleted file mode 100644 index 6bf7a1036..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 +++ /dev/null @@ -1 +0,0 @@ -`\\`.{a:`b`} \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 deleted file mode 100644 index 41ebe5ba9..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 +++ /dev/null @@ -1 +0,0 @@ -`foo` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 deleted file mode 100644 index 28b9bcbbb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 +++ /dev/null @@ -1 +0,0 @@ -` foo` \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 deleted file mode 100644 index 065295bc1..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `null`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 deleted file mode 100644 index 43d164927..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `[1]`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 deleted file mode 100644 index 6b884fa86..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 +++ /dev/null @@ -1 +0,0 @@ -foo[?key != `{"a":2}`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 deleted file mode 100644 index d85c779d0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 +++ /dev/null @@ -1 +0,0 @@ -foo[?`true` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 deleted file mode 100644 index 44d6628cd..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 +++ /dev/null @@ -1 +0,0 @@ -bad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 deleted file mode 100644 index 3e6dcf304..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 +++ /dev/null @@ -1 +0,0 @@ -foo[?`false` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 deleted file mode 100644 index bdb820b30..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 +++ /dev/null @@ -1 +0,0 @@ -foo[?`0` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 deleted file mode 100644 index 3f3048a00..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 +++ /dev/null @@ -1 +0,0 @@ -foo[?`1` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 deleted file mode 100644 index dacc25724..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 +++ /dev/null @@ -1 +0,0 @@ -foo[?`null` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 deleted file mode 100644 index 32ebae880..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 +++ /dev/null @@ -1 +0,0 @@ -foo[?`[1]` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 deleted file mode 100644 index dcd023e0f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 +++ /dev/null @@ -1 +0,0 @@ -foo[?`{"a":2}` != key] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 deleted file mode 100644 index e08cc13cb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[?bar==`1`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 deleted file mode 100644 index 1ec43f45f..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 +++ /dev/null @@ -1 +0,0 @@ -reservations[*].instances[?bar==`1`] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 deleted file mode 100644 index 303871163..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 +++ /dev/null @@ -1 +0,0 @@ -reservations[].instances[?bar==`1`][] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 deleted file mode 100644 index e3875746b..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 +++ /dev/null @@ -1 +0,0 @@ -foo[?bar==`1`].bar[0] \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 deleted file mode 100644 index da7bc1ccf..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 +++ /dev/null @@ -1 +0,0 @@ -bad.morebad.morebad \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 deleted file mode 100644 index 5c3d68356..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 +++ /dev/null @@ -1 +0,0 @@ -foo[?a==`1`].b.c \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 deleted file mode 100644 index 6232808f0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 +++ /dev/null @@ -1 +0,0 @@ -abs(foo) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 deleted file mode 100644 index 6232808f0..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 +++ /dev/null @@ -1 +0,0 @@ -abs(foo) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 deleted file mode 100644 index 29497f4ff..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 +++ /dev/null @@ -1 +0,0 @@ -abs(array[1]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 deleted file mode 100644 index 29497f4ff..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 +++ /dev/null @@ -1 +0,0 @@ -abs(array[1]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 deleted file mode 100644 index 346696563..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 +++ /dev/null @@ -1 +0,0 @@ -abs(`-24`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 deleted file mode 100644 index 346696563..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 +++ /dev/null @@ -1 +0,0 @@ -abs(`-24`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 deleted file mode 100644 index c6268f847..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 +++ /dev/null @@ -1 +0,0 @@ -avg(numbers) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 deleted file mode 100644 index 7ce703695..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 +++ /dev/null @@ -1 +0,0 @@ -ceil(`1.2`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 deleted file mode 100644 index 0561bc26d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 +++ /dev/null @@ -1 +0,0 @@ -ceil(decimals[0]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 deleted file mode 100644 index 191028156..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 +++ /dev/null @@ -1 +0,0 @@ -foo \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 deleted file mode 100644 index c78c1fc30..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 +++ /dev/null @@ -1 +0,0 @@ -ceil(decimals[1]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 deleted file mode 100644 index ebcb4bbdb..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 +++ /dev/null @@ -1 +0,0 @@ -ceil(decimals[2]) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 deleted file mode 100644 index 6edbf1afe..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 +++ /dev/null @@ -1 +0,0 @@ -contains('abc', 'a') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 deleted file mode 100644 index d2b2f070d..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 +++ /dev/null @@ -1 +0,0 @@ -contains('abc', 'd') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 deleted file mode 100644 index 3535da2ec..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 +++ /dev/null @@ -1 +0,0 @@ -contains(strings, 'a') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 deleted file mode 100644 index ba839fe60..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 +++ /dev/null @@ -1 +0,0 @@ -contains(decimals, `1.2`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 deleted file mode 100644 index f43581869..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 +++ /dev/null @@ -1 +0,0 @@ -contains(decimals, `false`) \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 deleted file mode 100644 index adb65fc01..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 +++ /dev/null @@ -1 +0,0 @@ -ends_with(str, 'r') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 b/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 deleted file mode 100644 index 93d6901be..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 +++ /dev/null @@ -1 +0,0 @@ -ends_with(str, 'tr') \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/fuzz/jmespath.go b/vendor/github.com/jmespath/go-jmespath/fuzz/jmespath.go deleted file mode 100644 index c7df08782..000000000 --- a/vendor/github.com/jmespath/go-jmespath/fuzz/jmespath.go +++ /dev/null @@ -1,13 +0,0 @@ -package jmespath - -import "github.com/jmespath/go-jmespath" - -// Fuzz will fuzz test the JMESPath parser. -func Fuzz(data []byte) int { - p := jmespath.NewParser() - _, err := p.Parse(string(data)) - if err != nil { - return 1 - } - return 0 -} diff --git a/vendor/github.com/lib/pq/certs/README b/vendor/github.com/lib/pq/certs/README deleted file mode 100644 index 24ab7b256..000000000 --- a/vendor/github.com/lib/pq/certs/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains certificates and private keys for testing some -SSL-related functionality in Travis. Do NOT use these certificates for -anything other than testing. diff --git a/vendor/github.com/lib/pq/certs/postgresql.crt b/vendor/github.com/lib/pq/certs/postgresql.crt deleted file mode 100644 index 6e6b4284a..000000000 --- a/vendor/github.com/lib/pq/certs/postgresql.crt +++ /dev/null @@ -1,69 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 2 (0x2) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=pq CA - Validity - Not Before: Oct 11 15:10:11 2014 GMT - Not After : Oct 8 15:10:11 2024 GMT - Subject: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=pqgosslcert - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:e3:8c:06:9a:70:54:51:d1:34:34:83:39:cd:a2: - 59:0f:05:ed:8d:d8:0e:34:d0:92:f4:09:4d:ee:8c: - 78:55:49:24:f8:3c:e0:34:58:02:b2:e7:94:58:c1: - e8:e5:bb:d1:af:f6:54:c1:40:b1:90:70:79:0d:35: - 54:9c:8f:16:e9:c2:f0:92:e6:64:49:38:c1:76:f8: - 47:66:c4:5b:4a:b6:a9:43:ce:c8:be:6c:4d:2b:94: - 97:3c:55:bc:d1:d0:6e:b7:53:ae:89:5c:4b:6b:86: - 40:be:c1:ae:1e:64:ce:9c:ae:87:0a:69:e5:c8:21: - 12:be:ae:1d:f6:45:df:16:a7 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - 9B:25:31:63:A2:D8:06:FF:CB:E3:E9:96:FF:0D:BA:DC:12:7D:04:CF - X509v3 Authority Key Identifier: - keyid:52:93:ED:1E:76:0A:9F:65:4F:DE:19:66:C1:D5:22:40:35:CB:A0:72 - - X509v3 Basic Constraints: - CA:FALSE - X509v3 Key Usage: - Digital Signature, Non Repudiation, Key Encipherment - Signature Algorithm: sha256WithRSAEncryption - 3e:f5:f8:0b:4e:11:bd:00:86:1f:ce:dc:97:02:98:91:11:f5: - 65:f6:f2:8a:b2:3e:47:92:05:69:28:c9:e9:b4:f7:cf:93:d1: - 2d:81:5d:00:3c:23:be:da:70:ea:59:e1:2c:d3:25:49:ae:a6: - 95:54:c1:10:df:23:e3:fe:d6:e4:76:c7:6b:73:ad:1b:34:7c: - e2:56:cc:c0:37:ae:c5:7a:11:20:6c:3d:05:0e:99:cd:22:6c: - cf:59:a1:da:28:d4:65:ba:7d:2f:2b:3d:69:6d:a6:c1:ae:57: - bf:56:64:13:79:f8:48:46:65:eb:81:67:28:0b:7b:de:47:10: - b3:80:3c:31:d1:58:94:01:51:4a:c7:c8:1a:01:a8:af:c4:cd: - bb:84:a5:d9:8b:b4:b9:a1:64:3e:95:d9:90:1d:d5:3f:67:cc: - 3b:ba:f5:b4:d1:33:77:ee:c2:d2:3e:7e:c5:66:6e:b7:35:4c: - 60:57:b0:b8:be:36:c8:f3:d3:95:8c:28:4a:c9:f7:27:a4:0d: - e5:96:99:eb:f5:c8:bd:f3:84:6d:ef:02:f9:8a:36:7d:6b:5f: - 36:68:37:41:d9:74:ae:c6:78:2e:44:86:a1:ad:43:ca:fb:b5: - 3e:ba:10:23:09:02:ac:62:d1:d0:83:c8:95:b9:e3:5e:30:ff: - 5b:2b:38:fa ------BEGIN CERTIFICATE----- -MIIDEzCCAfugAwIBAgIBAjANBgkqhkiG9w0BAQsFADBeMQswCQYDVQQGEwJVUzEP -MA0GA1UECBMGTmV2YWRhMRIwEAYDVQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdp -dGh1Yi5jb20vbGliL3BxMQ4wDAYDVQQDEwVwcSBDQTAeFw0xNDEwMTExNTEwMTFa -Fw0yNDEwMDgxNTEwMTFaMGQxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGEx -EjAQBgNVBAcTCUxhcyBWZWdhczEaMBgGA1UEChMRZ2l0aHViLmNvbS9saWIvcHEx -FDASBgNVBAMTC3BxZ29zc2xjZXJ0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB -gQDjjAaacFRR0TQ0gznNolkPBe2N2A400JL0CU3ujHhVSST4POA0WAKy55RYwejl -u9Gv9lTBQLGQcHkNNVScjxbpwvCS5mRJOMF2+EdmxFtKtqlDzsi+bE0rlJc8VbzR -0G63U66JXEtrhkC+wa4eZM6crocKaeXIIRK+rh32Rd8WpwIDAQABo1owWDAdBgNV -HQ4EFgQUmyUxY6LYBv/L4+mW/w263BJ9BM8wHwYDVR0jBBgwFoAUUpPtHnYKn2VP -3hlmwdUiQDXLoHIwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJKoZIhvcNAQEL -BQADggEBAD71+AtOEb0Ahh/O3JcCmJER9WX28oqyPkeSBWkoyem098+T0S2BXQA8 -I77acOpZ4SzTJUmuppVUwRDfI+P+1uR2x2tzrRs0fOJWzMA3rsV6ESBsPQUOmc0i -bM9Zodoo1GW6fS8rPWltpsGuV79WZBN5+EhGZeuBZygLe95HELOAPDHRWJQBUUrH -yBoBqK/EzbuEpdmLtLmhZD6V2ZAd1T9nzDu69bTRM3fuwtI+fsVmbrc1TGBXsLi+ -Nsjz05WMKErJ9yekDeWWmev1yL3zhG3vAvmKNn1rXzZoN0HZdK7GeC5EhqGtQ8r7 -tT66ECMJAqxi0dCDyJW5414w/1srOPo= ------END CERTIFICATE----- diff --git a/vendor/github.com/lib/pq/certs/postgresql.key b/vendor/github.com/lib/pq/certs/postgresql.key deleted file mode 100644 index eb8b20be9..000000000 --- a/vendor/github.com/lib/pq/certs/postgresql.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQDjjAaacFRR0TQ0gznNolkPBe2N2A400JL0CU3ujHhVSST4POA0 -WAKy55RYwejlu9Gv9lTBQLGQcHkNNVScjxbpwvCS5mRJOMF2+EdmxFtKtqlDzsi+ -bE0rlJc8VbzR0G63U66JXEtrhkC+wa4eZM6crocKaeXIIRK+rh32Rd8WpwIDAQAB -AoGAM5dM6/kp9P700i8qjOgRPym96Zoh5nGfz/rIE5z/r36NBkdvIg8OVZfR96nH -b0b9TOMR5lsPp0sI9yivTWvX6qyvLJRWy2vvx17hXK9NxXUNTAm0PYZUTvCtcPeX -RnJpzQKNZQPkFzF0uXBc4CtPK2Vz0+FGvAelrhYAxnw1dIkCQQD+9qaW5QhXjsjb -Nl85CmXgxPmGROcgLQCO+omfrjf9UXrituU9Dz6auym5lDGEdMFnkzfr+wpasEy9 -mf5ZZOhDAkEA5HjXfVGaCtpydOt6hDon/uZsyssCK2lQ7NSuE3vP+sUsYMzIpEoy -t3VWXqKbo+g9KNDTP4WEliqp1aiSIylzzQJANPeqzihQnlgEdD4MdD4rwhFJwVIp -Le8Lcais1KaN7StzOwxB/XhgSibd2TbnPpw+3bSg5n5lvUdo+e62/31OHwJAU1jS -I+F09KikQIr28u3UUWT2IzTT4cpVv1AHAQyV3sG3YsjSGT0IK20eyP9BEBZU2WL0 -7aNjrvR5aHxKc5FXsQJABsFtyGpgI5X4xufkJZVZ+Mklz2n7iXa+XPatMAHFxAtb -EEMt60rngwMjXAzBSC6OYuYogRRAY3UCacNC5VhLYQ== ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/lib/pq/certs/root.crt b/vendor/github.com/lib/pq/certs/root.crt deleted file mode 100644 index aecf8f621..000000000 --- a/vendor/github.com/lib/pq/certs/root.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEAzCCAuugAwIBAgIJANmheROCdW1NMA0GCSqGSIb3DQEBBQUAMF4xCzAJBgNV -BAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGExEjAQBgNVBAcTCUxhcyBWZWdhczEaMBgG -A1UEChMRZ2l0aHViLmNvbS9saWIvcHExDjAMBgNVBAMTBXBxIENBMB4XDTE0MTAx -MTE1MDQyOVoXDTI0MTAwODE1MDQyOVowXjELMAkGA1UEBhMCVVMxDzANBgNVBAgT -Bk5ldmFkYTESMBAGA1UEBxMJTGFzIFZlZ2FzMRowGAYDVQQKExFnaXRodWIuY29t -L2xpYi9wcTEOMAwGA1UEAxMFcHEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCV4PxP7ShzWBzUCThcKk3qZtOLtHmszQVtbqhvgTpm1kTRtKBdVMu0 -pLAHQ3JgJCnAYgH0iZxVGoMP16T3irdgsdC48+nNTFM2T0cCdkfDURGIhSFN47cb -Pgy306BcDUD2q7ucW33+dlFSRuGVewocoh4BWM/vMtMvvWzdi4Ag/L/jhb+5wZxZ -sWymsadOVSDePEMKOvlCa3EdVwVFV40TVyDb+iWBUivDAYsS2a3KajuJrO6MbZiE -Sp2RCIkZS2zFmzWxVRi9ZhzIZhh7EVF9JAaNC3T52jhGUdlRq3YpBTMnd89iOh74 -6jWXG7wSuPj3haFzyNhmJ0ZUh+2Ynoh1AgMBAAGjgcMwgcAwHQYDVR0OBBYEFFKT -7R52Cp9lT94ZZsHVIkA1y6ByMIGQBgNVHSMEgYgwgYWAFFKT7R52Cp9lT94ZZsHV -IkA1y6ByoWKkYDBeMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGTmV2YWRhMRIwEAYD -VQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdpdGh1Yi5jb20vbGliL3BxMQ4wDAYD -VQQDEwVwcSBDQYIJANmheROCdW1NMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF -BQADggEBAAEhCLWkqJNMI8b4gkbmj5fqQ/4+oO83bZ3w2Oqf6eZ8I8BC4f2NOyE6 -tRUlq5+aU7eqC1cOAvGjO+YHN/bF/DFpwLlzvUSXt+JP/pYcUjL7v+pIvwqec9hD -ndvM4iIbkD/H/OYQ3L+N3W+G1x7AcFIX+bGCb3PzYVQAjxreV6//wgKBosMGFbZo -HPxT9RPMun61SViF04H5TNs0derVn1+5eiiYENeAhJzQNyZoOOUuX1X/Inx9bEPh -C5vFBtSMgIytPgieRJVWAiMLYsfpIAStrHztRAbBs2DU01LmMgRvHdxgFEKinC/d -UHZZQDP+6pT+zADrGhQGXe4eThaO6f0= ------END CERTIFICATE----- diff --git a/vendor/github.com/lib/pq/certs/server.crt b/vendor/github.com/lib/pq/certs/server.crt deleted file mode 100644 index ddc995a6d..000000000 --- a/vendor/github.com/lib/pq/certs/server.crt +++ /dev/null @@ -1,81 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=pq CA - Validity - Not Before: Oct 11 15:05:15 2014 GMT - Not After : Oct 8 15:05:15 2024 GMT - Subject: C=US, ST=Nevada, L=Las Vegas, O=github.com/lib/pq, CN=postgres - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:d7:8a:4c:85:fb:17:a5:3c:8f:e0:72:11:29:ce: - 3f:b0:1f:3f:7d:c6:ee:7f:a7:fc:02:2b:35:47:08: - a6:3d:90:df:5c:56:14:94:00:c7:6d:d1:d2:e2:61: - 95:77:b8:e3:a6:66:31:f9:1f:21:7d:62:e1:27:da: - 94:37:61:4a:ea:63:53:a0:61:b8:9c:bb:a5:e2:e7: - b7:a6:d8:0f:05:04:c7:29:e2:ea:49:2b:7f:de:15: - 00:a6:18:70:50:c7:0c:de:9a:f9:5a:96:b0:e1:94: - 06:c6:6d:4a:21:3b:b4:0f:a5:6d:92:86:34:b2:4e: - d7:0e:a7:19:c0:77:0b:7b:87:c8:92:de:42:ff:86: - d2:b7:9a:a4:d4:15:23:ca:ad:a5:69:21:b8:ce:7e: - 66:cb:85:5d:b9:ed:8b:2d:09:8d:94:e4:04:1e:72: - ec:ef:d0:76:90:15:5a:a4:f7:91:4b:e9:ce:4e:9d: - 5d:9a:70:17:9c:d8:e9:73:83:ea:3d:61:99:a6:cd: - ac:91:40:5a:88:77:e5:4e:2a:8e:3d:13:f3:f9:38: - 6f:81:6b:8a:95:ca:0e:07:ab:6f:da:b4:8c:d9:ff: - aa:78:03:aa:c7:c2:cf:6f:64:92:d3:d8:83:d5:af: - f1:23:18:a7:2e:7b:17:0b:e7:7d:f1:fa:a8:41:a3: - 04:57 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - EE:F0:B3:46:DC:C7:09:EB:0E:B6:2F:E5:FE:62:60:45:44:9F:59:CC - X509v3 Authority Key Identifier: - keyid:52:93:ED:1E:76:0A:9F:65:4F:DE:19:66:C1:D5:22:40:35:CB:A0:72 - - X509v3 Basic Constraints: - CA:FALSE - X509v3 Key Usage: - Digital Signature, Non Repudiation, Key Encipherment - Signature Algorithm: sha256WithRSAEncryption - 7e:5a:6e:be:bf:d2:6c:c1:d6:fa:b6:fb:3f:06:53:36:08:87: - 9d:95:b1:39:af:9e:f6:47:38:17:39:da:25:7c:f2:ad:0c:e3: - ab:74:19:ca:fb:8c:a0:50:c0:1d:19:8a:9c:21:ed:0f:3a:d1: - 96:54:2e:10:09:4f:b8:70:f7:2b:99:43:d2:c6:15:bc:3f:24: - 7d:28:39:32:3f:8d:a4:4f:40:75:7f:3e:0d:1c:d1:69:f2:4e: - 98:83:47:97:d2:25:ac:c9:36:86:2f:04:a6:c4:86:c7:c4:00: - 5f:7f:b9:ad:fc:bf:e9:f5:78:d7:82:1a:51:0d:fc:ab:9e:92: - 1d:5f:0c:18:d1:82:e0:14:c9:ce:91:89:71:ff:49:49:ff:35: - bf:7b:44:78:42:c1:d0:66:65:bb:28:2e:60:ca:9b:20:12:a9: - 90:61:b1:96:ec:15:46:c9:37:f7:07:90:8a:89:45:2a:3f:37: - ec:dc:e3:e5:8f:c3:3a:57:80:a5:54:60:0c:e1:b2:26:99:2b: - 40:7e:36:d1:9a:70:02:ec:63:f4:3b:72:ae:81:fb:30:20:6d: - cb:48:46:c6:b5:8f:39:b1:84:05:25:55:8d:f5:62:f6:1b:46: - 2e:da:a3:4c:26:12:44:d7:56:b6:b8:a9:ca:d3:ab:71:45:7c: - 9f:48:6d:1e ------BEGIN CERTIFICATE----- -MIIDlDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADBeMQswCQYDVQQGEwJVUzEP -MA0GA1UECBMGTmV2YWRhMRIwEAYDVQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdp -dGh1Yi5jb20vbGliL3BxMQ4wDAYDVQQDEwVwcSBDQTAeFw0xNDEwMTExNTA1MTVa -Fw0yNDEwMDgxNTA1MTVaMGExCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGEx -EjAQBgNVBAcTCUxhcyBWZWdhczEaMBgGA1UEChMRZ2l0aHViLmNvbS9saWIvcHEx -ETAPBgNVBAMTCHBvc3RncmVzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA14pMhfsXpTyP4HIRKc4/sB8/fcbuf6f8Ais1RwimPZDfXFYUlADHbdHS4mGV -d7jjpmYx+R8hfWLhJ9qUN2FK6mNToGG4nLul4ue3ptgPBQTHKeLqSSt/3hUAphhw -UMcM3pr5Wpaw4ZQGxm1KITu0D6VtkoY0sk7XDqcZwHcLe4fIkt5C/4bSt5qk1BUj -yq2laSG4zn5my4Vdue2LLQmNlOQEHnLs79B2kBVapPeRS+nOTp1dmnAXnNjpc4Pq -PWGZps2skUBaiHflTiqOPRPz+ThvgWuKlcoOB6tv2rSM2f+qeAOqx8LPb2SS09iD -1a/xIxinLnsXC+d98fqoQaMEVwIDAQABo1owWDAdBgNVHQ4EFgQU7vCzRtzHCesO -ti/l/mJgRUSfWcwwHwYDVR0jBBgwFoAUUpPtHnYKn2VP3hlmwdUiQDXLoHIwCQYD -VR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJKoZIhvcNAQELBQADggEBAH5abr6/0mzB -1vq2+z8GUzYIh52VsTmvnvZHOBc52iV88q0M46t0Gcr7jKBQwB0Zipwh7Q860ZZU -LhAJT7hw9yuZQ9LGFbw/JH0oOTI/jaRPQHV/Pg0c0WnyTpiDR5fSJazJNoYvBKbE -hsfEAF9/ua38v+n1eNeCGlEN/Kuekh1fDBjRguAUyc6RiXH/SUn/Nb97RHhCwdBm -ZbsoLmDKmyASqZBhsZbsFUbJN/cHkIqJRSo/N+zc4+WPwzpXgKVUYAzhsiaZK0B+ -NtGacALsY/Q7cq6B+zAgbctIRsa1jzmxhAUlVY31YvYbRi7ao0wmEkTXVra4qcrT -q3FFfJ9IbR4= ------END CERTIFICATE----- diff --git a/vendor/github.com/lib/pq/certs/server.key b/vendor/github.com/lib/pq/certs/server.key deleted file mode 100644 index bd7b019b6..000000000 --- a/vendor/github.com/lib/pq/certs/server.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEA14pMhfsXpTyP4HIRKc4/sB8/fcbuf6f8Ais1RwimPZDfXFYU -lADHbdHS4mGVd7jjpmYx+R8hfWLhJ9qUN2FK6mNToGG4nLul4ue3ptgPBQTHKeLq -SSt/3hUAphhwUMcM3pr5Wpaw4ZQGxm1KITu0D6VtkoY0sk7XDqcZwHcLe4fIkt5C -/4bSt5qk1BUjyq2laSG4zn5my4Vdue2LLQmNlOQEHnLs79B2kBVapPeRS+nOTp1d -mnAXnNjpc4PqPWGZps2skUBaiHflTiqOPRPz+ThvgWuKlcoOB6tv2rSM2f+qeAOq -x8LPb2SS09iD1a/xIxinLnsXC+d98fqoQaMEVwIDAQABAoIBAF3ZoihUhJ82F4+r -Gz4QyDpv4L1reT2sb1aiabhcU8ZK5nbWJG+tRyjSS/i2dNaEcttpdCj9HR/zhgZM -bm0OuAgG58rVwgS80CZUruq++Qs+YVojq8/gWPTiQD4SNhV2Fmx3HkwLgUk3oxuT -SsvdqzGE3okGVrutCIcgy126eA147VPMoej1Bb3fO6npqK0pFPhZfAc0YoqJuM+k -obRm5pAnGUipyLCFXjA9HYPKwYZw2RtfdA3CiImHeanSdqS+ctrC9y8BV40Th7gZ -haXdKUNdjmIxV695QQ1mkGqpKLZFqhzKioGQ2/Ly2d1iaKN9fZltTusu8unepWJ2 -tlT9qMECgYEA9uHaF1t2CqE+AJvWTihHhPIIuLxoOQXYea1qvxfcH/UMtaLKzCNm -lQ5pqCGsPvp+10f36yttO1ZehIvlVNXuJsjt0zJmPtIolNuJY76yeussfQ9jHheB -5uPEzCFlHzxYbBUyqgWaF6W74okRGzEGJXjYSP0yHPPdU4ep2q3bGiUCgYEA34Af -wBSuQSK7uLxArWHvQhyuvi43ZGXls6oRGl+Ysj54s8BP6XGkq9hEJ6G4yxgyV+BR -DUOs5X8/TLT8POuIMYvKTQthQyCk0eLv2FLdESDuuKx0kBVY3s8lK3/z5HhrdOiN -VMNZU+xDKgKc3hN9ypkk8vcZe6EtH7Y14e0rVcsCgYBTgxi8F/M5K0wG9rAqphNz -VFBA9XKn/2M33cKjO5X5tXIEKzpAjaUQvNxexG04rJGljzG8+mar0M6ONahw5yD1 -O7i/XWgazgpuOEkkVYiYbd8RutfDgR4vFVMn3hAP3eDnRtBplRWH9Ec3HTiNIys6 -F8PKBOQjyRZQQC7jyzW3hQKBgACe5HeuFwXLSOYsb6mLmhR+6+VPT4wR1F95W27N -USk9jyxAnngxfpmTkiziABdgS9N+pfr5cyN4BP77ia/Jn6kzkC5Cl9SN5KdIkA3z -vPVtN/x/ThuQU5zaymmig1ThGLtMYggYOslG4LDfLPxY5YKIhle+Y+259twdr2yf -Mf2dAoGAaGv3tWMgnIdGRk6EQL/yb9PKHo7ShN+tKNlGaK7WwzBdKs+Fe8jkgcr7 -pz4Ne887CmxejdISzOCcdT+Zm9Bx6I/uZwWOtDvWpIgIxVX9a9URj/+D1MxTE/y4 -d6H+c89yDY62I2+drMpdjCd3EtCaTlxpTbRS+s1eAHMH7aEkcCE= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/lib/pq/hstore/hstore.go b/vendor/github.com/lib/pq/hstore/hstore.go deleted file mode 100644 index 72d5abf51..000000000 --- a/vendor/github.com/lib/pq/hstore/hstore.go +++ /dev/null @@ -1,118 +0,0 @@ -package hstore - -import ( - "database/sql" - "database/sql/driver" - "strings" -) - -// A wrapper for transferring Hstore values back and forth easily. -type Hstore struct { - Map map[string]sql.NullString -} - -// escapes and quotes hstore keys/values -// s should be a sql.NullString or string -func hQuote(s interface{}) string { - var str string - switch v := s.(type) { - case sql.NullString: - if !v.Valid { - return "NULL" - } - str = v.String - case string: - str = v - default: - panic("not a string or sql.NullString") - } - - str = strings.Replace(str, "\\", "\\\\", -1) - return `"` + strings.Replace(str, "\"", "\\\"", -1) + `"` -} - -// Scan implements the Scanner interface. -// -// Note h.Map is reallocated before the scan to clear existing values. If the -// hstore column's database value is NULL, then h.Map is set to nil instead. -func (h *Hstore) Scan(value interface{}) error { - if value == nil { - h.Map = nil - return nil - } - h.Map = make(map[string]sql.NullString) - var b byte - pair := [][]byte{{}, {}} - pi := 0 - inQuote := false - didQuote := false - sawSlash := false - bindex := 0 - for bindex, b = range value.([]byte) { - if sawSlash { - pair[pi] = append(pair[pi], b) - sawSlash = false - continue - } - - switch b { - case '\\': - sawSlash = true - continue - case '"': - inQuote = !inQuote - if !didQuote { - didQuote = true - } - continue - default: - if !inQuote { - switch b { - case ' ', '\t', '\n', '\r': - continue - case '=': - continue - case '>': - pi = 1 - didQuote = false - continue - case ',': - s := string(pair[1]) - if !didQuote && len(s) == 4 && strings.ToLower(s) == "null" { - h.Map[string(pair[0])] = sql.NullString{String: "", Valid: false} - } else { - h.Map[string(pair[0])] = sql.NullString{String: string(pair[1]), Valid: true} - } - pair[0] = []byte{} - pair[1] = []byte{} - pi = 0 - continue - } - } - } - pair[pi] = append(pair[pi], b) - } - if bindex > 0 { - s := string(pair[1]) - if !didQuote && len(s) == 4 && strings.ToLower(s) == "null" { - h.Map[string(pair[0])] = sql.NullString{String: "", Valid: false} - } else { - h.Map[string(pair[0])] = sql.NullString{String: string(pair[1]), Valid: true} - } - } - return nil -} - -// Value implements the driver Valuer interface. Note if h.Map is nil, the -// database column value will be set to NULL. -func (h Hstore) Value() (driver.Value, error) { - if h.Map == nil { - return nil, nil - } - parts := []string{} - for key, val := range h.Map { - thispart := hQuote(key) + "=>" + hQuote(val) - parts = append(parts, thispart) - } - return []byte(strings.Join(parts, ",")), nil -} diff --git a/vendor/github.com/lib/pq/listen_example/doc.go b/vendor/github.com/lib/pq/listen_example/doc.go deleted file mode 100644 index 5bc99f5c1..000000000 --- a/vendor/github.com/lib/pq/listen_example/doc.go +++ /dev/null @@ -1,102 +0,0 @@ -/* - -Below you will find a self-contained Go program which uses the LISTEN / NOTIFY -mechanism to avoid polling the database while waiting for more work to arrive. - - // - // You can see the program in action by defining a function similar to - // the following: - // - // CREATE OR REPLACE FUNCTION public.get_work() - // RETURNS bigint - // LANGUAGE sql - // AS $$ - // SELECT CASE WHEN random() >= 0.2 THEN int8 '1' END - // $$ - // ; - - package main - - import ( - "database/sql" - "fmt" - "time" - - "github.com/lib/pq" - ) - - func doWork(db *sql.DB, work int64) { - // work here - } - - func getWork(db *sql.DB) { - for { - // get work from the database here - var work sql.NullInt64 - err := db.QueryRow("SELECT get_work()").Scan(&work) - if err != nil { - fmt.Println("call to get_work() failed: ", err) - time.Sleep(10 * time.Second) - continue - } - if !work.Valid { - // no more work to do - fmt.Println("ran out of work") - return - } - - fmt.Println("starting work on ", work.Int64) - go doWork(db, work.Int64) - } - } - - func waitForNotification(l *pq.Listener) { - for { - select { - case <-l.Notify: - fmt.Println("received notification, new work available") - return - case <-time.After(90 * time.Second): - go func() { - l.Ping() - }() - // Check if there's more work available, just in case it takes - // a while for the Listener to notice connection loss and - // reconnect. - fmt.Println("received no work for 90 seconds, checking for new work") - return - } - } - } - - func main() { - var conninfo string = "" - - db, err := sql.Open("postgres", conninfo) - if err != nil { - panic(err) - } - - reportProblem := func(ev pq.ListenerEventType, err error) { - if err != nil { - fmt.Println(err.Error()) - } - } - - listener := pq.NewListener(conninfo, 10 * time.Second, time.Minute, reportProblem) - err = listener.Listen("getwork") - if err != nil { - panic(err) - } - - fmt.Println("entering main loop") - for { - // process all available work before waiting for notifications - getWork(db) - waitForNotification(listener) - } - } - - -*/ -package listen_example diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/error.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/error.json deleted file mode 100644 index 11eb6e692..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/error.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "errors" : [ { - "status" : 404, - "message" : "Not Found" - } ] -} diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/groups.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/groups.json deleted file mode 100644 index 101c855af..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/groups.json +++ /dev/null @@ -1,16 +0,0 @@ -[ { - "name" : "administrators", - "uri" : "https://artifactory/artifactory/api/security/groups/administrators" -}, { - "name" : "docker-readers", - "uri" : "https://artifactory/artifactory/api/security/groups/docker-readers" -}, { - "name" : "remote-readers", - "uri" : "https://artifactory/artifactory/api/security/groups/remote-readers" -}, { - "name" : "developers", - "uri" : "https://artifactory/artifactory/api/security/groups/developers" -}, { - "name" : "java-committers", - "uri" : "https://artifactory/artifactory/api/security/groups/java-committers" -} ] diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/license_information.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/license_information.json deleted file mode 100644 index 48e7d8d95..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/license_information.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type" : "Trial", - "validThrough" : "Sep 30, 2015", - "licensedTo" : "User Bob" -} diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/local_repository_config.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/local_repository_config.json deleted file mode 100644 index 035bc3154..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/local_repository_config.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "key" : "libs-release-local", - "packageType" : "maven", - "description" : "Local repository for in-house libraries", - "notes" : "", - "includesPattern" : "**/*", - "excludesPattern" : "", - "repoLayoutRef" : "maven-2-default", - "enableNuGetSupport" : false, - "enableGemsSupport" : false, - "enableNpmSupport" : false, - "enableBowerSupport" : false, - "enableDebianSupport" : false, - "debianTrivialLayout" : false, - "enablePypiSupport" : false, - "enableDockerSupport" : false, - "dockerApiVersion" : "V1", - "forceDockerAuthentication" : false, - "enableVagrantSupport" : false, - "enableGitLfsSupport" : false, - "checksumPolicyType" : "client-checksums", - "handleReleases" : true, - "handleSnapshots" : false, - "maxUniqueSnapshots" : 0, - "snapshotVersionBehavior" : "unique", - "suppressPomConsistencyChecks" : true, - "blackedOut" : false, - "propertySets" : [ "artifactory" ], - "archiveBrowsingEnabled" : false, - "calculateYumMetadata" : false, - "yumRootDepth" : 0, - "rclass" : "local" -} diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/permissions.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/permissions.json deleted file mode 100644 index 57ea2bc55..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/permissions.json +++ /dev/null @@ -1,16 +0,0 @@ -[ { - "name" : "snapshot-write", - "uri" : "https://artifactory/artifactory/api/security/permissions/snapshot-write" -}, { - "name" : "Any Remote", - "uri" : "https://artifactory/artifactory/api/security/permissions/Any%20Remote" -}, { - "name" : "Anything", - "uri" : "https://artifactory/artifactory/api/security/permissions/Anything" -}, { - "name" : "release-commiter", - "uri" : "https://artifactory/artifactory/api/security/permissions/release-commiter" -}, { - "name" : "read-docker", - "uri" : "https://artifactory/artifactory/api/security/permissions/read-docker" -} ] diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/permissions_details.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/permissions_details.json deleted file mode 100644 index c4f5079b5..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/permissions_details.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name" : "release-commiter", - "includesPattern" : "**", - "excludesPattern" : "", - "repositories" : [ "docker-local-v2", "libs-release-local", "plugins-release-local" ], - "principals" : { - "groups" : { - "java-committers" : [ "r", "d", "w", "n" ] - } - } -} \ No newline at end of file diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/remote_repository_config.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/remote_repository_config.json deleted file mode 100644 index f078ffab6..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/remote_repository_config.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "key" : "jcenter", - "packageType" : "maven", - "description" : "Bintray Central Java repository", - "notes" : "", - "includesPattern" : "**/*", - "excludesPattern" : "", - "repoLayoutRef" : "maven-2-default", - "enableNuGetSupport" : false, - "enableGemsSupport" : false, - "enableNpmSupport" : false, - "enableBowerSupport" : false, - "enableDebianSupport" : false, - "debianTrivialLayout" : false, - "enablePypiSupport" : false, - "enableDockerSupport" : false, - "dockerApiVersion" : "V1", - "forceDockerAuthentication" : false, - "enableVagrantSupport" : false, - "enableGitLfsSupport" : false, - "url" : "http://jcenter.bintray.com", - "username" : "", - "password" : "", - "handleReleases" : true, - "handleSnapshots" : false, - "suppressPomConsistencyChecks" : true, - "remoteRepoChecksumPolicyType" : "", - "hardFail" : false, - "offline" : false, - "blackedOut" : false, - "storeArtifactsLocally" : true, - "socketTimeoutMillis" : 15000, - "localAddress" : "", - "retrievalCachePeriodSecs" : 43200, - "assumedOfflinePeriodSecs" : 300, - "missedRetrievalCachePeriodSecs" : 7200, - "unusedArtifactsCleanupPeriodHours" : 0, - "fetchJarsEagerly" : false, - "fetchSourcesEagerly" : false, - "shareConfiguration" : false, - "synchronizeProperties" : false, - "maxUniqueSnapshots" : 0, - "propertySets" : [ "artifactory" ], - "archiveBrowsingEnabled" : false, - "listRemoteFolderItems" : true, - "rejectInvalidJars" : false, - "allowAnyHostAuth" : false, - "enableCookieManagement" : false, - "enableTokenAuthentication" : false, - "rclass" : "remote" -} \ No newline at end of file diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/repositories.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/repositories.json deleted file mode 100644 index 503d79595..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/repositories.json +++ /dev/null @@ -1,94 +0,0 @@ -[ { - "key" : "dev-docker-local", - "description" : "Development Docker Registry", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/dev-docker-local" -}, { - "key" : "docker-local-v2", - "description" : "Production Docker Repository", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/docker-local-v2" -}, { - "key" : "ext-release-local", - "description" : "Local repository for third party libraries", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/ext-release-local" -}, { - "key" : "ext-snapshot-local", - "description" : "Local repository for third party snapshots", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/ext-snapshot-local" -}, { - "key" : "libs-release-local", - "description" : "Local repository for in-house libraries", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/libs-release-local" -}, { - "key" : "libs-snapshot-local", - "description" : "Local repository for in-house snapshots", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/libs-snapshot-local" -}, { - "key" : "plugins-release-local", - "description" : "Local repository for plugins", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/plugins-release-local" -}, { - "key" : "plugins-snapshot-local", - "description" : "Local repository for plugins snapshots", - "type" : "LOCAL", - "url" : "https://artifactory.domain/artifactory/plugins-snapshot-local" -}, { - "key" : "bower-remote", - "type" : "REMOTE", - "url" : "https://github.com/" -}, { - "key" : "docker-remote", - "type" : "REMOTE", - "url" : "https://registry-1.docker.io/" -}, { - "key" : "jcenter", - "description" : "Bintray Central Java repository", - "type" : "REMOTE", - "url" : "http://jcenter.bintray.com" -}, { - "key" : "npm-remote", - "type" : "REMOTE", - "url" : "https://registry.npmjs.org" -}, { - "key" : "nuget-remote", - "type" : "REMOTE", - "url" : "https://www.nuget.org/" -}, { - "key" : "pypi-remote", - "type" : "REMOTE", - "url" : "https://pypi.python.org" -}, { - "key" : "rubygems-remote", - "type" : "REMOTE", - "url" : "https://rubygems.org/" -}, { - "key" : "nexus-releases-remote", - "type" : "REMOTE", - "url" : "https://nexus.domain/content/repositories/releases/" -}, { - "key" : "libs-release", - "type" : "VIRTUAL", - "url" : "https://artifactory.domain/artifactory/libs-release" -}, { - "key" : "libs-snapshot", - "type" : "VIRTUAL", - "url" : "https://artifactory.domain/artifactory/libs-snapshot" -}, { - "key" : "plugins-release", - "type" : "VIRTUAL", - "url" : "https://artifactory.domain/artifactory/plugins-release" -}, { - "key" : "plugins-snapshot", - "type" : "VIRTUAL", - "url" : "https://artifactory.domain/artifactory/plugins-snapshot" -}, { - "key" : "remote-repos", - "type" : "VIRTUAL", - "url" : "https://artifactory.domain/artifactory/remote-repos" -} ] diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/single_group.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/single_group.json deleted file mode 100644 index 33f121db0..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/single_group.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name" : "docker-readers", - "description" : "Can read from Docker repositories", - "autoJoin" : false, - "realm" : "artifactory" -} \ No newline at end of file diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/single_user.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/single_user.json deleted file mode 100644 index c77a41d1e..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/single_user.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name" : "admin", - "email" : "admin@admin.com", - "admin" : true, - "profileUpdatable" : true, - "internalPasswordDisabled" : false, - "groups" : [ "administrators" ], - "lastLoggedIn" : "2015-08-11T14:04:11.472Z", - "realm" : "internal", - "offlineMode" : false -} diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/users.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/users.json deleted file mode 100644 index 235153f88..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/users.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "name": "davids", - "uri" : "http://localhost:8080/artifactory/api/security/users/davids" - }, { - "name": "danl", - "uri" : "http://localhost:8080/artifactory/api/security/users/danl" - } -] diff --git a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/virtual_repository_config.json b/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/virtual_repository_config.json deleted file mode 100644 index 224239f2b..000000000 --- a/vendor/github.com/lusis/go-artifactory/src/artifactory.v401/assets/test/virtual_repository_config.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "key" : "libs-release", - "packageType" : "maven", - "description" : "", - "notes" : "", - "includesPattern" : "**/*", - "excludesPattern" : "", - "enableNuGetSupport" : false, - "enableGemsSupport" : false, - "enableNpmSupport" : false, - "enableBowerSupport" : false, - "enableDebianSupport" : false, - "debianTrivialLayout" : false, - "enablePypiSupport" : false, - "enableDockerSupport" : false, - "dockerApiVersion" : "V1", - "forceDockerAuthentication" : false, - "enableVagrantSupport" : false, - "enableGitLfsSupport" : false, - "repositories" : [ "libs-release-local", "ext-release-local", "remote-repos" ], - "artifactoryRequestsCanRetrieveRemoteArtifacts" : false, - "keyPair" : "", - "pomRepositoryReferencesCleanupPolicy" : "discard_active_reference", - "rclass" : "virtual" -} diff --git a/vendor/github.com/mitchellh/packer/post-processor/compress/LICENSE b/vendor/github.com/mitchellh/packer/post-processor/compress/LICENSE deleted file mode 100644 index 38bbf26f3..000000000 --- a/vendor/github.com/mitchellh/packer/post-processor/compress/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Vasiliy Tolstov - -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/pearkes/cloudflare/testutil/http.go b/vendor/github.com/pearkes/cloudflare/testutil/http.go deleted file mode 100644 index e4f8ddb80..000000000 --- a/vendor/github.com/pearkes/cloudflare/testutil/http.go +++ /dev/null @@ -1,174 +0,0 @@ -package testutil - -import ( - "bytes" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "time" -) - -type HTTPServer struct { - URL string - Timeout time.Duration - started bool - request chan *http.Request - response chan ResponseFunc -} - -type Response struct { - Status int - Headers map[string]string - Body string -} - -func NewHTTPServer() *HTTPServer { - return &HTTPServer{URL: "http://localhost:4444", Timeout: 5 * time.Second} -} - -type ResponseFunc func(path string) Response - -func (s *HTTPServer) Start() { - if s.started { - return - } - s.started = true - s.request = make(chan *http.Request, 1024) - s.response = make(chan ResponseFunc, 1024) - u, err := url.Parse(s.URL) - if err != nil { - panic(err) - } - l, err := net.Listen("tcp", u.Host) - if err != nil { - panic(err) - } - go http.Serve(l, s) - - s.Response(203, nil, "") - for { - // Wait for it to be up. - resp, err := http.Get(s.URL) - if err == nil && resp.StatusCode == 203 { - break - } - time.Sleep(1e8) - } - s.WaitRequest() // Consume dummy request. -} - -// Flush discards all pending requests and responses. -func (s *HTTPServer) Flush() { - for { - select { - case <-s.request: - case <-s.response: - default: - return - } - } -} - -func body(req *http.Request) string { - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - return string(data) -} - -func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - req.ParseMultipartForm(1e6) - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - req.Body = ioutil.NopCloser(bytes.NewBuffer(data)) - s.request <- req - var resp Response - select { - case respFunc := <-s.response: - resp = respFunc(req.URL.Path) - case <-time.After(s.Timeout): - const msg = "ERROR: Timeout waiting for test to prepare a response\n" - fmt.Fprintf(os.Stderr, msg) - resp = Response{500, nil, msg} - } - if resp.Headers != nil { - h := w.Header() - for k, v := range resp.Headers { - h.Set(k, v) - } - } - if resp.Status != 0 { - w.WriteHeader(resp.Status) - } - w.Write([]byte(resp.Body)) -} - -// WaitRequests returns the next n requests made to the http server from -// the queue. If not enough requests were previously made, it waits until -// the timeout value for them to be made. -func (s *HTTPServer) WaitRequests(n int) []*http.Request { - reqs := make([]*http.Request, 0, n) - for i := 0; i < n; i++ { - select { - case req := <-s.request: - reqs = append(reqs, req) - case <-time.After(s.Timeout): - panic("Timeout waiting for request") - } - } - return reqs -} - -// WaitRequest returns the next request made to the http server from -// the queue. If no requests were previously made, it waits until the -// timeout value for one to be made. -func (s *HTTPServer) WaitRequest() *http.Request { - return s.WaitRequests(1)[0] -} - -// ResponseFunc prepares the test server to respond the following n -// requests using f to build each response. -func (s *HTTPServer) ResponseFunc(n int, f ResponseFunc) { - for i := 0; i < n; i++ { - s.response <- f - } -} - -// ResponseMap maps request paths to responses. -type ResponseMap map[string]Response - -// ResponseMap prepares the test server to respond the following n -// requests using the m to obtain the responses. -func (s *HTTPServer) ResponseMap(n int, m ResponseMap) { - f := func(path string) Response { - for rpath, resp := range m { - if rpath == path { - return resp - } - } - body := "Path not found in response map: " + path - return Response{Status: 500, Body: body} - } - s.ResponseFunc(n, f) -} - -// Responses prepares the test server to respond the following n requests -// using the provided response parameters. -func (s *HTTPServer) Responses(n int, status int, headers map[string]string, body string) { - f := func(path string) Response { - return Response{status, headers, body} - } - s.ResponseFunc(n, f) -} - -// Response prepares the test server to respond the following request -// using the provided response parameters. -func (s *HTTPServer) Response(status int, headers map[string]string, body string) { - s.Responses(1, status, headers, body) -} diff --git a/vendor/github.com/pearkes/dnsimple/testutil/http.go b/vendor/github.com/pearkes/dnsimple/testutil/http.go deleted file mode 100644 index e4f8ddb80..000000000 --- a/vendor/github.com/pearkes/dnsimple/testutil/http.go +++ /dev/null @@ -1,174 +0,0 @@ -package testutil - -import ( - "bytes" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "time" -) - -type HTTPServer struct { - URL string - Timeout time.Duration - started bool - request chan *http.Request - response chan ResponseFunc -} - -type Response struct { - Status int - Headers map[string]string - Body string -} - -func NewHTTPServer() *HTTPServer { - return &HTTPServer{URL: "http://localhost:4444", Timeout: 5 * time.Second} -} - -type ResponseFunc func(path string) Response - -func (s *HTTPServer) Start() { - if s.started { - return - } - s.started = true - s.request = make(chan *http.Request, 1024) - s.response = make(chan ResponseFunc, 1024) - u, err := url.Parse(s.URL) - if err != nil { - panic(err) - } - l, err := net.Listen("tcp", u.Host) - if err != nil { - panic(err) - } - go http.Serve(l, s) - - s.Response(203, nil, "") - for { - // Wait for it to be up. - resp, err := http.Get(s.URL) - if err == nil && resp.StatusCode == 203 { - break - } - time.Sleep(1e8) - } - s.WaitRequest() // Consume dummy request. -} - -// Flush discards all pending requests and responses. -func (s *HTTPServer) Flush() { - for { - select { - case <-s.request: - case <-s.response: - default: - return - } - } -} - -func body(req *http.Request) string { - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - return string(data) -} - -func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - req.ParseMultipartForm(1e6) - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - req.Body = ioutil.NopCloser(bytes.NewBuffer(data)) - s.request <- req - var resp Response - select { - case respFunc := <-s.response: - resp = respFunc(req.URL.Path) - case <-time.After(s.Timeout): - const msg = "ERROR: Timeout waiting for test to prepare a response\n" - fmt.Fprintf(os.Stderr, msg) - resp = Response{500, nil, msg} - } - if resp.Headers != nil { - h := w.Header() - for k, v := range resp.Headers { - h.Set(k, v) - } - } - if resp.Status != 0 { - w.WriteHeader(resp.Status) - } - w.Write([]byte(resp.Body)) -} - -// WaitRequests returns the next n requests made to the http server from -// the queue. If not enough requests were previously made, it waits until -// the timeout value for them to be made. -func (s *HTTPServer) WaitRequests(n int) []*http.Request { - reqs := make([]*http.Request, 0, n) - for i := 0; i < n; i++ { - select { - case req := <-s.request: - reqs = append(reqs, req) - case <-time.After(s.Timeout): - panic("Timeout waiting for request") - } - } - return reqs -} - -// WaitRequest returns the next request made to the http server from -// the queue. If no requests were previously made, it waits until the -// timeout value for one to be made. -func (s *HTTPServer) WaitRequest() *http.Request { - return s.WaitRequests(1)[0] -} - -// ResponseFunc prepares the test server to respond the following n -// requests using f to build each response. -func (s *HTTPServer) ResponseFunc(n int, f ResponseFunc) { - for i := 0; i < n; i++ { - s.response <- f - } -} - -// ResponseMap maps request paths to responses. -type ResponseMap map[string]Response - -// ResponseMap prepares the test server to respond the following n -// requests using the m to obtain the responses. -func (s *HTTPServer) ResponseMap(n int, m ResponseMap) { - f := func(path string) Response { - for rpath, resp := range m { - if rpath == path { - return resp - } - } - body := "Path not found in response map: " + path - return Response{Status: 500, Body: body} - } - s.ResponseFunc(n, f) -} - -// Responses prepares the test server to respond the following n requests -// using the provided response parameters. -func (s *HTTPServer) Responses(n int, status int, headers map[string]string, body string) { - f := func(path string) Response { - return Response{status, headers, body} - } - s.ResponseFunc(n, f) -} - -// Response prepares the test server to respond the following request -// using the provided response parameters. -func (s *HTTPServer) Response(status int, headers map[string]string, body string) { - s.Responses(1, status, headers, body) -} diff --git a/vendor/github.com/pearkes/mailgun/testutil/http.go b/vendor/github.com/pearkes/mailgun/testutil/http.go deleted file mode 100644 index e4f8ddb80..000000000 --- a/vendor/github.com/pearkes/mailgun/testutil/http.go +++ /dev/null @@ -1,174 +0,0 @@ -package testutil - -import ( - "bytes" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "time" -) - -type HTTPServer struct { - URL string - Timeout time.Duration - started bool - request chan *http.Request - response chan ResponseFunc -} - -type Response struct { - Status int - Headers map[string]string - Body string -} - -func NewHTTPServer() *HTTPServer { - return &HTTPServer{URL: "http://localhost:4444", Timeout: 5 * time.Second} -} - -type ResponseFunc func(path string) Response - -func (s *HTTPServer) Start() { - if s.started { - return - } - s.started = true - s.request = make(chan *http.Request, 1024) - s.response = make(chan ResponseFunc, 1024) - u, err := url.Parse(s.URL) - if err != nil { - panic(err) - } - l, err := net.Listen("tcp", u.Host) - if err != nil { - panic(err) - } - go http.Serve(l, s) - - s.Response(203, nil, "") - for { - // Wait for it to be up. - resp, err := http.Get(s.URL) - if err == nil && resp.StatusCode == 203 { - break - } - time.Sleep(1e8) - } - s.WaitRequest() // Consume dummy request. -} - -// Flush discards all pending requests and responses. -func (s *HTTPServer) Flush() { - for { - select { - case <-s.request: - case <-s.response: - default: - return - } - } -} - -func body(req *http.Request) string { - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - return string(data) -} - -func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - req.ParseMultipartForm(1e6) - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - req.Body = ioutil.NopCloser(bytes.NewBuffer(data)) - s.request <- req - var resp Response - select { - case respFunc := <-s.response: - resp = respFunc(req.URL.Path) - case <-time.After(s.Timeout): - const msg = "ERROR: Timeout waiting for test to prepare a response\n" - fmt.Fprintf(os.Stderr, msg) - resp = Response{500, nil, msg} - } - if resp.Headers != nil { - h := w.Header() - for k, v := range resp.Headers { - h.Set(k, v) - } - } - if resp.Status != 0 { - w.WriteHeader(resp.Status) - } - w.Write([]byte(resp.Body)) -} - -// WaitRequests returns the next n requests made to the http server from -// the queue. If not enough requests were previously made, it waits until -// the timeout value for them to be made. -func (s *HTTPServer) WaitRequests(n int) []*http.Request { - reqs := make([]*http.Request, 0, n) - for i := 0; i < n; i++ { - select { - case req := <-s.request: - reqs = append(reqs, req) - case <-time.After(s.Timeout): - panic("Timeout waiting for request") - } - } - return reqs -} - -// WaitRequest returns the next request made to the http server from -// the queue. If no requests were previously made, it waits until the -// timeout value for one to be made. -func (s *HTTPServer) WaitRequest() *http.Request { - return s.WaitRequests(1)[0] -} - -// ResponseFunc prepares the test server to respond the following n -// requests using f to build each response. -func (s *HTTPServer) ResponseFunc(n int, f ResponseFunc) { - for i := 0; i < n; i++ { - s.response <- f - } -} - -// ResponseMap maps request paths to responses. -type ResponseMap map[string]Response - -// ResponseMap prepares the test server to respond the following n -// requests using the m to obtain the responses. -func (s *HTTPServer) ResponseMap(n int, m ResponseMap) { - f := func(path string) Response { - for rpath, resp := range m { - if rpath == path { - return resp - } - } - body := "Path not found in response map: " + path - return Response{Status: 500, Body: body} - } - s.ResponseFunc(n, f) -} - -// Responses prepares the test server to respond the following n requests -// using the provided response parameters. -func (s *HTTPServer) Responses(n int, status int, headers map[string]string, body string) { - f := func(path string) Response { - return Response{status, headers, body} - } - s.ResponseFunc(n, f) -} - -// Response prepares the test server to respond the following request -// using the provided response parameters. -func (s *HTTPServer) Response(status int, headers map[string]string, body string) { - s.Responses(1, status, headers, body) -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/README.md b/vendor/github.com/rackspace/gophercloud/acceptance/README.md deleted file mode 100644 index 3199837c2..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Gophercloud Acceptance tests - -The purpose of these acceptance tests is to validate that SDK features meet -the requirements of a contract - to consumers, other parts of the library, and -to a remote API. - -> **Note:** Because every test will be run against a real API endpoint, you -> may incur bandwidth and service charges for all the resource usage. These -> tests *should* remove their remote products automatically. However, there may -> be certain cases where this does not happen; always double-check to make sure -> you have no stragglers left behind. - -### Step 1. Set environment variables - -A lot of tests rely on environment variables for configuration - so you will need -to set them before running the suite. If you're testing against pure OpenStack APIs, -you can download a file that contains all of these variables for you: just visit -the `project/access_and_security` page in your control panel and click the "Download -OpenStack RC File" button at the top right. For all other providers, you will need -to set them manually. - -#### Authentication - -|Name|Description| -|---|---| -|`OS_USERNAME`|Your API username| -|`OS_PASSWORD`|Your API password| -|`OS_AUTH_URL`|The identity URL you need to authenticate| -|`OS_TENANT_NAME`|Your API tenant name| -|`OS_TENANT_ID`|Your API tenant ID| -|`RS_USERNAME`|Your Rackspace username| -|`RS_API_KEY`|Your Rackspace API key| - -#### General - -|Name|Description| -|---|---| -|`OS_REGION_NAME`|The region you want your resources to reside in| -|`RS_REGION`|Rackspace region you want your resource to reside in| - -#### Compute - -|Name|Description| -|---|---| -|`OS_IMAGE_ID`|The ID of the image your want your server to be based on| -|`OS_FLAVOR_ID`|The ID of the flavor you want your server to be based on| -|`OS_FLAVOR_ID_RESIZE`|The ID of the flavor you want your server to be resized to| -|`RS_IMAGE_ID`|The ID of the image you want servers to be created with| -|`RS_FLAVOR_ID`|The ID of the flavor you want your server to be created with| - -### 2. Run the test suite - -From the root directory, run: - -``` -./script/acceptancetest -``` diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/pkg.go deleted file mode 100644 index bb158c3ee..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/pkg.go +++ /dev/null @@ -1,3 +0,0 @@ -// The v2 package contains acceptance tests for the Openstack Compute V2 service. - -package v2 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/db/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/db/v1/common.go deleted file mode 100644 index f7ffc37b2..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/db/v1/common.go +++ /dev/null @@ -1,70 +0,0 @@ -// +build acceptance db - -package v1 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" - "github.com/rackspace/gophercloud/openstack/db/v1/instances" - th "github.com/rackspace/gophercloud/testhelper" -) - -func newClient(t *testing.T) *gophercloud.ServiceClient { - ao, err := openstack.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - - client, err := openstack.AuthenticatedClient(ao) - th.AssertNoErr(t, err) - - c, err := openstack.NewDBV1(client, gophercloud.EndpointOpts{ - Region: os.Getenv("OS_REGION_NAME"), - }) - th.AssertNoErr(t, err) - - return c -} - -type context struct { - test *testing.T - client *gophercloud.ServiceClient - instanceID string - DBIDs []string - users []string -} - -func newContext(t *testing.T) context { - return context{ - test: t, - client: newClient(t), - } -} - -func (c context) Logf(msg string, args ...interface{}) { - if len(args) > 0 { - c.test.Logf(msg, args...) - } else { - c.test.Log(msg) - } -} - -func (c context) AssertNoErr(err error) { - th.AssertNoErr(c.test, err) -} - -func (c context) WaitUntilActive(id string) { - err := gophercloud.WaitFor(60, func() (bool, error) { - inst, err := instances.Get(c.client, id).Extract() - if err != nil { - return false, err - } - if inst.Status == "ACTIVE" { - return true, nil - } - return false, nil - }) - - c.AssertNoErr(err) -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/db/v1/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/db/v1/pkg.go deleted file mode 100644 index b7b1f993d..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/db/v1/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v1 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/identity/v2/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/identity/v2/pkg.go deleted file mode 100644 index 5ec3cc8e8..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/identity/v2/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v2 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/identity/v3/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/identity/v3/pkg.go deleted file mode 100644 index eac3ae96a..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/identity/v3/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v3 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/common.go deleted file mode 100644 index 1efac2c08..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/common.go +++ /dev/null @@ -1,39 +0,0 @@ -package v2 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" - th "github.com/rackspace/gophercloud/testhelper" -) - -var Client *gophercloud.ServiceClient - -func NewClient() (*gophercloud.ServiceClient, error) { - opts, err := openstack.AuthOptionsFromEnv() - if err != nil { - return nil, err - } - - provider, err := openstack.AuthenticatedClient(opts) - if err != nil { - return nil, err - } - - return openstack.NewNetworkV2(provider, gophercloud.EndpointOpts{ - Name: "neutron", - Region: os.Getenv("OS_REGION_NAME"), - }) -} - -func Setup(t *testing.T) { - client, err := NewClient() - th.AssertNoErr(t, err) - Client = client -} - -func Teardown() { - Client = nil -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/fwaas/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/fwaas/pkg.go deleted file mode 100644 index 206bf3313..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/fwaas/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package fwaas diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/lbaas/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/lbaas/common.go deleted file mode 100644 index 27dfe5f8b..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/lbaas/common.go +++ /dev/null @@ -1,78 +0,0 @@ -package lbaas - -import ( - "testing" - - base "github.com/rackspace/gophercloud/acceptance/openstack/networking/v2" - "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/monitors" - "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools" - "github.com/rackspace/gophercloud/openstack/networking/v2/networks" - "github.com/rackspace/gophercloud/openstack/networking/v2/subnets" - th "github.com/rackspace/gophercloud/testhelper" -) - -func SetupTopology(t *testing.T) (string, string) { - // create network - n, err := networks.Create(base.Client, networks.CreateOpts{Name: "tmp_network"}).Extract() - th.AssertNoErr(t, err) - - t.Logf("Created network %s", n.ID) - - // create subnet - s, err := subnets.Create(base.Client, subnets.CreateOpts{ - NetworkID: n.ID, - CIDR: "192.168.199.0/24", - IPVersion: subnets.IPv4, - Name: "tmp_subnet", - }).Extract() - th.AssertNoErr(t, err) - - t.Logf("Created subnet %s", s.ID) - - return n.ID, s.ID -} - -func DeleteTopology(t *testing.T, networkID string) { - res := networks.Delete(base.Client, networkID) - th.AssertNoErr(t, res.Err) - t.Logf("Deleted network %s", networkID) -} - -func CreatePool(t *testing.T, subnetID string) string { - p, err := pools.Create(base.Client, pools.CreateOpts{ - LBMethod: pools.LBMethodRoundRobin, - Protocol: "HTTP", - Name: "tmp_pool", - SubnetID: subnetID, - }).Extract() - - th.AssertNoErr(t, err) - - t.Logf("Created pool %s", p.ID) - - return p.ID -} - -func DeletePool(t *testing.T, poolID string) { - res := pools.Delete(base.Client, poolID) - th.AssertNoErr(t, res.Err) - t.Logf("Deleted pool %s", poolID) -} - -func CreateMonitor(t *testing.T) string { - m, err := monitors.Create(base.Client, monitors.CreateOpts{ - Delay: 10, - Timeout: 10, - MaxRetries: 3, - Type: monitors.TypeHTTP, - ExpectedCodes: "200", - URLPath: "/login", - HTTPMethod: "GET", - }).Extract() - - th.AssertNoErr(t, err) - - t.Logf("Created monitor ID [%s]", m.ID) - - return m.ID -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/lbaas/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/lbaas/pkg.go deleted file mode 100644 index f5a7df7b7..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/lbaas/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package lbaas diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/pkg.go deleted file mode 100644 index aeec0fa75..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/extensions/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package extensions diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/pkg.go deleted file mode 100644 index 5ec3cc8e8..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/networking/v2/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v2 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/objectstorage/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/objectstorage/v1/common.go deleted file mode 100644 index 1eac681b5..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/objectstorage/v1/common.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build acceptance - -package v1 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" - th "github.com/rackspace/gophercloud/testhelper" -) - -var metadata = map[string]string{"gopher": "cloud"} - -func newClient(t *testing.T) *gophercloud.ServiceClient { - ao, err := openstack.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - - client, err := openstack.AuthenticatedClient(ao) - th.AssertNoErr(t, err) - - c, err := openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{ - Region: os.Getenv("OS_REGION_NAME"), - }) - th.AssertNoErr(t, err) - return c -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/orchestration/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/orchestration/v1/common.go deleted file mode 100644 index 2c28dcbcc..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/orchestration/v1/common.go +++ /dev/null @@ -1,44 +0,0 @@ -// +build acceptance - -package v1 - -import ( - "fmt" - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" - th "github.com/rackspace/gophercloud/testhelper" -) - -var template = fmt.Sprintf(` -{ - "heat_template_version": "2013-05-23", - "description": "Simple template to test heat commands", - "parameters": {}, - "resources": { - "hello_world": { - "type":"OS::Nova::Server", - "properties": { - "flavor": "%s", - "image": "%s", - "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n" - } - } - } -}`, os.Getenv("OS_FLAVOR_ID"), os.Getenv("OS_IMAGE_ID")) - -func newClient(t *testing.T) *gophercloud.ServiceClient { - ao, err := openstack.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - - client, err := openstack.AuthenticatedClient(ao) - th.AssertNoErr(t, err) - - c, err := openstack.NewOrchestrationV1(client, gophercloud.EndpointOpts{ - Region: os.Getenv("OS_REGION_NAME"), - }) - th.AssertNoErr(t, err) - return c -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/orchestration/v1/hello-compute.json b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/orchestration/v1/hello-compute.json deleted file mode 100644 index 11cfc8053..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/orchestration/v1/hello-compute.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "heat_template_version": "2013-05-23", - "resources": { - "compute_instance": { - "type": "OS::Nova::Server", - "properties": { - "flavor": "m1.small", - "image": "cirros-0.3.2-x86_64-disk", - "name": "Single Compute Instance" - } - } - } -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/pkg.go deleted file mode 100644 index 3a8ecdb10..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/pkg.go +++ /dev/null @@ -1,4 +0,0 @@ -// +build acceptance - -package openstack - diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/blockstorage/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/blockstorage/v1/common.go deleted file mode 100644 index e9fdd9920..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/blockstorage/v1/common.go +++ /dev/null @@ -1,38 +0,0 @@ -// +build acceptance - -package v1 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/acceptance/tools" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -func newClient() (*gophercloud.ServiceClient, error) { - opts, err := rackspace.AuthOptionsFromEnv() - if err != nil { - return nil, err - } - opts = tools.OnlyRS(opts) - region := os.Getenv("RS_REGION") - - provider, err := rackspace.AuthenticatedClient(opts) - if err != nil { - return nil, err - } - - return rackspace.NewBlockStorageV1(provider, gophercloud.EndpointOpts{ - Region: region, - }) -} - -func setup(t *testing.T) *gophercloud.ServiceClient { - client, err := newClient() - th.AssertNoErr(t, err) - - return client -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/cdn/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/cdn/v1/common.go deleted file mode 100644 index 2333ca77b..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/cdn/v1/common.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build acceptance - -package v1 - -import ( - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -func newClient(t *testing.T) *gophercloud.ServiceClient { - ao, err := rackspace.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - - client, err := rackspace.AuthenticatedClient(ao) - th.AssertNoErr(t, err) - - c, err := rackspace.NewCDNV1(client, gophercloud.EndpointOpts{}) - th.AssertNoErr(t, err) - return c -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/compute/v2/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/compute/v2/pkg.go deleted file mode 100644 index 5ec3cc8e8..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/compute/v2/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v2 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/db/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/db/v1/common.go deleted file mode 100644 index 24512b99a..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/db/v1/common.go +++ /dev/null @@ -1,73 +0,0 @@ -// +build acceptance db rackspace - -package v1 - -import ( - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/acceptance/tools" - "github.com/rackspace/gophercloud/rackspace" - "github.com/rackspace/gophercloud/rackspace/db/v1/instances" - th "github.com/rackspace/gophercloud/testhelper" -) - -func newClient(t *testing.T) *gophercloud.ServiceClient { - opts, err := rackspace.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - opts = tools.OnlyRS(opts) - - client, err := rackspace.AuthenticatedClient(opts) - th.AssertNoErr(t, err) - - c, err := rackspace.NewDBV1(client, gophercloud.EndpointOpts{ - Region: "IAD", - }) - th.AssertNoErr(t, err) - - return c -} - -type context struct { - test *testing.T - client *gophercloud.ServiceClient - instanceID string - DBIDs []string - replicaID string - backupID string - configGroupID string - users []string -} - -func newContext(t *testing.T) context { - return context{ - test: t, - client: newClient(t), - } -} - -func (c context) Logf(msg string, args ...interface{}) { - if len(args) > 0 { - c.test.Logf(msg, args...) - } else { - c.test.Log(msg) - } -} - -func (c context) AssertNoErr(err error) { - th.AssertNoErr(c.test, err) -} - -func (c context) WaitUntilActive(id string) { - err := gophercloud.WaitFor(60, func() (bool, error) { - inst, err := instances.Get(c.client, id).Extract() - if err != nil { - return false, err - } - if inst.Status == "ACTIVE" { - return true, nil - } - return false, nil - }) - c.AssertNoErr(err) -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/db/v1/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/db/v1/pkg.go deleted file mode 100644 index b7b1f993d..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/db/v1/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v1 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/identity/v2/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/identity/v2/pkg.go deleted file mode 100644 index 5ec3cc8e8..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/identity/v2/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package v2 diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/lb/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/lb/v1/common.go deleted file mode 100644 index 4ce05e69c..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/lb/v1/common.go +++ /dev/null @@ -1,62 +0,0 @@ -// +build acceptance lbs - -package v1 - -import ( - "os" - "strconv" - "strings" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/acceptance/tools" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -func newProvider() (*gophercloud.ProviderClient, error) { - opts, err := rackspace.AuthOptionsFromEnv() - if err != nil { - return nil, err - } - opts = tools.OnlyRS(opts) - - return rackspace.AuthenticatedClient(opts) -} - -func newClient() (*gophercloud.ServiceClient, error) { - provider, err := newProvider() - if err != nil { - return nil, err - } - - return rackspace.NewLBV1(provider, gophercloud.EndpointOpts{ - Region: os.Getenv("RS_REGION"), - }) -} - -func newComputeClient() (*gophercloud.ServiceClient, error) { - provider, err := newProvider() - if err != nil { - return nil, err - } - - return rackspace.NewComputeV2(provider, gophercloud.EndpointOpts{ - Region: os.Getenv("RS_REGION"), - }) -} - -func setup(t *testing.T) *gophercloud.ServiceClient { - client, err := newClient() - th.AssertNoErr(t, err) - - return client -} - -func intsToStr(ids []int) string { - strIDs := []string{} - for _, id := range ids { - strIDs = append(strIDs, strconv.Itoa(id)) - } - return strings.Join(strIDs, ", ") -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/networking/v2/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/networking/v2/common.go deleted file mode 100644 index 81704187f..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/networking/v2/common.go +++ /dev/null @@ -1,39 +0,0 @@ -package v2 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -var Client *gophercloud.ServiceClient - -func NewClient() (*gophercloud.ServiceClient, error) { - opts, err := rackspace.AuthOptionsFromEnv() - if err != nil { - return nil, err - } - - provider, err := rackspace.AuthenticatedClient(opts) - if err != nil { - return nil, err - } - - return rackspace.NewNetworkV2(provider, gophercloud.EndpointOpts{ - Name: "cloudNetworks", - Region: os.Getenv("RS_REGION"), - }) -} - -func Setup(t *testing.T) { - client, err := NewClient() - th.AssertNoErr(t, err) - Client = client -} - -func Teardown() { - Client = nil -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/objectstorage/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/objectstorage/v1/common.go deleted file mode 100644 index 1ae07278c..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/objectstorage/v1/common.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build acceptance rackspace objectstorage v1 - -package v1 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/acceptance/tools" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -func rackspaceAuthOptions(t *testing.T) gophercloud.AuthOptions { - // Obtain credentials from the environment. - options, err := rackspace.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - options = tools.OnlyRS(options) - - if options.Username == "" { - t.Fatal("Please provide a Rackspace username as RS_USERNAME.") - } - if options.APIKey == "" { - t.Fatal("Please provide a Rackspace API key as RS_API_KEY.") - } - - return options -} - -func createClient(t *testing.T, cdn bool) (*gophercloud.ServiceClient, error) { - region := os.Getenv("RS_REGION") - if region == "" { - t.Fatal("Please provide a Rackspace region as RS_REGION") - } - - ao := rackspaceAuthOptions(t) - - provider, err := rackspace.NewClient(ao.IdentityEndpoint) - th.AssertNoErr(t, err) - - err = rackspace.Authenticate(provider, ao) - th.AssertNoErr(t, err) - - if cdn { - return rackspace.NewObjectCDNV1(provider, gophercloud.EndpointOpts{ - Region: region, - }) - } - - return rackspace.NewObjectStorageV1(provider, gophercloud.EndpointOpts{ - Region: region, - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/orchestration/v1/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/orchestration/v1/common.go deleted file mode 100644 index b9d51979d..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/orchestration/v1/common.go +++ /dev/null @@ -1,45 +0,0 @@ -// +build acceptance - -package v1 - -import ( - "fmt" - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -var template = fmt.Sprintf(` -{ - "heat_template_version": "2013-05-23", - "description": "Simple template to test heat commands", - "parameters": {}, - "resources": { - "hello_world": { - "type":"OS::Nova::Server", - "properties": { - "flavor": "%s", - "image": "%s", - "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n" - } - } - } -} -`, os.Getenv("RS_FLAVOR_ID"), os.Getenv("RS_IMAGE_ID")) - -func newClient(t *testing.T) *gophercloud.ServiceClient { - ao, err := rackspace.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - - client, err := rackspace.AuthenticatedClient(ao) - th.AssertNoErr(t, err) - - c, err := rackspace.NewOrchestrationV1(client, gophercloud.EndpointOpts{ - Region: os.Getenv("RS_REGION_NAME"), - }) - th.AssertNoErr(t, err) - return c -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/pkg.go deleted file mode 100644 index 5d17b32ca..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package rackspace diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/rackconnect/v3/common.go b/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/rackconnect/v3/common.go deleted file mode 100644 index 8c7531417..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/rackspace/rackconnect/v3/common.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build acceptance - -package v3 - -import ( - "os" - "testing" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/rackspace" - th "github.com/rackspace/gophercloud/testhelper" -) - -func newClient(t *testing.T) *gophercloud.ServiceClient { - ao, err := rackspace.AuthOptionsFromEnv() - th.AssertNoErr(t, err) - - client, err := rackspace.AuthenticatedClient(ao) - th.AssertNoErr(t, err) - - c, err := rackspace.NewRackConnectV3(client, gophercloud.EndpointOpts{ - Region: os.Getenv("RS_REGION_NAME"), - }) - th.AssertNoErr(t, err) - return c -} diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/tools/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/tools/pkg.go deleted file mode 100644 index f7eca1298..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/tools/pkg.go +++ /dev/null @@ -1 +0,0 @@ -package tools diff --git a/vendor/github.com/rackspace/gophercloud/acceptance/tools/tools.go b/vendor/github.com/rackspace/gophercloud/acceptance/tools/tools.go deleted file mode 100644 index 35679b728..000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/tools/tools.go +++ /dev/null @@ -1,89 +0,0 @@ -// +build acceptance common - -package tools - -import ( - "crypto/rand" - "errors" - mrand "math/rand" - "os" - "time" - - "github.com/rackspace/gophercloud" -) - -// ErrTimeout is returned if WaitFor takes longer than 300 second to happen. -var ErrTimeout = errors.New("Timed out") - -// OnlyRS overrides the default Gophercloud behavior of using OS_-prefixed environment variables -// if RS_ variables aren't present. Otherwise, they'll stomp over each other here in the acceptance -// tests, where you need to have both defined. -func OnlyRS(original gophercloud.AuthOptions) gophercloud.AuthOptions { - if os.Getenv("RS_AUTH_URL") == "" { - original.IdentityEndpoint = "" - } - if os.Getenv("RS_USERNAME") == "" { - original.Username = "" - } - if os.Getenv("RS_PASSWORD") == "" { - original.Password = "" - } - if os.Getenv("RS_API_KEY") == "" { - original.APIKey = "" - } - return original -} - -// WaitFor polls a predicate function once per second to wait for a certain state to arrive. -func WaitFor(predicate func() (bool, error)) error { - for i := 0; i < 300; i++ { - time.Sleep(1 * time.Second) - - satisfied, err := predicate() - if err != nil { - return err - } - if satisfied { - return nil - } - } - return ErrTimeout -} - -// MakeNewPassword generates a new string that's guaranteed to be different than the given one. -func MakeNewPassword(oldPass string) string { - randomPassword := RandomString("", 16) - for randomPassword == oldPass { - randomPassword = RandomString("", 16) - } - return randomPassword -} - -// RandomString generates a string of given length, but random content. -// All content will be within the ASCII graphic character set. -// (Implementation from Even Shaw's contribution on -// http://stackoverflow.com/questions/12771930/what-is-the-fastest-way-to-generate-a-long-random-string-in-go). -func RandomString(prefix string, n int) string { - const alphanum = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - var bytes = make([]byte, n) - rand.Read(bytes) - for i, b := range bytes { - bytes[i] = alphanum[b%byte(len(alphanum))] - } - return prefix + string(bytes) -} - -// RandomInt will return a random integer between a specified range. -func RandomInt(min, max int) int { - mrand.Seed(time.Now().Unix()) - return mrand.Intn(max-min) + min -} - -// Elide returns the first bit of its input string with a suffix of "..." if it's longer than -// a comfortable 40 characters. -func Elide(value string) string { - if len(value) > 40 { - return value[0:37] + "..." - } - return value -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/doc.go deleted file mode 100644 index e3af39f51..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package apiversions provides information and interaction with the different -// API versions for the OpenStack Block Storage service, code-named Cinder. -package apiversions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/requests.go deleted file mode 100644 index bb2c25915..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/requests.go +++ /dev/null @@ -1,21 +0,0 @@ -package apiversions - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List lists all the Cinder API versions available to end-users. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(c, listURL(c), func(r pagination.PageResult) pagination.Page { - return APIVersionPage{pagination.SinglePageBase(r)} - }) -} - -// Get will retrieve the volume type with the provided ID. To extract the volume -// type from the result, call the Extract method on the GetResult. -func Get(client *gophercloud.ServiceClient, v string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, v), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/results.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/results.go deleted file mode 100644 index 7b0df115b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/results.go +++ /dev/null @@ -1,58 +0,0 @@ -package apiversions - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// APIVersion represents an API version for Cinder. -type APIVersion struct { - ID string `json:"id" mapstructure:"id"` // unique identifier - Status string `json:"status" mapstructure:"status"` // current status - Updated string `json:"updated" mapstructure:"updated"` // date last updated -} - -// APIVersionPage is the page returned by a pager when traversing over a -// collection of API versions. -type APIVersionPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an APIVersionPage struct is empty. -func (r APIVersionPage) IsEmpty() (bool, error) { - is, err := ExtractAPIVersions(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractAPIVersions takes a collection page, extracts all of the elements, -// and returns them a slice of APIVersion structs. It is effectively a cast. -func ExtractAPIVersions(page pagination.Page) ([]APIVersion, error) { - var resp struct { - Versions []APIVersion `mapstructure:"versions"` - } - - err := mapstructure.Decode(page.(APIVersionPage).Body, &resp) - - return resp.Versions, err -} - -// GetResult represents the result of a get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts an API version resource. -func (r GetResult) Extract() (*APIVersion, error) { - var resp struct { - Version *APIVersion `mapstructure:"version"` - } - - err := mapstructure.Decode(r.Body, &resp) - - return resp.Version, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/urls.go deleted file mode 100644 index 56f8260a2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/urls.go +++ /dev/null @@ -1,15 +0,0 @@ -package apiversions - -import ( - "strings" - - "github.com/rackspace/gophercloud" -) - -func getURL(c *gophercloud.ServiceClient, version string) string { - return c.ServiceURL(strings.TrimRight(version, "/") + "/") -} - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/doc.go deleted file mode 100644 index 198f83077..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package snapshots provides information and interaction with snapshots in the -// OpenStack Block Storage service. A snapshot is a point in time copy of the -// data contained in an external storage volume, and can be controlled -// programmatically. -package snapshots diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/fixtures.go deleted file mode 100644 index d1461fb69..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/fixtures.go +++ /dev/null @@ -1,114 +0,0 @@ -package snapshots - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func MockListResponse(t *testing.T) { - th.Mux.HandleFunc("/snapshots", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` - { - "snapshots": [ - { - "id": "289da7f8-6440-407c-9fb4-7db01ec49164", - "display_name": "snapshot-001" - }, - { - "id": "96c3bda7-c82a-4f50-be73-ca7621794835", - "display_name": "snapshot-002" - } - ] - } - `) - }) -} - -func MockGetResponse(t *testing.T) { - th.Mux.HandleFunc("/snapshots/d32019d3-bc6e-4319-9c1d-6722fc136a22", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` -{ - "snapshot": { - "display_name": "snapshot-001", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22" - } -} - `) - }) -} - -func MockCreateResponse(t *testing.T) { - th.Mux.HandleFunc("/snapshots", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Content-Type", "application/json") - th.TestHeader(t, r, "Accept", "application/json") - th.TestJSONRequest(t, r, ` -{ - "snapshot": { - "volume_id": "1234", - "display_name": "snapshot-001" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusCreated) - - fmt.Fprintf(w, ` -{ - "snapshot": { - "volume_id": "1234", - "display_name": "snapshot-001", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22" - } -} - `) - }) -} - -func MockUpdateMetadataResponse(t *testing.T) { - th.Mux.HandleFunc("/snapshots/123/metadata", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Content-Type", "application/json") - th.TestJSONRequest(t, r, ` - { - "metadata": { - "key": "v1" - } - } - `) - - fmt.Fprintf(w, ` - { - "metadata": { - "key": "v1" - } - } - `) - }) -} - -func MockDeleteResponse(t *testing.T) { - th.Mux.HandleFunc("/snapshots/d32019d3-bc6e-4319-9c1d-6722fc136a22", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go deleted file mode 100644 index 71936e51b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go +++ /dev/null @@ -1,206 +0,0 @@ -package snapshots - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToSnapshotCreateMap() (map[string]interface{}, error) -} - -// CreateOpts contains options for creating a Snapshot. This object is passed to -// the snapshots.Create function. For more information about these parameters, -// see the Snapshot object. -type CreateOpts struct { - // OPTIONAL - Description string - // OPTIONAL - Force bool - // OPTIONAL - Metadata map[string]interface{} - // OPTIONAL - Name string - // REQUIRED - VolumeID string -} - -// ToSnapshotCreateMap assembles a request body based on the contents of a -// CreateOpts. -func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.VolumeID == "" { - return nil, fmt.Errorf("Required CreateOpts field 'VolumeID' not set.") - } - s["volume_id"] = opts.VolumeID - - if opts.Description != "" { - s["display_description"] = opts.Description - } - if opts.Force == true { - s["force"] = opts.Force - } - if opts.Metadata != nil { - s["metadata"] = opts.Metadata - } - if opts.Name != "" { - s["display_name"] = opts.Name - } - - return map[string]interface{}{"snapshot": s}, nil -} - -// Create will create a new Snapshot based on the values in CreateOpts. To -// extract the Snapshot object from the response, call the Extract method on the -// CreateResult. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToSnapshotCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(createURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - return res -} - -// Delete will delete the existing Snapshot with the provided ID. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(deleteURL(client, id), nil) - return res -} - -// Get retrieves the Snapshot with the provided ID. To extract the Snapshot -// object from the response, call the Extract method on the GetResult. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, id), &res.Body, nil) - return res -} - -// ListOptsBuilder allows extensions to add additional parameters to the List -// request. -type ListOptsBuilder interface { - ToSnapshotListQuery() (string, error) -} - -// ListOpts hold options for listing Snapshots. It is passed to the -// snapshots.List function. -type ListOpts struct { - Name string `q:"display_name"` - Status string `q:"status"` - VolumeID string `q:"volume_id"` -} - -// ToSnapshotListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToSnapshotListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List returns Snapshots optionally limited by the conditions provided in -// ListOpts. -func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := listURL(client) - if opts != nil { - query, err := opts.ToSnapshotListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPage := func(r pagination.PageResult) pagination.Page { - return ListResult{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, url, createPage) -} - -// UpdateMetadataOptsBuilder allows extensions to add additional parameters to -// the Update request. -type UpdateMetadataOptsBuilder interface { - ToSnapshotUpdateMetadataMap() (map[string]interface{}, error) -} - -// UpdateMetadataOpts contain options for updating an existing Snapshot. This -// object is passed to the snapshots.Update function. For more information -// about the parameters, see the Snapshot object. -type UpdateMetadataOpts struct { - Metadata map[string]interface{} -} - -// ToSnapshotUpdateMetadataMap assembles a request body based on the contents of -// an UpdateMetadataOpts. -func (opts UpdateMetadataOpts) ToSnapshotUpdateMetadataMap() (map[string]interface{}, error) { - v := make(map[string]interface{}) - - if opts.Metadata != nil { - v["metadata"] = opts.Metadata - } - - return v, nil -} - -// UpdateMetadata will update the Snapshot with provided information. To -// extract the updated Snapshot from the response, call the ExtractMetadata -// method on the UpdateMetadataResult. -func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) UpdateMetadataResult { - var res UpdateMetadataResult - - reqBody, err := opts.ToSnapshotUpdateMetadataMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Put(updateMetadataURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// IDFromName is a convienience function that returns a snapshot's ID given its name. -func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { - snapshotCount := 0 - snapshotID := "" - if name == "" { - return "", fmt.Errorf("A snapshot name must be provided.") - } - pager := List(client, nil) - pager.EachPage(func(page pagination.Page) (bool, error) { - snapshotList, err := ExtractSnapshots(page) - if err != nil { - return false, err - } - - for _, s := range snapshotList { - if s.Name == name { - snapshotCount++ - snapshotID = s.ID - } - } - return true, nil - }) - - switch snapshotCount { - case 0: - return "", fmt.Errorf("Unable to find snapshot: %s", name) - case 1: - return snapshotID, nil - default: - return "", fmt.Errorf("Found %d snapshots matching %s", snapshotCount, name) - } -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/results.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/results.go deleted file mode 100644 index e595798e4..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/results.go +++ /dev/null @@ -1,123 +0,0 @@ -package snapshots - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// Snapshot contains all the information associated with an OpenStack Snapshot. -type Snapshot struct { - // Currect status of the Snapshot. - Status string `mapstructure:"status"` - - // Display name. - Name string `mapstructure:"display_name"` - - // Instances onto which the Snapshot is attached. - Attachments []string `mapstructure:"attachments"` - - // Logical group. - AvailabilityZone string `mapstructure:"availability_zone"` - - // Is the Snapshot bootable? - Bootable string `mapstructure:"bootable"` - - // Date created. - CreatedAt string `mapstructure:"created_at"` - - // Display description. - Description string `mapstructure:"display_discription"` - - // See VolumeType object for more information. - VolumeType string `mapstructure:"volume_type"` - - // ID of the Snapshot from which this Snapshot was created. - SnapshotID string `mapstructure:"snapshot_id"` - - // ID of the Volume from which this Snapshot was created. - VolumeID string `mapstructure:"volume_id"` - - // User-defined key-value pairs. - Metadata map[string]string `mapstructure:"metadata"` - - // Unique identifier. - ID string `mapstructure:"id"` - - // Size of the Snapshot, in GB. - Size int `mapstructure:"size"` -} - -// CreateResult contains the response body and error from a Create request. -type CreateResult struct { - commonResult -} - -// GetResult contains the response body and error from a Get request. -type GetResult struct { - commonResult -} - -// DeleteResult contains the response body and error from a Delete request. -type DeleteResult struct { - gophercloud.ErrResult -} - -// ListResult is a pagination.Pager that is returned from a call to the List function. -type ListResult struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a ListResult contains no Snapshots. -func (r ListResult) IsEmpty() (bool, error) { - volumes, err := ExtractSnapshots(r) - if err != nil { - return true, err - } - return len(volumes) == 0, nil -} - -// ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call. -func ExtractSnapshots(page pagination.Page) ([]Snapshot, error) { - var response struct { - Snapshots []Snapshot `json:"snapshots"` - } - - err := mapstructure.Decode(page.(ListResult).Body, &response) - return response.Snapshots, err -} - -// UpdateMetadataResult contains the response body and error from an UpdateMetadata request. -type UpdateMetadataResult struct { - commonResult -} - -// ExtractMetadata returns the metadata from a response from snapshots.UpdateMetadata. -func (r UpdateMetadataResult) ExtractMetadata() (map[string]interface{}, error) { - if r.Err != nil { - return nil, r.Err - } - - m := r.Body.(map[string]interface{})["metadata"] - return m.(map[string]interface{}), nil -} - -type commonResult struct { - gophercloud.Result -} - -// Extract will get the Snapshot object out of the commonResult object. -func (r commonResult) Extract() (*Snapshot, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Snapshot *Snapshot `json:"snapshot"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Snapshot, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/urls.go deleted file mode 100644 index 4d635e8dd..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/urls.go +++ /dev/null @@ -1,27 +0,0 @@ -package snapshots - -import "github.com/rackspace/gophercloud" - -func createURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("snapshots") -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("snapshots", id) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return deleteURL(c, id) -} - -func listURL(c *gophercloud.ServiceClient) string { - return createURL(c) -} - -func metadataURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("snapshots", id, "metadata") -} - -func updateMetadataURL(c *gophercloud.ServiceClient, id string) string { - return metadataURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/util.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/util.go deleted file mode 100644 index 64cdc607e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/util.go +++ /dev/null @@ -1,22 +0,0 @@ -package snapshots - -import ( - "github.com/rackspace/gophercloud" -) - -// WaitForStatus will continually poll the resource, checking for a particular -// status. It will do this for the amount of seconds defined. -func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error { - return gophercloud.WaitFor(secs, func() (bool, error) { - current, err := Get(c, id).Extract() - if err != nil { - return false, err - } - - if current.Status == status { - return true, nil - } - - return false, nil - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/doc.go deleted file mode 100644 index 2f66ba5e4..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -/* -This is package created is to hold fixtures (which imports testing), -so that importing volumes package does not inadvertently import testing into production code -More information here: -https://github.com/rackspace/gophercloud/issues/473 -*/ -package testing diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/fixtures.go deleted file mode 100644 index 3df7653f7..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/fixtures.go +++ /dev/null @@ -1,113 +0,0 @@ -package testing - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func MockListResponse(t *testing.T) { - th.Mux.HandleFunc("/volumes", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` - { - "volumes": [ - { - "id": "289da7f8-6440-407c-9fb4-7db01ec49164", - "display_name": "vol-001" - }, - { - "id": "96c3bda7-c82a-4f50-be73-ca7621794835", - "display_name": "vol-002" - } - ] - } - `) - }) -} - -func MockGetResponse(t *testing.T) { - th.Mux.HandleFunc("/volumes/d32019d3-bc6e-4319-9c1d-6722fc136a22", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` -{ - "volume": { - "display_name": "vol-001", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "attachments": [ - { - "device": "/dev/vde", - "server_id": "a740d24b-dc5b-4d59-ac75-53971c2920ba", - "id": "d6da11e5-2ed3-413e-88d8-b772ba62193d", - "volume_id": "d6da11e5-2ed3-413e-88d8-b772ba62193d" - } - ] - } -} - `) - }) -} - -func MockCreateResponse(t *testing.T) { - th.Mux.HandleFunc("/volumes", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Content-Type", "application/json") - th.TestHeader(t, r, "Accept", "application/json") - th.TestJSONRequest(t, r, ` -{ - "volume": { - "size": 75 - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusCreated) - - fmt.Fprintf(w, ` -{ - "volume": { - "size": 4, - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22" - } -} - `) - }) -} - -func MockDeleteResponse(t *testing.T) { - th.Mux.HandleFunc("/volumes/d32019d3-bc6e-4319-9c1d-6722fc136a22", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} - -func MockUpdateResponse(t *testing.T) { - th.Mux.HandleFunc("/volumes/d32019d3-bc6e-4319-9c1d-6722fc136a22", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` - { - "volume": { - "display_name": "vol-002", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22" - } - } - `) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/doc.go deleted file mode 100644 index 793084f89..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Package volumetypes provides information and interaction with volume types -// in the OpenStack Block Storage service. A volume type indicates the type of -// a block storage volume, such as SATA, SCSCI, SSD, etc. These can be -// customized or defined by the OpenStack admin. -// -// You can also define extra_specs associated with your volume types. For -// instance, you could have a VolumeType=SATA, with extra_specs (RPM=10000, -// RAID-Level=5) . Extra_specs are defined and customized by the admin. -package volumetypes diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/fixtures.go deleted file mode 100644 index e3326eae1..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/fixtures.go +++ /dev/null @@ -1,60 +0,0 @@ -package volumetypes - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func MockListResponse(t *testing.T) { - th.Mux.HandleFunc("/types", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` - { - "volume_types": [ - { - "id": "289da7f8-6440-407c-9fb4-7db01ec49164", - "name": "vol-type-001", - "extra_specs": { - "capabilities": "gpu" - } - }, - { - "id": "96c3bda7-c82a-4f50-be73-ca7621794835", - "name": "vol-type-002", - "extra_specs": {} - } - ] - } - `) - }) -} - -func MockGetResponse(t *testing.T) { - th.Mux.HandleFunc("/types/d32019d3-bc6e-4319-9c1d-6722fc136a22", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` -{ - "volume_type": { - "name": "vol-type-001", - "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", - "extra_specs": { - "serverNumber": "2" - } - } -} - `) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/requests.go deleted file mode 100644 index 1673d13aa..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/requests.go +++ /dev/null @@ -1,76 +0,0 @@ -package volumetypes - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToVolumeTypeCreateMap() (map[string]interface{}, error) -} - -// CreateOpts are options for creating a volume type. -type CreateOpts struct { - // OPTIONAL. See VolumeType. - ExtraSpecs map[string]interface{} - // OPTIONAL. See VolumeType. - Name string -} - -// ToVolumeTypeCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToVolumeTypeCreateMap() (map[string]interface{}, error) { - vt := make(map[string]interface{}) - - if opts.ExtraSpecs != nil { - vt["extra_specs"] = opts.ExtraSpecs - } - if opts.Name != "" { - vt["name"] = opts.Name - } - - return map[string]interface{}{"volume_type": vt}, nil -} - -// Create will create a new volume. To extract the created volume type object, -// call the Extract method on the CreateResult. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToVolumeTypeCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(createURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - return res -} - -// Delete will delete the volume type with the provided ID. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(deleteURL(client, id), nil) - return res -} - -// Get will retrieve the volume type with the provided ID. To extract the volume -// type from the result, call the Extract method on the GetResult. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, err := client.Get(getURL(client, id), &res.Body, nil) - res.Err = err - return res -} - -// List returns all volume types. -func List(client *gophercloud.ServiceClient) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return ListResult{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, listURL(client), createPage) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/results.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/results.go deleted file mode 100644 index c049a045d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/results.go +++ /dev/null @@ -1,72 +0,0 @@ -package volumetypes - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// VolumeType contains all information associated with an OpenStack Volume Type. -type VolumeType struct { - ExtraSpecs map[string]interface{} `json:"extra_specs" mapstructure:"extra_specs"` // user-defined metadata - ID string `json:"id" mapstructure:"id"` // unique identifier - Name string `json:"name" mapstructure:"name"` // display name -} - -// CreateResult contains the response body and error from a Create request. -type CreateResult struct { - commonResult -} - -// GetResult contains the response body and error from a Get request. -type GetResult struct { - commonResult -} - -// DeleteResult contains the response error from a Delete request. -type DeleteResult struct { - gophercloud.ErrResult -} - -// ListResult is a pagination.Pager that is returned from a call to the List function. -type ListResult struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a ListResult contains no Volume Types. -func (r ListResult) IsEmpty() (bool, error) { - volumeTypes, err := ExtractVolumeTypes(r) - if err != nil { - return true, err - } - return len(volumeTypes) == 0, nil -} - -// ExtractVolumeTypes extracts and returns Volume Types. -func ExtractVolumeTypes(page pagination.Page) ([]VolumeType, error) { - var response struct { - VolumeTypes []VolumeType `mapstructure:"volume_types"` - } - - err := mapstructure.Decode(page.(ListResult).Body, &response) - return response.VolumeTypes, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract will get the Volume Type object out of the commonResult object. -func (r commonResult) Extract() (*VolumeType, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - VolumeType *VolumeType `json:"volume_type" mapstructure:"volume_type"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.VolumeType, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/urls.go deleted file mode 100644 index cf8367bfa..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes/urls.go +++ /dev/null @@ -1,19 +0,0 @@ -package volumetypes - -import "github.com/rackspace/gophercloud" - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("types") -} - -func createURL(c *gophercloud.ServiceClient) string { - return listURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("types", id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return getURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/doc.go deleted file mode 100644 index f78d4f735..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package base provides information and interaction with the base API -// resource in the OpenStack CDN service. This API resource allows for -// retrieving the Home Document and pinging the root URL. -package base diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/fixtures.go deleted file mode 100644 index 19b5ece46..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/fixtures.go +++ /dev/null @@ -1,53 +0,0 @@ -package base - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// HandleGetSuccessfully creates an HTTP handler at `/` on the test handler mux -// that responds with a `Get` response. -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` - { - "resources": { - "rel/cdn": { - "href-template": "services{?marker,limit}", - "href-vars": { - "marker": "param/marker", - "limit": "param/limit" - }, - "hints": { - "allow": [ - "GET" - ], - "formats": { - "application/json": {} - } - } - } - } - } - `) - - }) -} - -// HandlePingSuccessfully creates an HTTP handler at `/ping` on the test handler -// mux that responds with a `Ping` response. -func HandlePingSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/requests.go deleted file mode 100644 index dd221bc98..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/requests.go +++ /dev/null @@ -1,21 +0,0 @@ -package base - -import "github.com/rackspace/gophercloud" - -// Get retrieves the home document, allowing the user to discover the -// entire API. -func Get(c *gophercloud.ServiceClient) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c), &res.Body, nil) - return res -} - -// Ping retrieves a ping to the server. -func Ping(c *gophercloud.ServiceClient) PingResult { - var res PingResult - _, res.Err = c.Get(pingURL(c), nil, &gophercloud.RequestOpts{ - OkCodes: []int{204}, - MoreHeaders: map[string]string{"Accept": ""}, - }) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/results.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/results.go deleted file mode 100644 index bef1da8a1..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/results.go +++ /dev/null @@ -1,35 +0,0 @@ -package base - -import ( - "errors" - - "github.com/rackspace/gophercloud" -) - -// HomeDocument is a resource that contains all the resources for the CDN API. -type HomeDocument map[string]interface{} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a home document resource. -func (r GetResult) Extract() (*HomeDocument, error) { - if r.Err != nil { - return nil, r.Err - } - - submap, ok := r.Body.(map[string]interface{})["resources"] - if !ok { - return nil, errors.New("Unexpected HomeDocument structure") - } - casted := HomeDocument(submap.(map[string]interface{})) - - return &casted, nil -} - -// PingResult represents the result of a Ping operation. -type PingResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/urls.go deleted file mode 100644 index a95e18bca..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/base/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package base - -import "github.com/rackspace/gophercloud" - -func getURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL() -} - -func pingURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("ping") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/doc.go deleted file mode 100644 index d4066985c..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package flavors provides information and interaction with the flavors API -// resource in the OpenStack CDN service. This API resource allows for -// listing flavors and retrieving a specific flavor. -// -// A flavor is a mapping configuration to a CDN provider. -package flavors diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/fixtures.go deleted file mode 100644 index d7ec1a00d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/fixtures.go +++ /dev/null @@ -1,82 +0,0 @@ -package flavors - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// HandleListCDNFlavorsSuccessfully creates an HTTP handler at `/flavors` on the test handler mux -// that responds with a `List` response. -func HandleListCDNFlavorsSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/flavors", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` - { - "flavors": [ - { - "id": "europe", - "providers": [ - { - "provider": "Fastly", - "links": [ - { - "href": "http://www.fastly.com", - "rel": "provider_url" - } - ] - } - ], - "links": [ - { - "href": "https://www.poppycdn.io/v1.0/flavors/europe", - "rel": "self" - } - ] - } - ] - } - `) - }) -} - -// HandleGetCDNFlavorSuccessfully creates an HTTP handler at `/flavors/{id}` on the test handler mux -// that responds with a `Get` response. -func HandleGetCDNFlavorSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/flavors/asia", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` - { - "id" : "asia", - "providers" : [ - { - "provider" : "ChinaCache", - "links": [ - { - "href": "http://www.chinacache.com", - "rel": "provider_url" - } - ] - } - ], - "links": [ - { - "href": "https://www.poppycdn.io/v1.0/flavors/asia", - "rel": "self" - } - ] - } - `) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/requests.go deleted file mode 100644 index 8755a95b8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/requests.go +++ /dev/null @@ -1,22 +0,0 @@ -package flavors - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a single page of CDN flavors. -func List(c *gophercloud.ServiceClient) pagination.Pager { - url := listURL(c) - createPage := func(r pagination.PageResult) pagination.Page { - return FlavorPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// Get retrieves a specific flavor based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, id), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/results.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/results.go deleted file mode 100644 index 8cab48b53..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/results.go +++ /dev/null @@ -1,71 +0,0 @@ -package flavors - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Provider represents a provider for a particular flavor. -type Provider struct { - // Specifies the name of the provider. The name must not exceed 64 bytes in - // length and is limited to unicode, digits, underscores, and hyphens. - Provider string `mapstructure:"provider"` - // Specifies a list with an href where rel is provider_url. - Links []gophercloud.Link `mapstructure:"links"` -} - -// Flavor represents a mapping configuration to a CDN provider. -type Flavor struct { - // Specifies the name of the flavor. The name must not exceed 64 bytes in - // length and is limited to unicode, digits, underscores, and hyphens. - ID string `mapstructure:"id"` - // Specifies the list of providers mapped to this flavor. - Providers []Provider `mapstructure:"providers"` - // Specifies the self-navigating JSON document paths. - Links []gophercloud.Link `mapstructure:"links"` -} - -// FlavorPage is the page returned by a pager when traversing over a -// collection of CDN flavors. -type FlavorPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a FlavorPage contains no Flavors. -func (r FlavorPage) IsEmpty() (bool, error) { - flavors, err := ExtractFlavors(r) - if err != nil { - return true, err - } - return len(flavors) == 0, nil -} - -// ExtractFlavors extracts and returns Flavors. It is used while iterating over -// a flavors.List call. -func ExtractFlavors(page pagination.Page) ([]Flavor, error) { - var response struct { - Flavors []Flavor `json:"flavors"` - } - - err := mapstructure.Decode(page.(FlavorPage).Body, &response) - return response.Flavors, err -} - -// GetResult represents the result of a get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract is a function that extracts a flavor from a GetResult. -func (r GetResult) Extract() (*Flavor, error) { - if r.Err != nil { - return nil, r.Err - } - - var res Flavor - - err := mapstructure.Decode(r.Body, &res) - - return &res, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/urls.go deleted file mode 100644 index 6eb38d293..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/flavors/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package flavors - -import "github.com/rackspace/gophercloud" - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("flavors") -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("flavors", id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/doc.go deleted file mode 100644 index ceecaa5a5..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package serviceassets provides information and interaction with the -// serviceassets API resource in the OpenStack CDN service. This API resource -// allows for deleting cached assets. -// -// A service distributes assets across the network. Service assets let you -// interrogate properties about these assets and perform certain actions on them. -package serviceassets diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/fixtures.go deleted file mode 100644 index 5c6b5d00e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/fixtures.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceassets - -import ( - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// HandleDeleteCDNAssetSuccessfully creates an HTTP handler at `/services/{id}/assets` on the test handler mux -// that responds with a `Delete` response. -func HandleDeleteCDNAssetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0/assets", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/requests.go deleted file mode 100644 index 1ddc65faf..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/requests.go +++ /dev/null @@ -1,48 +0,0 @@ -package serviceassets - -import ( - "strings" - - "github.com/rackspace/gophercloud" -) - -// DeleteOptsBuilder allows extensions to add additional parameters to the Delete -// request. -type DeleteOptsBuilder interface { - ToCDNAssetDeleteParams() (string, error) -} - -// DeleteOpts is a structure that holds options for deleting CDN service assets. -type DeleteOpts struct { - // If all is set to true, specifies that the delete occurs against all of the - // assets for the service. - All bool `q:"all"` - // Specifies the relative URL of the asset to be deleted. - URL string `q:"url"` -} - -// ToCDNAssetDeleteParams formats a DeleteOpts into a query string. -func (opts DeleteOpts) ToCDNAssetDeleteParams() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// Delete accepts a unique service ID or URL and deletes the CDN service asset associated with -// it. For example, both "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" and -// "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" -// are valid options for idOrURL. -func Delete(c *gophercloud.ServiceClient, idOrURL string, opts DeleteOptsBuilder) DeleteResult { - var url string - if strings.Contains(idOrURL, "/") { - url = idOrURL - } else { - url = deleteURL(c, idOrURL) - } - - var res DeleteResult - _, res.Err = c.Delete(url, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/results.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/results.go deleted file mode 100644 index 1d8734b7c..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/results.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceassets - -import "github.com/rackspace/gophercloud" - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/urls.go deleted file mode 100644 index cb0aea8fc..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets/urls.go +++ /dev/null @@ -1,7 +0,0 @@ -package serviceassets - -import "github.com/rackspace/gophercloud" - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("services", id, "assets") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/doc.go deleted file mode 100644 index 41f7c60da..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package services provides information and interaction with the services API -// resource in the OpenStack CDN service. This API resource allows for -// listing, creating, updating, retrieving, and deleting services. -// -// A service represents an application that has its content cached to the edge -// nodes. -package services diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/errors.go deleted file mode 100644 index 359584c2a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/errors.go +++ /dev/null @@ -1,7 +0,0 @@ -package services - -import "fmt" - -func no(str string) error { - return fmt.Errorf("Required parameter %s not provided", str) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/fixtures.go deleted file mode 100644 index d9bc9f20b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/fixtures.go +++ /dev/null @@ -1,372 +0,0 @@ -package services - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// HandleListCDNServiceSuccessfully creates an HTTP handler at `/services` on the test handler mux -// that responds with a `List` response. -func HandleListCDNServiceSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/services", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, ` - { - "links": [ - { - "rel": "next", - "href": "https://www.poppycdn.io/v1.0/services?marker=96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0&limit=20" - } - ], - "services": [ - { - "id": "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", - "name": "mywebsite.com", - "domains": [ - { - "domain": "www.mywebsite.com" - } - ], - "origins": [ - { - "origin": "mywebsite.com", - "port": 80, - "ssl": false - } - ], - "caching": [ - { - "name": "default", - "ttl": 3600 - }, - { - "name": "home", - "ttl": 17200, - "rules": [ - { - "name": "index", - "request_url": "/index.htm" - } - ] - }, - { - "name": "images", - "ttl": 12800, - "rules": [ - { - "name": "images", - "request_url": "*.png" - } - ] - } - ], - "restrictions": [ - { - "name": "website only", - "rules": [ - { - "name": "mywebsite.com", - "referrer": "www.mywebsite.com" - } - ] - } - ], - "flavor_id": "asia", - "status": "deployed", - "errors" : [], - "links": [ - { - "href": "https://www.poppycdn.io/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", - "rel": "self" - }, - { - "href": "mywebsite.com.cdn123.poppycdn.net", - "rel": "access_url" - }, - { - "href": "https://www.poppycdn.io/v1.0/flavors/asia", - "rel": "flavor" - } - ] - }, - { - "id": "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f1", - "name": "myothersite.com", - "domains": [ - { - "domain": "www.myothersite.com" - } - ], - "origins": [ - { - "origin": "44.33.22.11", - "port": 80, - "ssl": false - }, - { - "origin": "77.66.55.44", - "port": 80, - "ssl": false, - "rules": [ - { - "name": "videos", - "request_url": "^/videos/*.m3u" - } - ] - } - ], - "caching": [ - { - "name": "default", - "ttl": 3600 - } - ], - "restrictions": [ - {} - ], - "flavor_id": "europe", - "status": "deployed", - "links": [ - { - "href": "https://www.poppycdn.io/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f1", - "rel": "self" - }, - { - "href": "myothersite.com.poppycdn.net", - "rel": "access_url" - }, - { - "href": "https://www.poppycdn.io/v1.0/flavors/europe", - "rel": "flavor" - } - ] - } - ] - } - `) - case "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f1": - fmt.Fprintf(w, `{ - "services": [] - }`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// HandleCreateCDNServiceSuccessfully creates an HTTP handler at `/services` on the test handler mux -// that responds with a `Create` response. -func HandleCreateCDNServiceSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/services", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestJSONRequest(t, r, ` - { - "name": "mywebsite.com", - "domains": [ - { - "domain": "www.mywebsite.com" - }, - { - "domain": "blog.mywebsite.com" - } - ], - "origins": [ - { - "origin": "mywebsite.com", - "port": 80, - "ssl": false - } - ], - "restrictions": [ - { - "name": "website only", - "rules": [ - { - "name": "mywebsite.com", - "referrer": "www.mywebsite.com" - } - ] - } - ], - "caching": [ - { - "name": "default", - "ttl": 3600 - } - ], - - "flavor_id": "cdn" - } - `) - w.Header().Add("Location", "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0") - w.WriteHeader(http.StatusAccepted) - }) -} - -// HandleGetCDNServiceSuccessfully creates an HTTP handler at `/services/{id}` on the test handler mux -// that responds with a `Get` response. -func HandleGetCDNServiceSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` - { - "id": "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", - "name": "mywebsite.com", - "domains": [ - { - "domain": "www.mywebsite.com", - "protocol": "http" - } - ], - "origins": [ - { - "origin": "mywebsite.com", - "port": 80, - "ssl": false - } - ], - "caching": [ - { - "name": "default", - "ttl": 3600 - }, - { - "name": "home", - "ttl": 17200, - "rules": [ - { - "name": "index", - "request_url": "/index.htm" - } - ] - }, - { - "name": "images", - "ttl": 12800, - "rules": [ - { - "name": "images", - "request_url": "*.png" - } - ] - } - ], - "restrictions": [ - { - "name": "website only", - "rules": [ - { - "name": "mywebsite.com", - "referrer": "www.mywebsite.com" - } - ] - } - ], - "flavor_id": "cdn", - "status": "deployed", - "errors" : [], - "links": [ - { - "href": "https://global.cdn.api.rackspacecloud.com/v1.0/110011/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", - "rel": "self" - }, - { - "href": "blog.mywebsite.com.cdn1.raxcdn.com", - "rel": "access_url" - }, - { - "href": "https://global.cdn.api.rackspacecloud.com/v1.0/110011/flavors/cdn", - "rel": "flavor" - } - ] - } - `) - }) -} - -// HandleUpdateCDNServiceSuccessfully creates an HTTP handler at `/services/{id}` on the test handler mux -// that responds with a `Update` response. -func HandleUpdateCDNServiceSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PATCH") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestJSONRequest(t, r, ` - [ - { - "op": "add", - "path": "/domains/-", - "value": {"domain": "appended.mocksite4.com"} - }, - { - "op": "add", - "path": "/domains/4", - "value": {"domain": "inserted.mocksite4.com"} - }, - { - "op": "add", - "path": "/domains", - "value": [ - {"domain": "bulkadded1.mocksite4.com"}, - {"domain": "bulkadded2.mocksite4.com"} - ] - }, - { - "op": "replace", - "path": "/origins/2", - "value": {"origin": "44.33.22.11", "port": 80, "ssl": false} - }, - { - "op": "replace", - "path": "/origins", - "value": [ - {"origin": "44.33.22.11", "port": 80, "ssl": false}, - {"origin": "55.44.33.22", "port": 443, "ssl": true} - ] - }, - { - "op": "remove", - "path": "/caching/8" - }, - { - "op": "remove", - "path": "/caching" - }, - { - "op": "replace", - "path": "/name", - "value": "differentServiceName" - } - ] - `) - w.Header().Add("Location", "https://www.poppycdn.io/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0") - w.WriteHeader(http.StatusAccepted) - }) -} - -// HandleDeleteCDNServiceSuccessfully creates an HTTP handler at `/services/{id}` on the test handler mux -// that responds with a `Delete` response. -func HandleDeleteCDNServiceSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/requests.go deleted file mode 100644 index 8b37928e2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/requests.go +++ /dev/null @@ -1,378 +0,0 @@ -package services - -import ( - "fmt" - "strings" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToCDNServiceListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Marker and Limit are used for pagination. -type ListOpts struct { - Marker string `q:"marker"` - Limit int `q:"limit"` -} - -// ToCDNServiceListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToCDNServiceListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List returns a Pager which allows you to iterate over a collection of -// CDN services. It accepts a ListOpts struct, which allows for pagination via -// marker and limit. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := listURL(c) - if opts != nil { - query, err := opts.ToCDNServiceListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPage := func(r pagination.PageResult) pagination.Page { - p := ServicePage{pagination.MarkerPageBase{PageResult: r}} - p.MarkerPageBase.Owner = p - return p - } - - pager := pagination.NewPager(c, url, createPage) - return pager -} - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type CreateOptsBuilder interface { - ToCDNServiceCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // REQUIRED. Specifies the name of the service. The minimum length for name is - // 3. The maximum length is 256. - Name string - // REQUIRED. Specifies a list of domains used by users to access their website. - Domains []Domain - // REQUIRED. Specifies a list of origin domains or IP addresses where the - // original assets are stored. - Origins []Origin - // REQUIRED. Specifies the CDN provider flavor ID to use. For a list of - // flavors, see the operation to list the available flavors. The minimum - // length for flavor_id is 1. The maximum length is 256. - FlavorID string - // OPTIONAL. Specifies the TTL rules for the assets under this service. Supports wildcards for fine-grained control. - Caching []CacheRule - // OPTIONAL. Specifies the restrictions that define who can access assets (content from the CDN cache). - Restrictions []Restriction -} - -// ToCDNServiceCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToCDNServiceCreateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.Name == "" { - return nil, no("Name") - } - s["name"] = opts.Name - - if opts.Domains == nil { - return nil, no("Domains") - } - for _, domain := range opts.Domains { - if domain.Domain == "" { - return nil, no("Domains[].Domain") - } - } - s["domains"] = opts.Domains - - if opts.Origins == nil { - return nil, no("Origins") - } - for _, origin := range opts.Origins { - if origin.Origin == "" { - return nil, no("Origins[].Origin") - } - if origin.Rules == nil && len(opts.Origins) > 1 { - return nil, no("Origins[].Rules") - } - for _, rule := range origin.Rules { - if rule.Name == "" { - return nil, no("Origins[].Rules[].Name") - } - if rule.RequestURL == "" { - return nil, no("Origins[].Rules[].RequestURL") - } - } - } - s["origins"] = opts.Origins - - if opts.FlavorID == "" { - return nil, no("FlavorID") - } - s["flavor_id"] = opts.FlavorID - - if opts.Caching != nil { - for _, cache := range opts.Caching { - if cache.Name == "" { - return nil, no("Caching[].Name") - } - if cache.Rules != nil { - for _, rule := range cache.Rules { - if rule.Name == "" { - return nil, no("Caching[].Rules[].Name") - } - if rule.RequestURL == "" { - return nil, no("Caching[].Rules[].RequestURL") - } - } - } - } - s["caching"] = opts.Caching - } - - if opts.Restrictions != nil { - for _, restriction := range opts.Restrictions { - if restriction.Name == "" { - return nil, no("Restrictions[].Name") - } - if restriction.Rules != nil { - for _, rule := range restriction.Rules { - if rule.Name == "" { - return nil, no("Restrictions[].Rules[].Name") - } - } - } - } - s["restrictions"] = opts.Restrictions - } - - return s, nil -} - -// Create accepts a CreateOpts struct and creates a new CDN service using the -// values provided. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToCDNServiceCreateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - resp, err := c.Post(createURL(c), &reqBody, nil, nil) - res.Header = resp.Header - res.Err = err - return res -} - -// Get retrieves a specific service based on its URL or its unique ID. For -// example, both "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" and -// "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" -// are valid options for idOrURL. -func Get(c *gophercloud.ServiceClient, idOrURL string) GetResult { - var url string - if strings.Contains(idOrURL, "/") { - url = idOrURL - } else { - url = getURL(c, idOrURL) - } - - var res GetResult - _, res.Err = c.Get(url, &res.Body, nil) - return res -} - -// Path is a JSON pointer location that indicates which service parameter is being added, replaced, -// or removed. -type Path struct { - baseElement string -} - -func (p Path) renderRoot() string { - return "/" + p.baseElement -} - -func (p Path) renderDash() string { - return fmt.Sprintf("/%s/-", p.baseElement) -} - -func (p Path) renderIndex(index int64) string { - return fmt.Sprintf("/%s/%d", p.baseElement, index) -} - -var ( - // PathDomains indicates that an update operation is to be performed on a Domain. - PathDomains = Path{baseElement: "domains"} - - // PathOrigins indicates that an update operation is to be performed on an Origin. - PathOrigins = Path{baseElement: "origins"} - - // PathCaching indicates that an update operation is to be performed on a CacheRule. - PathCaching = Path{baseElement: "caching"} -) - -type value interface { - toPatchValue() interface{} - appropriatePath() Path - renderRootOr(func(p Path) string) string -} - -// Patch represents a single update to an existing Service. Multiple updates to a service can be -// submitted at the same time. -type Patch interface { - ToCDNServiceUpdateMap() map[string]interface{} -} - -// Insertion is a Patch that requests the addition of a value (Domain, Origin, or CacheRule) to -// a Service at a fixed index. Use an Append instead to append the new value to the end of its -// collection. Pass it to the Update function as part of the Patch slice. -type Insertion struct { - Index int64 - Value value -} - -// ToCDNServiceUpdateMap converts an Insertion into a request body fragment suitable for the -// Update call. -func (i Insertion) ToCDNServiceUpdateMap() map[string]interface{} { - return map[string]interface{}{ - "op": "add", - "path": i.Value.renderRootOr(func(p Path) string { return p.renderIndex(i.Index) }), - "value": i.Value.toPatchValue(), - } -} - -// Append is a Patch that requests the addition of a value (Domain, Origin, or CacheRule) to a -// Service at the end of its respective collection. Use an Insertion instead to insert the value -// at a fixed index within the collection. Pass this to the Update function as part of its -// Patch slice. -type Append struct { - Value value -} - -// ToCDNServiceUpdateMap converts an Append into a request body fragment suitable for the -// Update call. -func (a Append) ToCDNServiceUpdateMap() map[string]interface{} { - return map[string]interface{}{ - "op": "add", - "path": a.Value.renderRootOr(func(p Path) string { return p.renderDash() }), - "value": a.Value.toPatchValue(), - } -} - -// Replacement is a Patch that alters a specific service parameter (Domain, Origin, or CacheRule) -// in-place by index. Pass it to the Update function as part of the Patch slice. -type Replacement struct { - Value value - Index int64 -} - -// ToCDNServiceUpdateMap converts a Replacement into a request body fragment suitable for the -// Update call. -func (r Replacement) ToCDNServiceUpdateMap() map[string]interface{} { - return map[string]interface{}{ - "op": "replace", - "path": r.Value.renderRootOr(func(p Path) string { return p.renderIndex(r.Index) }), - "value": r.Value.toPatchValue(), - } -} - -// NameReplacement specifically updates the Service name. Pass it to the Update function as part -// of the Patch slice. -type NameReplacement struct { - NewName string -} - -// ToCDNServiceUpdateMap converts a NameReplacement into a request body fragment suitable for the -// Update call. -func (r NameReplacement) ToCDNServiceUpdateMap() map[string]interface{} { - return map[string]interface{}{ - "op": "replace", - "path": "/name", - "value": r.NewName, - } -} - -// Removal is a Patch that requests the removal of a service parameter (Domain, Origin, or -// CacheRule) by index. Pass it to the Update function as part of the Patch slice. -type Removal struct { - Path Path - Index int64 - All bool -} - -// ToCDNServiceUpdateMap converts a Removal into a request body fragment suitable for the -// Update call. -func (r Removal) ToCDNServiceUpdateMap() map[string]interface{} { - result := map[string]interface{}{"op": "remove"} - if r.All { - result["path"] = r.Path.renderRoot() - } else { - result["path"] = r.Path.renderIndex(r.Index) - } - return result -} - -type UpdateOpts []Patch - -// Update accepts a slice of Patch operations (Insertion, Append, Replacement or Removal) and -// updates an existing CDN service using the values provided. idOrURL can be either the service's -// URL or its ID. For example, both "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" and -// "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" -// are valid options for idOrURL. -func Update(c *gophercloud.ServiceClient, idOrURL string, opts UpdateOpts) UpdateResult { - var url string - if strings.Contains(idOrURL, "/") { - url = idOrURL - } else { - url = updateURL(c, idOrURL) - } - - reqBody := make([]map[string]interface{}, len(opts)) - for i, patch := range opts { - reqBody[i] = patch.ToCDNServiceUpdateMap() - } - - resp, err := c.Request("PATCH", url, gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{202}, - }) - var result UpdateResult - result.Header = resp.Header - result.Err = err - return result -} - -// Delete accepts a service's ID or its URL and deletes the CDN service -// associated with it. For example, both "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" and -// "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" -// are valid options for idOrURL. -func Delete(c *gophercloud.ServiceClient, idOrURL string) DeleteResult { - var url string - if strings.Contains(idOrURL, "/") { - url = idOrURL - } else { - url = deleteURL(c, idOrURL) - } - - var res DeleteResult - _, res.Err = c.Delete(url, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/results.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/results.go deleted file mode 100644 index 33406c482..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/results.go +++ /dev/null @@ -1,316 +0,0 @@ -package services - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// Domain represents a domain used by users to access their website. -type Domain struct { - // Specifies the domain used to access the assets on their website, for which - // a CNAME is given to the CDN provider. - Domain string `mapstructure:"domain" json:"domain"` - // Specifies the protocol used to access the assets on this domain. Only "http" - // or "https" are currently allowed. The default is "http". - Protocol string `mapstructure:"protocol" json:"protocol,omitempty"` -} - -func (d Domain) toPatchValue() interface{} { - r := make(map[string]interface{}) - r["domain"] = d.Domain - if d.Protocol != "" { - r["protocol"] = d.Protocol - } - return r -} - -func (d Domain) appropriatePath() Path { - return PathDomains -} - -func (d Domain) renderRootOr(render func(p Path) string) string { - return render(d.appropriatePath()) -} - -// DomainList provides a useful way to perform bulk operations in a single Patch. -type DomainList []Domain - -func (list DomainList) toPatchValue() interface{} { - r := make([]interface{}, len(list)) - for i, domain := range list { - r[i] = domain.toPatchValue() - } - return r -} - -func (list DomainList) appropriatePath() Path { - return PathDomains -} - -func (list DomainList) renderRootOr(_ func(p Path) string) string { - return list.appropriatePath().renderRoot() -} - -// OriginRule represents a rule that defines when an origin should be accessed. -type OriginRule struct { - // Specifies the name of this rule. - Name string `mapstructure:"name" json:"name"` - // Specifies the request URL this rule should match for this origin to be used. Regex is supported. - RequestURL string `mapstructure:"request_url" json:"request_url"` -} - -// Origin specifies a list of origin domains or IP addresses where the original assets are stored. -type Origin struct { - // Specifies the URL or IP address to pull origin content from. - Origin string `mapstructure:"origin" json:"origin"` - // Specifies the port used to access the origin. The default is port 80. - Port int `mapstructure:"port" json:"port,omitempty"` - // Specifies whether or not to use HTTPS to access the origin. The default - // is false. - SSL bool `mapstructure:"ssl" json:"ssl"` - // Specifies a collection of rules that define the conditions when this origin - // should be accessed. If there is more than one origin, the rules parameter is required. - Rules []OriginRule `mapstructure:"rules" json:"rules,omitempty"` -} - -func (o Origin) toPatchValue() interface{} { - r := make(map[string]interface{}) - r["origin"] = o.Origin - r["port"] = o.Port - r["ssl"] = o.SSL - if len(o.Rules) > 0 { - r["rules"] = make([]map[string]interface{}, len(o.Rules)) - for index, rule := range o.Rules { - submap := r["rules"].([]map[string]interface{})[index] - submap["name"] = rule.Name - submap["request_url"] = rule.RequestURL - } - } - return r -} - -func (o Origin) appropriatePath() Path { - return PathOrigins -} - -func (o Origin) renderRootOr(render func(p Path) string) string { - return render(o.appropriatePath()) -} - -// OriginList provides a useful way to perform bulk operations in a single Patch. -type OriginList []Origin - -func (list OriginList) toPatchValue() interface{} { - r := make([]interface{}, len(list)) - for i, origin := range list { - r[i] = origin.toPatchValue() - } - return r -} - -func (list OriginList) appropriatePath() Path { - return PathOrigins -} - -func (list OriginList) renderRootOr(_ func(p Path) string) string { - return list.appropriatePath().renderRoot() -} - -// TTLRule specifies a rule that determines if a TTL should be applied to an asset. -type TTLRule struct { - // Specifies the name of this rule. - Name string `mapstructure:"name" json:"name"` - // Specifies the request URL this rule should match for this TTL to be used. Regex is supported. - RequestURL string `mapstructure:"request_url" json:"request_url"` -} - -// CacheRule specifies the TTL rules for the assets under this service. -type CacheRule struct { - // Specifies the name of this caching rule. Note: 'default' is a reserved name used for the default TTL setting. - Name string `mapstructure:"name" json:"name"` - // Specifies the TTL to apply. - TTL int `mapstructure:"ttl" json:"ttl"` - // Specifies a collection of rules that determine if this TTL should be applied to an asset. - Rules []TTLRule `mapstructure:"rules" json:"rules,omitempty"` -} - -func (c CacheRule) toPatchValue() interface{} { - r := make(map[string]interface{}) - r["name"] = c.Name - r["ttl"] = c.TTL - r["rules"] = make([]map[string]interface{}, len(c.Rules)) - for index, rule := range c.Rules { - submap := r["rules"].([]map[string]interface{})[index] - submap["name"] = rule.Name - submap["request_url"] = rule.RequestURL - } - return r -} - -func (c CacheRule) appropriatePath() Path { - return PathCaching -} - -func (c CacheRule) renderRootOr(render func(p Path) string) string { - return render(c.appropriatePath()) -} - -// CacheRuleList provides a useful way to perform bulk operations in a single Patch. -type CacheRuleList []CacheRule - -func (list CacheRuleList) toPatchValue() interface{} { - r := make([]interface{}, len(list)) - for i, rule := range list { - r[i] = rule.toPatchValue() - } - return r -} - -func (list CacheRuleList) appropriatePath() Path { - return PathCaching -} - -func (list CacheRuleList) renderRootOr(_ func(p Path) string) string { - return list.appropriatePath().renderRoot() -} - -// RestrictionRule specifies a rule that determines if this restriction should be applied to an asset. -type RestrictionRule struct { - // Specifies the name of this rule. - Name string `mapstructure:"name" json:"name"` - // Specifies the http host that requests must come from. - Referrer string `mapstructure:"referrer" json:"referrer,omitempty"` -} - -// Restriction specifies a restriction that defines who can access assets (content from the CDN cache). -type Restriction struct { - // Specifies the name of this restriction. - Name string `mapstructure:"name" json:"name"` - // Specifies a collection of rules that determine if this TTL should be applied to an asset. - Rules []RestrictionRule `mapstructure:"rules" json:"rules"` -} - -// Error specifies an error that occurred during the previous service action. -type Error struct { - // Specifies an error message detailing why there is an error. - Message string `mapstructure:"message"` -} - -// Service represents a CDN service resource. -type Service struct { - // Specifies the service ID that represents distributed content. The value is - // a UUID, such as 96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0, that is generated by the server. - ID string `mapstructure:"id"` - // Specifies the name of the service. - Name string `mapstructure:"name"` - // Specifies a list of domains used by users to access their website. - Domains []Domain `mapstructure:"domains"` - // Specifies a list of origin domains or IP addresses where the original assets are stored. - Origins []Origin `mapstructure:"origins"` - // Specifies the TTL rules for the assets under this service. Supports wildcards for fine grained control. - Caching []CacheRule `mapstructure:"caching"` - // Specifies the restrictions that define who can access assets (content from the CDN cache). - Restrictions []Restriction `mapstructure:"restrictions" json:"restrictions,omitempty"` - // Specifies the CDN provider flavor ID to use. For a list of flavors, see the operation to list the available flavors. - FlavorID string `mapstructure:"flavor_id"` - // Specifies the current status of the service. - Status string `mapstructure:"status"` - // Specifies the list of errors that occurred during the previous service action. - Errors []Error `mapstructure:"errors"` - // Specifies the self-navigating JSON document paths. - Links []gophercloud.Link `mapstructure:"links"` -} - -// ServicePage is the page returned by a pager when traversing over a -// collection of CDN services. -type ServicePage struct { - pagination.MarkerPageBase -} - -// IsEmpty returns true if a ListResult contains no services. -func (r ServicePage) IsEmpty() (bool, error) { - services, err := ExtractServices(r) - if err != nil { - return true, err - } - return len(services) == 0, nil -} - -// LastMarker returns the last service in a ListResult. -func (r ServicePage) LastMarker() (string, error) { - services, err := ExtractServices(r) - if err != nil { - return "", err - } - if len(services) == 0 { - return "", nil - } - return (services[len(services)-1]).ID, nil -} - -// ExtractServices is a function that takes a ListResult and returns the services' information. -func ExtractServices(page pagination.Page) ([]Service, error) { - var response struct { - Services []Service `mapstructure:"services"` - } - - err := mapstructure.Decode(page.(ServicePage).Body, &response) - return response.Services, err -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - gophercloud.Result -} - -// Extract is a method that extracts the location of a newly created service. -func (r CreateResult) Extract() (string, error) { - if r.Err != nil { - return "", r.Err - } - if l, ok := r.Header["Location"]; ok && len(l) > 0 { - return l[0], nil - } - return "", nil -} - -// GetResult represents the result of a get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract is a function that extracts a service from a GetResult. -func (r GetResult) Extract() (*Service, error) { - if r.Err != nil { - return nil, r.Err - } - - var res Service - - err := mapstructure.Decode(r.Body, &res) - - return &res, err -} - -// UpdateResult represents the result of a Update operation. -type UpdateResult struct { - gophercloud.Result -} - -// Extract is a method that extracts the location of an updated service. -func (r UpdateResult) Extract() (string, error) { - if r.Err != nil { - return "", r.Err - } - if l, ok := r.Header["Location"]; ok && len(l) > 0 { - return l[0], nil - } - return "", nil -} - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/urls.go deleted file mode 100644 index d953d4c19..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/cdn/v1/services/urls.go +++ /dev/null @@ -1,23 +0,0 @@ -package services - -import "github.com/rackspace/gophercloud" - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("services") -} - -func createURL(c *gophercloud.ServiceClient) string { - return listURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("services", id) -} - -func updateURL(c *gophercloud.ServiceClient, id string) string { - return getURL(c, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return getURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/README.md b/vendor/github.com/rackspace/gophercloud/openstack/common/README.md deleted file mode 100644 index 7b55795d0..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Common Resources - -This directory is for resources that are shared by multiple services. diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/doc.go deleted file mode 100644 index 4a168f4b2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/doc.go +++ /dev/null @@ -1,15 +0,0 @@ -// Package extensions provides information and interaction with the different extensions available -// for an OpenStack service. -// -// The purpose of OpenStack API extensions is to: -// -// - Introduce new features in the API without requiring a version change. -// - Introduce vendor-specific niche functionality. -// - Act as a proving ground for experimental functionalities that might be included in a future -// version of the API. -// -// Extensions usually have tags that prevent conflicts with other extensions that define attributes -// or resources with the same names, and with core resources and attributes. -// Because an extension might not be supported by all plug-ins, its availability varies with deployments -// and the specific plug-in. -package extensions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/errors.go deleted file mode 100644 index aeec0fa75..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/errors.go +++ /dev/null @@ -1 +0,0 @@ -package extensions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/fixtures.go deleted file mode 100644 index 0ed7de9f1..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/fixtures.go +++ /dev/null @@ -1,91 +0,0 @@ -// +build fixtures - -package extensions - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -// ListOutput provides a single page of Extension results. -const ListOutput = ` -{ - "extensions": [ - { - "updated": "2013-01-20T00:00:00-00:00", - "name": "Neutron Service Type Management", - "links": [], - "namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0", - "alias": "service-type", - "description": "API for retrieving service providers for Neutron advanced services" - } - ] -}` - -// GetOutput provides a single Extension result. -const GetOutput = ` -{ - "extension": { - "updated": "2013-02-03T10:00:00-00:00", - "name": "agent", - "links": [], - "namespace": "http://docs.openstack.org/ext/agent/api/v2.0", - "alias": "agent", - "description": "The agent management extension." - } -} -` - -// ListedExtension is the Extension that should be parsed from ListOutput. -var ListedExtension = Extension{ - Updated: "2013-01-20T00:00:00-00:00", - Name: "Neutron Service Type Management", - Links: []interface{}{}, - Namespace: "http://docs.openstack.org/ext/neutron/service-type/api/v1.0", - Alias: "service-type", - Description: "API for retrieving service providers for Neutron advanced services", -} - -// ExpectedExtensions is a slice containing the Extension that should be parsed from ListOutput. -var ExpectedExtensions = []Extension{ListedExtension} - -// SingleExtension is the Extension that should be parsed from GetOutput. -var SingleExtension = &Extension{ - Updated: "2013-02-03T10:00:00-00:00", - Name: "agent", - Links: []interface{}{}, - Namespace: "http://docs.openstack.org/ext/agent/api/v2.0", - Alias: "agent", - Description: "The agent management extension.", -} - -// HandleListExtensionsSuccessfully creates an HTTP handler at `/extensions` on the test handler -// mux that response with a list containing a single tenant. -func HandleListExtensionsSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/extensions", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - - fmt.Fprintf(w, ListOutput) - }) -} - -// HandleGetExtensionSuccessfully creates an HTTP handler at `/extensions/agent` that responds with -// a JSON payload corresponding to SingleExtension. -func HandleGetExtensionSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/extensions/agent", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, GetOutput) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/requests.go deleted file mode 100644 index 0b7108501..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/requests.go +++ /dev/null @@ -1,21 +0,0 @@ -package extensions - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Get retrieves information for a specific extension using its alias. -func Get(c *gophercloud.ServiceClient, alias string) GetResult { - var res GetResult - _, res.Err = c.Get(ExtensionURL(c, alias), &res.Body, nil) - return res -} - -// List returns a Pager which allows you to iterate over the full collection of extensions. -// It does not accept query parameters. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page { - return ExtensionPage{pagination.SinglePageBase(r)} - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/results.go b/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/results.go deleted file mode 100644 index 777d083fa..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/results.go +++ /dev/null @@ -1,65 +0,0 @@ -package extensions - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// GetResult temporarily stores the result of a Get call. -// Use its Extract() method to interpret it as an Extension. -type GetResult struct { - gophercloud.Result -} - -// Extract interprets a GetResult as an Extension. -func (r GetResult) Extract() (*Extension, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Extension *Extension `json:"extension"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Extension, err -} - -// Extension is a struct that represents an OpenStack extension. -type Extension struct { - Updated string `json:"updated" mapstructure:"updated"` - Name string `json:"name" mapstructure:"name"` - Links []interface{} `json:"links" mapstructure:"links"` - Namespace string `json:"namespace" mapstructure:"namespace"` - Alias string `json:"alias" mapstructure:"alias"` - Description string `json:"description" mapstructure:"description"` -} - -// ExtensionPage is the page returned by a pager when traversing over a collection of extensions. -type ExtensionPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an ExtensionPage struct is empty. -func (r ExtensionPage) IsEmpty() (bool, error) { - is, err := ExtractExtensions(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractExtensions accepts a Page struct, specifically an ExtensionPage struct, and extracts the -// elements into a slice of Extension structs. -// In other words, a generic collection is mapped into a relevant slice. -func ExtractExtensions(page pagination.Page) ([]Extension, error) { - var resp struct { - Extensions []Extension `mapstructure:"extensions"` - } - - err := mapstructure.Decode(page.(ExtensionPage).Body, &resp) - - return resp.Extensions, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/urls.go deleted file mode 100644 index 6460c66bc..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/common/extensions/urls.go +++ /dev/null @@ -1,13 +0,0 @@ -package extensions - -import "github.com/rackspace/gophercloud" - -// ExtensionURL generates the URL for an extension resource by name. -func ExtensionURL(c *gophercloud.ServiceClient, name string) string { - return c.ServiceURL("extensions", name) -} - -// ListExtensionURL generates the URL for the extensions resource collection. -func ListExtensionURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("extensions") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/doc.go deleted file mode 100644 index 2571a1a5a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/doc.go +++ /dev/null @@ -1 +0,0 @@ -package defsecrules diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/fixtures.go deleted file mode 100644 index c28e492d3..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/fixtures.go +++ /dev/null @@ -1,108 +0,0 @@ -package defsecrules - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -const rootPath = "/os-security-group-default-rules" - -func mockListRulesResponse(t *testing.T) { - th.Mux.HandleFunc(rootPath, func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group_default_rules": [ - { - "from_port": 80, - "id": "{ruleID}", - "ip_protocol": "TCP", - "ip_range": { - "cidr": "10.10.10.0/24" - }, - "to_port": 80 - } - ] -} - `) - }) -} - -func mockCreateRuleResponse(t *testing.T) { - th.Mux.HandleFunc(rootPath, func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "security_group_default_rule": { - "ip_protocol": "TCP", - "from_port": 80, - "to_port": 80, - "cidr": "10.10.12.0/24" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group_default_rule": { - "from_port": 80, - "id": "{ruleID}", - "ip_protocol": "TCP", - "ip_range": { - "cidr": "10.10.12.0/24" - }, - "to_port": 80 - } -} -`) - }) -} - -func mockGetRuleResponse(t *testing.T, ruleID string) { - url := rootPath + "/" + ruleID - th.Mux.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group_default_rule": { - "id": "{ruleID}", - "from_port": 80, - "to_port": 80, - "ip_protocol": "TCP", - "ip_range": { - "cidr": "10.10.12.0/24" - } - } -} - `) - }) -} - -func mockDeleteRuleResponse(t *testing.T, ruleID string) { - url := rootPath + "/" + ruleID - th.Mux.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/requests.go deleted file mode 100644 index 9f27ef172..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/requests.go +++ /dev/null @@ -1,95 +0,0 @@ -package defsecrules - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List will return a collection of default rules. -func List(client *gophercloud.ServiceClient) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return DefaultRulePage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, rootURL(client), createPage) -} - -// CreateOpts represents the configuration for adding a new default rule. -type CreateOpts struct { - // Required - the lower bound of the port range that will be opened. - FromPort int `json:"from_port"` - - // Required - the upper bound of the port range that will be opened. - ToPort int `json:"to_port"` - - // Required - the protocol type that will be allowed, e.g. TCP. - IPProtocol string `json:"ip_protocol"` - - // ONLY required if FromGroupID is blank. This represents the IP range that - // will be the source of network traffic to your security group. Use - // 0.0.0.0/0 to allow all IP addresses. - CIDR string `json:"cidr,omitempty"` -} - -// CreateOptsBuilder builds the create rule options into a serializable format. -type CreateOptsBuilder interface { - ToRuleCreateMap() (map[string]interface{}, error) -} - -// ToRuleCreateMap builds the create rule options into a serializable format. -func (opts CreateOpts) ToRuleCreateMap() (map[string]interface{}, error) { - rule := make(map[string]interface{}) - - if opts.FromPort == 0 { - return rule, errors.New("A FromPort must be set") - } - if opts.ToPort == 0 { - return rule, errors.New("A ToPort must be set") - } - if opts.IPProtocol == "" { - return rule, errors.New("A IPProtocol must be set") - } - if opts.CIDR == "" { - return rule, errors.New("A CIDR must be set") - } - - rule["from_port"] = opts.FromPort - rule["to_port"] = opts.ToPort - rule["ip_protocol"] = opts.IPProtocol - rule["cidr"] = opts.CIDR - - return map[string]interface{}{"security_group_default_rule": rule}, nil -} - -// Create is the operation responsible for creating a new default rule. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var result CreateResult - - reqBody, err := opts.ToRuleCreateMap() - if err != nil { - result.Err = err - return result - } - - _, result.Err = client.Post(rootURL(client), reqBody, &result.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return result -} - -// Get will return details for a particular default rule. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var result GetResult - _, result.Err = client.Get(resourceURL(client, id), &result.Body, nil) - return result -} - -// Delete will permanently delete a default rule from the project. -func Delete(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult { - var result gophercloud.ErrResult - _, result.Err = client.Delete(resourceURL(client, id), nil) - return result -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/results.go deleted file mode 100644 index e588d3e32..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/results.go +++ /dev/null @@ -1,69 +0,0 @@ -package defsecrules - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups" - "github.com/rackspace/gophercloud/pagination" -) - -// DefaultRule represents a default rule - which is identical to a -// normal security rule. -type DefaultRule secgroups.Rule - -// DefaultRulePage is a single page of a DefaultRule collection. -type DefaultRulePage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a page of default rules contains any results. -func (page DefaultRulePage) IsEmpty() (bool, error) { - users, err := ExtractDefaultRules(page) - if err != nil { - return false, err - } - return len(users) == 0, nil -} - -// ExtractDefaultRules returns a slice of DefaultRules contained in a single -// page of results. -func ExtractDefaultRules(page pagination.Page) ([]DefaultRule, error) { - casted := page.(DefaultRulePage).Body - var response struct { - Rules []DefaultRule `mapstructure:"security_group_default_rules"` - } - - err := mapstructure.WeakDecode(casted, &response) - - return response.Rules, err -} - -type commonResult struct { - gophercloud.Result -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// Extract will extract a DefaultRule struct from most responses. -func (r commonResult) Extract() (*DefaultRule, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Rule DefaultRule `mapstructure:"security_group_default_rule"` - } - - err := mapstructure.WeakDecode(r.Body, &response) - - return &response.Rule, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/urls.go deleted file mode 100644 index cc928ab89..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/urls.go +++ /dev/null @@ -1,13 +0,0 @@ -package defsecrules - -import "github.com/rackspace/gophercloud" - -const rulepath = "os-security-group-default-rules" - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rulepath, id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rulepath) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/delegate.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/delegate.go deleted file mode 100644 index 10079097b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/delegate.go +++ /dev/null @@ -1,23 +0,0 @@ -package extensions - -import ( - "github.com/rackspace/gophercloud" - common "github.com/rackspace/gophercloud/openstack/common/extensions" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtractExtensions interprets a Page as a slice of Extensions. -func ExtractExtensions(page pagination.Page) ([]common.Extension, error) { - return common.ExtractExtensions(page) -} - -// Get retrieves information for a specific extension using its alias. -func Get(c *gophercloud.ServiceClient, alias string) common.GetResult { - return common.Get(c, alias) -} - -// List returns a Pager which allows you to iterate over the full collection of extensions. -// It does not accept query parameters. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return common.List(c) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/doc.go deleted file mode 100644 index 80785faca..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package diskconfig provides information and interaction with the Disk -// Config extension that works with the OpenStack Compute service. -package diskconfig diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests.go deleted file mode 100644 index 7407e0d17..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests.go +++ /dev/null @@ -1,114 +0,0 @@ -package diskconfig - -import ( - "errors" - - "github.com/rackspace/gophercloud/openstack/compute/v2/servers" -) - -// DiskConfig represents one of the two possible settings for the DiskConfig option when creating, -// rebuilding, or resizing servers: Auto or Manual. -type DiskConfig string - -const ( - // Auto builds a server with a single partition the size of the target flavor disk and - // automatically adjusts the filesystem to fit the entire partition. Auto may only be used with - // images and servers that use a single EXT3 partition. - Auto DiskConfig = "AUTO" - - // Manual builds a server using whatever partition scheme and filesystem are present in the source - // image. If the target flavor disk is larger, the remaining space is left unpartitioned. This - // enables images to have non-EXT3 filesystems, multiple partitions, and so on, and enables you - // to manage the disk configuration. It also results in slightly shorter boot times. - Manual DiskConfig = "MANUAL" -) - -// ErrInvalidDiskConfig is returned if an invalid string is specified for a DiskConfig option. -var ErrInvalidDiskConfig = errors.New("DiskConfig must be either diskconfig.Auto or diskconfig.Manual.") - -// Validate ensures that a DiskConfig contains an appropriate value. -func (config DiskConfig) validate() error { - switch config { - case Auto, Manual: - return nil - default: - return ErrInvalidDiskConfig - } -} - -// CreateOptsExt adds a DiskConfig option to the base CreateOpts. -type CreateOptsExt struct { - servers.CreateOptsBuilder - - // DiskConfig [optional] controls how the created server's disk is partitioned. - DiskConfig DiskConfig `json:"OS-DCF:diskConfig,omitempty"` -} - -// ToServerCreateMap adds the diskconfig option to the base server creation options. -func (opts CreateOptsExt) ToServerCreateMap() (map[string]interface{}, error) { - base, err := opts.CreateOptsBuilder.ToServerCreateMap() - if err != nil { - return nil, err - } - - if string(opts.DiskConfig) == "" { - return base, nil - } - - serverMap := base["server"].(map[string]interface{}) - serverMap["OS-DCF:diskConfig"] = string(opts.DiskConfig) - - return base, nil -} - -// RebuildOptsExt adds a DiskConfig option to the base RebuildOpts. -type RebuildOptsExt struct { - servers.RebuildOptsBuilder - - // DiskConfig [optional] controls how the rebuilt server's disk is partitioned. - DiskConfig DiskConfig -} - -// ToServerRebuildMap adds the diskconfig option to the base server rebuild options. -func (opts RebuildOptsExt) ToServerRebuildMap() (map[string]interface{}, error) { - err := opts.DiskConfig.validate() - if err != nil { - return nil, err - } - - base, err := opts.RebuildOptsBuilder.ToServerRebuildMap() - if err != nil { - return nil, err - } - - serverMap := base["rebuild"].(map[string]interface{}) - serverMap["OS-DCF:diskConfig"] = string(opts.DiskConfig) - - return base, nil -} - -// ResizeOptsExt adds a DiskConfig option to the base server resize options. -type ResizeOptsExt struct { - servers.ResizeOptsBuilder - - // DiskConfig [optional] controls how the resized server's disk is partitioned. - DiskConfig DiskConfig -} - -// ToServerResizeMap adds the diskconfig option to the base server creation options. -func (opts ResizeOptsExt) ToServerResizeMap() (map[string]interface{}, error) { - err := opts.DiskConfig.validate() - if err != nil { - return nil, err - } - - base, err := opts.ResizeOptsBuilder.ToServerResizeMap() - if err != nil { - return nil, err - } - - serverMap := base["resize"].(map[string]interface{}) - serverMap["OS-DCF:diskConfig"] = string(opts.DiskConfig) - - return base, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/results.go deleted file mode 100644 index 10ec2dafc..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/results.go +++ /dev/null @@ -1,60 +0,0 @@ -package diskconfig - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/compute/v2/servers" - "github.com/rackspace/gophercloud/pagination" -) - -func commonExtract(result gophercloud.Result) (*DiskConfig, error) { - var resp struct { - Server struct { - DiskConfig string `mapstructure:"OS-DCF:diskConfig"` - } `mapstructure:"server"` - } - - err := mapstructure.Decode(result.Body, &resp) - if err != nil { - return nil, err - } - - config := DiskConfig(resp.Server.DiskConfig) - return &config, nil -} - -// ExtractGet returns the disk configuration from a servers.Get call. -func ExtractGet(result servers.GetResult) (*DiskConfig, error) { - return commonExtract(result.Result) -} - -// ExtractUpdate returns the disk configuration from a servers.Update call. -func ExtractUpdate(result servers.UpdateResult) (*DiskConfig, error) { - return commonExtract(result.Result) -} - -// ExtractRebuild returns the disk configuration from a servers.Rebuild call. -func ExtractRebuild(result servers.RebuildResult) (*DiskConfig, error) { - return commonExtract(result.Result) -} - -// ExtractDiskConfig returns the DiskConfig setting for a specific server acquired from an -// servers.ExtractServers call, while iterating through a Pager. -func ExtractDiskConfig(page pagination.Page, index int) (*DiskConfig, error) { - casted := page.(servers.ServerPage).Body - - type server struct { - DiskConfig string `mapstructure:"OS-DCF:diskConfig"` - } - var response struct { - Servers []server `mapstructure:"servers"` - } - - err := mapstructure.Decode(casted, &response) - if err != nil { - return nil, err - } - - config := DiskConfig(response.Servers[index].DiskConfig) - return &config, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/doc.go deleted file mode 100644 index 2b447da1d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package extensions provides information and interaction with the -// different extensions available for the OpenStack Compute service. -package extensions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/doc.go deleted file mode 100644 index fafe4a04d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package network provides the ability to manage nova-networks -package networks diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/fixtures.go deleted file mode 100644 index 12b94859b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/fixtures.go +++ /dev/null @@ -1,209 +0,0 @@ -// +build fixtures - -package networks - -import ( - "fmt" - "net/http" - "testing" - "time" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -// ListOutput is a sample response to a List call. -const ListOutput = ` -{ - "networks": [ - { - "bridge": "br100", - "bridge_interface": "eth0", - "broadcast": "10.0.0.7", - "cidr": "10.0.0.0/29", - "cidr_v6": null, - "created_at": "2011-08-15 06:19:19.387525", - "deleted": false, - "deleted_at": null, - "dhcp_start": "10.0.0.3", - "dns1": null, - "dns2": null, - "gateway": "10.0.0.1", - "gateway_v6": null, - "host": "nsokolov-desktop", - "id": "20c8acc0-f747-4d71-a389-46d078ebf047", - "injected": false, - "label": "mynet_0", - "multi_host": false, - "netmask": "255.255.255.248", - "netmask_v6": null, - "priority": null, - "project_id": "1234", - "rxtx_base": null, - "updated_at": "2011-08-16 09:26:13.048257", - "vlan": 100, - "vpn_private_address": "10.0.0.2", - "vpn_public_address": "127.0.0.1", - "vpn_public_port": 1000 - }, - { - "bridge": "br101", - "bridge_interface": "eth0", - "broadcast": "10.0.0.15", - "cidr": "10.0.0.10/29", - "cidr_v6": null, - "created_at": "2011-08-15 06:19:19.885495", - "deleted": false, - "deleted_at": null, - "dhcp_start": "10.0.0.11", - "dns1": null, - "dns2": null, - "gateway": "10.0.0.9", - "gateway_v6": null, - "host": null, - "id": "20c8acc0-f747-4d71-a389-46d078ebf000", - "injected": false, - "label": "mynet_1", - "multi_host": false, - "netmask": "255.255.255.248", - "netmask_v6": null, - "priority": null, - "project_id": null, - "rxtx_base": null, - "updated_at": null, - "vlan": 101, - "vpn_private_address": "10.0.0.10", - "vpn_public_address": null, - "vpn_public_port": 1001 - } - ] -} -` - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "network": { - "bridge": "br101", - "bridge_interface": "eth0", - "broadcast": "10.0.0.15", - "cidr": "10.0.0.10/29", - "cidr_v6": null, - "created_at": "2011-08-15 06:19:19.885495", - "deleted": false, - "deleted_at": null, - "dhcp_start": "10.0.0.11", - "dns1": null, - "dns2": null, - "gateway": "10.0.0.9", - "gateway_v6": null, - "host": null, - "id": "20c8acc0-f747-4d71-a389-46d078ebf000", - "injected": false, - "label": "mynet_1", - "multi_host": false, - "netmask": "255.255.255.248", - "netmask_v6": null, - "priority": null, - "project_id": null, - "rxtx_base": null, - "updated_at": null, - "vlan": 101, - "vpn_private_address": "10.0.0.10", - "vpn_public_address": null, - "vpn_public_port": 1001 - } -} -` - -// FirstNetwork is the first result in ListOutput. -var nilTime time.Time -var FirstNetwork = Network{ - Bridge: "br100", - BridgeInterface: "eth0", - Broadcast: "10.0.0.7", - CIDR: "10.0.0.0/29", - CIDRv6: "", - CreatedAt: time.Date(2011, 8, 15, 6, 19, 19, 387525000, time.UTC), - Deleted: false, - DeletedAt: nilTime, - DHCPStart: "10.0.0.3", - DNS1: "", - DNS2: "", - Gateway: "10.0.0.1", - Gatewayv6: "", - Host: "nsokolov-desktop", - ID: "20c8acc0-f747-4d71-a389-46d078ebf047", - Injected: false, - Label: "mynet_0", - MultiHost: false, - Netmask: "255.255.255.248", - Netmaskv6: "", - Priority: 0, - ProjectID: "1234", - RXTXBase: 0, - UpdatedAt: time.Date(2011, 8, 16, 9, 26, 13, 48257000, time.UTC), - VLAN: 100, - VPNPrivateAddress: "10.0.0.2", - VPNPublicAddress: "127.0.0.1", - VPNPublicPort: 1000, -} - -// SecondNetwork is the second result in ListOutput. -var SecondNetwork = Network{ - Bridge: "br101", - BridgeInterface: "eth0", - Broadcast: "10.0.0.15", - CIDR: "10.0.0.10/29", - CIDRv6: "", - CreatedAt: time.Date(2011, 8, 15, 6, 19, 19, 885495000, time.UTC), - Deleted: false, - DeletedAt: nilTime, - DHCPStart: "10.0.0.11", - DNS1: "", - DNS2: "", - Gateway: "10.0.0.9", - Gatewayv6: "", - Host: "", - ID: "20c8acc0-f747-4d71-a389-46d078ebf000", - Injected: false, - Label: "mynet_1", - MultiHost: false, - Netmask: "255.255.255.248", - Netmaskv6: "", - Priority: 0, - ProjectID: "", - RXTXBase: 0, - UpdatedAt: nilTime, - VLAN: 101, - VPNPrivateAddress: "10.0.0.10", - VPNPublicAddress: "", - VPNPublicPort: 1001, -} - -// ExpectedNetworkSlice is the slice of results that should be parsed -// from ListOutput, in the expected order. -var ExpectedNetworkSlice = []Network{FirstNetwork, SecondNetwork} - -// HandleListSuccessfully configures the test server to respond to a List request. -func HandleListSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-networks", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, ListOutput) - }) -} - -// HandleGetSuccessfully configures the test server to respond to a Get request -// for an existing network. -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-networks/20c8acc0-f747-4d71-a389-46d078ebf000", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, GetOutput) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests.go deleted file mode 100644 index eb203878b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests.go +++ /dev/null @@ -1,22 +0,0 @@ -package networks - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager that allows you to iterate over a collection of Network. -func List(client *gophercloud.ServiceClient) pagination.Pager { - url := listURL(client) - createPage := func(r pagination.PageResult) pagination.Page { - return NetworkPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, url, createPage) -} - -// Get returns data about a previously created Network. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, id), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/results.go deleted file mode 100644 index 55b361d7f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/results.go +++ /dev/null @@ -1,222 +0,0 @@ -package networks - -import ( - "fmt" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// A Network represents a nova-network that an instance communicates on -type Network struct { - // The Bridge that VIFs on this network are connected to - Bridge string `mapstructure:"bridge"` - - // BridgeInterface is what interface is connected to the Bridge - BridgeInterface string `mapstructure:"bridge_interface"` - - // The Broadcast address of the network. - Broadcast string `mapstructure:"broadcast"` - - // CIDR is the IPv4 subnet. - CIDR string `mapstructure:"cidr"` - - // CIDRv6 is the IPv6 subnet. - CIDRv6 string `mapstructure:"cidr_v6"` - - // CreatedAt is when the network was created.. - CreatedAt time.Time `mapstructure:"-"` - - // Deleted shows if the network has been deleted. - Deleted bool `mapstructure:"deleted"` - - // DeletedAt is the time when the network was deleted. - DeletedAt time.Time `mapstructure:"-"` - - // DHCPStart is the start of the DHCP address range. - DHCPStart string `mapstructure:"dhcp_start"` - - // DNS1 is the first DNS server to use through DHCP. - DNS1 string `mapstructure:"dns_1"` - - // DNS2 is the first DNS server to use through DHCP. - DNS2 string `mapstructure:"dns_2"` - - // Gateway is the network gateway. - Gateway string `mapstructure:"gateway"` - - // Gatewayv6 is the IPv6 network gateway. - Gatewayv6 string `mapstructure:"gateway_v6"` - - // Host is the host that the network service is running on. - Host string `mapstructure:"host"` - - // ID is the UUID of the network. - ID string `mapstructure:"id"` - - // Injected determines if network information is injected into the host. - Injected bool `mapstructure:"injected"` - - // Label is the common name that the network has.. - Label string `mapstructure:"label"` - - // MultiHost is if multi-host networking is enablec.. - MultiHost bool `mapstructure:"multi_host"` - - // Netmask is the network netmask. - Netmask string `mapstructure:"netmask"` - - // Netmaskv6 is the IPv6 netmask. - Netmaskv6 string `mapstructure:"netmask_v6"` - - // Priority is the network interface priority. - Priority int `mapstructure:"priority"` - - // ProjectID is the project associated with this network. - ProjectID string `mapstructure:"project_id"` - - // RXTXBase configures bandwidth entitlement. - RXTXBase int `mapstructure:"rxtx_base"` - - // UpdatedAt is the time when the network was last updated. - UpdatedAt time.Time `mapstructure:"-"` - - // VLAN is the vlan this network runs on. - VLAN int `mapstructure:"vlan"` - - // VPNPrivateAddress is the private address of the CloudPipe VPN. - VPNPrivateAddress string `mapstructure:"vpn_private_address"` - - // VPNPublicAddress is the public address of the CloudPipe VPN. - VPNPublicAddress string `mapstructure:"vpn_public_address"` - - // VPNPublicPort is the port of the CloudPipe VPN. - VPNPublicPort int `mapstructure:"vpn_public_port"` -} - -// NetworkPage stores a single, only page of Networks -// results from a List call. -type NetworkPage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a NetworkPage is empty. -func (page NetworkPage) IsEmpty() (bool, error) { - va, err := ExtractNetworks(page) - return len(va) == 0, err -} - -// ExtractNetworks interprets a page of results as a slice of Networks -func ExtractNetworks(page pagination.Page) ([]Network, error) { - var res struct { - Networks []Network `mapstructure:"networks"` - } - - err := mapstructure.Decode(page.(NetworkPage).Body, &res) - - var rawNetworks []interface{} - body := page.(NetworkPage).Body - switch body.(type) { - case map[string]interface{}: - rawNetworks = body.(map[string]interface{})["networks"].([]interface{}) - case map[string][]interface{}: - rawNetworks = body.(map[string][]interface{})["networks"] - default: - return res.Networks, fmt.Errorf("Unknown type") - } - - for i := range rawNetworks { - thisNetwork := rawNetworks[i].(map[string]interface{}) - if t, ok := thisNetwork["created_at"].(string); ok && t != "" { - createdAt, err := time.Parse("2006-01-02 15:04:05.000000", t) - if err != nil { - return res.Networks, err - } - res.Networks[i].CreatedAt = createdAt - } - - if t, ok := thisNetwork["updated_at"].(string); ok && t != "" { - updatedAt, err := time.Parse("2006-01-02 15:04:05.000000", t) - if err != nil { - return res.Networks, err - } - res.Networks[i].UpdatedAt = updatedAt - } - - if t, ok := thisNetwork["deleted_at"].(string); ok && t != "" { - deletedAt, err := time.Parse("2006-01-02 15:04:05.000000", t) - if err != nil { - return res.Networks, err - } - res.Networks[i].DeletedAt = deletedAt - } - } - - return res.Networks, err -} - -type NetworkResult struct { - gophercloud.Result -} - -// Extract is a method that attempts to interpret any Network resource -// response as a Network struct. -func (r NetworkResult) Extract() (*Network, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Network *Network `json:"network" mapstructure:"network"` - } - - config := &mapstructure.DecoderConfig{ - Result: &res, - WeaklyTypedInput: true, - } - decoder, err := mapstructure.NewDecoder(config) - if err != nil { - return nil, err - } - - if err := decoder.Decode(r.Body); err != nil { - return nil, err - } - - b := r.Body.(map[string]interface{})["network"].(map[string]interface{}) - - if t, ok := b["created_at"].(string); ok && t != "" { - createdAt, err := time.Parse("2006-01-02 15:04:05.000000", t) - if err != nil { - return res.Network, err - } - res.Network.CreatedAt = createdAt - } - - if t, ok := b["updated_at"].(string); ok && t != "" { - updatedAt, err := time.Parse("2006-01-02 15:04:05.000000", t) - if err != nil { - return res.Network, err - } - res.Network.UpdatedAt = updatedAt - } - - if t, ok := b["deleted_at"].(string); ok && t != "" { - deletedAt, err := time.Parse("2006-01-02 15:04:05.000000", t) - if err != nil { - return res.Network, err - } - res.Network.DeletedAt = deletedAt - } - - return res.Network, err - -} - -// GetResult is the response from a Get operation. Call its Extract method to interpret it -// as a Network. -type GetResult struct { - NetworkResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls.go deleted file mode 100644 index 69664620a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls.go +++ /dev/null @@ -1,17 +0,0 @@ -package networks - -import "github.com/rackspace/gophercloud" - -const resourcePath = "os-networks" - -func resourceURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(resourcePath) -} - -func listURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(resourcePath, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/doc.go deleted file mode 100644 index d2729f874..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -/* -Package startstop provides functionality to start and stop servers that have -been provisioned by the OpenStack Compute service. -*/ -package startstop diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/fixtures.go deleted file mode 100644 index 670828a98..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/fixtures.go +++ /dev/null @@ -1,27 +0,0 @@ -package startstop - -import ( - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -func mockStartServerResponse(t *testing.T, id string) { - th.Mux.HandleFunc("/servers/"+id+"/action", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - th.TestJSONRequest(t, r, `{"os-start": null}`) - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockStopServerResponse(t *testing.T, id string) { - th.Mux.HandleFunc("/servers/"+id+"/action", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - th.TestJSONRequest(t, r, `{"os-stop": null}`) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/requests.go deleted file mode 100644 index 0e090e69f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/requests.go +++ /dev/null @@ -1,23 +0,0 @@ -package startstop - -import "github.com/rackspace/gophercloud" - -func actionURL(client *gophercloud.ServiceClient, id string) string { - return client.ServiceURL("servers", id, "action") -} - -// Start is the operation responsible for starting a Compute server. -func Start(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult { - var res gophercloud.ErrResult - reqBody := map[string]interface{}{"os-start": nil} - _, res.Err = client.Post(actionURL(client, id), reqBody, nil, nil) - return res -} - -// Stop is the operation responsible for stopping a Compute server. -func Stop(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult { - var res gophercloud.ErrResult - reqBody := map[string]interface{}{"os-stop": nil} - _, res.Err = client.Post(actionURL(client, id), reqBody, nil, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go deleted file mode 100644 index 183391a62..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -/* -This is package created is to hold fixtures (which imports testing), -so that importing volumeattach package does not inadvertently import testing into production code -More information here: -https://github.com/rackspace/gophercloud/issues/473 -*/ -package testing diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/fixtures.go deleted file mode 100644 index c469bfbc8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/fixtures.go +++ /dev/null @@ -1,110 +0,0 @@ -// +build fixtures - -package testing - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -// ListOutput is a sample response to a List call. -const ListOutput = ` -{ - "volumeAttachments": [ - { - "device": "/dev/vdd", - "id": "a26887c6-c47b-4654-abb5-dfadf7d3f803", - "serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f803" - }, - { - "device": "/dev/vdc", - "id": "a26887c6-c47b-4654-abb5-dfadf7d3f804", - "serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f804" - } - ] -} -` - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "volumeAttachment": { - "device": "/dev/vdc", - "id": "a26887c6-c47b-4654-abb5-dfadf7d3f804", - "serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f804" - } -} -` - -// CreateOutput is a sample response to a Create call. -const CreateOutput = ` -{ - "volumeAttachment": { - "device": "/dev/vdc", - "id": "a26887c6-c47b-4654-abb5-dfadf7d3f804", - "serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f804" - } -} -` - -// HandleListSuccessfully configures the test server to respond to a List request. -func HandleListSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/os-volume_attachments", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, ListOutput) - }) -} - -// HandleGetSuccessfully configures the test server to respond to a Get request -// for an existing attachment -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/os-volume_attachments/a26887c6-c47b-4654-abb5-dfadf7d3f804", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, GetOutput) - }) -} - -// HandleCreateSuccessfully configures the test server to respond to a Create request -// for a new attachment -func HandleCreateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/os-volume_attachments", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - th.TestJSONRequest(t, r, ` -{ - "volumeAttachment": { - "volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f804", - "device": "/dev/vdc" - } -} -`) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, CreateOutput) - }) -} - -// HandleDeleteSuccessfully configures the test server to respond to a Delete request for a -// an existing attachment -func HandleDeleteSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/os-volume_attachments/a26887c6-c47b-4654-abb5-dfadf7d3f804", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/doc.go deleted file mode 100644 index 45b9cfb4e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package configurations provides information and interaction with the -// configuration API resource in the Rackspace Database service. -// -// A configuration group is a collection of key/value pairs which define how a -// particular database operates. These key/value pairs are specific to each -// datastore type and serve like settings. Some directives are capable of being -// applied dynamically, while other directives require a server restart to take -// effect. The configuration group can be applied to an instance at creation or -// applied to an existing instance to modify the behavior of the running -// datastore on the instance. -package configurations diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/fixtures.go deleted file mode 100644 index ae6541615..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/fixtures.go +++ /dev/null @@ -1,157 +0,0 @@ -package configurations - -import ( - "fmt" - "time" -) - -var ( - timestamp = "2015-11-12T14:22:42Z" - timeVal, _ = time.Parse(time.RFC3339, timestamp) -) - -var singleConfigJSON = ` -{ - "created": "` + timestamp + `", - "datastore_name": "mysql", - "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "datastore_version_name": "5.6", - "description": "example_description", - "id": "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - "name": "example-configuration-name", - "updated": "` + timestamp + `" -} -` - -var singleConfigWithValuesJSON = ` -{ - "created": "` + timestamp + `", - "datastore_name": "mysql", - "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "datastore_version_name": "5.6", - "description": "example description", - "id": "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - "instance_count": 0, - "name": "example-configuration-name", - "updated": "` + timestamp + `", - "values": { - "collation_server": "latin1_swedish_ci", - "connect_timeout": 120 - } -} -` - -var ( - ListConfigsJSON = fmt.Sprintf(`{"configurations": [%s]}`, singleConfigJSON) - GetConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigJSON) - CreateConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigWithValuesJSON) -) - -var CreateReq = ` -{ - "configuration": { - "datastore": { - "type": "a00000a0-00a0-0a00-00a0-000a000000aa", - "version": "b00000b0-00b0-0b00-00b0-000b000000bb" - }, - "description": "example description", - "name": "example-configuration-name", - "values": { - "collation_server": "latin1_swedish_ci", - "connect_timeout": 120 - } - } -} -` - -var UpdateReq = ` -{ - "configuration": { - "values": { - "connect_timeout": 300 - } - } -} -` - -var ListInstancesJSON = ` -{ - "instances": [ - { - "id": "d4603f69-ec7e-4e9b-803f-600b9205576f", - "name": "json_rack_instance" - } - ] -} -` - -var ListParamsJSON = ` -{ - "configuration-parameters": [ - { - "max": 1, - "min": 0, - "name": "innodb_file_per_table", - "restart_required": true, - "type": "integer" - }, - { - "max": 4294967296, - "min": 0, - "name": "key_buffer_size", - "restart_required": false, - "type": "integer" - }, - { - "max": 65535, - "min": 2, - "name": "connect_timeout", - "restart_required": false, - "type": "integer" - }, - { - "max": 4294967296, - "min": 0, - "name": "join_buffer_size", - "restart_required": false, - "type": "integer" - } - ] -} -` - -var GetParamJSON = ` -{ - "max": 1, - "min": 0, - "name": "innodb_file_per_table", - "restart_required": true, - "type": "integer" -} -` - -var ExampleConfig = Config{ - Created: timeVal, - DatastoreName: "mysql", - DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb", - DatastoreVersionName: "5.6", - Description: "example_description", - ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - Name: "example-configuration-name", - Updated: timeVal, -} - -var ExampleConfigWithValues = Config{ - Created: timeVal, - DatastoreName: "mysql", - DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb", - DatastoreVersionName: "5.6", - Description: "example description", - ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - Name: "example-configuration-name", - Updated: timeVal, - Values: map[string]interface{}{ - "collation_server": "latin1_swedish_ci", - "connect_timeout": 120, - }, -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/requests.go deleted file mode 100644 index 83c710206..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/requests.go +++ /dev/null @@ -1,287 +0,0 @@ -package configurations - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/db/v1/instances" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all of the available configurations. -func List(client *gophercloud.ServiceClient) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return ConfigPage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, baseURL(client), pageFn) -} - -// CreateOptsBuilder is a top-level interface which renders a JSON map. -type CreateOptsBuilder interface { - ToConfigCreateMap() (map[string]interface{}, error) -} - -// DatastoreOpts is the primary options struct for creating and modifying -// how configuration resources are associated with datastores. -type DatastoreOpts struct { - // [OPTIONAL] The type of datastore. Defaults to "MySQL". - Type string - - // [OPTIONAL] The specific version of a datastore. Defaults to "5.6". - Version string -} - -// ToMap renders a JSON map for a datastore setting. -func (opts DatastoreOpts) ToMap() (map[string]string, error) { - datastore := map[string]string{} - - if opts.Type != "" { - datastore["type"] = opts.Type - } - - if opts.Version != "" { - datastore["version"] = opts.Version - } - - return datastore, nil -} - -// CreateOpts is the struct responsible for configuring new configurations. -type CreateOpts struct { - // [REQUIRED] The configuration group name - Name string - - // [REQUIRED] A map of user-defined configuration settings that will define - // how each associated datastore works. Each key/value pair is specific to a - // datastore type. - Values map[string]interface{} - - // [OPTIONAL] Associates the configuration group with a particular datastore. - Datastore *DatastoreOpts - - // [OPTIONAL] A human-readable explanation for the group. - Description string -} - -// ToConfigCreateMap casts a CreateOpts struct into a JSON map. -func (opts CreateOpts) ToConfigCreateMap() (map[string]interface{}, error) { - if opts.Name == "" { - return nil, errors.New("Name is a required field") - } - if len(opts.Values) == 0 { - return nil, errors.New("Values must be a populated map") - } - - config := map[string]interface{}{ - "name": opts.Name, - "values": opts.Values, - } - - if opts.Datastore != nil { - ds, err := opts.Datastore.ToMap() - if err != nil { - return config, err - } - config["datastore"] = ds - } - - if opts.Description != "" { - config["description"] = opts.Description - } - - return map[string]interface{}{"configuration": config}, nil -} - -// Create will create a new configuration group. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToConfigCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("POST", baseURL(client), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONBody: &reqBody, - JSONResponse: &res.Body, - }) - - return res -} - -// Get will retrieve the details for a specified configuration group. -func Get(client *gophercloud.ServiceClient, configID string) GetResult { - var res GetResult - - _, res.Err = client.Request("GET", resourceURL(client, configID), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONResponse: &res.Body, - }) - - return res -} - -// UpdateOptsBuilder is the top-level interface for casting update options into -// JSON maps. -type UpdateOptsBuilder interface { - ToConfigUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the struct responsible for modifying existing configurations. -type UpdateOpts struct { - // [OPTIONAL] The configuration group name - Name string - - // [OPTIONAL] A map of user-defined configuration settings that will define - // how each associated datastore works. Each key/value pair is specific to a - // datastore type. - Values map[string]interface{} - - // [OPTIONAL] Associates the configuration group with a particular datastore. - Datastore *DatastoreOpts - - // [OPTIONAL] A human-readable explanation for the group. - Description string -} - -// ToConfigUpdateMap will cast an UpdateOpts struct into a JSON map. -func (opts UpdateOpts) ToConfigUpdateMap() (map[string]interface{}, error) { - config := map[string]interface{}{} - - if opts.Name != "" { - config["name"] = opts.Name - } - - if opts.Description != "" { - config["description"] = opts.Description - } - - if opts.Datastore != nil { - ds, err := opts.Datastore.ToMap() - if err != nil { - return config, err - } - config["datastore"] = ds - } - - if len(opts.Values) > 0 { - config["values"] = opts.Values - } - - return map[string]interface{}{"configuration": config}, nil -} - -// Update will modify an existing configuration group by performing a merge -// between new and existing values. If the key already exists, the new value -// will overwrite. All other keys will remain unaffected. -func Update(client *gophercloud.ServiceClient, configID string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToConfigUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("PATCH", resourceURL(client, configID), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONBody: &reqBody, - }) - - return res -} - -// Replace will modify an existing configuration group by overwriting the -// entire parameter group with the new values provided. Any existing keys not -// included in UpdateOptsBuilder will be deleted. -func Replace(client *gophercloud.ServiceClient, configID string, opts UpdateOptsBuilder) ReplaceResult { - var res ReplaceResult - - reqBody, err := opts.ToConfigUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("PUT", resourceURL(client, configID), gophercloud.RequestOpts{ - OkCodes: []int{202}, - JSONBody: &reqBody, - }) - - return res -} - -// Delete will permanently delete a configuration group. Please note that -// config groups cannot be deleted whilst still attached to running instances - -// you must detach and then delete them. -func Delete(client *gophercloud.ServiceClient, configID string) DeleteResult { - var res DeleteResult - - _, res.Err = client.Request("DELETE", resourceURL(client, configID), gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - - return res -} - -// ListInstances will list all the instances associated with a particular -// configuration group. -func ListInstances(client *gophercloud.ServiceClient, configID string) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return instances.InstancePage{pagination.LinkedPageBase{PageResult: r}} - } - return pagination.NewPager(client, instancesURL(client, configID), pageFn) -} - -// ListDatastoreParams will list all the available and supported parameters -// that can be used for a particular datastore ID and a particular version. -// For example, if you are wondering how you can configure a MySQL 5.6 instance, -// you can use this operation (you will need to retrieve the MySQL datastore ID -// by using the datastores API). -func ListDatastoreParams(client *gophercloud.ServiceClient, datastoreID, versionID string) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return ParamPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, listDSParamsURL(client, datastoreID, versionID), pageFn) -} - -// GetDatastoreParam will retrieve information about a specific configuration -// parameter. For example, you can use this operation to understand more about -// "innodb_file_per_table" configuration param for MySQL datastores. You will -// need the param's ID first, which can be attained by using the ListDatastoreParams -// operation. -func GetDatastoreParam(client *gophercloud.ServiceClient, datastoreID, versionID, paramID string) ParamResult { - var res ParamResult - - _, res.Err = client.Request("GET", getDSParamURL(client, datastoreID, versionID, paramID), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONResponse: &res.Body, - }) - - return res -} - -// ListGlobalParams is similar to ListDatastoreParams but does not require a -// DatastoreID. -func ListGlobalParams(client *gophercloud.ServiceClient, versionID string) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return ParamPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, listGlobalParamsURL(client, versionID), pageFn) -} - -// GetGlobalParam is similar to GetDatastoreParam but does not require a -// DatastoreID. -func GetGlobalParam(client *gophercloud.ServiceClient, versionID, paramID string) ParamResult { - var res ParamResult - - _, res.Err = client.Request("GET", getGlobalParamURL(client, versionID, paramID), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONResponse: &res.Body, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/results.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/results.go deleted file mode 100644 index d0d1d6e99..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/results.go +++ /dev/null @@ -1,197 +0,0 @@ -package configurations - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Config represents a configuration group API resource. -type Config struct { - Created time.Time `mapstructure:"-"` - Updated time.Time `mapstructure:"-"` - DatastoreName string `mapstructure:"datastore_name"` - DatastoreVersionID string `mapstructure:"datastore_version_id"` - DatastoreVersionName string `mapstructure:"datastore_version_name"` - Description string - ID string - Name string - Values map[string]interface{} -} - -// ConfigPage contains a page of Config resources in a paginated collection. -type ConfigPage struct { - pagination.SinglePageBase -} - -// IsEmpty indicates whether a ConfigPage is empty. -func (r ConfigPage) IsEmpty() (bool, error) { - is, err := ExtractConfigs(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractConfigs will retrieve a slice of Config structs from a page. -func ExtractConfigs(page pagination.Page) ([]Config, error) { - casted := page.(ConfigPage).Body - - var resp struct { - Configs []Config `mapstructure:"configurations" json:"configurations"` - } - - if err := mapstructure.Decode(casted, &resp); err != nil { - return nil, err - } - - var vals []interface{} - switch casted.(type) { - case map[string]interface{}: - vals = casted.(map[string]interface{})["configurations"].([]interface{}) - case map[string][]interface{}: - vals = casted.(map[string][]interface{})["configurations"] - default: - return resp.Configs, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i, v := range vals { - val := v.(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Configs, err - } - resp.Configs[i].Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Configs, err - } - resp.Configs[i].Updated = updatedTime - } - } - - return resp.Configs, nil -} - -type commonResult struct { - gophercloud.Result -} - -// Extract will retrieve a Config resource from an operation result. -func (r commonResult) Extract() (*Config, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Config Config `mapstructure:"configuration"` - } - - err := mapstructure.Decode(r.Body, &response) - val := r.Body.(map[string]interface{})["configuration"].(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Config, err - } - response.Config.Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Config, err - } - response.Config.Updated = updatedTime - } - - return &response.Config, err -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - commonResult -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - commonResult -} - -// UpdateResult represents the result of an Update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -// ReplaceResult represents the result of a Replace operation. -type ReplaceResult struct { - gophercloud.ErrResult -} - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Param represents a configuration parameter API resource. -type Param struct { - Max int - Min int - Name string - RestartRequired bool `mapstructure:"restart_required" json:"restart_required"` - Type string -} - -// ParamPage contains a page of Param resources in a paginated collection. -type ParamPage struct { - pagination.SinglePageBase -} - -// IsEmpty indicates whether a ParamPage is empty. -func (r ParamPage) IsEmpty() (bool, error) { - is, err := ExtractParams(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractParams will retrieve a slice of Param structs from a page. -func ExtractParams(page pagination.Page) ([]Param, error) { - casted := page.(ParamPage).Body - - var resp struct { - Params []Param `mapstructure:"configuration-parameters" json:"configuration-parameters"` - } - - err := mapstructure.Decode(casted, &resp) - return resp.Params, err -} - -// ParamResult represents the result of an operation which retrieves details -// about a particular configuration param. -type ParamResult struct { - gophercloud.Result -} - -// Extract will retrieve a param from an operation result. -func (r ParamResult) Extract() (*Param, error) { - if r.Err != nil { - return nil, r.Err - } - - var param Param - - err := mapstructure.Decode(r.Body, ¶m) - return ¶m, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/urls.go deleted file mode 100644 index abea96158..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/configurations/urls.go +++ /dev/null @@ -1,31 +0,0 @@ -package configurations - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("configurations") -} - -func resourceURL(c *gophercloud.ServiceClient, configID string) string { - return c.ServiceURL("configurations", configID) -} - -func instancesURL(c *gophercloud.ServiceClient, configID string) string { - return c.ServiceURL("configurations", configID, "instances") -} - -func listDSParamsURL(c *gophercloud.ServiceClient, datastoreID, versionID string) string { - return c.ServiceURL("datastores", datastoreID, "versions", versionID, "parameters") -} - -func getDSParamURL(c *gophercloud.ServiceClient, datastoreID, versionID, paramID string) string { - return c.ServiceURL("datastores", datastoreID, "versions", versionID, "parameters", paramID) -} - -func listGlobalParamsURL(c *gophercloud.ServiceClient, versionID string) string { - return c.ServiceURL("datastores", "versions", versionID, "parameters") -} - -func getGlobalParamURL(c *gophercloud.ServiceClient, versionID, paramID string) string { - return c.ServiceURL("datastores", "versions", versionID, "parameters", paramID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/doc.go deleted file mode 100644 index 15275fe5d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package flavors provides information and interaction with the database API -// resource in the OpenStack Database service. -// -// A database, when referred to here, refers to the database engine running on -// an instance. -package databases diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/fixtures.go deleted file mode 100644 index 3e677211b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/fixtures.go +++ /dev/null @@ -1,61 +0,0 @@ -package databases - -import ( - "testing" - - "github.com/rackspace/gophercloud/testhelper/fixture" -) - -var ( - instanceID = "{instanceID}" - resURL = "/instances/" + instanceID + "/databases" -) - -var createDBsReq = ` -{ - "databases": [ - { - "character_set": "utf8", - "collate": "utf8_general_ci", - "name": "testingdb" - }, - { - "name": "sampledb" - } - ] -} -` - -var listDBsResp = ` -{ - "databases": [ - { - "name": "anotherexampledb" - }, - { - "name": "exampledb" - }, - { - "name": "nextround" - }, - { - "name": "sampledb" - }, - { - "name": "testingdb" - } - ] -} -` - -func HandleCreate(t *testing.T) { - fixture.SetupHandler(t, resURL, "POST", createDBsReq, "", 202) -} - -func HandleList(t *testing.T) { - fixture.SetupHandler(t, resURL, "GET", "", listDBsResp, 200) -} - -func HandleDelete(t *testing.T) { - fixture.SetupHandler(t, resURL+"/{dbName}", "DELETE", "", "", 202) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/requests.go deleted file mode 100644 index f1eb5d9ae..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/requests.go +++ /dev/null @@ -1,115 +0,0 @@ -package databases - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsBuilder builds create options -type CreateOptsBuilder interface { - ToDBCreateMap() (map[string]interface{}, error) -} - -// DatabaseOpts is the struct responsible for configuring a database; often in -// the context of an instance. -type CreateOpts struct { - // [REQUIRED] Specifies the name of the database. Valid names can be composed - // of the following characters: letters (either case); numbers; these - // characters '@', '?', '#', ' ' but NEVER beginning a name string; '_' is - // permitted anywhere. Prohibited characters that are forbidden include: - // single quotes, double quotes, back quotes, semicolons, commas, backslashes, - // and forward slashes. - Name string - - // [OPTIONAL] Set of symbols and encodings. The default character set is - // "utf8". See http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html for - // supported character sets. - CharSet string - - // [OPTIONAL] Set of rules for comparing characters in a character set. The - // default value for collate is "utf8_general_ci". See - // http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html for supported - // collations. - Collate string -} - -// ToMap is a helper function to convert individual DB create opt structures -// into sub-maps. -func (opts CreateOpts) ToMap() (map[string]string, error) { - if opts.Name == "" { - return nil, fmt.Errorf("Name is a required field") - } - if len(opts.Name) > 64 { - return nil, fmt.Errorf("Name must be less than 64 chars long") - } - - db := map[string]string{"name": opts.Name} - - if opts.CharSet != "" { - db["character_set"] = opts.CharSet - } - if opts.Collate != "" { - db["collate"] = opts.Collate - } - return db, nil -} - -// BatchCreateOpts allows for multiple databases to created and modified. -type BatchCreateOpts []CreateOpts - -// ToDBCreateMap renders a JSON map for creating DBs. -func (opts BatchCreateOpts) ToDBCreateMap() (map[string]interface{}, error) { - dbs := make([]map[string]string, len(opts)) - for i, db := range opts { - dbMap, err := db.ToMap() - if err != nil { - return nil, err - } - dbs[i] = dbMap - } - return map[string]interface{}{"databases": dbs}, nil -} - -// Create will create a new database within the specified instance. If the -// specified instance does not exist, a 404 error will be returned. -func Create(client *gophercloud.ServiceClient, instanceID string, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToDBCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("POST", baseURL(client, instanceID), gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{202}, - }) - - return res -} - -// List will list all of the databases for a specified instance. Note: this -// operation will only return user-defined databases; it will exclude system -// databases like "mysql", "information_schema", "lost+found" etc. -func List(client *gophercloud.ServiceClient, instanceID string) pagination.Pager { - createPageFn := func(r pagination.PageResult) pagination.Page { - return DBPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, baseURL(client, instanceID), createPageFn) -} - -// Delete will permanently delete the database within a specified instance. -// All contained data inside the database will also be permanently deleted. -func Delete(client *gophercloud.ServiceClient, instanceID, dbName string) DeleteResult { - var res DeleteResult - - _, res.Err = client.Request("DELETE", dbURL(client, instanceID, dbName), gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/results.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/results.go deleted file mode 100644 index 7d4b6aeb2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/results.go +++ /dev/null @@ -1,72 +0,0 @@ -package databases - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Database represents a Database API resource. -type Database struct { - // Specifies the name of the MySQL database. - Name string - - // Set of symbols and encodings. The default character set is utf8. - CharSet string - - // Set of rules for comparing characters in a character set. The default - // value for collate is utf8_general_ci. - Collate string -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - gophercloud.ErrResult -} - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// DBPage represents a single page of a paginated DB collection. -type DBPage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks to see whether the collection is empty. -func (page DBPage) IsEmpty() (bool, error) { - dbs, err := ExtractDBs(page) - if err != nil { - return true, err - } - return len(dbs) == 0, nil -} - -// NextPageURL will retrieve the next page URL. -func (page DBPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"databases_links"` - } - - var r resp - err := mapstructure.Decode(page.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// ExtractDBs will convert a generic pagination struct into a more -// relevant slice of DB structs. -func ExtractDBs(page pagination.Page) ([]Database, error) { - casted := page.(DBPage).Body - - var response struct { - Databases []Database `mapstructure:"databases"` - } - - err := mapstructure.Decode(casted, &response) - return response.Databases, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/urls.go deleted file mode 100644 index 027ca5847..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/databases/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package databases - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient, instanceID string) string { - return c.ServiceURL("instances", instanceID, "databases") -} - -func dbURL(c *gophercloud.ServiceClient, instanceID, dbName string) string { - return c.ServiceURL("instances", instanceID, "databases", dbName) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/doc.go deleted file mode 100644 index ae14026b5..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package datastores provides information and interaction with the datastore -// API resource in the Rackspace Database service. -package datastores diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/fixtures.go deleted file mode 100644 index fd767cd3b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/fixtures.go +++ /dev/null @@ -1,100 +0,0 @@ -package datastores - -import ( - "fmt" - - "github.com/rackspace/gophercloud" -) - -const version1JSON = ` -{ - "id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "links": [ - { - "href": "https://10.240.28.38:8779/v1.0/1234/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb", - "rel": "self" - }, - { - "href": "https://10.240.28.38:8779/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb", - "rel": "bookmark" - } - ], - "name": "5.1" -} -` - -const version2JSON = ` -{ - "id": "c00000b0-00c0-0c00-00c0-000b000000cc", - "links": [ - { - "href": "https://10.240.28.38:8779/v1.0/1234/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc", - "rel": "self" - }, - { - "href": "https://10.240.28.38:8779/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc", - "rel": "bookmark" - } - ], - "name": "5.2" -} -` - -var versionsJSON = fmt.Sprintf(`"versions": [%s, %s]`, version1JSON, version2JSON) - -var singleDSJSON = fmt.Sprintf(` -{ - "default_version": "c00000b0-00c0-0c00-00c0-000b000000cc", - "id": "10000000-0000-0000-0000-000000000001", - "links": [ - { - "href": "https://10.240.28.38:8779/v1.0/1234/datastores/10000000-0000-0000-0000-000000000001", - "rel": "self" - }, - { - "href": "https://10.240.28.38:8779/datastores/10000000-0000-0000-0000-000000000001", - "rel": "bookmark" - } - ], - "name": "mysql", - %s -} -`, versionsJSON) - -var ( - ListDSResp = fmt.Sprintf(`{"datastores":[%s]}`, singleDSJSON) - GetDSResp = fmt.Sprintf(`{"datastore":%s}`, singleDSJSON) - ListVersionsResp = fmt.Sprintf(`{%s}`, versionsJSON) - GetVersionResp = fmt.Sprintf(`{"version":%s}`, version1JSON) -) - -var ExampleVersion1 = Version{ - ID: "b00000b0-00b0-0b00-00b0-000b000000bb", - Links: []gophercloud.Link{ - gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb"}, - gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb"}, - }, - Name: "5.1", -} - -var exampleVersion2 = Version{ - ID: "c00000b0-00c0-0c00-00c0-000b000000cc", - Links: []gophercloud.Link{ - gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc"}, - gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc"}, - }, - Name: "5.2", -} - -var ExampleVersions = []Version{ExampleVersion1, exampleVersion2} - -var ExampleDatastore = Datastore{ - DefaultVersion: "c00000b0-00c0-0c00-00c0-000b000000cc", - ID: "10000000-0000-0000-0000-000000000001", - Links: []gophercloud.Link{ - gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/10000000-0000-0000-0000-000000000001"}, - gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/10000000-0000-0000-0000-000000000001"}, - }, - Name: "mysql", - Versions: ExampleVersions, -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/requests.go deleted file mode 100644 index 9e147ab2d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/requests.go +++ /dev/null @@ -1,47 +0,0 @@ -package datastores - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all available datastore types that instances can use. -func List(client *gophercloud.ServiceClient) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return DatastorePage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, baseURL(client), pageFn) -} - -// Get will retrieve the details of a specified datastore type. -func Get(client *gophercloud.ServiceClient, datastoreID string) GetResult { - var res GetResult - - _, res.Err = client.Request("GET", resourceURL(client, datastoreID), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONResponse: &res.Body, - }) - - return res -} - -// ListVersions will list all of the available versions for a specified -// datastore type. -func ListVersions(client *gophercloud.ServiceClient, datastoreID string) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return VersionPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, versionsURL(client, datastoreID), pageFn) -} - -// GetVersion will retrieve the details of a specified datastore version. -func GetVersion(client *gophercloud.ServiceClient, datastoreID, versionID string) GetVersionResult { - var res GetVersionResult - - _, res.Err = client.Request("GET", versionURL(client, datastoreID, versionID), gophercloud.RequestOpts{ - OkCodes: []int{200}, - JSONResponse: &res.Body, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/results.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/results.go deleted file mode 100644 index a86a3cc60..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/results.go +++ /dev/null @@ -1,123 +0,0 @@ -package datastores - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Version represents a version API resource. Multiple versions belong to a Datastore. -type Version struct { - ID string - Links []gophercloud.Link - Name string -} - -// Datastore represents a Datastore API resource. -type Datastore struct { - DefaultVersion string `json:"default_version" mapstructure:"default_version"` - ID string - Links []gophercloud.Link - Name string - Versions []Version -} - -// DatastorePartial is a meta structure which is used in various API responses. -// It is a lightweight and truncated version of a full Datastore resource, -// offering details of the Version, Type and VersionID only. -type DatastorePartial struct { - Version string - Type string - VersionID string `json:"version_id" mapstructure:"version_id"` -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// GetVersionResult represents the result of getting a version. -type GetVersionResult struct { - gophercloud.Result -} - -// DatastorePage represents a page of datastore resources. -type DatastorePage struct { - pagination.SinglePageBase -} - -// IsEmpty indicates whether a Datastore collection is empty. -func (r DatastorePage) IsEmpty() (bool, error) { - is, err := ExtractDatastores(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractDatastores retrieves a slice of datastore structs from a paginated -// collection. -func ExtractDatastores(page pagination.Page) ([]Datastore, error) { - casted := page.(DatastorePage).Body - - var resp struct { - Datastores []Datastore `mapstructure:"datastores" json:"datastores"` - } - - err := mapstructure.Decode(casted, &resp) - return resp.Datastores, err -} - -// Extract retrieves a single Datastore struct from an operation result. -func (r GetResult) Extract() (*Datastore, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Datastore Datastore `mapstructure:"datastore"` - } - - err := mapstructure.Decode(r.Body, &response) - return &response.Datastore, err -} - -// DatastorePage represents a page of version resources. -type VersionPage struct { - pagination.SinglePageBase -} - -// IsEmpty indicates whether a collection of version resources is empty. -func (r VersionPage) IsEmpty() (bool, error) { - is, err := ExtractVersions(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractVersions retrieves a slice of versions from a paginated collection. -func ExtractVersions(page pagination.Page) ([]Version, error) { - casted := page.(VersionPage).Body - - var resp struct { - Versions []Version `mapstructure:"versions" json:"versions"` - } - - err := mapstructure.Decode(casted, &resp) - return resp.Versions, err -} - -// Extract retrieves a single Version struct from an operation result. -func (r GetVersionResult) Extract() (*Version, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Version Version `mapstructure:"version"` - } - - err := mapstructure.Decode(r.Body, &response) - return &response.Version, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/urls.go deleted file mode 100644 index c4d52480e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/datastores/urls.go +++ /dev/null @@ -1,19 +0,0 @@ -package datastores - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("datastores") -} - -func resourceURL(c *gophercloud.ServiceClient, dsID string) string { - return c.ServiceURL("datastores", dsID) -} - -func versionsURL(c *gophercloud.ServiceClient, dsID string) string { - return c.ServiceURL("datastores", dsID, "versions") -} - -func versionURL(c *gophercloud.ServiceClient, dsID, versionID string) string { - return c.ServiceURL("datastores", dsID, "versions", versionID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/doc.go deleted file mode 100644 index 4d281d562..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package flavors provides information and interaction with the flavor API -// resource in the OpenStack Database service. -// -// A flavor is an available hardware configuration for a database instance. -// Each flavor has a unique combination of disk space, memory capacity and -// priority for CPU time. -package flavors diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/fixtures.go deleted file mode 100644 index f0016bcb2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/fixtures.go +++ /dev/null @@ -1,50 +0,0 @@ -package flavors - -import ( - "fmt" - "testing" - - "github.com/rackspace/gophercloud/testhelper/fixture" -) - -const flavor = ` -{ - "id": %d, - "links": [ - { - "href": "https://openstack.example.com/v1.0/1234/flavors/%d", - "rel": "self" - }, - { - "href": "https://openstack.example.com/flavors/%d", - "rel": "bookmark" - } - ], - "name": "%s", - "ram": %d -} -` - -var ( - flavorID = "{flavorID}" - _baseURL = "/flavors" - resURL = "/flavors/" + flavorID -) - -var ( - flavor1 = fmt.Sprintf(flavor, 1, 1, 1, "m1.tiny", 512) - flavor2 = fmt.Sprintf(flavor, 2, 2, 2, "m1.small", 1024) - flavor3 = fmt.Sprintf(flavor, 3, 3, 3, "m1.medium", 2048) - flavor4 = fmt.Sprintf(flavor, 4, 4, 4, "m1.large", 4096) - - listFlavorsResp = fmt.Sprintf(`{"flavors":[%s, %s, %s, %s]}`, flavor1, flavor2, flavor3, flavor4) - getFlavorResp = fmt.Sprintf(`{"flavor": %s}`, flavor1) -) - -func HandleList(t *testing.T) { - fixture.SetupHandler(t, _baseURL, "GET", "", listFlavorsResp, 200) -} - -func HandleGet(t *testing.T) { - fixture.SetupHandler(t, resURL, "GET", "", getFlavorResp, 200) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/requests.go deleted file mode 100644 index fa34446b8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/requests.go +++ /dev/null @@ -1,29 +0,0 @@ -package flavors - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all available hardware flavors that an instance can use. The -// operation is identical to the one supported by the Nova API, but without the -// "disk" property. -func List(client *gophercloud.ServiceClient) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return FlavorPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, listURL(client), createPage) -} - -// Get will retrieve information for a specified hardware flavor. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var gr GetResult - - _, gr.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &gr.Body, - OkCodes: []int{200}, - }) - - return gr -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/results.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/results.go deleted file mode 100644 index 2cee010aa..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/results.go +++ /dev/null @@ -1,92 +0,0 @@ -package flavors - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// GetResult temporarily holds the response from a Get call. -type GetResult struct { - gophercloud.Result -} - -// Extract provides access to the individual Flavor returned by the Get function. -func (gr GetResult) Extract() (*Flavor, error) { - if gr.Err != nil { - return nil, gr.Err - } - - var result struct { - Flavor Flavor `mapstructure:"flavor"` - } - - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - WeaklyTypedInput: true, - Result: &result, - }) - - err = decoder.Decode(gr.Body) - return &result.Flavor, err -} - -// Flavor records represent (virtual) hardware configurations for server resources in a region. -type Flavor struct { - // The flavor's unique identifier. - ID string `mapstructure:"id"` - - // The RAM capacity for the flavor. - RAM int `mapstructure:"ram"` - - // The Name field provides a human-readable moniker for the flavor. - Name string `mapstructure:"name"` - - // Links to access the flavor. - Links []gophercloud.Link -} - -// FlavorPage contains a single page of the response from a List call. -type FlavorPage struct { - pagination.LinkedPageBase -} - -// IsEmpty determines if a page contains any results. -func (p FlavorPage) IsEmpty() (bool, error) { - flavors, err := ExtractFlavors(p) - if err != nil { - return true, err - } - return len(flavors) == 0, nil -} - -// NextPageURL uses the response's embedded link reference to navigate to the next page of results. -func (p FlavorPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"flavors_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// ExtractFlavors provides access to the list of flavors in a page acquired from the List operation. -func ExtractFlavors(page pagination.Page) ([]Flavor, error) { - casted := page.(FlavorPage).Body - var container struct { - Flavors []Flavor `mapstructure:"flavors"` - } - - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - WeaklyTypedInput: true, - Result: &container, - }) - - err = decoder.Decode(casted) - - return container.Flavors, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/urls.go deleted file mode 100644 index 80da11f9b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/flavors/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package flavors - -import "github.com/rackspace/gophercloud" - -func getURL(client *gophercloud.ServiceClient, id string) string { - return client.ServiceURL("flavors", id) -} - -func listURL(client *gophercloud.ServiceClient) string { - return client.ServiceURL("flavors") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/doc.go deleted file mode 100644 index dc5c90f95..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package instances provides information and interaction with the instance API -// resource in the OpenStack Database service. -// -// A database instance is an isolated database environment with compute and -// storage resources in a single tenant environment on a shared physical host -// machine. -package instances diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/fixtures.go deleted file mode 100644 index af7b185a6..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/fixtures.go +++ /dev/null @@ -1,169 +0,0 @@ -package instances - -import ( - "fmt" - "testing" - "time" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/db/v1/datastores" - "github.com/rackspace/gophercloud/openstack/db/v1/flavors" - "github.com/rackspace/gophercloud/testhelper/fixture" -) - -var ( - timestamp = "2015-11-12T14:22:42Z" - timeVal, _ = time.Parse(time.RFC3339, timestamp) -) - -var instance = ` -{ - "created": "` + timestamp + `", - "datastore": { - "type": "mysql", - "version": "5.6" - }, - "flavor": { - "id": "1", - "links": [ - { - "href": "https://my-openstack.com/v1.0/1234/flavors/1", - "rel": "self" - }, - { - "href": "https://my-openstack.com/v1.0/1234/flavors/1", - "rel": "bookmark" - } - ] - }, - "links": [ - { - "href": "https://my-openstack.com/v1.0/1234/instances/1", - "rel": "self" - } - ], - "hostname": "e09ad9a3f73309469cf1f43d11e79549caf9acf2.my-openstack.com", - "id": "{instanceID}", - "name": "json_rack_instance", - "status": "BUILD", - "updated": "` + timestamp + `", - "volume": { - "size": 2 - } -} -` - -var createReq = ` -{ - "instance": { - "databases": [ - { - "character_set": "utf8", - "collate": "utf8_general_ci", - "name": "sampledb" - }, - { - "name": "nextround" - } - ], - "flavorRef": "1", - "name": "json_rack_instance", - "users": [ - { - "databases": [ - { - "name": "sampledb" - } - ], - "name": "demouser", - "password": "demopassword" - } - ], - "volume": { - "size": 2 - } - } -} -` - -var ( - instanceID = "{instanceID}" - rootURL = "/instances" - resURL = rootURL + "/" + instanceID - uRootURL = resURL + "/root" - aURL = resURL + "/action" -) - -var ( - restartReq = `{"restart": {}}` - resizeReq = `{"resize": {"flavorRef": "2"}}` - resizeVolReq = `{"resize": {"volume": {"size": 4}}}` -) - -var ( - createResp = fmt.Sprintf(`{"instance": %s}`, instance) - listInstancesResp = fmt.Sprintf(`{"instances":[%s]}`, instance) - getInstanceResp = createResp - enableUserResp = `{"user":{"name":"root","password":"secretsecret"}}` - isUserEnabledResp = `{"rootEnabled":true}` -) - -var expectedInstance = Instance{ - Created: timeVal, - Updated: timeVal, - Flavor: flavors.Flavor{ - ID: "1", - Links: []gophercloud.Link{ - gophercloud.Link{Href: "https://my-openstack.com/v1.0/1234/flavors/1", Rel: "self"}, - gophercloud.Link{Href: "https://my-openstack.com/v1.0/1234/flavors/1", Rel: "bookmark"}, - }, - }, - Hostname: "e09ad9a3f73309469cf1f43d11e79549caf9acf2.my-openstack.com", - ID: instanceID, - Links: []gophercloud.Link{ - gophercloud.Link{Href: "https://my-openstack.com/v1.0/1234/instances/1", Rel: "self"}, - }, - Name: "json_rack_instance", - Status: "BUILD", - Volume: Volume{Size: 2}, - Datastore: datastores.DatastorePartial{ - Type: "mysql", - Version: "5.6", - }, -} - -func HandleCreate(t *testing.T) { - fixture.SetupHandler(t, rootURL, "POST", createReq, createResp, 200) -} - -func HandleList(t *testing.T) { - fixture.SetupHandler(t, rootURL, "GET", "", listInstancesResp, 200) -} - -func HandleGet(t *testing.T) { - fixture.SetupHandler(t, resURL, "GET", "", getInstanceResp, 200) -} - -func HandleDelete(t *testing.T) { - fixture.SetupHandler(t, resURL, "DELETE", "", "", 202) -} - -func HandleEnableRoot(t *testing.T) { - fixture.SetupHandler(t, uRootURL, "POST", "", enableUserResp, 200) -} - -func HandleIsRootEnabled(t *testing.T) { - fixture.SetupHandler(t, uRootURL, "GET", "", isUserEnabledResp, 200) -} - -func HandleRestart(t *testing.T) { - fixture.SetupHandler(t, aURL, "POST", restartReq, "", 202) -} - -func HandleResize(t *testing.T) { - fixture.SetupHandler(t, aURL, "POST", resizeReq, "", 202) -} - -func HandleResizeVol(t *testing.T) { - fixture.SetupHandler(t, aURL, "POST", resizeVolReq, "", 202) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/requests.go deleted file mode 100644 index f4a63b814..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/requests.go +++ /dev/null @@ -1,238 +0,0 @@ -package instances - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - db "github.com/rackspace/gophercloud/openstack/db/v1/databases" - "github.com/rackspace/gophercloud/openstack/db/v1/users" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsBuilder is the top-level interface for create options. -type CreateOptsBuilder interface { - ToInstanceCreateMap() (map[string]interface{}, error) -} - -// DatastoreOpts represents the configuration for how an instance stores data. -type DatastoreOpts struct { - Version string - Type string -} - -func (opts DatastoreOpts) ToMap() (map[string]string, error) { - return map[string]string{ - "version": opts.Version, - "type": opts.Type, - }, nil -} - -// CreateOpts is the struct responsible for configuring a new database instance. -type CreateOpts struct { - // Either the integer UUID (in string form) of the flavor, or its URI - // reference as specified in the response from the List() call. Required. - FlavorRef string - - // Specifies the volume size in gigabytes (GB). The value must be between 1 - // and 300. Required. - Size int - - // Name of the instance to create. The length of the name is limited to - // 255 characters and any characters are permitted. Optional. - Name string - - // A slice of database information options. - Databases db.CreateOptsBuilder - - // A slice of user information options. - Users users.CreateOptsBuilder - - // Options to configure the type of datastore the instance will use. This is - // optional, and if excluded will default to MySQL. - Datastore *DatastoreOpts -} - -// ToInstanceCreateMap will render a JSON map. -func (opts CreateOpts) ToInstanceCreateMap() (map[string]interface{}, error) { - if opts.Size > 300 || opts.Size < 1 { - return nil, fmt.Errorf("Size (GB) must be between 1-300") - } - if opts.FlavorRef == "" { - return nil, fmt.Errorf("FlavorRef is a required field") - } - - instance := map[string]interface{}{ - "volume": map[string]int{"size": opts.Size}, - "flavorRef": opts.FlavorRef, - } - - if opts.Name != "" { - instance["name"] = opts.Name - } - if opts.Databases != nil { - dbs, err := opts.Databases.ToDBCreateMap() - if err != nil { - return nil, err - } - instance["databases"] = dbs["databases"] - } - if opts.Users != nil { - users, err := opts.Users.ToUserCreateMap() - if err != nil { - return nil, err - } - instance["users"] = users["users"] - } - - return map[string]interface{}{"instance": instance}, nil -} - -// Create asynchronously provisions a new database instance. It requires the -// user to specify a flavor and a volume size. The API service then provisions -// the instance with the requested flavor and sets up a volume of the specified -// size, which is the storage for the database instance. -// -// Although this call only allows the creation of 1 instance per request, you -// can create an instance with multiple databases and users. The default -// binding for a MySQL instance is port 3306. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToInstanceCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("POST", baseURL(client), gophercloud.RequestOpts{ - JSONBody: &reqBody, - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res -} - -// List retrieves the status and information for all database instances. -func List(client *gophercloud.ServiceClient) pagination.Pager { - createPageFn := func(r pagination.PageResult) pagination.Page { - return InstancePage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, baseURL(client), createPageFn) -} - -// Get retrieves the status and information for a specified database instance. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - - _, res.Err = client.Request("GET", resourceURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res -} - -// Delete permanently destroys the database instance. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - - _, res.Err = client.Request("DELETE", resourceURL(client, id), gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - - return res -} - -// EnableRootUser enables the login from any host for the root user and -// provides the user with a generated root password. -func EnableRootUser(client *gophercloud.ServiceClient, id string) UserRootResult { - var res UserRootResult - - _, res.Err = client.Request("POST", userRootURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res -} - -// IsRootEnabled checks an instance to see if root access is enabled. It returns -// True if root user is enabled for the specified database instance or False -// otherwise. -func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) { - var res gophercloud.Result - - _, err := client.Request("GET", userRootURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res.Body.(map[string]interface{})["rootEnabled"] == true, err -} - -// Restart will restart only the MySQL Instance. Restarting MySQL will -// erase any dynamic configuration settings that you have made within MySQL. -// The MySQL service will be unavailable until the instance restarts. -func Restart(client *gophercloud.ServiceClient, id string) ActionResult { - var res ActionResult - - _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{ - JSONBody: map[string]interface{}{"restart": struct{}{}}, - OkCodes: []int{202}, - }) - - return res -} - -// Resize changes the memory size of the instance, assuming a valid -// flavorRef is provided. It will also restart the MySQL service. -func Resize(client *gophercloud.ServiceClient, id, flavorRef string) ActionResult { - var res ActionResult - - type resize struct { - FlavorRef string `json:"flavorRef"` - } - - type req struct { - Resize resize `json:"resize"` - } - - reqBody := req{Resize: resize{FlavorRef: flavorRef}} - - _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{ - JSONBody: reqBody, - OkCodes: []int{202}, - }) - - return res -} - -// ResizeVolume will resize the attached volume for an instance. It supports -// only increasing the volume size and does not support decreasing the size. -// The volume size is in gigabytes (GB) and must be an integer. -func ResizeVolume(client *gophercloud.ServiceClient, id string, size int) ActionResult { - var res ActionResult - - type volume struct { - Size int `json:"size"` - } - - type resize struct { - Volume volume `json:"volume"` - } - - type req struct { - Resize resize `json:"resize"` - } - - reqBody := req{Resize: resize{Volume: volume{Size: size}}} - - _, res.Err = client.Request("POST", actionURL(client, id), gophercloud.RequestOpts{ - JSONBody: reqBody, - OkCodes: []int{202}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/results.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/results.go deleted file mode 100644 index 95aed166b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/results.go +++ /dev/null @@ -1,213 +0,0 @@ -package instances - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/db/v1/datastores" - "github.com/rackspace/gophercloud/openstack/db/v1/flavors" - "github.com/rackspace/gophercloud/openstack/db/v1/users" - "github.com/rackspace/gophercloud/pagination" -) - -// Volume represents information about an attached volume for a database instance. -type Volume struct { - // The size in GB of the volume - Size int - - Used float64 -} - -// Instance represents a remote MySQL instance. -type Instance struct { - // Indicates the datetime that the instance was created - Created time.Time `mapstructure:"-"` - - // Indicates the most recent datetime that the instance was updated. - Updated time.Time `mapstructure:"-"` - - // Indicates the hardware flavor the instance uses. - Flavor flavors.Flavor - - // A DNS-resolvable hostname associated with the database instance (rather - // than an IPv4 address). Since the hostname always resolves to the correct - // IP address of the database instance, this relieves the user from the task - // of maintaining the mapping. Note that although the IP address may likely - // change on resizing, migrating, and so forth, the hostname always resolves - // to the correct database instance. - Hostname string - - // Indicates the unique identifier for the instance resource. - ID string - - // Exposes various links that reference the instance resource. - Links []gophercloud.Link - - // The human-readable name of the instance. - Name string - - // The build status of the instance. - Status string - - // Information about the attached volume of the instance. - Volume Volume - - // Indicates how the instance stores data. - Datastore datastores.DatastorePartial -} - -type commonResult struct { - gophercloud.Result -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - commonResult -} - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Extract will extract an Instance from various result structs. -func (r commonResult) Extract() (*Instance, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Instance Instance `mapstructure:"instance"` - } - - err := mapstructure.Decode(r.Body, &response) - val := r.Body.(map[string]interface{})["instance"].(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Instance, err - } - response.Instance.Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Instance, err - } - response.Instance.Updated = updatedTime - } - - return &response.Instance, err -} - -// InstancePage represents a single page of a paginated instance collection. -type InstancePage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks to see whether the collection is empty. -func (page InstancePage) IsEmpty() (bool, error) { - instances, err := ExtractInstances(page) - if err != nil { - return true, err - } - return len(instances) == 0, nil -} - -// NextPageURL will retrieve the next page URL. -func (page InstancePage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"instances_links"` - } - - var r resp - err := mapstructure.Decode(page.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// ExtractInstances will convert a generic pagination struct into a more -// relevant slice of Instance structs. -func ExtractInstances(page pagination.Page) ([]Instance, error) { - casted := page.(InstancePage).Body - - var resp struct { - Instances []Instance `mapstructure:"instances"` - } - - if err := mapstructure.Decode(casted, &resp); err != nil { - return nil, err - } - - var vals []interface{} - switch casted.(type) { - case map[string]interface{}: - vals = casted.(map[string]interface{})["instances"].([]interface{}) - case map[string][]interface{}: - vals = casted.(map[string][]interface{})["instances"] - default: - return resp.Instances, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i, v := range vals { - val := v.(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Instances, err - } - resp.Instances[i].Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Instances, err - } - resp.Instances[i].Updated = updatedTime - } - } - - return resp.Instances, nil -} - -// UserRootResult represents the result of an operation to enable the root user. -type UserRootResult struct { - gophercloud.Result -} - -// Extract will extract root user information from a UserRootResult. -func (r UserRootResult) Extract() (*users.User, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - User users.User `mapstructure:"user"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.User, err -} - -// ActionResult represents the result of action requests, such as: restarting -// an instance service, resizing its memory allocation, and resizing its -// attached volume size. -type ActionResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/urls.go deleted file mode 100644 index 28c0bec3d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/instances/urls.go +++ /dev/null @@ -1,19 +0,0 @@ -package instances - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("instances") -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("instances", id) -} - -func userRootURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("instances", id, "root") -} - -func actionURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("instances", id, "action") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/doc.go deleted file mode 100644 index cf07832f3..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package users provides information and interaction with the user API -// resource in the OpenStack Database service. -package users diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/fixtures.go deleted file mode 100644 index 516b335e0..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/fixtures.go +++ /dev/null @@ -1,37 +0,0 @@ -package users - -import ( - "fmt" - "testing" - - "github.com/rackspace/gophercloud/testhelper/fixture" -) - -const user1 = ` -{"databases": [{"name": "databaseA"}],"name": "dbuser3"%s} -` - -const user2 = ` -{"databases": [{"name": "databaseB"},{"name": "databaseC"}],"name": "dbuser4"%s} -` - -var ( - instanceID = "{instanceID}" - _rootURL = "/instances/" + instanceID + "/users" - pUser1 = fmt.Sprintf(user1, `,"password":"secretsecret"`) - pUser2 = fmt.Sprintf(user2, `,"password":"secretsecret"`) - createReq = fmt.Sprintf(`{"users":[%s, %s]}`, pUser1, pUser2) - listResp = fmt.Sprintf(`{"users":[%s, %s]}`, fmt.Sprintf(user1, ""), fmt.Sprintf(user2, "")) -) - -func HandleCreate(t *testing.T) { - fixture.SetupHandler(t, _rootURL, "POST", createReq, "", 202) -} - -func HandleList(t *testing.T) { - fixture.SetupHandler(t, _rootURL, "GET", "", listResp, 200) -} - -func HandleDelete(t *testing.T) { - fixture.SetupHandler(t, _rootURL+"/{userName}", "DELETE", "", "", 202) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/requests.go deleted file mode 100644 index 7533fc494..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/requests.go +++ /dev/null @@ -1,132 +0,0 @@ -package users - -import ( - "errors" - - "github.com/rackspace/gophercloud" - db "github.com/rackspace/gophercloud/openstack/db/v1/databases" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsBuilder is the top-level interface for creating JSON maps. -type CreateOptsBuilder interface { - ToUserCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the struct responsible for configuring a new user; often in the -// context of an instance. -type CreateOpts struct { - // [REQUIRED] Specifies a name for the user. Valid names can be composed - // of the following characters: letters (either case); numbers; these - // characters '@', '?', '#', ' ' but NEVER beginning a name string; '_' is - // permitted anywhere. Prohibited characters that are forbidden include: - // single quotes, double quotes, back quotes, semicolons, commas, backslashes, - // and forward slashes. Spaces at the front or end of a user name are also - // not permitted. - Name string - - // [REQUIRED] Specifies a password for the user. - Password string - - // [OPTIONAL] An array of databases that this user will connect to. The - // "name" field is the only requirement for each option. - Databases db.BatchCreateOpts - - // [OPTIONAL] Specifies the host from which a user is allowed to connect to - // the database. Possible values are a string containing an IPv4 address or - // "%" to allow connecting from any host. Optional; the default is "%". - Host string -} - -// ToMap is a convenience function for creating sub-maps for individual users. -func (opts CreateOpts) ToMap() (map[string]interface{}, error) { - - if opts.Name == "root" { - return nil, errors.New("root is a reserved user name and cannot be used") - } - if opts.Name == "" { - return nil, errors.New("Name is a required field") - } - if opts.Password == "" { - return nil, errors.New("Password is a required field") - } - - user := map[string]interface{}{ - "name": opts.Name, - "password": opts.Password, - } - - if opts.Host != "" { - user["host"] = opts.Host - } - - dbs := make([]map[string]string, len(opts.Databases)) - for i, db := range opts.Databases { - dbs[i] = map[string]string{"name": db.Name} - } - - if len(dbs) > 0 { - user["databases"] = dbs - } - - return user, nil -} - -// BatchCreateOpts allows multiple users to be created at once. -type BatchCreateOpts []CreateOpts - -// ToUserCreateMap will generate a JSON map. -func (opts BatchCreateOpts) ToUserCreateMap() (map[string]interface{}, error) { - users := make([]map[string]interface{}, len(opts)) - for i, opt := range opts { - user, err := opt.ToMap() - if err != nil { - return nil, err - } - users[i] = user - } - return map[string]interface{}{"users": users}, nil -} - -// Create asynchronously provisions a new user for the specified database -// instance based on the configuration defined in CreateOpts. If databases are -// assigned for a particular user, the user will be granted all privileges -// for those specified databases. "root" is a reserved name and cannot be used. -func Create(client *gophercloud.ServiceClient, instanceID string, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToUserCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("POST", baseURL(client, instanceID), gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{202}, - }) - - return res -} - -// List will list all the users associated with a specified database instance, -// along with their associated databases. This operation will not return any -// system users or administrators for a database. -func List(client *gophercloud.ServiceClient, instanceID string) pagination.Pager { - createPageFn := func(r pagination.PageResult) pagination.Page { - return UserPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, baseURL(client, instanceID), createPageFn) -} - -// Delete will permanently delete a user from a specified database instance. -func Delete(client *gophercloud.ServiceClient, instanceID, userName string) DeleteResult { - var res DeleteResult - - _, res.Err = client.Request("DELETE", userURL(client, instanceID, userName), gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/results.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/results.go deleted file mode 100644 index 217ddd8da..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/results.go +++ /dev/null @@ -1,73 +0,0 @@ -package users - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - db "github.com/rackspace/gophercloud/openstack/db/v1/databases" - "github.com/rackspace/gophercloud/pagination" -) - -// User represents a database user -type User struct { - // The user name - Name string - - // The user password - Password string - - // The databases associated with this user - Databases []db.Database -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - gophercloud.ErrResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// UserPage represents a single page of a paginated user collection. -type UserPage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks to see whether the collection is empty. -func (page UserPage) IsEmpty() (bool, error) { - users, err := ExtractUsers(page) - if err != nil { - return true, err - } - return len(users) == 0, nil -} - -// NextPageURL will retrieve the next page URL. -func (page UserPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"users_links"` - } - - var r resp - err := mapstructure.Decode(page.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// ExtractUsers will convert a generic pagination struct into a more -// relevant slice of User structs. -func ExtractUsers(page pagination.Page) ([]User, error) { - casted := page.(UserPage).Body - - var response struct { - Users []User `mapstructure:"users"` - } - - err := mapstructure.Decode(casted, &response) - - return response.Users, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/urls.go deleted file mode 100644 index 2a3cacdaf..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/db/v1/users/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package users - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient, instanceID string) string { - return c.ServiceURL("instances", instanceID, "users") -} - -func userURL(c *gophercloud.ServiceClient, instanceID, userName string) string { - return c.ServiceURL("instances", instanceID, "users", userName) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/docs.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/docs.go deleted file mode 100644 index 895417871..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/docs.go +++ /dev/null @@ -1,16 +0,0 @@ -// Package roles provides functionality to interact with and control roles on -// the API. -// -// A role represents a personality that a user can assume when performing a -// specific set of operations. If a role includes a set of rights and -// privileges, a user assuming that role inherits those rights and privileges. -// -// When a token is generated, the list of roles that user can assume is returned -// back to them. Services that are being called by that user determine how they -// interpret the set of roles a user has and to which operations or resources -// each role grants access. -// -// It is up to individual services such as Compute or Image to assign meaning -// to these roles. As far as the Identity service is concerned, a role is an -// arbitrary name assigned by the user. -package roles diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/fixtures.go deleted file mode 100644 index 8256f0fe8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/fixtures.go +++ /dev/null @@ -1,48 +0,0 @@ -package roles - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func MockListRoleResponse(t *testing.T) { - th.Mux.HandleFunc("/OS-KSADM/roles", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "roles": [ - { - "id": "123", - "name": "compute:admin", - "description": "Nova Administrator" - } - ] -} - `) - }) -} - -func MockAddUserRoleResponse(t *testing.T) { - th.Mux.HandleFunc("/tenants/{tenant_id}/users/{user_id}/roles/OS-KSADM/{role_id}", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusCreated) - }) -} - -func MockDeleteUserRoleResponse(t *testing.T) { - th.Mux.HandleFunc("/tenants/{tenant_id}/users/{user_id}/roles/OS-KSADM/{role_id}", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/requests.go deleted file mode 100644 index 9a333140b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/requests.go +++ /dev/null @@ -1,33 +0,0 @@ -package roles - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List is the operation responsible for listing all available global roles -// that a user can adopt. -func List(client *gophercloud.ServiceClient) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return RolePage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, rootURL(client), createPage) -} - -// AddUserRole is the operation responsible for assigning a particular role to -// a user. This is confined to the scope of the user's tenant - so the tenant -// ID is a required argument. -func AddUserRole(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult { - var result UserRoleResult - _, result.Err = client.Put(userRoleURL(client, tenantID, userID, roleID), nil, nil, nil) - return result -} - -// DeleteUserRole is the operation responsible for deleting a particular role -// from a user. This is confined to the scope of the user's tenant - so the -// tenant ID is a required argument. -func DeleteUserRole(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult { - var result UserRoleResult - _, result.Err = client.Delete(userRoleURL(client, tenantID, userID, roleID), nil) - return result -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/results.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/results.go deleted file mode 100644 index ebb3aa530..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/results.go +++ /dev/null @@ -1,53 +0,0 @@ -package roles - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Role represents an API role resource. -type Role struct { - // The unique ID for the role. - ID string - - // The human-readable name of the role. - Name string - - // The description of the role. - Description string - - // The associated service for this role. - ServiceID string -} - -// RolePage is a single page of a user Role collection. -type RolePage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a page of Tenants contains any results. -func (page RolePage) IsEmpty() (bool, error) { - users, err := ExtractRoles(page) - if err != nil { - return false, err - } - return len(users) == 0, nil -} - -// ExtractRoles returns a slice of roles contained in a single page of results. -func ExtractRoles(page pagination.Page) ([]Role, error) { - casted := page.(RolePage).Body - var response struct { - Roles []Role `mapstructure:"roles"` - } - - err := mapstructure.Decode(casted, &response) - return response.Roles, err -} - -// UserRoleResult represents the result of either an AddUserRole or -// a DeleteUserRole operation. -type UserRoleResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/urls.go deleted file mode 100644 index 61b31551d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles/urls.go +++ /dev/null @@ -1,21 +0,0 @@ -package roles - -import "github.com/rackspace/gophercloud" - -const ( - ExtPath = "OS-KSADM" - RolePath = "roles" - UserPath = "users" -) - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(ExtPath, RolePath, id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(ExtPath, RolePath) -} - -func userRoleURL(c *gophercloud.ServiceClient, tenantID, userID, roleID string) string { - return c.ServiceURL("tenants", tenantID, UserPath, userID, RolePath, ExtPath, roleID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/delegate.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/delegate.go deleted file mode 100644 index fd6e80ea6..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/delegate.go +++ /dev/null @@ -1,52 +0,0 @@ -package extensions - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - common "github.com/rackspace/gophercloud/openstack/common/extensions" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtensionPage is a single page of Extension results. -type ExtensionPage struct { - common.ExtensionPage -} - -// IsEmpty returns true if the current page contains at least one Extension. -func (page ExtensionPage) IsEmpty() (bool, error) { - is, err := ExtractExtensions(page) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractExtensions accepts a Page struct, specifically an ExtensionPage struct, and extracts the -// elements into a slice of Extension structs. -func ExtractExtensions(page pagination.Page) ([]common.Extension, error) { - // Identity v2 adds an intermediate "values" object. - - var resp struct { - Extensions struct { - Values []common.Extension `mapstructure:"values"` - } `mapstructure:"extensions"` - } - - err := mapstructure.Decode(page.(ExtensionPage).Body, &resp) - return resp.Extensions.Values, err -} - -// Get retrieves information for a specific extension using its alias. -func Get(c *gophercloud.ServiceClient, alias string) common.GetResult { - return common.Get(c, alias) -} - -// List returns a Pager which allows you to iterate over the full collection of extensions. -// It does not accept query parameters. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return common.List(c).WithPageCreator(func(r pagination.PageResult) pagination.Page { - return ExtensionPage{ - ExtensionPage: common.ExtensionPage{SinglePageBase: pagination.SinglePageBase(r)}, - } - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/doc.go deleted file mode 100644 index 791e4e391..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package extensions provides information and interaction with the -// different extensions available for the OpenStack Identity service. -package extensions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/fixtures.go deleted file mode 100644 index 96cb7d24a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/extensions/fixtures.go +++ /dev/null @@ -1,60 +0,0 @@ -// +build fixtures - -package extensions - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -// ListOutput provides a single Extension result. It differs from the delegated implementation -// by the introduction of an intermediate "values" member. -const ListOutput = ` -{ - "extensions": { - "values": [ - { - "updated": "2013-01-20T00:00:00-00:00", - "name": "Neutron Service Type Management", - "links": [], - "namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0", - "alias": "service-type", - "description": "API for retrieving service providers for Neutron advanced services" - } - ] - } -} -` - -// HandleListExtensionsSuccessfully creates an HTTP handler that returns ListOutput for a List -// call. -func HandleListExtensionsSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/extensions", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - w.Header().Add("Content-Type", "application/json") - - fmt.Fprintf(w, ` -{ - "extensions": { - "values": [ - { - "updated": "2013-01-20T00:00:00-00:00", - "name": "Neutron Service Type Management", - "links": [], - "namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0", - "alias": "service-type", - "description": "API for retrieving service providers for Neutron advanced services" - } - ] - } -} - `) - }) - -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/doc.go deleted file mode 100644 index 82abcb9fc..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/doc.go +++ /dev/null @@ -1 +0,0 @@ -package users diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/fixtures.go deleted file mode 100644 index 8941868dd..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/fixtures.go +++ /dev/null @@ -1,163 +0,0 @@ -package users - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func MockListUserResponse(t *testing.T) { - th.Mux.HandleFunc("/users", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "users":[ - { - "id": "u1000", - "name": "John Smith", - "username": "jqsmith", - "email": "john.smith@example.org", - "enabled": true, - "tenant_id": "12345" - }, - { - "id": "u1001", - "name": "Jane Smith", - "username": "jqsmith", - "email": "jane.smith@example.org", - "enabled": true, - "tenant_id": "12345" - } - ] -} - `) - }) -} - -func mockCreateUserResponse(t *testing.T) { - th.Mux.HandleFunc("/users", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "user": { - "name": "new_user", - "tenant_id": "12345", - "enabled": false, - "email": "new_user@foo.com" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "user": { - "name": "new_user", - "tenant_id": "12345", - "enabled": false, - "email": "new_user@foo.com", - "id": "c39e3de9be2d4c779f1dfd6abacc176d" - } -} -`) - }) -} - -func mockGetUserResponse(t *testing.T) { - th.Mux.HandleFunc("/users/new_user", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "user": { - "name": "new_user", - "tenant_id": "12345", - "enabled": false, - "email": "new_user@foo.com", - "id": "c39e3de9be2d4c779f1dfd6abacc176d" - } -} -`) - }) -} - -func mockUpdateUserResponse(t *testing.T) { - th.Mux.HandleFunc("/users/c39e3de9be2d4c779f1dfd6abacc176d", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "user": { - "name": "new_name", - "enabled": true, - "email": "new_email@foo.com" - } -} -`) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "user": { - "name": "new_name", - "tenant_id": "12345", - "enabled": true, - "email": "new_email@foo.com", - "id": "c39e3de9be2d4c779f1dfd6abacc176d" - } -} -`) - }) -} - -func mockDeleteUserResponse(t *testing.T) { - th.Mux.HandleFunc("/users/c39e3de9be2d4c779f1dfd6abacc176d", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} - -func mockListRolesResponse(t *testing.T) { - th.Mux.HandleFunc("/tenants/1d8b6120dcc640fda4fc9194ffc80273/users/c39e3de9be2d4c779f1dfd6abacc176d/roles", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "roles": [ - { - "id": "9fe2ff9ee4384b1894a90878d3e92bab", - "name": "foo_role" - }, - { - "id": "1ea3d56793574b668e85960fbf651e13", - "name": "admin" - } - ] -} - `) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/requests.go deleted file mode 100644 index 88be45ecc..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/requests.go +++ /dev/null @@ -1,161 +0,0 @@ -package users - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -func List(client *gophercloud.ServiceClient) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return UserPage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, rootURL(client), createPage) -} - -// EnabledState represents whether the user is enabled or not. -type EnabledState *bool - -// Useful variables to use when creating or updating users. -var ( - iTrue = true - iFalse = false - - Enabled EnabledState = &iTrue - Disabled EnabledState = &iFalse -) - -// CommonOpts are the parameters that are shared between CreateOpts and -// UpdateOpts -type CommonOpts struct { - // Either a name or username is required. When provided, the value must be - // unique or a 409 conflict error will be returned. If you provide a name but - // omit a username, the latter will be set to the former; and vice versa. - Name, Username string - - // The ID of the tenant to which you want to assign this user. - TenantID string - - // Indicates whether this user is enabled or not. - Enabled EnabledState - - // The email address of this user. - Email string -} - -// CreateOpts represents the options needed when creating new users. -type CreateOpts CommonOpts - -// CreateOptsBuilder describes struct types that can be accepted by the Create call. -type CreateOptsBuilder interface { - ToUserCreateMap() (map[string]interface{}, error) -} - -// ToUserCreateMap assembles a request body based on the contents of a CreateOpts. -func (opts CreateOpts) ToUserCreateMap() (map[string]interface{}, error) { - m := make(map[string]interface{}) - - if opts.Name == "" && opts.Username == "" { - return m, errors.New("Either a Name or Username must be provided") - } - - if opts.Name != "" { - m["name"] = opts.Name - } - if opts.Username != "" { - m["username"] = opts.Username - } - if opts.Enabled != nil { - m["enabled"] = &opts.Enabled - } - if opts.Email != "" { - m["email"] = opts.Email - } - if opts.TenantID != "" { - m["tenant_id"] = opts.TenantID - } - - return map[string]interface{}{"user": m}, nil -} - -// Create is the operation responsible for creating new users. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToUserCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(rootURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - - return res -} - -// Get requests details on a single user, either by ID. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var result GetResult - _, result.Err = client.Get(ResourceURL(client, id), &result.Body, nil) - return result -} - -// UpdateOptsBuilder allows extensions to add additional attributes to the Update request. -type UpdateOptsBuilder interface { - ToUserUpdateMap() map[string]interface{} -} - -// UpdateOpts specifies the base attributes that may be updated on an existing server. -type UpdateOpts CommonOpts - -// ToUserUpdateMap formats an UpdateOpts structure into a request body. -func (opts UpdateOpts) ToUserUpdateMap() map[string]interface{} { - m := make(map[string]interface{}) - - if opts.Name != "" { - m["name"] = opts.Name - } - if opts.Username != "" { - m["username"] = opts.Username - } - if opts.Enabled != nil { - m["enabled"] = &opts.Enabled - } - if opts.Email != "" { - m["email"] = opts.Email - } - if opts.TenantID != "" { - m["tenant_id"] = opts.TenantID - } - - return map[string]interface{}{"user": m} -} - -// Update is the operation responsible for updating exist users by their UUID. -func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var result UpdateResult - reqBody := opts.ToUserUpdateMap() - _, result.Err = client.Put(ResourceURL(client, id), reqBody, &result.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return result -} - -// Delete is the operation responsible for permanently deleting an API user. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var result DeleteResult - _, result.Err = client.Delete(ResourceURL(client, id), nil) - return result -} - -func ListRoles(client *gophercloud.ServiceClient, tenantID, userID string) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return RolePage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, listRolesURL(client, tenantID, userID), createPage) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/results.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/results.go deleted file mode 100644 index f531d5d02..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/results.go +++ /dev/null @@ -1,128 +0,0 @@ -package users - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// User represents a user resource that exists on the API. -type User struct { - // The UUID for this user. - ID string - - // The human name for this user. - Name string - - // The username for this user. - Username string - - // Indicates whether the user is enabled (true) or disabled (false). - Enabled bool - - // The email address for this user. - Email string - - // The ID of the tenant to which this user belongs. - TenantID string `mapstructure:"tenant_id"` -} - -// Role assigns specific responsibilities to users, allowing them to accomplish -// certain API operations whilst scoped to a service. -type Role struct { - // UUID of the role - ID string - - // Name of the role - Name string -} - -// UserPage is a single page of a User collection. -type UserPage struct { - pagination.SinglePageBase -} - -// RolePage is a single page of a user Role collection. -type RolePage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a page of Tenants contains any results. -func (page UserPage) IsEmpty() (bool, error) { - users, err := ExtractUsers(page) - if err != nil { - return false, err - } - return len(users) == 0, nil -} - -// ExtractUsers returns a slice of Tenants contained in a single page of results. -func ExtractUsers(page pagination.Page) ([]User, error) { - casted := page.(UserPage).Body - var response struct { - Users []User `mapstructure:"users"` - } - - err := mapstructure.Decode(casted, &response) - return response.Users, err -} - -// IsEmpty determines whether or not a page of Tenants contains any results. -func (page RolePage) IsEmpty() (bool, error) { - users, err := ExtractRoles(page) - if err != nil { - return false, err - } - return len(users) == 0, nil -} - -// ExtractRoles returns a slice of Roles contained in a single page of results. -func ExtractRoles(page pagination.Page) ([]Role, error) { - casted := page.(RolePage).Body - var response struct { - Roles []Role `mapstructure:"roles"` - } - - err := mapstructure.Decode(casted, &response) - return response.Roles, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract interprets any commonResult as a User, if possible. -func (r commonResult) Extract() (*User, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - User User `mapstructure:"user"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.User, err -} - -// CreateResult represents the result of a Create operation -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a Get operation -type GetResult struct { - commonResult -} - -// UpdateResult represents the result of an Update operation -type UpdateResult struct { - commonResult -} - -// DeleteResult represents the result of a Delete operation -type DeleteResult struct { - commonResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/urls.go deleted file mode 100644 index 7ec4385d7..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v2/users/urls.go +++ /dev/null @@ -1,21 +0,0 @@ -package users - -import "github.com/rackspace/gophercloud" - -const ( - tenantPath = "tenants" - userPath = "users" - rolePath = "roles" -) - -func ResourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(userPath, id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(userPath) -} - -func listRolesURL(c *gophercloud.ServiceClient, tenantID, userID string) string { - return c.ServiceURL(tenantPath, tenantID, userPath, userID, rolePath) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/doc.go deleted file mode 100644 index 85163949a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package endpoints provides information and interaction with the service -// endpoints API resource in the OpenStack Identity service. -// -// For more information, see: -// http://developer.openstack.org/api-ref-identity-v3.html#endpoints-v3 -package endpoints diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/errors.go deleted file mode 100644 index 854957ff9..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/errors.go +++ /dev/null @@ -1,21 +0,0 @@ -package endpoints - -import "fmt" - -func requiredAttribute(attribute string) error { - return fmt.Errorf("You must specify %s for this endpoint.", attribute) -} - -var ( - // ErrAvailabilityRequired is reported if an Endpoint is created without an Availability. - ErrAvailabilityRequired = requiredAttribute("an availability") - - // ErrNameRequired is reported if an Endpoint is created without a Name. - ErrNameRequired = requiredAttribute("a name") - - // ErrURLRequired is reported if an Endpoint is created without a URL. - ErrURLRequired = requiredAttribute("a URL") - - // ErrServiceIDRequired is reported if an Endpoint is created without a ServiceID. - ErrServiceIDRequired = requiredAttribute("a serviceID") -) diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/requests.go deleted file mode 100644 index 99a495d59..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/requests.go +++ /dev/null @@ -1,123 +0,0 @@ -package endpoints - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// EndpointOpts contains the subset of Endpoint attributes that should be used to create or update an Endpoint. -type EndpointOpts struct { - Availability gophercloud.Availability - Name string - Region string - URL string - ServiceID string -} - -// Create inserts a new Endpoint into the service catalog. -// Within EndpointOpts, Region may be omitted by being left as "", but all other fields are required. -func Create(client *gophercloud.ServiceClient, opts EndpointOpts) CreateResult { - // Redefined so that Region can be re-typed as a *string, which can be omitted from the JSON output. - type endpoint struct { - Interface string `json:"interface"` - Name string `json:"name"` - Region *string `json:"region,omitempty"` - URL string `json:"url"` - ServiceID string `json:"service_id"` - } - - type request struct { - Endpoint endpoint `json:"endpoint"` - } - - // Ensure that EndpointOpts is fully populated. - if opts.Availability == "" { - return createErr(ErrAvailabilityRequired) - } - if opts.Name == "" { - return createErr(ErrNameRequired) - } - if opts.URL == "" { - return createErr(ErrURLRequired) - } - if opts.ServiceID == "" { - return createErr(ErrServiceIDRequired) - } - - // Populate the request body. - reqBody := request{ - Endpoint: endpoint{ - Interface: string(opts.Availability), - Name: opts.Name, - URL: opts.URL, - ServiceID: opts.ServiceID, - }, - } - reqBody.Endpoint.Region = gophercloud.MaybeString(opts.Region) - - var result CreateResult - _, result.Err = client.Post(listURL(client), reqBody, &result.Body, nil) - return result -} - -// ListOpts allows finer control over the endpoints returned by a List call. -// All fields are optional. -type ListOpts struct { - Availability gophercloud.Availability `q:"interface"` - ServiceID string `q:"service_id"` - Page int `q:"page"` - PerPage int `q:"per_page"` -} - -// List enumerates endpoints in a paginated collection, optionally filtered by ListOpts criteria. -func List(client *gophercloud.ServiceClient, opts ListOpts) pagination.Pager { - u := listURL(client) - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return pagination.Pager{Err: err} - } - u += q.String() - createPage := func(r pagination.PageResult) pagination.Page { - return EndpointPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, u, createPage) -} - -// Update changes an existing endpoint with new data. -// All fields are optional in the provided EndpointOpts. -func Update(client *gophercloud.ServiceClient, endpointID string, opts EndpointOpts) UpdateResult { - type endpoint struct { - Interface *string `json:"interface,omitempty"` - Name *string `json:"name,omitempty"` - Region *string `json:"region,omitempty"` - URL *string `json:"url,omitempty"` - ServiceID *string `json:"service_id,omitempty"` - } - - type request struct { - Endpoint endpoint `json:"endpoint"` - } - - reqBody := request{Endpoint: endpoint{}} - reqBody.Endpoint.Interface = gophercloud.MaybeString(string(opts.Availability)) - reqBody.Endpoint.Name = gophercloud.MaybeString(opts.Name) - reqBody.Endpoint.Region = gophercloud.MaybeString(opts.Region) - reqBody.Endpoint.URL = gophercloud.MaybeString(opts.URL) - reqBody.Endpoint.ServiceID = gophercloud.MaybeString(opts.ServiceID) - - var result UpdateResult - _, result.Err = client.Request("PATCH", endpointURL(client, endpointID), gophercloud.RequestOpts{ - JSONBody: &reqBody, - JSONResponse: &result.Body, - OkCodes: []int{200}, - }) - return result -} - -// Delete removes an endpoint from the service catalog. -func Delete(client *gophercloud.ServiceClient, endpointID string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(endpointURL(client, endpointID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/results.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/results.go deleted file mode 100644 index 128112295..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/results.go +++ /dev/null @@ -1,82 +0,0 @@ -package endpoints - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -type commonResult struct { - gophercloud.Result -} - -// Extract interprets a GetResult, CreateResult or UpdateResult as a concrete Endpoint. -// An error is returned if the original call or the extraction failed. -func (r commonResult) Extract() (*Endpoint, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Endpoint `json:"endpoint"` - } - - err := mapstructure.Decode(r.Body, &res) - - return &res.Endpoint, err -} - -// CreateResult is the deferred result of a Create call. -type CreateResult struct { - commonResult -} - -// createErr quickly wraps an error in a CreateResult. -func createErr(err error) CreateResult { - return CreateResult{commonResult{gophercloud.Result{Err: err}}} -} - -// UpdateResult is the deferred result of an Update call. -type UpdateResult struct { - commonResult -} - -// DeleteResult is the deferred result of an Delete call. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Endpoint describes the entry point for another service's API. -type Endpoint struct { - ID string `mapstructure:"id" json:"id"` - Availability gophercloud.Availability `mapstructure:"interface" json:"interface"` - Name string `mapstructure:"name" json:"name"` - Region string `mapstructure:"region" json:"region"` - ServiceID string `mapstructure:"service_id" json:"service_id"` - URL string `mapstructure:"url" json:"url"` -} - -// EndpointPage is a single page of Endpoint results. -type EndpointPage struct { - pagination.LinkedPageBase -} - -// IsEmpty returns true if no Endpoints were returned. -func (p EndpointPage) IsEmpty() (bool, error) { - es, err := ExtractEndpoints(p) - if err != nil { - return true, err - } - return len(es) == 0, nil -} - -// ExtractEndpoints extracts an Endpoint slice from a Page. -func ExtractEndpoints(page pagination.Page) ([]Endpoint, error) { - var response struct { - Endpoints []Endpoint `mapstructure:"endpoints"` - } - - err := mapstructure.Decode(page.(EndpointPage).Body, &response) - - return response.Endpoints, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/urls.go deleted file mode 100644 index 547d7b102..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/endpoints/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package endpoints - -import "github.com/rackspace/gophercloud" - -func listURL(client *gophercloud.ServiceClient) string { - return client.ServiceURL("endpoints") -} - -func endpointURL(client *gophercloud.ServiceClient, endpointID string) string { - return client.ServiceURL("endpoints", endpointID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/doc.go deleted file mode 100644 index bdbc674d6..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package roles provides information and interaction with the roles API -// resource for the OpenStack Identity service. -package roles diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests.go deleted file mode 100644 index d95c1e52f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests.go +++ /dev/null @@ -1,50 +0,0 @@ -package roles - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListAssignmentsOptsBuilder allows extensions to add additional parameters to -// the ListAssignments request. -type ListAssignmentsOptsBuilder interface { - ToRolesListAssignmentsQuery() (string, error) -} - -// ListAssignmentsOpts allows you to query the ListAssignments method. -// Specify one of or a combination of GroupId, RoleId, ScopeDomainId, ScopeProjectId, -// and/or UserId to search for roles assigned to corresponding entities. -// Effective lists effective assignments at the user, project, and domain level, -// allowing for the effects of group membership. -type ListAssignmentsOpts struct { - GroupId string `q:"group.id"` - RoleId string `q:"role.id"` - ScopeDomainId string `q:"scope.domain.id"` - ScopeProjectId string `q:"scope.project.id"` - UserId string `q:"user.id"` - Effective bool `q:"effective"` -} - -// ToRolesListAssignmentsQuery formats a ListAssignmentsOpts into a query string. -func (opts ListAssignmentsOpts) ToRolesListAssignmentsQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// ListAssignments enumerates the roles assigned to a specified resource. -func ListAssignments(client *gophercloud.ServiceClient, opts ListAssignmentsOptsBuilder) pagination.Pager { - url := listAssignmentsURL(client) - query, err := opts.ToRolesListAssignmentsQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - createPage := func(r pagination.PageResult) pagination.Page { - return RoleAssignmentsPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, url, createPage) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/results.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/results.go deleted file mode 100644 index d25abd25d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/results.go +++ /dev/null @@ -1,81 +0,0 @@ -package roles - -import ( - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// RoleAssignment is the result of a role assignments query. -type RoleAssignment struct { - Role Role `json:"role,omitempty"` - Scope Scope `json:"scope,omitempty"` - User User `json:"user,omitempty"` - Group Group `json:"group,omitempty"` -} - -type Role struct { - ID string `json:"id,omitempty"` -} - -type Scope struct { - Domain Domain `json:"domain,omitempty"` - Project Project `json:"domain,omitempty"` -} - -type Domain struct { - ID string `json:"id,omitempty"` -} - -type Project struct { - ID string `json:"id,omitempty"` -} - -type User struct { - ID string `json:"id,omitempty"` -} - -type Group struct { - ID string `json:"id,omitempty"` -} - -// RoleAssignmentsPage is a single page of RoleAssignments results. -type RoleAssignmentsPage struct { - pagination.LinkedPageBase -} - -// IsEmpty returns true if the page contains no results. -func (p RoleAssignmentsPage) IsEmpty() (bool, error) { - roleAssignments, err := ExtractRoleAssignments(p) - if err != nil { - return true, err - } - return len(roleAssignments) == 0, nil -} - -// NextPageURL uses the response's embedded link reference to navigate to the next page of results. -func (page RoleAssignmentsPage) NextPageURL() (string, error) { - type resp struct { - Links struct { - Next string `mapstructure:"next"` - } `mapstructure:"links"` - } - - var r resp - err := mapstructure.Decode(page.Body, &r) - if err != nil { - return "", err - } - - return r.Links.Next, nil -} - -// ExtractRoleAssignments extracts a slice of RoleAssignments from a Collection acquired from List. -func ExtractRoleAssignments(page pagination.Page) ([]RoleAssignment, error) { - var response struct { - RoleAssignments []RoleAssignment `mapstructure:"role_assignments"` - } - - err := mapstructure.Decode(page.(RoleAssignmentsPage).Body, &response) - return response.RoleAssignments, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls.go deleted file mode 100644 index b009340d0..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls.go +++ /dev/null @@ -1,7 +0,0 @@ -package roles - -import "github.com/rackspace/gophercloud" - -func listAssignmentsURL(client *gophercloud.ServiceClient) string { - return client.ServiceURL("role_assignments") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/doc.go deleted file mode 100644 index fa5641185..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package services provides information and interaction with the services API -// resource for the OpenStack Identity service. -package services diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/requests.go deleted file mode 100644 index 3ee924f3e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/requests.go +++ /dev/null @@ -1,77 +0,0 @@ -package services - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -type response struct { - Service Service `json:"service"` -} - -// Create adds a new service of the requested type to the catalog. -func Create(client *gophercloud.ServiceClient, serviceType string) CreateResult { - type request struct { - Type string `json:"type"` - } - - req := request{Type: serviceType} - - var result CreateResult - _, result.Err = client.Post(listURL(client), req, &result.Body, nil) - return result -} - -// ListOpts allows you to query the List method. -type ListOpts struct { - ServiceType string `q:"type"` - PerPage int `q:"perPage"` - Page int `q:"page"` -} - -// List enumerates the services available to a specific user. -func List(client *gophercloud.ServiceClient, opts ListOpts) pagination.Pager { - u := listURL(client) - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return pagination.Pager{Err: err} - } - u += q.String() - createPage := func(r pagination.PageResult) pagination.Page { - return ServicePage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, u, createPage) -} - -// Get returns additional information about a service, given its ID. -func Get(client *gophercloud.ServiceClient, serviceID string) GetResult { - var result GetResult - _, result.Err = client.Get(serviceURL(client, serviceID), &result.Body, nil) - return result -} - -// Update changes the service type of an existing service. -func Update(client *gophercloud.ServiceClient, serviceID string, serviceType string) UpdateResult { - type request struct { - Type string `json:"type"` - } - - req := request{Type: serviceType} - - var result UpdateResult - _, result.Err = client.Request("PATCH", serviceURL(client, serviceID), gophercloud.RequestOpts{ - JSONBody: &req, - JSONResponse: &result.Body, - OkCodes: []int{200}, - }) - return result -} - -// Delete removes an existing service. -// It either deletes all associated endpoints, or fails until all endpoints are deleted. -func Delete(client *gophercloud.ServiceClient, serviceID string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(serviceURL(client, serviceID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/results.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/results.go deleted file mode 100644 index 1d0d14128..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/results.go +++ /dev/null @@ -1,80 +0,0 @@ -package services - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -type commonResult struct { - gophercloud.Result -} - -// Extract interprets a GetResult, CreateResult or UpdateResult as a concrete Service. -// An error is returned if the original call or the extraction failed. -func (r commonResult) Extract() (*Service, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Service `json:"service"` - } - - err := mapstructure.Decode(r.Body, &res) - - return &res.Service, err -} - -// CreateResult is the deferred result of a Create call. -type CreateResult struct { - commonResult -} - -// GetResult is the deferred result of a Get call. -type GetResult struct { - commonResult -} - -// UpdateResult is the deferred result of an Update call. -type UpdateResult struct { - commonResult -} - -// DeleteResult is the deferred result of an Delete call. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Service is the result of a list or information query. -type Service struct { - Description *string `json:"description,omitempty"` - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` -} - -// ServicePage is a single page of Service results. -type ServicePage struct { - pagination.LinkedPageBase -} - -// IsEmpty returns true if the page contains no results. -func (p ServicePage) IsEmpty() (bool, error) { - services, err := ExtractServices(p) - if err != nil { - return true, err - } - return len(services) == 0, nil -} - -// ExtractServices extracts a slice of Services from a Collection acquired from List. -func ExtractServices(page pagination.Page) ([]Service, error) { - var response struct { - Services []Service `mapstructure:"services"` - } - - err := mapstructure.Decode(page.(ServicePage).Body, &response) - return response.Services, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/urls.go deleted file mode 100644 index 85443a48a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/identity/v3/services/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package services - -import "github.com/rackspace/gophercloud" - -func listURL(client *gophercloud.ServiceClient) string { - return client.ServiceURL("services") -} - -func serviceURL(client *gophercloud.ServiceClient, serviceID string) string { - return client.ServiceURL("services", serviceID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/doc.go deleted file mode 100644 index 0208ee20e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package apiversions provides information and interaction with the different -// API versions for the OpenStack Neutron service. This functionality is not -// restricted to this particular version. -package apiversions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/errors.go deleted file mode 100644 index 76bdb14f7..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/errors.go +++ /dev/null @@ -1 +0,0 @@ -package apiversions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/requests.go deleted file mode 100644 index 9fb6de141..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/requests.go +++ /dev/null @@ -1,21 +0,0 @@ -package apiversions - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListVersions lists all the Neutron API versions available to end-users -func ListVersions(c *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.PageResult) pagination.Page { - return APIVersionPage{pagination.SinglePageBase(r)} - }) -} - -// ListVersionResources lists all of the different API resources for a particular -// API versions. Typical resources for Neutron might be: networks, subnets, etc. -func ListVersionResources(c *gophercloud.ServiceClient, v string) pagination.Pager { - return pagination.NewPager(c, apiInfoURL(c, v), func(r pagination.PageResult) pagination.Page { - return APIVersionResourcePage{pagination.SinglePageBase(r)} - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/results.go deleted file mode 100644 index 97159341f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/results.go +++ /dev/null @@ -1,77 +0,0 @@ -package apiversions - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud/pagination" -) - -// APIVersion represents an API version for Neutron. It contains the status of -// the API, and its unique ID. -type APIVersion struct { - Status string `mapstructure:"status" json:"status"` - ID string `mapstructure:"id" json:"id"` -} - -// APIVersionPage is the page returned by a pager when traversing over a -// collection of API versions. -type APIVersionPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an APIVersionPage struct is empty. -func (r APIVersionPage) IsEmpty() (bool, error) { - is, err := ExtractAPIVersions(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractAPIVersions takes a collection page, extracts all of the elements, -// and returns them a slice of APIVersion structs. It is effectively a cast. -func ExtractAPIVersions(page pagination.Page) ([]APIVersion, error) { - var resp struct { - Versions []APIVersion `mapstructure:"versions"` - } - - err := mapstructure.Decode(page.(APIVersionPage).Body, &resp) - - return resp.Versions, err -} - -// APIVersionResource represents a generic API resource. It contains the name -// of the resource and its plural collection name. -type APIVersionResource struct { - Name string `mapstructure:"name" json:"name"` - Collection string `mapstructure:"collection" json:"collection"` -} - -// APIVersionResourcePage is a concrete type which embeds the common -// SinglePageBase struct, and is used when traversing API versions collections. -type APIVersionResourcePage struct { - pagination.SinglePageBase -} - -// IsEmpty is a concrete function which indicates whether an -// APIVersionResourcePage is empty or not. -func (r APIVersionResourcePage) IsEmpty() (bool, error) { - is, err := ExtractVersionResources(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractVersionResources accepts a Page struct, specifically a -// APIVersionResourcePage struct, and extracts the elements into a slice of -// APIVersionResource structs. In other words, the collection is mapped into -// a relevant slice. -func ExtractVersionResources(page pagination.Page) ([]APIVersionResource, error) { - var resp struct { - APIVersionResources []APIVersionResource `mapstructure:"resources"` - } - - err := mapstructure.Decode(page.(APIVersionResourcePage).Body, &resp) - - return resp.APIVersionResources, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/urls.go deleted file mode 100644 index 58aa2b61f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/apiversions/urls.go +++ /dev/null @@ -1,15 +0,0 @@ -package apiversions - -import ( - "strings" - - "github.com/rackspace/gophercloud" -) - -func apiVersionsURL(c *gophercloud.ServiceClient) string { - return c.Endpoint -} - -func apiInfoURL(c *gophercloud.ServiceClient, version string) string { - return c.Endpoint + strings.TrimRight(version, "/") + "/" -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/common/common_tests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/common/common_tests.go deleted file mode 100644 index 41603510d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/common/common_tests.go +++ /dev/null @@ -1,14 +0,0 @@ -package common - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/testhelper/client" -) - -const TokenID = client.TokenID - -func ServiceClient() *gophercloud.ServiceClient { - sc := client.ServiceClient() - sc.ResourceBase = sc.Endpoint + "v2.0/" - return sc -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/delegate.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/delegate.go deleted file mode 100644 index d08e1fda9..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/delegate.go +++ /dev/null @@ -1,41 +0,0 @@ -package extensions - -import ( - "github.com/rackspace/gophercloud" - common "github.com/rackspace/gophercloud/openstack/common/extensions" - "github.com/rackspace/gophercloud/pagination" -) - -// Extension is a single OpenStack extension. -type Extension struct { - common.Extension -} - -// GetResult wraps a GetResult from common. -type GetResult struct { - common.GetResult -} - -// ExtractExtensions interprets a Page as a slice of Extensions. -func ExtractExtensions(page pagination.Page) ([]Extension, error) { - inner, err := common.ExtractExtensions(page) - if err != nil { - return nil, err - } - outer := make([]Extension, len(inner)) - for index, ext := range inner { - outer[index] = Extension{ext} - } - return outer, nil -} - -// Get retrieves information for a specific extension using its alias. -func Get(c *gophercloud.ServiceClient, alias string) GetResult { - return GetResult{common.Get(c, alias)} -} - -// List returns a Pager which allows you to iterate over the full collection of extensions. -// It does not accept query parameters. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return common.List(c) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/doc.go deleted file mode 100644 index dad3a844f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package external provides information and interaction with the external -// extension for the OpenStack Networking service. -package external diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/requests.go deleted file mode 100644 index 097ae37f2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/requests.go +++ /dev/null @@ -1,69 +0,0 @@ -package external - -import ( - "time" - - "github.com/rackspace/gophercloud/openstack/networking/v2/networks" -) - -// AdminState gives users a solid type to work with for create and update -// operations. It is recommended that users use the `Up` and `Down` enums. -type AdminState *bool - -// Convenience vars for AdminStateUp values. -var ( - iTrue = true - iFalse = false - - Up AdminState = &iTrue - Down AdminState = &iFalse -) - -// CreateOpts is the structure used when creating new external network -// resources. It embeds networks.CreateOpts and so inherits all of its required -// and optional fields, with the addition of the External field. -type CreateOpts struct { - Parent networks.CreateOpts - External bool -} - -// ToNetworkCreateMap casts a CreateOpts struct to a map. -func (o CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error) { - - // DO NOT REMOVE. Though this line seemingly does nothing of value, it is a - // splint to prevent the unit test from failing on Go Tip. We suspect it is a - // compiler issue that will hopefully be worked out prior to our next release. - // Again, for all the unit tests to pass, this line is necessary and sufficient - // at the moment. We should reassess after the Go 1.5 release to determine - // if this line is still needed. - time.Sleep(0 * time.Millisecond) - - outer, err := o.Parent.ToNetworkCreateMap() - if err != nil { - return nil, err - } - - outer["network"].(map[string]interface{})["router:external"] = o.External - - return outer, nil -} - -// UpdateOpts is the structure used when updating existing external network -// resources. It embeds networks.UpdateOpts and so inherits all of its required -// and optional fields, with the addition of the External field. -type UpdateOpts struct { - Parent networks.UpdateOpts - External bool -} - -// ToNetworkUpdateMap casts an UpdateOpts struct to a map. -func (o UpdateOpts) ToNetworkUpdateMap() (map[string]interface{}, error) { - outer, err := o.Parent.ToNetworkUpdateMap() - if err != nil { - return nil, err - } - - outer["network"].(map[string]interface{})["router:external"] = o.External - - return outer, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/results.go deleted file mode 100644 index 54dbf4bb6..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/external/results.go +++ /dev/null @@ -1,81 +0,0 @@ -package external - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud/openstack/networking/v2/networks" - "github.com/rackspace/gophercloud/pagination" -) - -// NetworkExternal represents a decorated form of a Network with based on the -// "external-net" extension. -type NetworkExternal struct { - // UUID for the network - ID string `mapstructure:"id" json:"id"` - - // Human-readable name for the network. Might not be unique. - Name string `mapstructure:"name" json:"name"` - - // The administrative state of network. If false (down), the network does not forward packets. - AdminStateUp bool `mapstructure:"admin_state_up" json:"admin_state_up"` - - // Indicates whether network is currently operational. Possible values include - // `ACTIVE', `DOWN', `BUILD', or `ERROR'. Plug-ins might define additional values. - Status string `mapstructure:"status" json:"status"` - - // Subnets associated with this network. - Subnets []string `mapstructure:"subnets" json:"subnets"` - - // Owner of network. Only admin users can specify a tenant_id other than its own. - TenantID string `mapstructure:"tenant_id" json:"tenant_id"` - - // Specifies whether the network resource can be accessed by any tenant or not. - Shared bool `mapstructure:"shared" json:"shared"` - - // Specifies whether the network is an external network or not. - External bool `mapstructure:"router:external" json:"router:external"` -} - -func commonExtract(e error, response interface{}) (*NetworkExternal, error) { - if e != nil { - return nil, e - } - - var res struct { - Network *NetworkExternal `json:"network"` - } - - err := mapstructure.Decode(response, &res) - - return res.Network, err -} - -// ExtractGet decorates a GetResult struct returned from a networks.Get() -// function with extended attributes. -func ExtractGet(r networks.GetResult) (*NetworkExternal, error) { - return commonExtract(r.Err, r.Body) -} - -// ExtractCreate decorates a CreateResult struct returned from a networks.Create() -// function with extended attributes. -func ExtractCreate(r networks.CreateResult) (*NetworkExternal, error) { - return commonExtract(r.Err, r.Body) -} - -// ExtractUpdate decorates a UpdateResult struct returned from a -// networks.Update() function with extended attributes. -func ExtractUpdate(r networks.UpdateResult) (*NetworkExternal, error) { - return commonExtract(r.Err, r.Body) -} - -// ExtractList accepts a Page struct, specifically a NetworkPage struct, and -// extracts the elements into a slice of NetworkExternal structs. In other -// words, a generic collection is mapped into a relevant slice. -func ExtractList(page pagination.Page) ([]NetworkExternal, error) { - var resp struct { - Networks []NetworkExternal `mapstructure:"networks" json:"networks"` - } - - err := mapstructure.Decode(page.(networks.NetworkPage).Body, &resp) - - return resp.Networks, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/doc.go deleted file mode 100644 index 3ec450a7b..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package fwaas provides information and interaction with the Firewall -// as a Service extension for the OpenStack Networking service. -package fwaas diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/doc.go deleted file mode 100644 index d53345826..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package layer3 provides access to the Layer-3 networking extension for the -// OpenStack Neutron service. This extension allows API users to route packets -// between subnets, forward packets from internal networks to external ones, -// and access instances from external networks through floating IPs. -package layer3 diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/doc.go deleted file mode 100644 index bc1fc282f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package lbaas provides information and interaction with the Load Balancer -// as a Service extension for the OpenStack Networking service. -package lbaas diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider/doc.go deleted file mode 100644 index 373da44f8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// Package provider gives access to the provider Neutron plugin, allowing -// network extended attributes. The provider extended attributes for networks -// enable administrative users to specify how network objects map to the -// underlying networking infrastructure. These extended attributes also appear -// when administrative users query networks. -// -// For more information about extended attributes, see the NetworkExtAttrs -// struct. The actual semantics of these attributes depend on the technology -// back end of the particular plug-in. See the plug-in documentation and the -// OpenStack Cloud Administrator Guide to understand which values should be -// specific for each of these attributes when OpenStack Networking is deployed -// with a particular plug-in. The examples shown in this chapter refer to the -// Open vSwitch plug-in. -// -// The default policy settings enable only users with administrative rights to -// specify these parameters in requests and to see their values in responses. By -// default, the provider network extension attributes are completely hidden from -// regular tenants. As a rule of thumb, if these attributes are not visible in a -// GET /networks/ operation, this implies the user submitting the -// request is not authorized to view or manipulate provider network attributes. -package provider diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider/results.go deleted file mode 100644 index f07d6285d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider/results.go +++ /dev/null @@ -1,124 +0,0 @@ -package provider - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud/openstack/networking/v2/networks" - "github.com/rackspace/gophercloud/pagination" -) - -// AdminState gives users a solid type to work with for create and update -// operations. It is recommended that users use the `Up` and `Down` enums. -type AdminState *bool - -// Convenience vars for AdminStateUp values. -var ( - iTrue = true - iFalse = false - - Up AdminState = &iTrue - Down AdminState = &iFalse -) - -// NetworkExtAttrs represents an extended form of a Network with additional fields. -type NetworkExtAttrs struct { - // UUID for the network - ID string `mapstructure:"id" json:"id"` - - // Human-readable name for the network. Might not be unique. - Name string `mapstructure:"name" json:"name"` - - // The administrative state of network. If false (down), the network does not forward packets. - AdminStateUp bool `mapstructure:"admin_state_up" json:"admin_state_up"` - - // Indicates whether network is currently operational. Possible values include - // `ACTIVE', `DOWN', `BUILD', or `ERROR'. Plug-ins might define additional values. - Status string `mapstructure:"status" json:"status"` - - // Subnets associated with this network. - Subnets []string `mapstructure:"subnets" json:"subnets"` - - // Owner of network. Only admin users can specify a tenant_id other than its own. - TenantID string `mapstructure:"tenant_id" json:"tenant_id"` - - // Specifies whether the network resource can be accessed by any tenant or not. - Shared bool `mapstructure:"shared" json:"shared"` - - // Specifies the nature of the physical network mapped to this network - // resource. Examples are flat, vlan, or gre. - NetworkType string `json:"provider:network_type" mapstructure:"provider:network_type"` - - // Identifies the physical network on top of which this network object is - // being implemented. The OpenStack Networking API does not expose any facility - // for retrieving the list of available physical networks. As an example, in - // the Open vSwitch plug-in this is a symbolic name which is then mapped to - // specific bridges on each compute host through the Open vSwitch plug-in - // configuration file. - PhysicalNetwork string `json:"provider:physical_network" mapstructure:"provider:physical_network"` - - // Identifies an isolated segment on the physical network; the nature of the - // segment depends on the segmentation model defined by network_type. For - // instance, if network_type is vlan, then this is a vlan identifier; - // otherwise, if network_type is gre, then this will be a gre key. - SegmentationID string `json:"provider:segmentation_id" mapstructure:"provider:segmentation_id"` -} - -// ExtractGet decorates a GetResult struct returned from a networks.Get() -// function with extended attributes. -func ExtractGet(r networks.GetResult) (*NetworkExtAttrs, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Network *NetworkExtAttrs `json:"network"` - } - - err := mapstructure.WeakDecode(r.Body, &res) - - return res.Network, err -} - -// ExtractCreate decorates a CreateResult struct returned from a networks.Create() -// function with extended attributes. -func ExtractCreate(r networks.CreateResult) (*NetworkExtAttrs, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Network *NetworkExtAttrs `json:"network"` - } - - err := mapstructure.WeakDecode(r.Body, &res) - - return res.Network, err -} - -// ExtractUpdate decorates a UpdateResult struct returned from a -// networks.Update() function with extended attributes. -func ExtractUpdate(r networks.UpdateResult) (*NetworkExtAttrs, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Network *NetworkExtAttrs `json:"network"` - } - - err := mapstructure.WeakDecode(r.Body, &res) - - return res.Network, err -} - -// ExtractList accepts a Page struct, specifically a NetworkPage struct, and -// extracts the elements into a slice of NetworkExtAttrs structs. In other -// words, a generic collection is mapped into a relevant slice. -func ExtractList(page pagination.Page) ([]NetworkExtAttrs, error) { - var resp struct { - Networks []NetworkExtAttrs `mapstructure:"networks" json:"networks"` - } - - err := mapstructure.WeakDecode(page.(networks.NetworkPage).Body, &resp) - - return resp.Networks, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/doc.go deleted file mode 100644 index 31f744ccd..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Package security contains functionality to work with security group and -// security group rules Neutron resources. -// -// Security groups and security group rules allows administrators and tenants -// the ability to specify the type of traffic and direction (ingress/egress) -// that is allowed to pass through a port. A security group is a container for -// security group rules. -// -// When a port is created in Networking it is associated with a security group. -// If a security group is not specified the port is associated with a 'default' -// security group. By default, this group drops all ingress traffic and allows -// all egress. Rules can be added to this group in order to change the behaviour. -// -// The basic characteristics of Neutron Security Groups are: -// -// For ingress traffic (to an instance) -// - Only traffic matched with security group rules are allowed. -// - When there is no rule defined, all traffic is dropped. -// -// For egress traffic (from an instance) -// - Only traffic matched with security group rules are allowed. -// - When there is no rule defined, all egress traffic are dropped. -// - When a new security group is created, rules to allow all egress traffic -// is automatically added. -// -// "default security group" is defined for each tenant. -// - For the default security group a rule which allows intercommunication -// among hosts associated with the default security group is defined by default. -// - As a result, all egress traffic and intercommunication in the default -// group are allowed and all ingress from outside of the default group is -// dropped by default (in the default security group). -package security diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go deleted file mode 100644 index 2712ac162..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go +++ /dev/null @@ -1,131 +0,0 @@ -package groups - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the floating IP attributes you want to see returned. SortKey allows you to -// sort by a particular network attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - ID string `q:"id"` - Name string `q:"name"` - TenantID string `q:"tenant_id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// List returns a Pager which allows you to iterate over a collection of -// security groups. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, opts ListOpts) pagination.Pager { - q, err := gophercloud.BuildQueryString(&opts) - if err != nil { - return pagination.Pager{Err: err} - } - u := rootURL(c) + q.String() - return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page { - return SecGroupPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -var ( - errNameRequired = fmt.Errorf("Name is required") -) - -// CreateOpts contains all the values needed to create a new security group. -type CreateOpts struct { - // Required. Human-readable name for the VIP. Does not have to be unique. - Name string - - // Required for admins. Indicates the owner of the VIP. - TenantID string - - // Optional. Describes the security group. - Description string -} - -// Create is an operation which provisions a new security group with default -// security group rules for the IPv4 and IPv6 ether types. -func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { - var res CreateResult - - // Validate required opts - if opts.Name == "" { - res.Err = errNameRequired - return res - } - - type secgroup struct { - Name string `json:"name"` - TenantID string `json:"tenant_id,omitempty"` - Description string `json:"description,omitempty"` - } - - type request struct { - SecGroup secgroup `json:"security_group"` - } - - reqBody := request{SecGroup: secgroup{ - Name: opts.Name, - TenantID: opts.TenantID, - Description: opts.Description, - }} - - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get retrieves a particular security group based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(resourceURL(c, id), &res.Body, nil) - return res -} - -// Delete will permanently delete a particular security group based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(resourceURL(c, id), nil) - return res -} - -// IDFromName is a convenience function that returns a security group's ID given its name. -func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { - securityGroupCount := 0 - securityGroupID := "" - if name == "" { - return "", fmt.Errorf("A security group name must be provided.") - } - pager := List(client, ListOpts{}) - pager.EachPage(func(page pagination.Page) (bool, error) { - securityGroupList, err := ExtractGroups(page) - if err != nil { - return false, err - } - - for _, s := range securityGroupList { - if s.Name == name { - securityGroupCount++ - securityGroupID = s.ID - } - } - return true, nil - }) - - switch securityGroupCount { - case 0: - return "", fmt.Errorf("Unable to find security group: %s", name) - case 1: - return securityGroupID, nil - default: - return "", fmt.Errorf("Found %d security groups matching %s", securityGroupCount, name) - } -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/results.go deleted file mode 100644 index 49db261c2..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/results.go +++ /dev/null @@ -1,108 +0,0 @@ -package groups - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules" - "github.com/rackspace/gophercloud/pagination" -) - -// SecGroup represents a container for security group rules. -type SecGroup struct { - // The UUID for the security group. - ID string - - // Human-readable name for the security group. Might not be unique. Cannot be - // named "default" as that is automatically created for a tenant. - Name string - - // The security group description. - Description string - - // A slice of security group rules that dictate the permitted behaviour for - // traffic entering and leaving the group. - Rules []rules.SecGroupRule `json:"security_group_rules" mapstructure:"security_group_rules"` - - // Owner of the security group. Only admin users can specify a TenantID - // other than their own. - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` -} - -// SecGroupPage is the page returned by a pager when traversing over a -// collection of security groups. -type SecGroupPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of security groups has -// reached the end of a page and the pager seeks to traverse over a new one. In -// order to do this, it needs to construct the next page's URL. -func (p SecGroupPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"security_groups_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a SecGroupPage struct is empty. -func (p SecGroupPage) IsEmpty() (bool, error) { - is, err := ExtractGroups(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractGroups accepts a Page struct, specifically a SecGroupPage struct, -// and extracts the elements into a slice of SecGroup structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractGroups(page pagination.Page) ([]SecGroup, error) { - var resp struct { - SecGroups []SecGroup `mapstructure:"security_groups" json:"security_groups"` - } - - err := mapstructure.Decode(page.(SecGroupPage).Body, &resp) - - return resp.SecGroups, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a security group. -func (r commonResult) Extract() (*SecGroup, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - SecGroup *SecGroup `mapstructure:"security_group" json:"security_group"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.SecGroup, err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/urls.go deleted file mode 100644 index 84f7324f0..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/urls.go +++ /dev/null @@ -1,13 +0,0 @@ -package groups - -import "github.com/rackspace/gophercloud" - -const rootPath = "security-groups" - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go deleted file mode 100644 index e06934a09..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go +++ /dev/null @@ -1,174 +0,0 @@ -package rules - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the security group attributes you want to see returned. SortKey allows you to -// sort by a particular network attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - Direction string `q:"direction"` - EtherType string `q:"ethertype"` - ID string `q:"id"` - PortRangeMax int `q:"port_range_max"` - PortRangeMin int `q:"port_range_min"` - Protocol string `q:"protocol"` - RemoteGroupID string `q:"remote_group_id"` - RemoteIPPrefix string `q:"remote_ip_prefix"` - SecGroupID string `q:"security_group_id"` - TenantID string `q:"tenant_id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// List returns a Pager which allows you to iterate over a collection of -// security group rules. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, opts ListOpts) pagination.Pager { - q, err := gophercloud.BuildQueryString(&opts) - if err != nil { - return pagination.Pager{Err: err} - } - u := rootURL(c) + q.String() - return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page { - return SecGroupRulePage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// Errors -var ( - errValidDirectionRequired = fmt.Errorf("A valid Direction is required") - errValidEtherTypeRequired = fmt.Errorf("A valid EtherType is required") - errSecGroupIDRequired = fmt.Errorf("A valid SecGroupID is required") - errValidProtocolRequired = fmt.Errorf("A valid Protocol is required") -) - -// Constants useful for CreateOpts -const ( - DirIngress = "ingress" - DirEgress = "egress" - Ether4 = "IPv4" - Ether6 = "IPv6" - ProtocolTCP = "tcp" - ProtocolUDP = "udp" - ProtocolICMP = "icmp" -) - -// CreateOpts contains all the values needed to create a new security group rule. -type CreateOpts struct { - // Required. Must be either "ingress" or "egress": the direction in which the - // security group rule is applied. - Direction string - - // Required. Must be "IPv4" or "IPv6", and addresses represented in CIDR must - // match the ingress or egress rules. - EtherType string - - // Required. The security group ID to associate with this security group rule. - SecGroupID string - - // Optional. The maximum port number in the range that is matched by the - // security group rule. The PortRangeMin attribute constrains the PortRangeMax - // attribute. If the protocol is ICMP, this value must be an ICMP type. - PortRangeMax int - - // Optional. The minimum port number in the range that is matched by the - // security group rule. If the protocol is TCP or UDP, this value must be - // less than or equal to the value of the PortRangeMax attribute. If the - // protocol is ICMP, this value must be an ICMP type. - PortRangeMin int - - // Optional. The protocol that is matched by the security group rule. Valid - // values are "tcp", "udp", "icmp" or an empty string. - Protocol string - - // Optional. The remote group ID to be associated with this security group - // rule. You can specify either RemoteGroupID or RemoteIPPrefix. - RemoteGroupID string - - // Optional. The remote IP prefix to be associated with this security group - // rule. You can specify either RemoteGroupID or RemoteIPPrefix. This - // attribute matches the specified IP prefix as the source IP address of the - // IP packet. - RemoteIPPrefix string - - // Required for admins. Indicates the owner of the VIP. - TenantID string -} - -// Create is an operation which adds a new security group rule and associates it -// with an existing security group (whose ID is specified in CreateOpts). -func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { - var res CreateResult - - // Validate required opts - if opts.Direction != DirIngress && opts.Direction != DirEgress { - res.Err = errValidDirectionRequired - return res - } - if opts.EtherType != Ether4 && opts.EtherType != Ether6 { - res.Err = errValidEtherTypeRequired - return res - } - if opts.SecGroupID == "" { - res.Err = errSecGroupIDRequired - return res - } - if opts.Protocol != "" && opts.Protocol != ProtocolTCP && opts.Protocol != ProtocolUDP && opts.Protocol != ProtocolICMP { - res.Err = errValidProtocolRequired - return res - } - - type secrule struct { - Direction string `json:"direction"` - EtherType string `json:"ethertype"` - SecGroupID string `json:"security_group_id"` - PortRangeMax int `json:"port_range_max,omitempty"` - PortRangeMin int `json:"port_range_min,omitempty"` - Protocol string `json:"protocol,omitempty"` - RemoteGroupID string `json:"remote_group_id,omitempty"` - RemoteIPPrefix string `json:"remote_ip_prefix,omitempty"` - TenantID string `json:"tenant_id,omitempty"` - } - - type request struct { - SecRule secrule `json:"security_group_rule"` - } - - reqBody := request{SecRule: secrule{ - Direction: opts.Direction, - EtherType: opts.EtherType, - SecGroupID: opts.SecGroupID, - PortRangeMax: opts.PortRangeMax, - PortRangeMin: opts.PortRangeMin, - Protocol: opts.Protocol, - RemoteGroupID: opts.RemoteGroupID, - RemoteIPPrefix: opts.RemoteIPPrefix, - TenantID: opts.TenantID, - }} - - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get retrieves a particular security group rule based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(resourceURL(c, id), &res.Body, nil) - return res -} - -// Delete will permanently delete a particular security group rule based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(resourceURL(c, id), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/results.go deleted file mode 100644 index 6e1385768..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/results.go +++ /dev/null @@ -1,133 +0,0 @@ -package rules - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// SecGroupRule represents a rule to dictate the behaviour of incoming or -// outgoing traffic for a particular security group. -type SecGroupRule struct { - // The UUID for this security group rule. - ID string - - // The direction in which the security group rule is applied. The only values - // allowed are "ingress" or "egress". For a compute instance, an ingress - // security group rule is applied to incoming (ingress) traffic for that - // instance. An egress rule is applied to traffic leaving the instance. - Direction string - - // Must be IPv4 or IPv6, and addresses represented in CIDR must match the - // ingress or egress rules. - EtherType string `json:"ethertype" mapstructure:"ethertype"` - - // The security group ID to associate with this security group rule. - SecGroupID string `json:"security_group_id" mapstructure:"security_group_id"` - - // The minimum port number in the range that is matched by the security group - // rule. If the protocol is TCP or UDP, this value must be less than or equal - // to the value of the PortRangeMax attribute. If the protocol is ICMP, this - // value must be an ICMP type. - PortRangeMin int `json:"port_range_min" mapstructure:"port_range_min"` - - // The maximum port number in the range that is matched by the security group - // rule. The PortRangeMin attribute constrains the PortRangeMax attribute. If - // the protocol is ICMP, this value must be an ICMP type. - PortRangeMax int `json:"port_range_max" mapstructure:"port_range_max"` - - // The protocol that is matched by the security group rule. Valid values are - // "tcp", "udp", "icmp" or an empty string. - Protocol string - - // The remote group ID to be associated with this security group rule. You - // can specify either RemoteGroupID or RemoteIPPrefix. - RemoteGroupID string `json:"remote_group_id" mapstructure:"remote_group_id"` - - // The remote IP prefix to be associated with this security group rule. You - // can specify either RemoteGroupID or RemoteIPPrefix . This attribute - // matches the specified IP prefix as the source IP address of the IP packet. - RemoteIPPrefix string `json:"remote_ip_prefix" mapstructure:"remote_ip_prefix"` - - // The owner of this security group rule. - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` -} - -// SecGroupRulePage is the page returned by a pager when traversing over a -// collection of security group rules. -type SecGroupRulePage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of security group rules has -// reached the end of a page and the pager seeks to traverse over a new one. In -// order to do this, it needs to construct the next page's URL. -func (p SecGroupRulePage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"security_group_rules_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a SecGroupRulePage struct is empty. -func (p SecGroupRulePage) IsEmpty() (bool, error) { - is, err := ExtractRules(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractRules accepts a Page struct, specifically a SecGroupRulePage struct, -// and extracts the elements into a slice of SecGroupRule structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractRules(page pagination.Page) ([]SecGroupRule, error) { - var resp struct { - SecGroupRules []SecGroupRule `mapstructure:"security_group_rules" json:"security_group_rules"` - } - - err := mapstructure.Decode(page.(SecGroupRulePage).Body, &resp) - - return resp.SecGroupRules, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a security rule. -func (r commonResult) Extract() (*SecGroupRule, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - SecGroupRule *SecGroupRule `mapstructure:"security_group_rule" json:"security_group_rule"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.SecGroupRule, err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/urls.go deleted file mode 100644 index 8e2b2bb28..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/urls.go +++ /dev/null @@ -1,13 +0,0 @@ -package rules - -import "github.com/rackspace/gophercloud" - -const rootPath = "security-group-rules" - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/doc.go deleted file mode 100644 index f2db622d1..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package apiversions provides information and interaction with the different -// API versions for the OpenStack Heat service. This functionality is not -// restricted to this particular version. -package apiversions diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/requests.go deleted file mode 100644 index f6454c860..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/requests.go +++ /dev/null @@ -1,13 +0,0 @@ -package apiversions - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListVersions lists all the Neutron API versions available to end-users -func ListVersions(c *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.PageResult) pagination.Page { - return APIVersionPage{pagination.SinglePageBase(r)} - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/results.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/results.go deleted file mode 100644 index 0700ab0af..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/results.go +++ /dev/null @@ -1,42 +0,0 @@ -package apiversions - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// APIVersion represents an API version for Neutron. It contains the status of -// the API, and its unique ID. -type APIVersion struct { - Status string `mapstructure:"status"` - ID string `mapstructure:"id"` - Links []gophercloud.Link `mapstructure:"links"` -} - -// APIVersionPage is the page returned by a pager when traversing over a -// collection of API versions. -type APIVersionPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an APIVersionPage struct is empty. -func (r APIVersionPage) IsEmpty() (bool, error) { - is, err := ExtractAPIVersions(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractAPIVersions takes a collection page, extracts all of the elements, -// and returns them a slice of APIVersion structs. It is effectively a cast. -func ExtractAPIVersions(page pagination.Page) ([]APIVersion, error) { - var resp struct { - Versions []APIVersion `mapstructure:"versions"` - } - - err := mapstructure.Decode(page.(APIVersionPage).Body, &resp) - - return resp.Versions, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/urls.go deleted file mode 100644 index 55d6e0e7a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/apiversions/urls.go +++ /dev/null @@ -1,7 +0,0 @@ -package apiversions - -import "github.com/rackspace/gophercloud" - -func apiVersionsURL(c *gophercloud.ServiceClient) string { - return c.Endpoint -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/doc.go deleted file mode 100644 index 183e8dfa7..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package buildinfo provides build information about heat deployments. -package buildinfo diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/fixtures.go deleted file mode 100644 index 20ea09b44..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/fixtures.go +++ /dev/null @@ -1,45 +0,0 @@ -package buildinfo - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// GetExpected represents the expected object from a Get request. -var GetExpected = &BuildInfo{ - API: Revision{ - Revision: "2.4.5", - }, - Engine: Revision{ - Revision: "1.2.1", - }, -} - -// GetOutput represents the response body from a Get request. -const GetOutput = ` -{ - "api": { - "revision": "2.4.5" - }, - "engine": { - "revision": "1.2.1" - } -}` - -// HandleGetSuccessfully creates an HTTP handler at `/build_info` -// on the test handler mux that responds with a `Get` response. -func HandleGetSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/build_info", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/requests.go deleted file mode 100644 index 9e03e5cc8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/requests.go +++ /dev/null @@ -1,10 +0,0 @@ -package buildinfo - -import "github.com/rackspace/gophercloud" - -// Get retreives data for the given stack template. -func Get(c *gophercloud.ServiceClient) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/results.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/results.go deleted file mode 100644 index 683a434a0..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/results.go +++ /dev/null @@ -1,37 +0,0 @@ -package buildinfo - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" -) - -// Revision represents the API/Engine revision of a Heat deployment. -type Revision struct { - Revision string `mapstructure:"revision"` -} - -// BuildInfo represents the build information for a Heat deployment. -type BuildInfo struct { - API Revision `mapstructure:"api"` - Engine Revision `mapstructure:"engine"` -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a BuildInfo object and is called after a -// Get operation. -func (r GetResult) Extract() (*BuildInfo, error) { - if r.Err != nil { - return nil, r.Err - } - - var res BuildInfo - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - return &res, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/urls.go deleted file mode 100644 index 2c873d023..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo/urls.go +++ /dev/null @@ -1,7 +0,0 @@ -package buildinfo - -import "github.com/rackspace/gophercloud" - -func getURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("build_info") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/doc.go deleted file mode 100644 index 51cdd9747..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package stackevents provides operations for finding, listing, and retrieving -// stack events. Stack events are events that take place on stacks such as -// updating and abandoning. -package stackevents diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go deleted file mode 100644 index 235787a51..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go +++ /dev/null @@ -1,446 +0,0 @@ -package stackevents - -import ( - "fmt" - "net/http" - "testing" - "time" - - "github.com/rackspace/gophercloud" - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// FindExpected represents the expected object from a Find request. -var FindExpected = []Event{ - Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_IN_PROGRESS", - PhysicalResourceID: "", - ID: "06feb26f-9298-4a9b-8749-9d770e5d577a", - }, - Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_COMPLETE", - PhysicalResourceID: "49181cd6-169a-4130-9455-31185bbfc5bf", - ID: "93940999-7d40-44ae-8de4-19624e7b8d18", - }, -} - -// FindOutput represents the response body from a Find request. -const FindOutput = ` -{ - "events": [ - { - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:11", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_IN_PROGRESS", - "physical_resource_id": null, - "id": "06feb26f-9298-4a9b-8749-9d770e5d577a" - }, - { - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", - "id": "93940999-7d40-44ae-8de4-19624e7b8d18" - } - ] -}` - -// HandleFindSuccessfully creates an HTTP handler at `/stacks/postman_stack/events` -// on the test handler mux that responds with a `Find` response. -func HandleFindSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/postman_stack/events", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// ListExpected represents the expected object from a List request. -var ListExpected = []Event{ - Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_IN_PROGRESS", - PhysicalResourceID: "", - ID: "06feb26f-9298-4a9b-8749-9d770e5d577a", - }, - Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_COMPLETE", - PhysicalResourceID: "49181cd6-169a-4130-9455-31185bbfc5bf", - ID: "93940999-7d40-44ae-8de4-19624e7b8d18", - }, -} - -// ListOutput represents the response body from a List request. -const ListOutput = ` -{ - "events": [ - { - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:11", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_IN_PROGRESS", - "physical_resource_id": null, - "id": "06feb26f-9298-4a9b-8749-9d770e5d577a" - }, - { - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", - "id": "93940999-7d40-44ae-8de4-19624e7b8d18" - } - ] -}` - -// HandleListSuccessfully creates an HTTP handler at `/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/events` -// on the test handler mux that responds with a `List` response. -func HandleListSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/events", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, output) - case "93940999-7d40-44ae-8de4-19624e7b8d18": - fmt.Fprintf(w, `{"events":[]}`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// ListResourceEventsExpected represents the expected object from a ListResourceEvents request. -var ListResourceEventsExpected = []Event{ - Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_IN_PROGRESS", - PhysicalResourceID: "", - ID: "06feb26f-9298-4a9b-8749-9d770e5d577a", - }, - Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_COMPLETE", - PhysicalResourceID: "49181cd6-169a-4130-9455-31185bbfc5bf", - ID: "93940999-7d40-44ae-8de4-19624e7b8d18", - }, -} - -// ListResourceEventsOutput represents the response body from a ListResourceEvents request. -const ListResourceEventsOutput = ` -{ - "events": [ - { - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:11", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/06feb26f-9298-4a9b-8749-9d770e5d577a", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_IN_PROGRESS", - "physical_resource_id": null, - "id": "06feb26f-9298-4a9b-8749-9d770e5d577a" - }, - { - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", - "id": "93940999-7d40-44ae-8de4-19624e7b8d18" - } - ] -}` - -// HandleListResourceEventsSuccessfully creates an HTTP handler at `/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/resources/my_resource/events` -// on the test handler mux that responds with a `ListResourceEvents` response. -func HandleListResourceEventsSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/resources/my_resource/events", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, output) - case "93940999-7d40-44ae-8de4-19624e7b8d18": - fmt.Fprintf(w, `{"events":[]}`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// GetExpected represents the expected object from a Get request. -var GetExpected = &Event{ - ResourceName: "hello_world", - Time: time.Date(2015, 2, 5, 21, 33, 27, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "resource", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalResourceID: "hello_world", - ResourceStatusReason: "state changed", - ResourceStatus: "CREATE_COMPLETE", - PhysicalResourceID: "49181cd6-169a-4130-9455-31185bbfc5bf", - ID: "93940999-7d40-44ae-8de4-19624e7b8d18", -} - -// GetOutput represents the response body from a Get request. -const GetOutput = ` -{ - "event":{ - "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world/events/93940999-7d40-44ae-8de4-19624e7b8d18", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "resource" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", - "id": "93940999-7d40-44ae-8de4-19624e7b8d18" - } -}` - -// HandleGetSuccessfully creates an HTTP handler at `/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/resources/my_resource/events/93940999-7d40-44ae-8de4-19624e7b8d18` -// on the test handler mux that responds with a `Get` response. -func HandleGetSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/resources/my_resource/events/93940999-7d40-44ae-8de4-19624e7b8d18", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/requests.go deleted file mode 100644 index 70c6b97e8..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/requests.go +++ /dev/null @@ -1,203 +0,0 @@ -package stackevents - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Find retrieves stack events for the given stack name. -func Find(c *gophercloud.ServiceClient, stackName string) FindResult { - var res FindResult - - _, res.Err = c.Request("GET", findURL(c, stackName), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - }) - return res -} - -// SortDir is a type for specifying in which direction to sort a list of events. -type SortDir string - -// SortKey is a type for specifying by which key to sort a list of events. -type SortKey string - -// ResourceStatus is a type for specifying by which resource status to filter a -// list of events. -type ResourceStatus string - -// ResourceAction is a type for specifying by which resource action to filter a -// list of events. -type ResourceAction string - -var ( - // ResourceStatusInProgress is used to filter a List request by the 'IN_PROGRESS' status. - ResourceStatusInProgress ResourceStatus = "IN_PROGRESS" - // ResourceStatusComplete is used to filter a List request by the 'COMPLETE' status. - ResourceStatusComplete ResourceStatus = "COMPLETE" - // ResourceStatusFailed is used to filter a List request by the 'FAILED' status. - ResourceStatusFailed ResourceStatus = "FAILED" - - // ResourceActionCreate is used to filter a List request by the 'CREATE' action. - ResourceActionCreate ResourceAction = "CREATE" - // ResourceActionDelete is used to filter a List request by the 'DELETE' action. - ResourceActionDelete ResourceAction = "DELETE" - // ResourceActionUpdate is used to filter a List request by the 'UPDATE' action. - ResourceActionUpdate ResourceAction = "UPDATE" - // ResourceActionRollback is used to filter a List request by the 'ROLLBACK' action. - ResourceActionRollback ResourceAction = "ROLLBACK" - // ResourceActionSuspend is used to filter a List request by the 'SUSPEND' action. - ResourceActionSuspend ResourceAction = "SUSPEND" - // ResourceActionResume is used to filter a List request by the 'RESUME' action. - ResourceActionResume ResourceAction = "RESUME" - // ResourceActionAbandon is used to filter a List request by the 'ABANDON' action. - ResourceActionAbandon ResourceAction = "ABANDON" - - // SortAsc is used to sort a list of stacks in ascending order. - SortAsc SortDir = "asc" - // SortDesc is used to sort a list of stacks in descending order. - SortDesc SortDir = "desc" - - // SortName is used to sort a list of stacks by name. - SortName SortKey = "name" - // SortResourceType is used to sort a list of stacks by resource type. - SortResourceType SortKey = "resource_type" - // SortCreatedAt is used to sort a list of stacks by date created. - SortCreatedAt SortKey = "created_at" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToStackEventListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Marker and Limit are used for pagination. -type ListOpts struct { - // The stack resource ID with which to start the listing. - Marker string `q:"marker"` - // Integer value for the limit of values to return. - Limit int `q:"limit"` - // Filters the event list by the specified ResourceAction. You can use this - // filter multiple times to filter by multiple resource actions: CREATE, DELETE, - // UPDATE, ROLLBACK, SUSPEND, RESUME or ADOPT. - ResourceActions []ResourceAction `q:"resource_action"` - // Filters the event list by the specified resource_status. You can use this - // filter multiple times to filter by multiple resource statuses: IN_PROGRESS, - // COMPLETE or FAILED. - ResourceStatuses []ResourceStatus `q:"resource_status"` - // Filters the event list by the specified resource_name. You can use this - // filter multiple times to filter by multiple resource names. - ResourceNames []string `q:"resource_name"` - // Filters the event list by the specified resource_type. You can use this - // filter multiple times to filter by multiple resource types: OS::Nova::Server, - // OS::Cinder::Volume, and so on. - ResourceTypes []string `q:"resource_type"` - // Sorts the event list by: resource_type or created_at. - SortKey SortKey `q:"sort_keys"` - // The sort direction of the event list. Which is asc (ascending) or desc (descending). - SortDir SortDir `q:"sort_dir"` -} - -// ToStackEventListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToStackEventListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List makes a request against the API to list resources for the given stack. -func List(client *gophercloud.ServiceClient, stackName, stackID string, opts ListOptsBuilder) pagination.Pager { - url := listURL(client, stackName, stackID) - - if opts != nil { - query, err := opts.ToStackEventListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPageFn := func(r pagination.PageResult) pagination.Page { - p := EventPage{pagination.MarkerPageBase{PageResult: r}} - p.MarkerPageBase.Owner = p - return p - } - - return pagination.NewPager(client, url, createPageFn) -} - -// ListResourceEventsOptsBuilder allows extensions to add additional parameters to the -// ListResourceEvents request. -type ListResourceEventsOptsBuilder interface { - ToResourceEventListQuery() (string, error) -} - -// ListResourceEventsOpts allows the filtering and sorting of paginated resource events through -// the API. Marker and Limit are used for pagination. -type ListResourceEventsOpts struct { - // The stack resource ID with which to start the listing. - Marker string `q:"marker"` - // Integer value for the limit of values to return. - Limit int `q:"limit"` - // Filters the event list by the specified ResourceAction. You can use this - // filter multiple times to filter by multiple resource actions: CREATE, DELETE, - // UPDATE, ROLLBACK, SUSPEND, RESUME or ADOPT. - ResourceActions []string `q:"resource_action"` - // Filters the event list by the specified resource_status. You can use this - // filter multiple times to filter by multiple resource statuses: IN_PROGRESS, - // COMPLETE or FAILED. - ResourceStatuses []string `q:"resource_status"` - // Filters the event list by the specified resource_name. You can use this - // filter multiple times to filter by multiple resource names. - ResourceNames []string `q:"resource_name"` - // Filters the event list by the specified resource_type. You can use this - // filter multiple times to filter by multiple resource types: OS::Nova::Server, - // OS::Cinder::Volume, and so on. - ResourceTypes []string `q:"resource_type"` - // Sorts the event list by: resource_type or created_at. - SortKey SortKey `q:"sort_keys"` - // The sort direction of the event list. Which is asc (ascending) or desc (descending). - SortDir SortDir `q:"sort_dir"` -} - -// ToResourceEventListQuery formats a ListResourceEventsOpts into a query string. -func (opts ListResourceEventsOpts) ToResourceEventListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// ListResourceEvents makes a request against the API to list resources for the given stack. -func ListResourceEvents(client *gophercloud.ServiceClient, stackName, stackID, resourceName string, opts ListResourceEventsOptsBuilder) pagination.Pager { - url := listResourceEventsURL(client, stackName, stackID, resourceName) - - if opts != nil { - query, err := opts.ToResourceEventListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPageFn := func(r pagination.PageResult) pagination.Page { - p := EventPage{pagination.MarkerPageBase{PageResult: r}} - p.MarkerPageBase.Owner = p - return p - } - - return pagination.NewPager(client, url, createPageFn) -} - -// Get retreives data for the given stack resource. -func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, stackName, stackID, resourceName, eventID), &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go deleted file mode 100644 index cf9e24098..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go +++ /dev/null @@ -1,172 +0,0 @@ -package stackevents - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Event represents a stack event. -type Event struct { - // The name of the resource for which the event occurred. - ResourceName string `mapstructure:"resource_name"` - // The time the event occurred. - Time time.Time `mapstructure:"-"` - // The URLs to the event. - Links []gophercloud.Link `mapstructure:"links"` - // The logical ID of the stack resource. - LogicalResourceID string `mapstructure:"logical_resource_id"` - // The reason of the status of the event. - ResourceStatusReason string `mapstructure:"resource_status_reason"` - // The status of the event. - ResourceStatus string `mapstructure:"resource_status"` - // The physical ID of the stack resource. - PhysicalResourceID string `mapstructure:"physical_resource_id"` - // The event ID. - ID string `mapstructure:"id"` - // Properties of the stack resource. - ResourceProperties map[string]interface{} `mapstructure:"resource_properties"` -} - -// FindResult represents the result of a Find operation. -type FindResult struct { - gophercloud.Result -} - -// Extract returns a slice of Event objects and is called after a -// Find operation. -func (r FindResult) Extract() ([]Event, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Res []Event `mapstructure:"events"` - } - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - events := r.Body.(map[string]interface{})["events"].([]interface{}) - - for i, eventRaw := range events { - event := eventRaw.(map[string]interface{}) - if date, ok := event["event_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res[i].Time = t - } - } - - return res.Res, nil -} - -// EventPage abstracts the raw results of making a List() request against the API. -// As OpenStack extensions may freely alter the response bodies of structures returned to the client, you may only safely access the -// data provided through the ExtractResources call. -type EventPage struct { - pagination.MarkerPageBase -} - -// IsEmpty returns true if a page contains no Server results. -func (r EventPage) IsEmpty() (bool, error) { - events, err := ExtractEvents(r) - if err != nil { - return true, err - } - return len(events) == 0, nil -} - -// LastMarker returns the last stack ID in a ListResult. -func (r EventPage) LastMarker() (string, error) { - events, err := ExtractEvents(r) - if err != nil { - return "", err - } - if len(events) == 0 { - return "", nil - } - return events[len(events)-1].ID, nil -} - -// ExtractEvents interprets the results of a single page from a List() call, producing a slice of Event entities. -func ExtractEvents(page pagination.Page) ([]Event, error) { - casted := page.(EventPage).Body - - var res struct { - Res []Event `mapstructure:"events"` - } - - if err := mapstructure.Decode(casted, &res); err != nil { - return nil, err - } - - var events []interface{} - switch casted.(type) { - case map[string]interface{}: - events = casted.(map[string]interface{})["events"].([]interface{}) - case map[string][]interface{}: - events = casted.(map[string][]interface{})["events"] - default: - return res.Res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i, eventRaw := range events { - event := eventRaw.(map[string]interface{}) - if date, ok := event["event_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res[i].Time = t - } - } - - return res.Res, nil -} - -// ExtractResourceEvents interprets the results of a single page from a -// ListResourceEvents() call, producing a slice of Event entities. -func ExtractResourceEvents(page pagination.Page) ([]Event, error) { - return ExtractEvents(page) -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract returns a pointer to an Event object and is called after a -// Get operation. -func (r GetResult) Extract() (*Event, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Res *Event `mapstructure:"event"` - } - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - event := r.Body.(map[string]interface{})["event"].(map[string]interface{}) - - if date, ok := event["event_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res.Time = t - } - - return res.Res, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/urls.go deleted file mode 100644 index 8b5eceb17..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/urls.go +++ /dev/null @@ -1,19 +0,0 @@ -package stackevents - -import "github.com/rackspace/gophercloud" - -func findURL(c *gophercloud.ServiceClient, stackName string) string { - return c.ServiceURL("stacks", stackName, "events") -} - -func listURL(c *gophercloud.ServiceClient, stackName, stackID string) string { - return c.ServiceURL("stacks", stackName, stackID, "events") -} - -func listResourceEventsURL(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) string { - return c.ServiceURL("stacks", stackName, stackID, "resources", resourceName, "events") -} - -func getURL(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) string { - return c.ServiceURL("stacks", stackName, stackID, "resources", resourceName, "events", eventID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/doc.go deleted file mode 100644 index e4f8b08dc..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package stackresources provides operations for working with stack resources. -// A resource is a template artifact that represents some component of your -// desired architecture (a Cloud Server, a group of scaled Cloud Servers, a load -// balancer, some configuration management system, and so forth). -package stackresources diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go deleted file mode 100644 index 952dc54d1..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go +++ /dev/null @@ -1,439 +0,0 @@ -package stackresources - -import ( - "fmt" - "net/http" - "testing" - "time" - - "github.com/rackspace/gophercloud" - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// FindExpected represents the expected object from a Find request. -var FindExpected = []Resource{ - Resource{ - Name: "hello_world", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalID: "hello_world", - StatusReason: "state changed", - UpdatedTime: time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC), - CreationTime: time.Date(2015, 2, 5, 21, 33, 10, 0, time.UTC), - RequiredBy: []interface{}{}, - Status: "CREATE_IN_PROGRESS", - PhysicalID: "49181cd6-169a-4130-9455-31185bbfc5bf", - Type: "OS::Nova::Server", - Attributes: map[string]interface{}{"SXSW": "atx"}, - Description: "Some resource", - }, -} - -// FindOutput represents the response body from a Find request. -const FindOutput = ` -{ - "resources": [ - { - "description": "Some resource", - "attributes": {"SXSW": "atx"}, - "resource_name": "hello_world", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "updated_time": "2015-02-05T21:33:11", - "creation_time": "2015-02-05T21:33:10", - "required_by": [], - "resource_status": "CREATE_IN_PROGRESS", - "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", - "resource_type": "OS::Nova::Server" - } - ] -}` - -// HandleFindSuccessfully creates an HTTP handler at `/stacks/hello_world/resources` -// on the test handler mux that responds with a `Find` response. -func HandleFindSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/hello_world/resources", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// ListExpected represents the expected object from a List request. -var ListExpected = []Resource{ - Resource{ - Name: "hello_world", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - Rel: "stack", - }, - }, - LogicalID: "hello_world", - StatusReason: "state changed", - UpdatedTime: time.Date(2015, 2, 5, 21, 33, 11, 0, time.UTC), - CreationTime: time.Date(2015, 2, 5, 21, 33, 10, 0, time.UTC), - RequiredBy: []interface{}{}, - Status: "CREATE_IN_PROGRESS", - PhysicalID: "49181cd6-169a-4130-9455-31185bbfc5bf", - Type: "OS::Nova::Server", - Attributes: map[string]interface{}{"SXSW": "atx"}, - Description: "Some resource", - }, -} - -// ListOutput represents the response body from a List request. -const ListOutput = `{ - "resources": [ - { - "resource_name": "hello_world", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b/resources/hello_world", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/5f57cff9-93fc-424e-9f78-df0515e7f48b", - "rel": "stack" - } - ], - "logical_resource_id": "hello_world", - "resource_status_reason": "state changed", - "updated_time": "2015-02-05T21:33:11", - "required_by": [], - "resource_status": "CREATE_IN_PROGRESS", - "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", - "creation_time": "2015-02-05T21:33:10", - "resource_type": "OS::Nova::Server", - "attributes": {"SXSW": "atx"}, - "description": "Some resource" - } -] -}` - -// HandleListSuccessfully creates an HTTP handler at `/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/resources` -// on the test handler mux that responds with a `List` response. -func HandleListSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/hello_world/49181cd6-169a-4130-9455-31185bbfc5bf/resources", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, output) - case "49181cd6-169a-4130-9455-31185bbfc5bf": - fmt.Fprintf(w, `{"resources":[]}`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// GetExpected represents the expected object from a Get request. -var GetExpected = &Resource{ - Name: "wordpress_instance", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e/resources/wordpress_instance", - Rel: "self", - }, - gophercloud.Link{ - Href: "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e", - Rel: "stack", - }, - }, - LogicalID: "wordpress_instance", - Attributes: map[string]interface{}{"SXSW": "atx"}, - StatusReason: "state changed", - UpdatedTime: time.Date(2014, 12, 10, 18, 34, 35, 0, time.UTC), - RequiredBy: []interface{}{}, - Status: "CREATE_COMPLETE", - PhysicalID: "00e3a2fe-c65d-403c-9483-4db9930dd194", - Type: "OS::Nova::Server", -} - -// GetOutput represents the response body from a Get request. -const GetOutput = ` -{ - "resource": { - "description": "Some resource", - "attributes": {"SXSW": "atx"}, - "resource_name": "wordpress_instance", - "description": "", - "links": [ - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e/resources/wordpress_instance", - "rel": "self" - }, - { - "href": "http://166.78.160.107:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e", - "rel": "stack" - } - ], - "logical_resource_id": "wordpress_instance", - "resource_status": "CREATE_COMPLETE", - "updated_time": "2014-12-10T18:34:35", - "required_by": [], - "resource_status_reason": "state changed", - "physical_resource_id": "00e3a2fe-c65d-403c-9483-4db9930dd194", - "resource_type": "OS::Nova::Server" - } -}` - -// HandleGetSuccessfully creates an HTTP handler at `/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e/resources/wordpress_instance` -// on the test handler mux that responds with a `Get` response. -func HandleGetSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e/resources/wordpress_instance", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// MetadataExpected represents the expected object from a Metadata request. -var MetadataExpected = map[string]string{ - "number": "7", - "animal": "auk", -} - -// MetadataOutput represents the response body from a Metadata request. -const MetadataOutput = ` -{ - "metadata": { - "number": "7", - "animal": "auk" - } -}` - -// HandleMetadataSuccessfully creates an HTTP handler at `/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e/resources/wordpress_instance/metadata` -// on the test handler mux that responds with a `Metadata` response. -func HandleMetadataSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/teststack/0b1771bd-9336-4f2b-ae86-a80f971faf1e/resources/wordpress_instance/metadata", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// ListTypesExpected represents the expected object from a ListTypes request. -var ListTypesExpected = ResourceTypes{ - "OS::Nova::Server", - "OS::Heat::RandomString", - "OS::Swift::Container", - "OS::Trove::Instance", - "OS::Nova::FloatingIPAssociation", - "OS::Cinder::VolumeAttachment", - "OS::Nova::FloatingIP", - "OS::Nova::KeyPair", -} - -// same as above, but sorted -var SortedListTypesExpected = ResourceTypes{ - "OS::Cinder::VolumeAttachment", - "OS::Heat::RandomString", - "OS::Nova::FloatingIP", - "OS::Nova::FloatingIPAssociation", - "OS::Nova::KeyPair", - "OS::Nova::Server", - "OS::Swift::Container", - "OS::Trove::Instance", -} - -// ListTypesOutput represents the response body from a ListTypes request. -const ListTypesOutput = ` -{ - "resource_types": [ - "OS::Nova::Server", - "OS::Heat::RandomString", - "OS::Swift::Container", - "OS::Trove::Instance", - "OS::Nova::FloatingIPAssociation", - "OS::Cinder::VolumeAttachment", - "OS::Nova::FloatingIP", - "OS::Nova::KeyPair" - ] -}` - -// HandleListTypesSuccessfully creates an HTTP handler at `/resource_types` -// on the test handler mux that responds with a `ListTypes` response. -func HandleListTypesSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/resource_types", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// GetSchemaExpected represents the expected object from a Schema request. -var GetSchemaExpected = &TypeSchema{ - Attributes: map[string]interface{}{ - "an_attribute": map[string]interface{}{ - "description": "An attribute description .", - }, - }, - Properties: map[string]interface{}{ - "a_property": map[string]interface{}{ - "update_allowed": false, - "required": true, - "type": "string", - "description": "A resource description.", - }, - }, - ResourceType: "OS::Heat::AResourceName", - SupportStatus: map[string]interface{}{ - "message": "A status message", - "status": "SUPPORTED", - "version": "2014.1", - }, -} - -// GetSchemaOutput represents the response body from a Schema request. -const GetSchemaOutput = ` -{ - "attributes": { - "an_attribute": { - "description": "An attribute description ." - } - }, - "properties": { - "a_property": { - "update_allowed": false, - "required": true, - "type": "string", - "description": "A resource description." - } - }, - "resource_type": "OS::Heat::AResourceName", - "support_status": { - "message": "A status message", - "status": "SUPPORTED", - "version": "2014.1" - } -}` - -// HandleGetSchemaSuccessfully creates an HTTP handler at `/resource_types/OS::Heat::AResourceName` -// on the test handler mux that responds with a `Schema` response. -func HandleGetSchemaSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/resource_types/OS::Heat::AResourceName", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// GetTemplateExpected represents the expected object from a Template request. -var GetTemplateExpected = "{\n \"HeatTemplateFormatVersion\": \"2012-12-12\",\n \"Outputs\": {\n \"private_key\": {\n \"Description\": \"The private key if it has been saved.\",\n \"Value\": \"{\\\"Fn::GetAtt\\\": [\\\"KeyPair\\\", \\\"private_key\\\"]}\"\n },\n \"public_key\": {\n \"Description\": \"The public key.\",\n \"Value\": \"{\\\"Fn::GetAtt\\\": [\\\"KeyPair\\\", \\\"public_key\\\"]}\"\n }\n },\n \"Parameters\": {\n \"name\": {\n \"Description\": \"The name of the key pair.\",\n \"Type\": \"String\"\n },\n \"public_key\": {\n \"Description\": \"The optional public key. This allows users to supply the public key from a pre-existing key pair. If not supplied, a new key pair will be generated.\",\n \"Type\": \"String\"\n },\n \"save_private_key\": {\n \"AllowedValues\": [\n \"True\",\n \"true\",\n \"False\",\n \"false\"\n ],\n \"Default\": false,\n \"Description\": \"True if the system should remember a generated private key; False otherwise.\",\n \"Type\": \"String\"\n }\n },\n \"Resources\": {\n \"KeyPair\": {\n \"Properties\": {\n \"name\": {\n \"Ref\": \"name\"\n },\n \"public_key\": {\n \"Ref\": \"public_key\"\n },\n \"save_private_key\": {\n \"Ref\": \"save_private_key\"\n }\n },\n \"Type\": \"OS::Nova::KeyPair\"\n }\n }\n}" - -// GetTemplateOutput represents the response body from a Template request. -const GetTemplateOutput = ` -{ - "HeatTemplateFormatVersion": "2012-12-12", - "Outputs": { - "private_key": { - "Description": "The private key if it has been saved.", - "Value": "{\"Fn::GetAtt\": [\"KeyPair\", \"private_key\"]}" - }, - "public_key": { - "Description": "The public key.", - "Value": "{\"Fn::GetAtt\": [\"KeyPair\", \"public_key\"]}" - } - }, - "Parameters": { - "name": { - "Description": "The name of the key pair.", - "Type": "String" - }, - "public_key": { - "Description": "The optional public key. This allows users to supply the public key from a pre-existing key pair. If not supplied, a new key pair will be generated.", - "Type": "String" - }, - "save_private_key": { - "AllowedValues": [ - "True", - "true", - "False", - "false" - ], - "Default": false, - "Description": "True if the system should remember a generated private key; False otherwise.", - "Type": "String" - } - }, - "Resources": { - "KeyPair": { - "Properties": { - "name": { - "Ref": "name" - }, - "public_key": { - "Ref": "public_key" - }, - "save_private_key": { - "Ref": "save_private_key" - } - }, - "Type": "OS::Nova::KeyPair" - } - } -}` - -// HandleGetTemplateSuccessfully creates an HTTP handler at `/resource_types/OS::Heat::AResourceName/template` -// on the test handler mux that responds with a `Template` response. -func HandleGetTemplateSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/resource_types/OS::Heat::AResourceName/template", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go deleted file mode 100644 index fcb8d8a2f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go +++ /dev/null @@ -1,113 +0,0 @@ -package stackresources - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Find retrieves stack resources for the given stack name. -func Find(c *gophercloud.ServiceClient, stackName string) FindResult { - var res FindResult - - // Send request to API - _, res.Err = c.Request("GET", findURL(c, stackName), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - }) - return res -} - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToStackResourceListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Marker and Limit are used for pagination. -type ListOpts struct { - // Include resources from nest stacks up to Depth levels of recursion. - Depth int `q:"nested_depth"` -} - -// ToStackResourceListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToStackResourceListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List makes a request against the API to list resources for the given stack. -func List(client *gophercloud.ServiceClient, stackName, stackID string, opts ListOptsBuilder) pagination.Pager { - url := listURL(client, stackName, stackID) - - if opts != nil { - query, err := opts.ToStackResourceListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPageFn := func(r pagination.PageResult) pagination.Page { - return ResourcePage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, url, createPageFn) -} - -// Get retreives data for the given stack resource. -func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) GetResult { - var res GetResult - - // Send request to API - _, res.Err = c.Get(getURL(c, stackName, stackID, resourceName), &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Metadata retreives the metadata for the given stack resource. -func Metadata(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) MetadataResult { - var res MetadataResult - - // Send request to API - _, res.Err = c.Get(metadataURL(c, stackName, stackID, resourceName), &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// ListTypes makes a request against the API to list resource types. -func ListTypes(client *gophercloud.ServiceClient) pagination.Pager { - url := listTypesURL(client) - - createPageFn := func(r pagination.PageResult) pagination.Page { - return ResourceTypePage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, url, createPageFn) -} - -// Schema retreives the schema for the given resource type. -func Schema(c *gophercloud.ServiceClient, resourceType string) SchemaResult { - var res SchemaResult - - // Send request to API - _, res.Err = c.Get(schemaURL(c, resourceType), &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Template retreives the template representation for the given resource type. -func Template(c *gophercloud.ServiceClient, resourceType string) TemplateResult { - var res TemplateResult - - // Send request to API - _, res.Err = c.Get(templateURL(c, resourceType), &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go deleted file mode 100644 index 6ddc7660d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go +++ /dev/null @@ -1,284 +0,0 @@ -package stackresources - -import ( - "encoding/json" - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Resource represents a stack resource. -type Resource struct { - Attributes map[string]interface{} `mapstructure:"attributes"` - CreationTime time.Time `mapstructure:"-"` - Description string `mapstructure:"description"` - Links []gophercloud.Link `mapstructure:"links"` - LogicalID string `mapstructure:"logical_resource_id"` - Name string `mapstructure:"resource_name"` - PhysicalID string `mapstructure:"physical_resource_id"` - RequiredBy []interface{} `mapstructure:"required_by"` - Status string `mapstructure:"resource_status"` - StatusReason string `mapstructure:"resource_status_reason"` - Type string `mapstructure:"resource_type"` - UpdatedTime time.Time `mapstructure:"-"` -} - -// FindResult represents the result of a Find operation. -type FindResult struct { - gophercloud.Result -} - -// Extract returns a slice of Resource objects and is called after a -// Find operation. -func (r FindResult) Extract() ([]Resource, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Res []Resource `mapstructure:"resources"` - } - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - resources := r.Body.(map[string]interface{})["resources"].([]interface{}) - - for i, resourceRaw := range resources { - resource := resourceRaw.(map[string]interface{}) - if date, ok := resource["updated_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res[i].UpdatedTime = t - } - if date, ok := resource["creation_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res[i].CreationTime = t - } - } - - return res.Res, nil -} - -// ResourcePage abstracts the raw results of making a List() request against the API. -// As OpenStack extensions may freely alter the response bodies of structures returned to the client, you may only safely access the -// data provided through the ExtractResources call. -type ResourcePage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a page contains no Server results. -func (r ResourcePage) IsEmpty() (bool, error) { - resources, err := ExtractResources(r) - if err != nil { - return true, err - } - return len(resources) == 0, nil -} - -// ExtractResources interprets the results of a single page from a List() call, producing a slice of Resource entities. -func ExtractResources(page pagination.Page) ([]Resource, error) { - casted := page.(ResourcePage).Body - - var response struct { - Resources []Resource `mapstructure:"resources"` - } - if err := mapstructure.Decode(casted, &response); err != nil { - return nil, err - } - var resources []interface{} - switch casted.(type) { - case map[string]interface{}: - resources = casted.(map[string]interface{})["resources"].([]interface{}) - case map[string][]interface{}: - resources = casted.(map[string][]interface{})["resources"] - default: - return response.Resources, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i, resourceRaw := range resources { - resource := resourceRaw.(map[string]interface{}) - if date, ok := resource["updated_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - response.Resources[i].UpdatedTime = t - } - if date, ok := resource["creation_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - response.Resources[i].CreationTime = t - } - } - - return response.Resources, nil -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a Resource object and is called after a -// Get operation. -func (r GetResult) Extract() (*Resource, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Res *Resource `mapstructure:"resource"` - } - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - resource := r.Body.(map[string]interface{})["resource"].(map[string]interface{}) - - if date, ok := resource["updated_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res.UpdatedTime = t - } - if date, ok := resource["creation_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Res.CreationTime = t - } - - return res.Res, nil -} - -// MetadataResult represents the result of a Metadata operation. -type MetadataResult struct { - gophercloud.Result -} - -// Extract returns a map object and is called after a -// Metadata operation. -func (r MetadataResult) Extract() (map[string]string, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Meta map[string]string `mapstructure:"metadata"` - } - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - return res.Meta, nil -} - -// ResourceTypePage abstracts the raw results of making a ListTypes() request against the API. -// As OpenStack extensions may freely alter the response bodies of structures returned to the client, you may only safely access the -// data provided through the ExtractResourceTypes call. -type ResourceTypePage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a ResourceTypePage contains no resource types. -func (r ResourceTypePage) IsEmpty() (bool, error) { - rts, err := ExtractResourceTypes(r) - if err != nil { - return true, err - } - return len(rts) == 0, nil -} - -// ResourceTypes represents the type that holds the result of ExtractResourceTypes. -// We define methods on this type to sort it before output -type ResourceTypes []string - -func (r ResourceTypes) Len() int { - return len(r) -} - -func (r ResourceTypes) Swap(i, j int) { - r[i], r[j] = r[j], r[i] -} - -func (r ResourceTypes) Less(i, j int) bool { - return r[i] < r[j] -} - -// ExtractResourceTypes extracts and returns resource types. -func ExtractResourceTypes(page pagination.Page) (ResourceTypes, error) { - casted := page.(ResourceTypePage).Body - - var response struct { - ResourceTypes ResourceTypes `mapstructure:"resource_types"` - } - - if err := mapstructure.Decode(casted, &response); err != nil { - return nil, err - } - return response.ResourceTypes, nil -} - -// TypeSchema represents a stack resource schema. -type TypeSchema struct { - Attributes map[string]interface{} `mapstructure:"attributes"` - Properties map[string]interface{} `mapstrucutre:"properties"` - ResourceType string `mapstructure:"resource_type"` - SupportStatus map[string]interface{} `mapstructure:"support_status"` -} - -// SchemaResult represents the result of a Schema operation. -type SchemaResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a TypeSchema object and is called after a -// Schema operation. -func (r SchemaResult) Extract() (*TypeSchema, error) { - if r.Err != nil { - return nil, r.Err - } - - var res TypeSchema - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - return &res, nil -} - -// TemplateResult represents the result of a Template operation. -type TemplateResult struct { - gophercloud.Result -} - -// Extract returns the template and is called after a -// Template operation. -func (r TemplateResult) Extract() ([]byte, error) { - if r.Err != nil { - return nil, r.Err - } - template, err := json.MarshalIndent(r.Body, "", " ") - if err != nil { - return nil, err - } - return template, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/urls.go deleted file mode 100644 index ef078d9c9..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/urls.go +++ /dev/null @@ -1,31 +0,0 @@ -package stackresources - -import "github.com/rackspace/gophercloud" - -func findURL(c *gophercloud.ServiceClient, stackName string) string { - return c.ServiceURL("stacks", stackName, "resources") -} - -func listURL(c *gophercloud.ServiceClient, stackName, stackID string) string { - return c.ServiceURL("stacks", stackName, stackID, "resources") -} - -func getURL(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) string { - return c.ServiceURL("stacks", stackName, stackID, "resources", resourceName) -} - -func metadataURL(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) string { - return c.ServiceURL("stacks", stackName, stackID, "resources", resourceName, "metadata") -} - -func listTypesURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("resource_types") -} - -func schemaURL(c *gophercloud.ServiceClient, typeName string) string { - return c.ServiceURL("resource_types", typeName) -} - -func templateURL(c *gophercloud.ServiceClient, typeName string) string { - return c.ServiceURL("resource_types", typeName, "template") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/doc.go deleted file mode 100644 index 19231b513..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package stacks provides operation for working with Heat stacks. A stack is a -// group of resources (servers, load balancers, databases, and so forth) -// combined to fulfill a useful purpose. Based on a template, Heat orchestration -// engine creates an instantiated set of resources (a stack) to run the -// application framework or component specified (in the template). A stack is a -// running instance of a template. The result of creating a stack is a deployment -// of the application framework or component. -package stacks diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/environment.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/environment.go deleted file mode 100644 index abaff2057..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/environment.go +++ /dev/null @@ -1,137 +0,0 @@ -package stacks - -import ( - "fmt" - "strings" -) - -// Environment is a structure that represents stack environments -type Environment struct { - TE -} - -// EnvironmentSections is a map containing allowed sections in a stack environment file -var EnvironmentSections = map[string]bool{ - "parameters": true, - "parameter_defaults": true, - "resource_registry": true, -} - -// Validate validates the contents of the Environment -func (e *Environment) Validate() error { - if e.Parsed == nil { - if err := e.Parse(); err != nil { - return err - } - } - for key := range e.Parsed { - if _, ok := EnvironmentSections[key]; !ok { - return fmt.Errorf("Environment has wrong section: %s", key) - } - } - return nil -} - -// Parse environment file to resolve the URL's of the resources. This is done by -// reading from the `Resource Registry` section, which is why the function is -// named GetRRFileContents. -func (e *Environment) getRRFileContents(ignoreIf igFunc) error { - // initialize environment if empty - if e.Files == nil { - e.Files = make(map[string]string) - } - if e.fileMaps == nil { - e.fileMaps = make(map[string]string) - } - - // get the resource registry - rr := e.Parsed["resource_registry"] - - // search the resource registry for URLs - switch rr.(type) { - // process further only if the resource registry is a map - case map[string]interface{}, map[interface{}]interface{}: - rrMap, err := toStringKeys(rr) - if err != nil { - return err - } - // the resource registry might contain a base URL for the resource. If - // such a field is present, use it. Otherwise, use the default base URL. - var baseURL string - if val, ok := rrMap["base_url"]; ok { - baseURL = val.(string) - } else { - baseURL = e.baseURL - } - - // The contents of the resource may be located in a remote file, which - // will be a template. Instantiate a temporary template to manage the - // contents. - tempTemplate := new(Template) - tempTemplate.baseURL = baseURL - tempTemplate.client = e.client - - // Fetch the contents of remote resource URL's - if err = tempTemplate.getFileContents(rr, ignoreIf, false); err != nil { - return err - } - // check the `resources` section (if it exists) for more URL's. Note that - // the previous call to GetFileContents was (deliberately) not recursive - // as we want more control over where to look for URL's - if val, ok := rrMap["resources"]; ok { - switch val.(type) { - // process further only if the contents are a map - case map[string]interface{}, map[interface{}]interface{}: - resourcesMap, err := toStringKeys(val) - if err != nil { - return err - } - for _, v := range resourcesMap { - switch v.(type) { - case map[string]interface{}, map[interface{}]interface{}: - resourceMap, err := toStringKeys(v) - if err != nil { - return err - } - var resourceBaseURL string - // if base_url for the resource type is defined, use it - if val, ok := resourceMap["base_url"]; ok { - resourceBaseURL = val.(string) - } else { - resourceBaseURL = baseURL - } - tempTemplate.baseURL = resourceBaseURL - if err := tempTemplate.getFileContents(v, ignoreIf, false); err != nil { - return err - } - } - } - } - } - // if the resource registry contained any URL's, store them. This can - // then be passed as parameter to api calls to Heat api. - e.Files = tempTemplate.Files - return nil - default: - return nil - } -} - -// function to choose keys whose values are other environment files -func ignoreIfEnvironment(key string, value interface{}) bool { - // base_url and hooks refer to components which cannot have urls - if key == "base_url" || key == "hooks" { - return true - } - // if value is not string, it cannot be a URL - valueString, ok := value.(string) - if !ok { - return true - } - // if value contains `::`, it must be a reference to another resource type - // e.g. OS::Nova::Server : Rackspace::Cloud::Server - if strings.Contains(valueString, "::") { - return true - } - return false -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go deleted file mode 100644 index 83f5dec8d..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go +++ /dev/null @@ -1,604 +0,0 @@ -package stacks - -import ( - "fmt" - "net/http" - "testing" - "time" - - "github.com/rackspace/gophercloud" - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// CreateExpected represents the expected object from a Create request. -var CreateExpected = &CreatedStack{ - ID: "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://168.28.170.117:8004/v1/98606384f58drad0bhdb7d02779549ac/stacks/stackcreated/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Rel: "self", - }, - }, -} - -// CreateOutput represents the response body from a Create request. -const CreateOutput = ` -{ - "stack": { - "id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "links": [ - { - "href": "http://168.28.170.117:8004/v1/98606384f58drad0bhdb7d02779549ac/stacks/stackcreated/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "rel": "self" - } - ] - } -}` - -// HandleCreateSuccessfully creates an HTTP handler at `/stacks` on the test handler mux -// that responds with a `Create` response. -func HandleCreateSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - w.WriteHeader(http.StatusCreated) - fmt.Fprintf(w, output) - }) -} - -// ListExpected represents the expected object from a List request. -var ListExpected = []ListedStack{ - ListedStack{ - Description: "Simple template to test heat commands", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Rel: "self", - }, - }, - StatusReason: "Stack CREATE completed successfully", - Name: "postman_stack", - CreationTime: time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC), - Status: "CREATE_COMPLETE", - ID: "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Tags: []string{"rackspace", "atx"}, - }, - ListedStack{ - Description: "Simple template to test heat commands", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/gophercloud-test-stack-2/db6977b2-27aa-4775-9ae7-6213212d4ada", - Rel: "self", - }, - }, - StatusReason: "Stack successfully updated", - Name: "gophercloud-test-stack-2", - CreationTime: time.Date(2014, 12, 11, 17, 39, 16, 0, time.UTC), - UpdatedTime: time.Date(2014, 12, 11, 17, 40, 37, 0, time.UTC), - Status: "UPDATE_COMPLETE", - ID: "db6977b2-27aa-4775-9ae7-6213212d4ada", - Tags: []string{"sfo", "satx"}, - }, -} - -// FullListOutput represents the response body from a List request without a marker. -const FullListOutput = ` -{ - "stacks": [ - { - "description": "Simple template to test heat commands", - "links": [ - { - "href": "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "rel": "self" - } - ], - "stack_status_reason": "Stack CREATE completed successfully", - "stack_name": "postman_stack", - "creation_time": "2015-02-03T20:07:39", - "updated_time": null, - "stack_status": "CREATE_COMPLETE", - "id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "tags": ["rackspace", "atx"] - }, - { - "description": "Simple template to test heat commands", - "links": [ - { - "href": "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/gophercloud-test-stack-2/db6977b2-27aa-4775-9ae7-6213212d4ada", - "rel": "self" - } - ], - "stack_status_reason": "Stack successfully updated", - "stack_name": "gophercloud-test-stack-2", - "creation_time": "2014-12-11T17:39:16", - "updated_time": "2014-12-11T17:40:37", - "stack_status": "UPDATE_COMPLETE", - "id": "db6977b2-27aa-4775-9ae7-6213212d4ada", - "tags": ["sfo", "satx"] - } - ] -} -` - -// HandleListSuccessfully creates an HTTP handler at `/stacks` on the test handler mux -// that responds with a `List` response. -func HandleListSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, output) - case "db6977b2-27aa-4775-9ae7-6213212d4ada": - fmt.Fprintf(w, `[]`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// GetExpected represents the expected object from a Get request. -var GetExpected = &RetrievedStack{ - DisableRollback: true, - Description: "Simple template to test heat commands", - Parameters: map[string]string{ - "flavor": "m1.tiny", - "OS::stack_name": "postman_stack", - "OS::stack_id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - }, - StatusReason: "Stack CREATE completed successfully", - Name: "postman_stack", - Outputs: []map[string]interface{}{}, - CreationTime: time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Rel: "self", - }, - }, - Capabilities: []interface{}{}, - NotificationTopics: []interface{}{}, - Status: "CREATE_COMPLETE", - ID: "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - TemplateDescription: "Simple template to test heat commands", - Tags: []string{"rackspace", "atx"}, -} - -// GetOutput represents the response body from a Get request. -const GetOutput = ` -{ - "stack": { - "disable_rollback": true, - "description": "Simple template to test heat commands", - "parameters": { - "flavor": "m1.tiny", - "OS::stack_name": "postman_stack", - "OS::stack_id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87" - }, - "stack_status_reason": "Stack CREATE completed successfully", - "stack_name": "postman_stack", - "outputs": [], - "creation_time": "2015-02-03T20:07:39", - "links": [ - { - "href": "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "rel": "self" - } - ], - "capabilities": [], - "notification_topics": [], - "timeout_mins": null, - "stack_status": "CREATE_COMPLETE", - "updated_time": null, - "id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "template_description": "Simple template to test heat commands", - "tags": ["rackspace", "atx"] - } -} -` - -// HandleGetSuccessfully creates an HTTP handler at `/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87` -// on the test handler mux that responds with a `Get` response. -func HandleGetSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// HandleUpdateSuccessfully creates an HTTP handler at `/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87` -// on the test handler mux that responds with an `Update` response. -func HandleUpdateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/stacks/gophercloud-test-stack-2/db6977b2-27aa-4775-9ae7-6213212d4ada", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - }) -} - -// HandleDeleteSuccessfully creates an HTTP handler at `/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87` -// on the test handler mux that responds with a `Delete` response. -func HandleDeleteSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/stacks/gophercloud-test-stack-2/db6977b2-27aa-4775-9ae7-6213212d4ada", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusNoContent) - }) -} - -// GetExpected represents the expected object from a Get request. -var PreviewExpected = &PreviewedStack{ - DisableRollback: true, - Description: "Simple template to test heat commands", - Parameters: map[string]string{ - "flavor": "m1.tiny", - "OS::stack_name": "postman_stack", - "OS::stack_id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - }, - Name: "postman_stack", - CreationTime: time.Date(2015, 2, 3, 20, 7, 39, 0, time.UTC), - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "http://166.76.160.117:8004/v1/98606384f58d4ad0b3db7d0d779549ac/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Rel: "self", - }, - }, - Capabilities: []interface{}{}, - NotificationTopics: []interface{}{}, - ID: "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - TemplateDescription: "Simple template to test heat commands", -} - -// HandlePreviewSuccessfully creates an HTTP handler at `/stacks/preview` -// on the test handler mux that responds with a `Preview` response. -func HandlePreviewSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/preview", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// AbandonExpected represents the expected object from an Abandon request. -var AbandonExpected = &AbandonedStack{ - Status: "COMPLETE", - Name: "postman_stack", - Template: map[string]interface{}{ - "heat_template_version": "2013-05-23", - "description": "Simple template to test heat commands", - "parameters": map[string]interface{}{ - "flavor": map[string]interface{}{ - "default": "m1.tiny", - "type": "string", - }, - }, - "resources": map[string]interface{}{ - "hello_world": map[string]interface{}{ - "type": "OS::Nova::Server", - "properties": map[string]interface{}{ - "key_name": "heat_key", - "flavor": map[string]interface{}{ - "get_param": "flavor", - }, - "image": "ad091b52-742f-469e-8f3c-fd81cadf0743", - "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n", - }, - }, - }, - }, - Action: "CREATE", - ID: "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - Resources: map[string]interface{}{ - "hello_world": map[string]interface{}{ - "status": "COMPLETE", - "name": "hello_world", - "resource_id": "8a310d36-46fc-436f-8be4-37a696b8ac63", - "action": "CREATE", - "type": "OS::Nova::Server", - }, - }, - Files: map[string]string{ - "file:///Users/prat8228/go/src/github.com/rackspace/rack/my_nova.yaml": "heat_template_version: 2014-10-16\nparameters:\n flavor:\n type: string\n description: Flavor for the server to be created\n default: 4353\n hidden: true\nresources:\n test_server:\n type: \"OS::Nova::Server\"\n properties:\n name: test-server\n flavor: 2 GB General Purpose v1\n image: Debian 7 (Wheezy) (PVHVM)\n", - }, - StackUserProjectID: "897686", - ProjectID: "897686", - Environment: map[string]interface{}{ - "encrypted_param_names": make([]map[string]interface{}, 0), - "parameter_defaults": make(map[string]interface{}), - "parameters": make(map[string]interface{}), - "resource_registry": map[string]interface{}{ - "file:///Users/prat8228/go/src/github.com/rackspace/rack/my_nova.yaml": "file:///Users/prat8228/go/src/github.com/rackspace/rack/my_nova.yaml", - "resources": make(map[string]interface{}), - }, - }, -} - -// AbandonOutput represents the response body from an Abandon request. -const AbandonOutput = ` -{ - "status": "COMPLETE", - "name": "postman_stack", - "template": { - "heat_template_version": "2013-05-23", - "description": "Simple template to test heat commands", - "parameters": { - "flavor": { - "default": "m1.tiny", - "type": "string" - } - }, - "resources": { - "hello_world": { - "type": "OS::Nova::Server", - "properties": { - "key_name": "heat_key", - "flavor": { - "get_param": "flavor" - }, - "image": "ad091b52-742f-469e-8f3c-fd81cadf0743", - "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n" - } - } - } - }, - "action": "CREATE", - "id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87", - "resources": { - "hello_world": { - "status": "COMPLETE", - "name": "hello_world", - "resource_id": "8a310d36-46fc-436f-8be4-37a696b8ac63", - "action": "CREATE", - "type": "OS::Nova::Server" - } - }, - "files": { - "file:///Users/prat8228/go/src/github.com/rackspace/rack/my_nova.yaml": "heat_template_version: 2014-10-16\nparameters:\n flavor:\n type: string\n description: Flavor for the server to be created\n default: 4353\n hidden: true\nresources:\n test_server:\n type: \"OS::Nova::Server\"\n properties:\n name: test-server\n flavor: 2 GB General Purpose v1\n image: Debian 7 (Wheezy) (PVHVM)\n" -}, - "environment": { - "encrypted_param_names": [], - "parameter_defaults": {}, - "parameters": {}, - "resource_registry": { - "file:///Users/prat8228/go/src/github.com/rackspace/rack/my_nova.yaml": "file:///Users/prat8228/go/src/github.com/rackspace/rack/my_nova.yaml", - "resources": {} - } - }, - "stack_user_project_id": "897686", - "project_id": "897686" -}` - -// HandleAbandonSuccessfully creates an HTTP handler at `/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87/abandon` -// on the test handler mux that responds with an `Abandon` response. -func HandleAbandonSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c8/abandon", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// ValidJSONTemplate is a valid OpenStack Heat template in JSON format -const ValidJSONTemplate = ` -{ - "heat_template_version": "2014-10-16", - "parameters": { - "flavor": { - "default": 4353, - "description": "Flavor for the server to be created", - "hidden": true, - "type": "string" - } - }, - "resources": { - "test_server": { - "properties": { - "flavor": "2 GB General Purpose v1", - "image": "Debian 7 (Wheezy) (PVHVM)", - "name": "test-server" - }, - "type": "OS::Nova::Server" - } - } -} -` - -// ValidJSONTemplateParsed is the expected parsed version of ValidJSONTemplate -var ValidJSONTemplateParsed = map[string]interface{}{ - "heat_template_version": "2014-10-16", - "parameters": map[string]interface{}{ - "flavor": map[string]interface{}{ - "default": 4353, - "description": "Flavor for the server to be created", - "hidden": true, - "type": "string", - }, - }, - "resources": map[string]interface{}{ - "test_server": map[string]interface{}{ - "properties": map[string]interface{}{ - "flavor": "2 GB General Purpose v1", - "image": "Debian 7 (Wheezy) (PVHVM)", - "name": "test-server", - }, - "type": "OS::Nova::Server", - }, - }, -} - -// ValidYAMLTemplate is a valid OpenStack Heat template in YAML format -const ValidYAMLTemplate = ` -heat_template_version: 2014-10-16 -parameters: - flavor: - type: string - description: Flavor for the server to be created - default: 4353 - hidden: true -resources: - test_server: - type: "OS::Nova::Server" - properties: - name: test-server - flavor: 2 GB General Purpose v1 - image: Debian 7 (Wheezy) (PVHVM) -` - -// InvalidTemplateNoVersion is an invalid template as it has no `version` section -const InvalidTemplateNoVersion = ` -parameters: - flavor: - type: string - description: Flavor for the server to be created - default: 4353 - hidden: true -resources: - test_server: - type: "OS::Nova::Server" - properties: - name: test-server - flavor: 2 GB General Purpose v1 - image: Debian 7 (Wheezy) (PVHVM) -` - -// ValidJSONEnvironment is a valid environment for a stack in JSON format -const ValidJSONEnvironment = ` -{ - "parameters": { - "user_key": "userkey" - }, - "resource_registry": { - "My::WP::Server": "file:///home/shardy/git/heat-templates/hot/F18/WordPress_Native.yaml", - "OS::Quantum*": "OS::Neutron*", - "AWS::CloudWatch::Alarm": "file:///etc/heat/templates/AWS_CloudWatch_Alarm.yaml", - "OS::Metering::Alarm": "OS::Ceilometer::Alarm", - "AWS::RDS::DBInstance": "file:///etc/heat/templates/AWS_RDS_DBInstance.yaml", - "resources": { - "my_db_server": { - "OS::DBInstance": "file:///home/mine/all_my_cool_templates/db.yaml" - }, - "my_server": { - "OS::DBInstance": "file:///home/mine/all_my_cool_templates/db.yaml", - "hooks": "pre-create" - }, - "nested_stack": { - "nested_resource": { - "hooks": "pre-update" - }, - "another_resource": { - "hooks": [ - "pre-create", - "pre-update" - ] - } - } - } - } -} -` - -// ValidJSONEnvironmentParsed is the expected parsed version of ValidJSONEnvironment -var ValidJSONEnvironmentParsed = map[string]interface{}{ - "parameters": map[string]interface{}{ - "user_key": "userkey", - }, - "resource_registry": map[string]interface{}{ - "My::WP::Server": "file:///home/shardy/git/heat-templates/hot/F18/WordPress_Native.yaml", - "OS::Quantum*": "OS::Neutron*", - "AWS::CloudWatch::Alarm": "file:///etc/heat/templates/AWS_CloudWatch_Alarm.yaml", - "OS::Metering::Alarm": "OS::Ceilometer::Alarm", - "AWS::RDS::DBInstance": "file:///etc/heat/templates/AWS_RDS_DBInstance.yaml", - "resources": map[string]interface{}{ - "my_db_server": map[string]interface{}{ - "OS::DBInstance": "file:///home/mine/all_my_cool_templates/db.yaml", - }, - "my_server": map[string]interface{}{ - "OS::DBInstance": "file:///home/mine/all_my_cool_templates/db.yaml", - "hooks": "pre-create", - }, - "nested_stack": map[string]interface{}{ - "nested_resource": map[string]interface{}{ - "hooks": "pre-update", - }, - "another_resource": map[string]interface{}{ - "hooks": []interface{}{ - "pre-create", - "pre-update", - }, - }, - }, - }, - }, -} - -// ValidYAMLEnvironment is a valid environment for a stack in YAML format -const ValidYAMLEnvironment = ` -parameters: - user_key: userkey -resource_registry: - My::WP::Server: file:///home/shardy/git/heat-templates/hot/F18/WordPress_Native.yaml - # allow older templates with Quantum in them. - "OS::Quantum*": "OS::Neutron*" - # Choose your implementation of AWS::CloudWatch::Alarm - "AWS::CloudWatch::Alarm": "file:///etc/heat/templates/AWS_CloudWatch_Alarm.yaml" - #"AWS::CloudWatch::Alarm": "OS::Heat::CWLiteAlarm" - "OS::Metering::Alarm": "OS::Ceilometer::Alarm" - "AWS::RDS::DBInstance": "file:///etc/heat/templates/AWS_RDS_DBInstance.yaml" - resources: - my_db_server: - "OS::DBInstance": file:///home/mine/all_my_cool_templates/db.yaml - my_server: - "OS::DBInstance": file:///home/mine/all_my_cool_templates/db.yaml - hooks: pre-create - nested_stack: - nested_resource: - hooks: pre-update - another_resource: - hooks: [pre-create, pre-update] -` - -// InvalidEnvironment is an invalid environment as it has an extra section called `resources` -const InvalidEnvironment = ` -parameters: - flavor: - type: string - description: Flavor for the server to be created - default: 4353 - hidden: true -resources: - test_server: - type: "OS::Nova::Server" - properties: - name: test-server - flavor: 2 GB General Purpose v1 - image: Debian 7 (Wheezy) (PVHVM) -parameter_defaults: - KeyName: heat_key -` diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/requests.go deleted file mode 100644 index 1fc484d67..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/requests.go +++ /dev/null @@ -1,682 +0,0 @@ -package stacks - -import ( - "errors" - "strings" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Rollback is used to specify whether or not a stack can be rolled back. -type Rollback *bool - -var ( - disable = true - // Disable is used to specify that a stack cannot be rolled back. - Disable Rollback = &disable - enable = false - // Enable is used to specify that a stack can be rolled back. - Enable Rollback = &enable -) - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type CreateOptsBuilder interface { - ToStackCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // (REQUIRED) The name of the stack. It must start with an alphabetic character. - Name string - // (REQUIRED) A structure that contains either the template file or url. Call the - // associated methods to extract the information relevant to send in a create request. - TemplateOpts *Template - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, TemplateURL will be ignored - // (OPTIONAL; REQUIRED IF Template IS EMPTY) The URL of the template to instantiate. - // This value is ignored if Template is supplied inline. - TemplateURL string - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, Template will be ignored - // (OPTIONAL; REQUIRED IF TemplateURL IS EMPTY) A template to instantiate. The value - // is a stringified version of the JSON/YAML template. Since the template will likely - // be located in a file, one way to set this variable is by using ioutil.ReadFile: - // import "io/ioutil" - // var opts stacks.CreateOpts - // b, err := ioutil.ReadFile("path/to/you/template/file.json") - // if err != nil { - // // handle error... - // } - // opts.Template = string(b) - Template string - // (OPTIONAL) Enables or disables deletion of all stack resources when a stack - // creation fails. Default is true, meaning all resources are not deleted when - // stack creation fails. - DisableRollback Rollback - // (OPTIONAL) A structure that contains details for the environment of the stack. - EnvironmentOpts *Environment - // (DEPRECATED): Please use EnvironmentOpts to provide Environment data - // (OPTIONAL) A stringified JSON environment for the stack. - Environment string - // (DEPRECATED): Files is automatically determined - // by parsing the template and environment passed as TemplateOpts and - // EnvironmentOpts respectively. - // (OPTIONAL) A map that maps file names to file contents. It can also be used - // to pass provider template contents. Example: - // Files: `{"myfile": "#!/bin/bash\necho 'Hello world' > /root/testfile.txt"}` - Files map[string]interface{} - // (OPTIONAL) User-defined parameters to pass to the template. - Parameters map[string]string - // (OPTIONAL) The timeout for stack creation in minutes. - Timeout int - // (OPTIONAL) A list of tags to assosciate with the Stack - Tags []string -} - -// ToStackCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToStackCreateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.Name == "" { - return s, errors.New("Required field 'Name' not provided.") - } - s["stack_name"] = opts.Name - Files := make(map[string]string) - if opts.TemplateOpts == nil { - if opts.Template != "" { - s["template"] = opts.Template - } else if opts.TemplateURL != "" { - s["template_url"] = opts.TemplateURL - } else { - return s, errors.New("Either Template or TemplateURL must be provided.") - } - } else { - if err := opts.TemplateOpts.Parse(); err != nil { - return nil, err - } - - if err := opts.TemplateOpts.getFileContents(opts.TemplateOpts.Parsed, ignoreIfTemplate, true); err != nil { - return nil, err - } - opts.TemplateOpts.fixFileRefs() - s["template"] = string(opts.TemplateOpts.Bin) - - for k, v := range opts.TemplateOpts.Files { - Files[k] = v - } - } - if opts.DisableRollback != nil { - s["disable_rollback"] = &opts.DisableRollback - } - - if opts.EnvironmentOpts != nil { - if err := opts.EnvironmentOpts.Parse(); err != nil { - return nil, err - } - if err := opts.EnvironmentOpts.getRRFileContents(ignoreIfEnvironment); err != nil { - return nil, err - } - opts.EnvironmentOpts.fixFileRefs() - for k, v := range opts.EnvironmentOpts.Files { - Files[k] = v - } - s["environment"] = string(opts.EnvironmentOpts.Bin) - } else if opts.Environment != "" { - s["environment"] = opts.Environment - } - - if opts.Files != nil { - s["files"] = opts.Files - } else { - s["files"] = Files - } - - if opts.DisableRollback != nil { - s["disable_rollback"] = &opts.DisableRollback - } - - if opts.Parameters != nil { - s["parameters"] = opts.Parameters - } - - if opts.Timeout != 0 { - s["timeout_mins"] = opts.Timeout - } - - if opts.Tags != nil { - s["tags"] = strings.Join(opts.Tags, ",") - } - return s, nil -} - -// Create accepts a CreateOpts struct and creates a new stack using the values -// provided. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToStackCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil) - return res -} - -// AdoptOptsBuilder is the interface options structs have to satisfy in order -// to be used in the Adopt function in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type AdoptOptsBuilder interface { - ToStackAdoptMap() (map[string]interface{}, error) -} - -// AdoptOpts is the common options struct used in this package's Adopt -// operation. -type AdoptOpts struct { - // (REQUIRED) Existing resources data represented as a string to add to the - // new stack. Data returned by Abandon could be provided as AdoptsStackData. - AdoptStackData string - // (REQUIRED) The name of the stack. It must start with an alphabetic character. - Name string - // (REQUIRED) The timeout for stack creation in minutes. - Timeout int - // (REQUIRED) A structure that contains either the template file or url. Call the - // associated methods to extract the information relevant to send in a create request. - TemplateOpts *Template - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, TemplateURL will be ignored - // (OPTIONAL; REQUIRED IF Template IS EMPTY) The URL of the template to instantiate. - // This value is ignored if Template is supplied inline. - TemplateURL string - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, Template will be ignored - // (OPTIONAL; REQUIRED IF TemplateURL IS EMPTY) A template to instantiate. The value - // is a stringified version of the JSON/YAML template. Since the template will likely - // be located in a file, one way to set this variable is by using ioutil.ReadFile: - // import "io/ioutil" - // var opts stacks.CreateOpts - // b, err := ioutil.ReadFile("path/to/you/template/file.json") - // if err != nil { - // // handle error... - // } - // opts.Template = string(b) - Template string - // (OPTIONAL) Enables or disables deletion of all stack resources when a stack - // creation fails. Default is true, meaning all resources are not deleted when - // stack creation fails. - DisableRollback Rollback - // (OPTIONAL) A structure that contains details for the environment of the stack. - EnvironmentOpts *Environment - // (DEPRECATED): Please use EnvironmentOpts to provide Environment data - // (OPTIONAL) A stringified JSON environment for the stack. - Environment string - // (DEPRECATED): Files is automatically determined - // by parsing the template and environment passed as TemplateOpts and - // EnvironmentOpts respectively. - // (OPTIONAL) A map that maps file names to file contents. It can also be used - // to pass provider template contents. Example: - // Files: `{"myfile": "#!/bin/bash\necho 'Hello world' > /root/testfile.txt"}` - Files map[string]interface{} - // (OPTIONAL) User-defined parameters to pass to the template. - Parameters map[string]string -} - -// ToStackAdoptMap casts a CreateOpts struct to a map. -func (opts AdoptOpts) ToStackAdoptMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.Name == "" { - return s, errors.New("Required field 'Name' not provided.") - } - s["stack_name"] = opts.Name - Files := make(map[string]string) - if opts.AdoptStackData != "" { - s["adopt_stack_data"] = opts.AdoptStackData - } else if opts.TemplateOpts == nil { - if opts.Template != "" { - s["template"] = opts.Template - } else if opts.TemplateURL != "" { - s["template_url"] = opts.TemplateURL - } else { - return s, errors.New("One of AdoptStackData, Template, TemplateURL or TemplateOpts must be provided.") - } - } else { - if err := opts.TemplateOpts.Parse(); err != nil { - return nil, err - } - - if err := opts.TemplateOpts.getFileContents(opts.TemplateOpts.Parsed, ignoreIfTemplate, true); err != nil { - return nil, err - } - opts.TemplateOpts.fixFileRefs() - s["template"] = string(opts.TemplateOpts.Bin) - - for k, v := range opts.TemplateOpts.Files { - Files[k] = v - } - } - - if opts.DisableRollback != nil { - s["disable_rollback"] = &opts.DisableRollback - } - - if opts.EnvironmentOpts != nil { - if err := opts.EnvironmentOpts.Parse(); err != nil { - return nil, err - } - if err := opts.EnvironmentOpts.getRRFileContents(ignoreIfEnvironment); err != nil { - return nil, err - } - opts.EnvironmentOpts.fixFileRefs() - for k, v := range opts.EnvironmentOpts.Files { - Files[k] = v - } - s["environment"] = string(opts.EnvironmentOpts.Bin) - } else if opts.Environment != "" { - s["environment"] = opts.Environment - } - - if opts.Files != nil { - s["files"] = opts.Files - } else { - s["files"] = Files - } - - if opts.Parameters != nil { - s["parameters"] = opts.Parameters - } - - if opts.Timeout != 0 { - s["timeout"] = opts.Timeout - } - s["timeout_mins"] = opts.Timeout - - return s, nil -} - -// Adopt accepts an AdoptOpts struct and creates a new stack using the resources -// from another stack. -func Adopt(c *gophercloud.ServiceClient, opts AdoptOptsBuilder) AdoptResult { - var res AdoptResult - - reqBody, err := opts.ToStackAdoptMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(adoptURL(c), reqBody, &res.Body, nil) - return res -} - -// SortDir is a type for specifying in which direction to sort a list of stacks. -type SortDir string - -// SortKey is a type for specifying by which key to sort a list of stacks. -type SortKey string - -var ( - // SortAsc is used to sort a list of stacks in ascending order. - SortAsc SortDir = "asc" - // SortDesc is used to sort a list of stacks in descending order. - SortDesc SortDir = "desc" - // SortName is used to sort a list of stacks by name. - SortName SortKey = "name" - // SortStatus is used to sort a list of stacks by status. - SortStatus SortKey = "status" - // SortCreatedAt is used to sort a list of stacks by date created. - SortCreatedAt SortKey = "created_at" - // SortUpdatedAt is used to sort a list of stacks by date updated. - SortUpdatedAt SortKey = "updated_at" -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToStackListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. Filtering is achieved by passing in struct field values that map to -// the network attributes you want to see returned. SortKey allows you to sort -// by a particular network attribute. SortDir sets the direction, and is either -// `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - Status string `q:"status"` - Name string `q:"name"` - Marker string `q:"marker"` - Limit int `q:"limit"` - SortKey SortKey `q:"sort_keys"` - SortDir SortDir `q:"sort_dir"` -} - -// ToStackListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToStackListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List returns a Pager which allows you to iterate over a collection of -// stacks. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := listURL(c) - if opts != nil { - query, err := opts.ToStackListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPage := func(r pagination.PageResult) pagination.Page { - return StackPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// Get retreives a stack based on the stack name and stack ID. -func Get(c *gophercloud.ServiceClient, stackName, stackID string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, stackName, stackID), &res.Body, nil) - return res -} - -// UpdateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the Update operation in this package. -type UpdateOptsBuilder interface { - ToStackUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts contains the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - // (REQUIRED) A structure that contains either the template file or url. Call the - // associated methods to extract the information relevant to send in a create request. - TemplateOpts *Template - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, TemplateURL will be ignored - // (OPTIONAL; REQUIRED IF Template IS EMPTY) The URL of the template to instantiate. - // This value is ignored if Template is supplied inline. - TemplateURL string - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, Template will be ignored - // (OPTIONAL; REQUIRED IF TemplateURL IS EMPTY) A template to instantiate. The value - // is a stringified version of the JSON/YAML template. Since the template will likely - // be located in a file, one way to set this variable is by using ioutil.ReadFile: - // import "io/ioutil" - // var opts stacks.CreateOpts - // b, err := ioutil.ReadFile("path/to/you/template/file.json") - // if err != nil { - // // handle error... - // } - // opts.Template = string(b) - Template string - // (OPTIONAL) A structure that contains details for the environment of the stack. - EnvironmentOpts *Environment - // (DEPRECATED): Please use EnvironmentOpts to provide Environment data - // (OPTIONAL) A stringified JSON environment for the stack. - Environment string - // (DEPRECATED): Files is automatically determined - // by parsing the template and environment passed as TemplateOpts and - // EnvironmentOpts respectively. - // (OPTIONAL) A map that maps file names to file contents. It can also be used - // to pass provider template contents. Example: - // Files: `{"myfile": "#!/bin/bash\necho 'Hello world' > /root/testfile.txt"}` - Files map[string]interface{} - // (OPTIONAL) User-defined parameters to pass to the template. - Parameters map[string]string - // (OPTIONAL) The timeout for stack creation in minutes. - Timeout int - // (OPTIONAL) A list of tags to assosciate with the Stack - Tags []string -} - -// ToStackUpdateMap casts a CreateOpts struct to a map. -func (opts UpdateOpts) ToStackUpdateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - Files := make(map[string]string) - if opts.TemplateOpts == nil { - if opts.Template != "" { - s["template"] = opts.Template - } else if opts.TemplateURL != "" { - s["template_url"] = opts.TemplateURL - } else { - return s, errors.New("Either Template or TemplateURL must be provided.") - } - } else { - if err := opts.TemplateOpts.Parse(); err != nil { - return nil, err - } - - if err := opts.TemplateOpts.getFileContents(opts.TemplateOpts.Parsed, ignoreIfTemplate, true); err != nil { - return nil, err - } - opts.TemplateOpts.fixFileRefs() - s["template"] = string(opts.TemplateOpts.Bin) - - for k, v := range opts.TemplateOpts.Files { - Files[k] = v - } - } - - if opts.EnvironmentOpts != nil { - if err := opts.EnvironmentOpts.Parse(); err != nil { - return nil, err - } - if err := opts.EnvironmentOpts.getRRFileContents(ignoreIfEnvironment); err != nil { - return nil, err - } - opts.EnvironmentOpts.fixFileRefs() - for k, v := range opts.EnvironmentOpts.Files { - Files[k] = v - } - s["environment"] = string(opts.EnvironmentOpts.Bin) - } else if opts.Environment != "" { - s["environment"] = opts.Environment - } - - if opts.Files != nil { - s["files"] = opts.Files - } else { - s["files"] = Files - } - - if opts.Parameters != nil { - s["parameters"] = opts.Parameters - } - - if opts.Timeout != 0 { - s["timeout_mins"] = opts.Timeout - } - - if opts.Tags != nil { - s["tags"] = strings.Join(opts.Tags, ",") - } - - return s, nil -} - -// Update accepts an UpdateOpts struct and updates an existing stack using the values -// provided. -func Update(c *gophercloud.ServiceClient, stackName, stackID string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToStackUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(updateURL(c, stackName, stackID), reqBody, nil, nil) - return res -} - -// Delete deletes a stack based on the stack name and stack ID. -func Delete(c *gophercloud.ServiceClient, stackName, stackID string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, stackName, stackID), nil) - return res -} - -// PreviewOptsBuilder is the interface options structs have to satisfy in order -// to be used in the Preview operation in this package. -type PreviewOptsBuilder interface { - ToStackPreviewMap() (map[string]interface{}, error) -} - -// PreviewOpts contains the common options struct used in this package's Preview -// operation. -type PreviewOpts struct { - // (REQUIRED) The name of the stack. It must start with an alphabetic character. - Name string - // (REQUIRED) The timeout for stack creation in minutes. - Timeout int - // (REQUIRED) A structure that contains either the template file or url. Call the - // associated methods to extract the information relevant to send in a create request. - TemplateOpts *Template - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, TemplateURL will be ignored - // (OPTIONAL; REQUIRED IF Template IS EMPTY) The URL of the template to instantiate. - // This value is ignored if Template is supplied inline. - TemplateURL string - // (DEPRECATED): Please use TemplateOpts for providing the template. If - // TemplateOpts is provided, Template will be ignored - // (OPTIONAL; REQUIRED IF TemplateURL IS EMPTY) A template to instantiate. The value - // is a stringified version of the JSON/YAML template. Since the template will likely - // be located in a file, one way to set this variable is by using ioutil.ReadFile: - // import "io/ioutil" - // var opts stacks.CreateOpts - // b, err := ioutil.ReadFile("path/to/you/template/file.json") - // if err != nil { - // // handle error... - // } - // opts.Template = string(b) - Template string - // (OPTIONAL) Enables or disables deletion of all stack resources when a stack - // creation fails. Default is true, meaning all resources are not deleted when - // stack creation fails. - DisableRollback Rollback - // (OPTIONAL) A structure that contains details for the environment of the stack. - EnvironmentOpts *Environment - // (DEPRECATED): Please use EnvironmentOpts to provide Environment data - // (OPTIONAL) A stringified JSON environment for the stack. - Environment string - // (DEPRECATED): Files is automatically determined - // by parsing the template and environment passed as TemplateOpts and - // EnvironmentOpts respectively. - // (OPTIONAL) A map that maps file names to file contents. It can also be used - // to pass provider template contents. Example: - // Files: `{"myfile": "#!/bin/bash\necho 'Hello world' > /root/testfile.txt"}` - Files map[string]interface{} - // (OPTIONAL) User-defined parameters to pass to the template. - Parameters map[string]string -} - -// ToStackPreviewMap casts a PreviewOpts struct to a map. -func (opts PreviewOpts) ToStackPreviewMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.Name == "" { - return s, errors.New("Required field 'Name' not provided.") - } - s["stack_name"] = opts.Name - Files := make(map[string]string) - if opts.TemplateOpts == nil { - if opts.Template != "" { - s["template"] = opts.Template - } else if opts.TemplateURL != "" { - s["template_url"] = opts.TemplateURL - } else { - return s, errors.New("Either Template or TemplateURL must be provided.") - } - } else { - if err := opts.TemplateOpts.Parse(); err != nil { - return nil, err - } - - if err := opts.TemplateOpts.getFileContents(opts.TemplateOpts.Parsed, ignoreIfTemplate, true); err != nil { - return nil, err - } - opts.TemplateOpts.fixFileRefs() - s["template"] = string(opts.TemplateOpts.Bin) - - for k, v := range opts.TemplateOpts.Files { - Files[k] = v - } - } - if opts.DisableRollback != nil { - s["disable_rollback"] = &opts.DisableRollback - } - - if opts.EnvironmentOpts != nil { - if err := opts.EnvironmentOpts.Parse(); err != nil { - return nil, err - } - if err := opts.EnvironmentOpts.getRRFileContents(ignoreIfEnvironment); err != nil { - return nil, err - } - opts.EnvironmentOpts.fixFileRefs() - for k, v := range opts.EnvironmentOpts.Files { - Files[k] = v - } - s["environment"] = string(opts.EnvironmentOpts.Bin) - } else if opts.Environment != "" { - s["environment"] = opts.Environment - } - - if opts.Files != nil { - s["files"] = opts.Files - } else { - s["files"] = Files - } - - if opts.Parameters != nil { - s["parameters"] = opts.Parameters - } - - if opts.Timeout != 0 { - s["timeout_mins"] = opts.Timeout - } - - return s, nil -} - -// Preview accepts a PreviewOptsBuilder interface and creates a preview of a stack using the values -// provided. -func Preview(c *gophercloud.ServiceClient, opts PreviewOptsBuilder) PreviewResult { - var res PreviewResult - - reqBody, err := opts.ToStackPreviewMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Post(previewURL(c), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Abandon deletes the stack with the provided stackName and stackID, but leaves its -// resources intact, and returns data describing the stack and its resources. -func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) AbandonResult { - var res AbandonResult - _, res.Err = c.Delete(abandonURL(c, stackName, stackID), &gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go deleted file mode 100644 index 432bc8e0c..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go +++ /dev/null @@ -1,313 +0,0 @@ -package stacks - -import ( - "encoding/json" - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// CreatedStack represents the object extracted from a Create operation. -type CreatedStack struct { - ID string `mapstructure:"id"` - Links []gophercloud.Link `mapstructure:"links"` -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a CreatedStack object and is called after a -// Create operation. -func (r CreateResult) Extract() (*CreatedStack, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Stack *CreatedStack `mapstructure:"stack"` - } - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - return res.Stack, nil -} - -// AdoptResult represents the result of an Adopt operation. AdoptResult has the -// same form as CreateResult. -type AdoptResult struct { - CreateResult -} - -// StackPage is a pagination.Pager that is returned from a call to the List function. -type StackPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a ListResult contains no Stacks. -func (r StackPage) IsEmpty() (bool, error) { - stacks, err := ExtractStacks(r) - if err != nil { - return true, err - } - return len(stacks) == 0, nil -} - -// ListedStack represents an element in the slice extracted from a List operation. -type ListedStack struct { - CreationTime time.Time `mapstructure:"-"` - Description string `mapstructure:"description"` - ID string `mapstructure:"id"` - Links []gophercloud.Link `mapstructure:"links"` - Name string `mapstructure:"stack_name"` - Status string `mapstructure:"stack_status"` - StatusReason string `mapstructure:"stack_status_reason"` - Tags []string `mapstructure:"tags"` - UpdatedTime time.Time `mapstructure:"-"` -} - -// ExtractStacks extracts and returns a slice of ListedStack. It is used while iterating -// over a stacks.List call. -func ExtractStacks(page pagination.Page) ([]ListedStack, error) { - casted := page.(StackPage).Body - - var res struct { - Stacks []ListedStack `mapstructure:"stacks"` - } - - err := mapstructure.Decode(casted, &res) - if err != nil { - return nil, err - } - - var rawStacks []interface{} - switch casted.(type) { - case map[string]interface{}: - rawStacks = casted.(map[string]interface{})["stacks"].([]interface{}) - case map[string][]interface{}: - rawStacks = casted.(map[string][]interface{})["stacks"] - default: - return res.Stacks, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i := range rawStacks { - thisStack := (rawStacks[i]).(map[string]interface{}) - - if t, ok := thisStack["creation_time"].(string); ok && t != "" { - creationTime, err := time.Parse(gophercloud.STACK_TIME_FMT, t) - if err != nil { - return res.Stacks, err - } - res.Stacks[i].CreationTime = creationTime - } - - if t, ok := thisStack["updated_time"].(string); ok && t != "" { - updatedTime, err := time.Parse(gophercloud.STACK_TIME_FMT, t) - if err != nil { - return res.Stacks, err - } - res.Stacks[i].UpdatedTime = updatedTime - } - } - - return res.Stacks, nil -} - -// RetrievedStack represents the object extracted from a Get operation. -type RetrievedStack struct { - Capabilities []interface{} `mapstructure:"capabilities"` - CreationTime time.Time `mapstructure:"-"` - Description string `mapstructure:"description"` - DisableRollback bool `mapstructure:"disable_rollback"` - ID string `mapstructure:"id"` - Links []gophercloud.Link `mapstructure:"links"` - NotificationTopics []interface{} `mapstructure:"notification_topics"` - Outputs []map[string]interface{} `mapstructure:"outputs"` - Parameters map[string]string `mapstructure:"parameters"` - Name string `mapstructure:"stack_name"` - Status string `mapstructure:"stack_status"` - StatusReason string `mapstructure:"stack_status_reason"` - Tags []string `mapstructure:"tags"` - TemplateDescription string `mapstructure:"template_description"` - Timeout int `mapstructure:"timeout_mins"` - UpdatedTime time.Time `mapstructure:"-"` -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a RetrievedStack object and is called after a -// Get operation. -func (r GetResult) Extract() (*RetrievedStack, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Stack *RetrievedStack `mapstructure:"stack"` - } - - config := &mapstructure.DecoderConfig{ - Result: &res, - WeaklyTypedInput: true, - } - decoder, err := mapstructure.NewDecoder(config) - if err != nil { - return nil, err - } - - if err := decoder.Decode(r.Body); err != nil { - return nil, err - } - - b := r.Body.(map[string]interface{})["stack"].(map[string]interface{}) - - if date, ok := b["creation_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Stack.CreationTime = t - } - - if date, ok := b["updated_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Stack.UpdatedTime = t - } - - return res.Stack, err -} - -// UpdateResult represents the result of a Update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// PreviewedStack represents the result of a Preview operation. -type PreviewedStack struct { - Capabilities []interface{} `mapstructure:"capabilities"` - CreationTime time.Time `mapstructure:"-"` - Description string `mapstructure:"description"` - DisableRollback bool `mapstructure:"disable_rollback"` - ID string `mapstructure:"id"` - Links []gophercloud.Link `mapstructure:"links"` - Name string `mapstructure:"stack_name"` - NotificationTopics []interface{} `mapstructure:"notification_topics"` - Parameters map[string]string `mapstructure:"parameters"` - Resources []interface{} `mapstructure:"resources"` - TemplateDescription string `mapstructure:"template_description"` - Timeout int `mapstructure:"timeout_mins"` - UpdatedTime time.Time `mapstructure:"-"` -} - -// PreviewResult represents the result of a Preview operation. -type PreviewResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a PreviewedStack object and is called after a -// Preview operation. -func (r PreviewResult) Extract() (*PreviewedStack, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Stack *PreviewedStack `mapstructure:"stack"` - } - - config := &mapstructure.DecoderConfig{ - Result: &res, - WeaklyTypedInput: true, - } - decoder, err := mapstructure.NewDecoder(config) - if err != nil { - return nil, err - } - - if err := decoder.Decode(r.Body); err != nil { - return nil, err - } - - b := r.Body.(map[string]interface{})["stack"].(map[string]interface{}) - - if date, ok := b["creation_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Stack.CreationTime = t - } - - if date, ok := b["updated_time"]; ok && date != nil { - t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) - if err != nil { - return nil, err - } - res.Stack.UpdatedTime = t - } - - return res.Stack, err -} - -// AbandonedStack represents the result of an Abandon operation. -type AbandonedStack struct { - Status string `mapstructure:"status"` - Name string `mapstructure:"name"` - Template map[string]interface{} `mapstructure:"template"` - Action string `mapstructure:"action"` - ID string `mapstructure:"id"` - Resources map[string]interface{} `mapstructure:"resources"` - Files map[string]string `mapstructure:"files"` - StackUserProjectID string `mapstructure:"stack_user_project_id"` - ProjectID string `mapstructure:"project_id"` - Environment map[string]interface{} `mapstructure:"environment"` -} - -// AbandonResult represents the result of an Abandon operation. -type AbandonResult struct { - gophercloud.Result -} - -// Extract returns a pointer to an AbandonedStack object and is called after an -// Abandon operation. -func (r AbandonResult) Extract() (*AbandonedStack, error) { - if r.Err != nil { - return nil, r.Err - } - - var res AbandonedStack - - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - return &res, nil -} - -// String converts an AbandonResult to a string. This is useful to when passing -// the result of an Abandon operation to an AdoptOpts AdoptStackData field. -func (r AbandonResult) String() (string, error) { - out, err := json.Marshal(r) - if err != nil { - return "", err - } - return string(out), nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/template.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/template.go deleted file mode 100644 index 234ce498e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/template.go +++ /dev/null @@ -1,139 +0,0 @@ -package stacks - -import ( - "fmt" - "github.com/rackspace/gophercloud" - "reflect" - "strings" -) - -// Template is a structure that represents OpenStack Heat templates -type Template struct { - TE -} - -// TemplateFormatVersions is a map containing allowed variations of the template format version -// Note that this contains the permitted variations of the _keys_ not the values. -var TemplateFormatVersions = map[string]bool{ - "HeatTemplateFormatVersion": true, - "heat_template_version": true, - "AWSTemplateFormatVersion": true, -} - -// Validate validates the contents of the Template -func (t *Template) Validate() error { - if t.Parsed == nil { - if err := t.Parse(); err != nil { - return err - } - } - for key := range t.Parsed { - if _, ok := TemplateFormatVersions[key]; ok { - return nil - } - } - return fmt.Errorf("Template format version not found.") -} - -// GetFileContents recursively parses a template to search for urls. These urls -// are assumed to point to other templates (known in OpenStack Heat as child -// templates). The contents of these urls are fetched and stored in the `Files` -// parameter of the template structure. This is the only way that a user can -// use child templates that are located in their filesystem; urls located on the -// web (e.g. on github or swift) can be fetched directly by Heat engine. -func (t *Template) getFileContents(te interface{}, ignoreIf igFunc, recurse bool) error { - // initialize template if empty - if t.Files == nil { - t.Files = make(map[string]string) - } - if t.fileMaps == nil { - t.fileMaps = make(map[string]string) - } - switch te.(type) { - // if te is a map - case map[string]interface{}, map[interface{}]interface{}: - teMap, err := toStringKeys(te) - if err != nil { - return err - } - for k, v := range teMap { - value, ok := v.(string) - if !ok { - // if the value is not a string, recursively parse that value - if err := t.getFileContents(v, ignoreIf, recurse); err != nil { - return err - } - } else if !ignoreIf(k, value) { - // at this point, the k, v pair has a reference to an external template. - // The assumption of heatclient is that value v is a reference - // to a file in the users environment - - // create a new child template - childTemplate := new(Template) - - // initialize child template - - // get the base location of the child template - baseURL, err := gophercloud.NormalizePathURL(t.baseURL, value) - if err != nil { - return err - } - childTemplate.baseURL = baseURL - childTemplate.client = t.client - - // fetch the contents of the child template - if err := childTemplate.Parse(); err != nil { - return err - } - - // process child template recursively if required. This is - // required if the child template itself contains references to - // other templates - if recurse { - if err := childTemplate.getFileContents(childTemplate.Parsed, ignoreIf, recurse); err != nil { - return err - } - } - // update parent template with current child templates' content. - // At this point, the child template has been parsed recursively. - t.fileMaps[value] = childTemplate.URL - t.Files[childTemplate.URL] = string(childTemplate.Bin) - - } - } - return nil - // if te is a slice, call the function on each element of the slice. - case []interface{}: - teSlice := te.([]interface{}) - for i := range teSlice { - if err := t.getFileContents(teSlice[i], ignoreIf, recurse); err != nil { - return err - } - } - // if te is anything else, return - case string, bool, float64, nil, int: - return nil - default: - return fmt.Errorf("%v: Unrecognized type", reflect.TypeOf(te)) - - } - return nil -} - -// function to choose keys whose values are other template files -func ignoreIfTemplate(key string, value interface{}) bool { - // key must be either `get_file` or `type` for value to be a URL - if key != "get_file" && key != "type" { - return true - } - // value must be a string - valueString, ok := value.(string) - if !ok { - return true - } - // `.template` and `.yaml` are allowed suffixes for template URLs when referred to by `type` - if key == "type" && !(strings.HasSuffix(valueString, ".template") || strings.HasSuffix(valueString, ".yaml")) { - return true - } - return false -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/urls.go deleted file mode 100644 index 3dd2bb32e..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/urls.go +++ /dev/null @@ -1,35 +0,0 @@ -package stacks - -import "github.com/rackspace/gophercloud" - -func createURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("stacks") -} - -func adoptURL(c *gophercloud.ServiceClient) string { - return createURL(c) -} - -func listURL(c *gophercloud.ServiceClient) string { - return createURL(c) -} - -func getURL(c *gophercloud.ServiceClient, name, id string) string { - return c.ServiceURL("stacks", name, id) -} - -func updateURL(c *gophercloud.ServiceClient, name, id string) string { - return getURL(c, name, id) -} - -func deleteURL(c *gophercloud.ServiceClient, name, id string) string { - return getURL(c, name, id) -} - -func previewURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("stacks", "preview") -} - -func abandonURL(c *gophercloud.ServiceClient, name, id string) string { - return c.ServiceURL("stacks", name, id, "abandon") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/utils.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/utils.go deleted file mode 100644 index 7b476a9c3..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/utils.go +++ /dev/null @@ -1,161 +0,0 @@ -package stacks - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "path/filepath" - "reflect" - "strings" - - "github.com/rackspace/gophercloud" - "gopkg.in/yaml.v2" -) - -// Client is an interface that expects a Get method similar to http.Get. This -// is needed for unit testing, since we can mock an http client. Thus, the -// client will usually be an http.Client EXCEPT in unit tests. -type Client interface { - Get(string) (*http.Response, error) -} - -// TE is a base structure for both Template and Environment -type TE struct { - // Bin stores the contents of the template or environment. - Bin []byte - // URL stores the URL of the template. This is allowed to be a 'file://' - // for local files. - URL string - // Parsed contains a parsed version of Bin. Since there are 2 different - // fields referring to the same value, you must be careful when accessing - // this filed. - Parsed map[string]interface{} - // Files contains a mapping between the urls in templates to their contents. - Files map[string]string - // fileMaps is a map used internally when determining Files. - fileMaps map[string]string - // baseURL represents the location of the template or environment file. - baseURL string - // client is an interface which allows TE to fetch contents from URLS - client Client -} - -// Fetch fetches the contents of a TE from its URL. Once a TE structure has a -// URL, call the fetch method to fetch the contents. -func (t *TE) Fetch() error { - // if the baseURL is not provided, use the current directors as the base URL - if t.baseURL == "" { - u, err := getBasePath() - if err != nil { - return err - } - t.baseURL = u - } - - // if the contents are already present, do nothing. - if t.Bin != nil { - return nil - } - - // get a fqdn from the URL using the baseURL of the TE. For local files, - // the URL's will have the `file` scheme. - u, err := gophercloud.NormalizePathURL(t.baseURL, t.URL) - if err != nil { - return err - } - t.URL = u - - // get an HTTP client if none present - if t.client == nil { - t.client = getHTTPClient() - } - - // use the client to fetch the contents of the TE - resp, err := t.client.Get(t.URL) - if err != nil { - return err - } - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - t.Bin = body - return nil -} - -// get the basepath of the TE -func getBasePath() (string, error) { - basePath, err := filepath.Abs(".") - if err != nil { - return "", err - } - u, err := gophercloud.NormalizePathURL("", basePath) - if err != nil { - return "", err - } - return u, nil -} - -// get a an HTTP client to retrieve URL's. This client allows the use of `file` -// scheme since we may need to fetch files from users filesystem -func getHTTPClient() Client { - transport := &http.Transport{} - transport.RegisterProtocol("file", http.NewFileTransport(http.Dir("/"))) - return &http.Client{Transport: transport} -} - -// Parse will parse the contents and then validate. The contents MUST be either JSON or YAML. -func (t *TE) Parse() error { - if err := t.Fetch(); err != nil { - return err - } - if jerr := json.Unmarshal(t.Bin, &t.Parsed); jerr != nil { - if yerr := yaml.Unmarshal(t.Bin, &t.Parsed); yerr != nil { - return fmt.Errorf("Data in neither json nor yaml format.") - } - } - return t.Validate() -} - -// Validate validates the contents of TE -func (t *TE) Validate() error { - return nil -} - -// igfunc is a parameter used by GetFileContents and GetRRFileContents to check -// for valid URL's. -type igFunc func(string, interface{}) bool - -// convert map[interface{}]interface{} to map[string]interface{} -func toStringKeys(m interface{}) (map[string]interface{}, error) { - switch m.(type) { - case map[string]interface{}, map[interface{}]interface{}: - typedMap := make(map[string]interface{}) - if _, ok := m.(map[interface{}]interface{}); ok { - for k, v := range m.(map[interface{}]interface{}) { - typedMap[k.(string)] = v - } - } else { - typedMap = m.(map[string]interface{}) - } - return typedMap, nil - default: - return nil, fmt.Errorf("Expected a map of type map[string]interface{} or map[interface{}]interface{}, actual type: %v", reflect.TypeOf(m)) - - } -} - -// fix the reference to files by replacing relative URL's by absolute -// URL's -func (t *TE) fixFileRefs() { - tStr := string(t.Bin) - if t.fileMaps == nil { - return - } - for k, v := range t.fileMaps { - tStr = strings.Replace(tStr, k, v, -1) - } - t.Bin = []byte(tStr) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/doc.go deleted file mode 100644 index 5af0bd62a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package stacktemplates provides operations for working with Heat templates. -// A Cloud Orchestration template is a portable file, written in a user-readable -// language, that describes how a set of resources should be assembled and what -// software should be installed in order to produce a working stack. The template -// specifies what resources should be used, what attributes can be set, and other -// parameters that are critical to the successful, repeatable automation of a -// specific application stack. -package stacktemplates diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/fixtures.go deleted file mode 100644 index fa9b3016f..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/fixtures.go +++ /dev/null @@ -1,95 +0,0 @@ -package stacktemplates - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// GetExpected represents the expected object from a Get request. -var GetExpected = "{\n \"description\": \"Simple template to test heat commands\",\n \"heat_template_version\": \"2013-05-23\",\n \"parameters\": {\n \"flavor\": {\n \"default\": \"m1.tiny\",\n \"type\": \"string\"\n }\n },\n \"resources\": {\n \"hello_world\": {\n \"properties\": {\n \"flavor\": {\n \"get_param\": \"flavor\"\n },\n \"image\": \"ad091b52-742f-469e-8f3c-fd81cadf0743\",\n \"key_name\": \"heat_key\"\n },\n \"type\": \"OS::Nova::Server\"\n }\n }\n}" - -// GetOutput represents the response body from a Get request. -const GetOutput = ` -{ - "heat_template_version": "2013-05-23", - "description": "Simple template to test heat commands", - "parameters": { - "flavor": { - "default": "m1.tiny", - "type": "string" - } - }, - "resources": { - "hello_world": { - "type": "OS::Nova::Server", - "properties": { - "key_name": "heat_key", - "flavor": { - "get_param": "flavor" - }, - "image": "ad091b52-742f-469e-8f3c-fd81cadf0743" - } - } - } -}` - -// HandleGetSuccessfully creates an HTTP handler at `/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87/template` -// on the test handler mux that responds with a `Get` response. -func HandleGetSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/stacks/postman_stack/16ef0584-4458-41eb-87c8-0dc8d5f66c87/template", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} - -// ValidateExpected represents the expected object from a Validate request. -var ValidateExpected = &ValidatedTemplate{ - Description: "Simple template to test heat commands", - Parameters: map[string]interface{}{ - "flavor": map[string]interface{}{ - "Default": "m1.tiny", - "Type": "String", - "NoEcho": "false", - "Description": "", - "Label": "flavor", - }, - }, -} - -// ValidateOutput represents the response body from a Validate request. -const ValidateOutput = ` -{ - "Description": "Simple template to test heat commands", - "Parameters": { - "flavor": { - "Default": "m1.tiny", - "Type": "String", - "NoEcho": "false", - "Description": "", - "Label": "flavor" - } - } -}` - -// HandleValidateSuccessfully creates an HTTP handler at `/validate` -// on the test handler mux that responds with a `Validate` response. -func HandleValidateSuccessfully(t *testing.T, output string) { - th.Mux.HandleFunc("/validate", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, output) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/requests.go deleted file mode 100644 index c0cea3575..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/requests.go +++ /dev/null @@ -1,58 +0,0 @@ -package stacktemplates - -import ( - "fmt" - - "github.com/rackspace/gophercloud" -) - -// Get retreives data for the given stack template. -func Get(c *gophercloud.ServiceClient, stackName, stackID string) GetResult { - var res GetResult - _, res.Err = c.Request("GET", getURL(c, stackName, stackID), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - }) - return res -} - -// ValidateOptsBuilder describes struct types that can be accepted by the Validate call. -// The ValidateOpts struct in this package does. -type ValidateOptsBuilder interface { - ToStackTemplateValidateMap() (map[string]interface{}, error) -} - -// ValidateOpts specifies the template validation parameters. -type ValidateOpts struct { - Template string - TemplateURL string -} - -// ToStackTemplateValidateMap assembles a request body based on the contents of a ValidateOpts. -func (opts ValidateOpts) ToStackTemplateValidateMap() (map[string]interface{}, error) { - vo := make(map[string]interface{}) - if opts.Template != "" { - vo["template"] = opts.Template - return vo, nil - } - if opts.TemplateURL != "" { - vo["template_url"] = opts.TemplateURL - return vo, nil - } - return vo, fmt.Errorf("One of Template or TemplateURL is required.") -} - -// Validate validates the given stack template. -func Validate(c *gophercloud.ServiceClient, opts ValidateOptsBuilder) ValidateResult { - var res ValidateResult - - reqBody, err := opts.ToStackTemplateValidateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(validateURL(c), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/results.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/results.go deleted file mode 100644 index 4e9ba5a4c..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/results.go +++ /dev/null @@ -1,51 +0,0 @@ -package stacktemplates - -import ( - "encoding/json" - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" -) - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract returns the JSON template and is called after a Get operation. -func (r GetResult) Extract() ([]byte, error) { - if r.Err != nil { - return nil, r.Err - } - template, err := json.MarshalIndent(r.Body, "", " ") - if err != nil { - return nil, err - } - return template, nil -} - -// ValidatedTemplate represents the parsed object returned from a Validate request. -type ValidatedTemplate struct { - Description string `mapstructure:"Description"` - Parameters map[string]interface{} `mapstructure:"Parameters"` - ParameterGroups map[string]interface{} `mapstructure:"ParameterGroups"` -} - -// ValidateResult represents the result of a Validate operation. -type ValidateResult struct { - gophercloud.Result -} - -// Extract returns a pointer to a ValidatedTemplate object and is called after a -// Validate operation. -func (r ValidateResult) Extract() (*ValidatedTemplate, error) { - if r.Err != nil { - return nil, r.Err - } - - var res ValidatedTemplate - if err := mapstructure.Decode(r.Body, &res); err != nil { - return nil, err - } - - return &res, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/urls.go deleted file mode 100644 index c30b7ca1a..000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package stacktemplates - -import "github.com/rackspace/gophercloud" - -func getURL(c *gophercloud.ServiceClient, stackName, stackID string) string { - return c.ServiceURL("stacks", stackName, stackID, "template") -} - -func validateURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("validate") -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/auth_env.go b/vendor/github.com/rackspace/gophercloud/rackspace/auth_env.go deleted file mode 100644 index 5852c3ce7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/auth_env.go +++ /dev/null @@ -1,57 +0,0 @@ -package rackspace - -import ( - "fmt" - "os" - - "github.com/rackspace/gophercloud" -) - -var nilOptions = gophercloud.AuthOptions{} - -// ErrNoAuthUrl, ErrNoUsername, and ErrNoPassword errors indicate of the -// required RS_AUTH_URL, RS_USERNAME, or RS_PASSWORD environment variables, -// respectively, remain undefined. See the AuthOptions() function for more details. -var ( - ErrNoAuthURL = fmt.Errorf("Environment variable RS_AUTH_URL or OS_AUTH_URL need to be set.") - ErrNoUsername = fmt.Errorf("Environment variable RS_USERNAME or OS_USERNAME need to be set.") - ErrNoPassword = fmt.Errorf("Environment variable RS_API_KEY or RS_PASSWORD needs to be set.") -) - -func prefixedEnv(base string) string { - value := os.Getenv("RS_" + base) - if value == "" { - value = os.Getenv("OS_" + base) - } - return value -} - -// AuthOptionsFromEnv fills out an identity.AuthOptions structure with the -// settings found on the various Rackspace RS_* environment variables. -func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) { - authURL := prefixedEnv("AUTH_URL") - username := prefixedEnv("USERNAME") - password := prefixedEnv("PASSWORD") - apiKey := prefixedEnv("API_KEY") - - if authURL == "" { - return nilOptions, ErrNoAuthURL - } - - if username == "" { - return nilOptions, ErrNoUsername - } - - if password == "" && apiKey == "" { - return nilOptions, ErrNoPassword - } - - ao := gophercloud.AuthOptions{ - IdentityEndpoint: authURL, - Username: username, - Password: password, - APIKey: apiKey, - } - - return ao, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/delegate.go deleted file mode 100644 index 1cd1b6e30..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/delegate.go +++ /dev/null @@ -1,131 +0,0 @@ -package snapshots - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots" -) - -func updateURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("snapshots", id) -} - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToSnapshotCreateMap() (map[string]interface{}, error) -} - -// CreateOpts contains options for creating a Snapshot. This object is passed to -// the snapshots.Create function. For more information about these parameters, -// see the Snapshot object. -type CreateOpts struct { - // REQUIRED - VolumeID string - // OPTIONAL - Description string - // OPTIONAL - Force bool - // OPTIONAL - Name string -} - -// ToSnapshotCreateMap assembles a request body based on the contents of a -// CreateOpts. -func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.VolumeID == "" { - return nil, errors.New("Required CreateOpts field 'VolumeID' not set.") - } - - s["volume_id"] = opts.VolumeID - - if opts.Description != "" { - s["display_description"] = opts.Description - } - if opts.Name != "" { - s["display_name"] = opts.Name - } - if opts.Force { - s["force"] = opts.Force - } - - return map[string]interface{}{"snapshot": s}, nil -} - -// Create will create a new Snapshot based on the values in CreateOpts. To -// extract the Snapshot object from the response, call the Extract method on the -// CreateResult. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - return CreateResult{os.Create(client, opts)} -} - -// Delete will delete the existing Snapshot with the provided ID. -func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(client, id) -} - -// Get retrieves the Snapshot with the provided ID. To extract the Snapshot -// object from the response, call the Extract method on the GetResult. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - return GetResult{os.Get(client, id)} -} - -// List returns Snapshots. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client, os.ListOpts{}) -} - -// UpdateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Update operation in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type UpdateOptsBuilder interface { - ToSnapshotUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - Name string - Description string -} - -// ToSnapshotUpdateMap casts a UpdateOpts struct to a map. -func (opts UpdateOpts) ToSnapshotUpdateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.Name != "" { - s["display_name"] = opts.Name - } - if opts.Description != "" { - s["display_description"] = opts.Description - } - - return map[string]interface{}{"snapshot": s}, nil -} - -// Update accepts a UpdateOpts struct and updates an existing snapshot using the -// values provided. -func Update(c *gophercloud.ServiceClient, snapshotID string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToSnapshotUpdateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Request("PUT", updateURL(c, snapshotID), gophercloud.RequestOpts{ - JSONBody: &reqBody, - JSONResponse: &res.Body, - OkCodes: []int{200, 201}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/doc.go deleted file mode 100644 index ad6064f2a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package snapshots provides information and interaction with the snapshot -// API resource for the Rackspace Block Storage service. -package snapshots diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/results.go deleted file mode 100644 index c81644c5d..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/results.go +++ /dev/null @@ -1,147 +0,0 @@ -package snapshots - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// Status is the type used to represent a snapshot's status -type Status string - -// Constants to use for supported statuses -const ( - Creating Status = "CREATING" - Available Status = "AVAILABLE" - Deleting Status = "DELETING" - Error Status = "ERROR" - DeleteError Status = "ERROR_DELETING" -) - -// Snapshot is the Rackspace representation of an external block storage device. -type Snapshot struct { - // The timestamp when this snapshot was created. - CreatedAt string `mapstructure:"created_at"` - - // The human-readable description for this snapshot. - Description string `mapstructure:"display_description"` - - // The human-readable name for this snapshot. - Name string `mapstructure:"display_name"` - - // The UUID for this snapshot. - ID string `mapstructure:"id"` - - // The random metadata associated with this snapshot. Note: unlike standard - // OpenStack snapshots, this cannot actually be set. - Metadata map[string]string `mapstructure:"metadata"` - - // Indicates the current progress of the snapshot's backup procedure. - Progress string `mapstructure:"os-extended-snapshot-attributes:progress"` - - // The project ID. - ProjectID string `mapstructure:"os-extended-snapshot-attributes:project_id"` - - // The size of the volume which this snapshot backs up. - Size int `mapstructure:"size"` - - // The status of the snapshot. - Status Status `mapstructure:"status"` - - // The ID of the volume which this snapshot seeks to back up. - VolumeID string `mapstructure:"volume_id"` -} - -// CreateResult represents the result of a create operation -type CreateResult struct { - os.CreateResult -} - -// GetResult represents the result of a get operation -type GetResult struct { - os.GetResult -} - -// UpdateResult represents the result of an update operation -type UpdateResult struct { - gophercloud.Result -} - -func commonExtract(resp interface{}, err error) (*Snapshot, error) { - if err != nil { - return nil, err - } - - var respStruct struct { - Snapshot *Snapshot `json:"snapshot"` - } - - err = mapstructure.Decode(resp, &respStruct) - - return respStruct.Snapshot, err -} - -// Extract will get the Snapshot object out of the GetResult object. -func (r GetResult) Extract() (*Snapshot, error) { - return commonExtract(r.Body, r.Err) -} - -// Extract will get the Snapshot object out of the CreateResult object. -func (r CreateResult) Extract() (*Snapshot, error) { - return commonExtract(r.Body, r.Err) -} - -// Extract will get the Snapshot object out of the UpdateResult object. -func (r UpdateResult) Extract() (*Snapshot, error) { - return commonExtract(r.Body, r.Err) -} - -// ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call. -func ExtractSnapshots(page pagination.Page) ([]Snapshot, error) { - var response struct { - Snapshots []Snapshot `json:"snapshots"` - } - - err := mapstructure.Decode(page.(os.ListResult).Body, &response) - return response.Snapshots, err -} - -// WaitUntilComplete will continually poll a snapshot until it successfully -// transitions to a specified state. It will do this for at most the number of -// seconds specified. -func (snapshot Snapshot) WaitUntilComplete(c *gophercloud.ServiceClient, timeout int) error { - return gophercloud.WaitFor(timeout, func() (bool, error) { - // Poll resource - current, err := Get(c, snapshot.ID).Extract() - if err != nil { - return false, err - } - - // Has it been built yet? - if current.Progress == "100%" { - return true, nil - } - - return false, nil - }) -} - -// WaitUntilDeleted will continually poll a snapshot until it has been -// successfully deleted, i.e. returns a 404 status. -func (snapshot Snapshot) WaitUntilDeleted(c *gophercloud.ServiceClient, timeout int) error { - return gophercloud.WaitFor(timeout, func() (bool, error) { - // Poll resource - _, err := Get(c, snapshot.ID).Extract() - - // Check for a 404 - if casted, ok := err.(*gophercloud.UnexpectedResponseCodeError); ok && casted.Actual == 404 { - return true, nil - } else if err != nil { - return false, err - } - - return false, nil - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate.go deleted file mode 100644 index 438349410..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate.go +++ /dev/null @@ -1,75 +0,0 @@ -package volumes - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes" - "github.com/rackspace/gophercloud/pagination" -) - -type CreateOpts struct { - os.CreateOpts -} - -func (opts CreateOpts) ToVolumeCreateMap() (map[string]interface{}, error) { - if opts.Size < 75 || opts.Size > 1024 { - return nil, fmt.Errorf("Size field must be between 75 and 1024") - } - - return opts.CreateOpts.ToVolumeCreateMap() -} - -// Create will create a new Volume based on the values in CreateOpts. To extract -// the Volume object from the response, call the Extract method on the -// CreateResult. -func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) CreateResult { - return CreateResult{os.Create(client, opts)} -} - -// Delete will delete the existing Volume with the provided ID. -func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(client, id) -} - -// Get retrieves the Volume with the provided ID. To extract the Volume object -// from the response, call the Extract method on the GetResult. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - return GetResult{os.Get(client, id)} -} - -// List returns volumes optionally limited by the conditions provided in ListOpts. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client, os.ListOpts{}) -} - -// UpdateOpts contain options for updating an existing Volume. This object is passed -// to the volumes.Update function. For more information about the parameters, see -// the Volume object. -type UpdateOpts struct { - // OPTIONAL - Name string - // OPTIONAL - Description string -} - -// ToVolumeUpdateMap assembles a request body based on the contents of an -// UpdateOpts. -func (opts UpdateOpts) ToVolumeUpdateMap() (map[string]interface{}, error) { - v := make(map[string]interface{}) - - if opts.Description != "" { - v["display_description"] = opts.Description - } - if opts.Name != "" { - v["display_name"] = opts.Name - } - - return map[string]interface{}{"volume": v}, nil -} - -// Update will update the Volume with provided information. To extract the updated -// Volume from the response, call the Extract method on the UpdateResult. -func Update(client *gophercloud.ServiceClient, id string, opts os.UpdateOptsBuilder) UpdateResult { - return UpdateResult{os.Update(client, id, opts)} -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/doc.go deleted file mode 100644 index b2be25c53..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package volumes provides information and interaction with the volume -// API resource for the Rackspace Block Storage service. -package volumes diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/results.go deleted file mode 100644 index c7c2cc498..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/results.go +++ /dev/null @@ -1,66 +0,0 @@ -package volumes - -import ( - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// Volume wraps an Openstack volume -type Volume os.Volume - -// CreateResult represents the result of a create operation -type CreateResult struct { - os.CreateResult -} - -// GetResult represents the result of a get operation -type GetResult struct { - os.GetResult -} - -// UpdateResult represents the result of an update operation -type UpdateResult struct { - os.UpdateResult -} - -func commonExtract(resp interface{}, err error) (*Volume, error) { - if err != nil { - return nil, err - } - - var respStruct struct { - Volume *Volume `json:"volume"` - } - - err = mapstructure.Decode(resp, &respStruct) - - return respStruct.Volume, err -} - -// Extract will get the Volume object out of the GetResult object. -func (r GetResult) Extract() (*Volume, error) { - return commonExtract(r.Body, r.Err) -} - -// Extract will get the Volume object out of the CreateResult object. -func (r CreateResult) Extract() (*Volume, error) { - return commonExtract(r.Body, r.Err) -} - -// Extract will get the Volume object out of the UpdateResult object. -func (r UpdateResult) Extract() (*Volume, error) { - return commonExtract(r.Body, r.Err) -} - -// ExtractVolumes extracts and returns Volumes. It is used while iterating over a volumes.List call. -func ExtractVolumes(page pagination.Page) ([]Volume, error) { - var response struct { - Volumes []Volume `json:"volumes"` - } - - err := mapstructure.Decode(page.(os.ListResult).Body, &response) - - return response.Volumes, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/delegate.go deleted file mode 100644 index c96b3e4a3..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/delegate.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumetypes - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns all volume types. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// Get will retrieve the volume type with the provided ID. To extract the volume -// type from the result, call the Extract method on the GetResult. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - return GetResult{os.Get(client, id)} -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/doc.go deleted file mode 100644 index 70122b77c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package volumetypes provides information and interaction with the volume type -// API resource for the Rackspace Block Storage service. -package volumetypes diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/results.go deleted file mode 100644 index 39c8d6f7f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/results.go +++ /dev/null @@ -1,37 +0,0 @@ -package volumetypes - -import ( - "github.com/mitchellh/mapstructure" - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumetypes" - "github.com/rackspace/gophercloud/pagination" -) - -type VolumeType os.VolumeType - -type GetResult struct { - os.GetResult -} - -// Extract will get the Volume Type struct out of the response. -func (r GetResult) Extract() (*VolumeType, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - VolumeType *VolumeType `json:"volume_type" mapstructure:"volume_type"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.VolumeType, err -} - -func ExtractVolumeTypes(page pagination.Page) ([]VolumeType, error) { - var response struct { - VolumeTypes []VolumeType `mapstructure:"volume_types"` - } - - err := mapstructure.Decode(page.(os.ListResult).Body, &response) - return response.VolumeTypes, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/base/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/base/delegate.go deleted file mode 100644 index 5af7e0778..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/base/delegate.go +++ /dev/null @@ -1,18 +0,0 @@ -package base - -import ( - "github.com/rackspace/gophercloud" - - os "github.com/rackspace/gophercloud/openstack/cdn/v1/base" -) - -// Get retrieves the home document, allowing the user to discover the -// entire API. -func Get(c *gophercloud.ServiceClient) os.GetResult { - return os.Get(c) -} - -// Ping retrieves a ping to the server. -func Ping(c *gophercloud.ServiceClient) os.PingResult { - return os.Ping(c) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/base/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/base/doc.go deleted file mode 100644 index 5582306a8..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/base/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package base provides information and interaction with the base API -// resource in the Rackspace CDN service. This API resource allows for -// retrieving the Home Document and pinging the root URL. -package base diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/flavors/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/flavors/delegate.go deleted file mode 100644 index 7152fa23a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/flavors/delegate.go +++ /dev/null @@ -1,18 +0,0 @@ -package flavors - -import ( - "github.com/rackspace/gophercloud" - - os "github.com/rackspace/gophercloud/openstack/cdn/v1/flavors" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a single page of CDN flavors. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return os.List(c) -} - -// Get retrieves a specific flavor based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/flavors/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/flavors/doc.go deleted file mode 100644 index 4ad966eac..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/flavors/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package flavors provides information and interaction with the flavors API -// resource in the Rackspace CDN service. This API resource allows for -// listing flavors and retrieving a specific flavor. -// -// A flavor is a mapping configuration to a CDN provider. -package flavors diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets/delegate.go deleted file mode 100644 index 07c93a8dc..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets/delegate.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceassets - -import ( - "github.com/rackspace/gophercloud" - - os "github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets" -) - -// Delete accepts a unique ID and deletes the CDN service asset associated with -// it. -func Delete(c *gophercloud.ServiceClient, id string, opts os.DeleteOptsBuilder) os.DeleteResult { - return os.Delete(c, id, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets/doc.go deleted file mode 100644 index 46b3d50a8..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package serviceassets provides information and interaction with the -// serviceassets API resource in the Rackspace CDN service. This API resource -// allows for deleting cached assets. -// -// A service distributes assets across the network. Service assets let you -// interrogate properties about these assets and perform certain actions on them. -package serviceassets diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/services/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/services/delegate.go deleted file mode 100644 index e3f145997..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/services/delegate.go +++ /dev/null @@ -1,37 +0,0 @@ -package services - -import ( - "github.com/rackspace/gophercloud" - - os "github.com/rackspace/gophercloud/openstack/cdn/v1/services" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// CDN services. It accepts a ListOpts struct, which allows for pagination via -// marker and limit. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} - -// Create accepts a CreateOpts struct and creates a new CDN service using the -// values provided. -func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, opts) -} - -// Get retrieves a specific service based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(c, id) -} - -// Update accepts a UpdateOpts struct and updates an existing CDN service using -// the values provided. -func Update(c *gophercloud.ServiceClient, id string, patches []os.Patch) os.UpdateResult { - return os.Update(c, id, patches) -} - -// Delete accepts a unique ID and deletes the CDN service associated with it. -func Delete(c *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/services/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/services/doc.go deleted file mode 100644 index ee6e2a54f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/cdn/v1/services/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package services provides information and interaction with the services API -// resource in the Rackspace CDN service. This API resource allows for -// listing, creating, updating, retrieving, and deleting services. -// -// A service represents an application that has its content cached to the edge -// nodes. -package services diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/client.go b/vendor/github.com/rackspace/gophercloud/rackspace/client.go deleted file mode 100644 index a8f413ed9..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/client.go +++ /dev/null @@ -1,224 +0,0 @@ -package rackspace - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack" - "github.com/rackspace/gophercloud/openstack/utils" - tokens2 "github.com/rackspace/gophercloud/rackspace/identity/v2/tokens" -) - -const ( - // RackspaceUSIdentity is an identity endpoint located in the United States. - RackspaceUSIdentity = "https://identity.api.rackspacecloud.com/v2.0/" - - // RackspaceUKIdentity is an identity endpoint located in the UK. - RackspaceUKIdentity = "https://lon.identity.api.rackspacecloud.com/v2.0/" -) - -const ( - v20 = "v2.0" -) - -// NewClient creates a client that's prepared to communicate with the Rackspace API, but is not -// yet authenticated. Most users will probably prefer using the AuthenticatedClient function -// instead. -// -// Provide the base URL of the identity endpoint you wish to authenticate against as "endpoint". -// Often, this will be either RackspaceUSIdentity or RackspaceUKIdentity. -func NewClient(endpoint string) (*gophercloud.ProviderClient, error) { - if endpoint == "" { - return os.NewClient(RackspaceUSIdentity) - } - return os.NewClient(endpoint) -} - -// AuthenticatedClient logs in to Rackspace with the provided credentials and constructs a -// ProviderClient that's ready to operate. -// -// If the provided AuthOptions does not specify an explicit IdentityEndpoint, it will default to -// the canonical, production Rackspace US identity endpoint. -func AuthenticatedClient(options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error) { - client, err := NewClient(options.IdentityEndpoint) - if err != nil { - return nil, err - } - - err = Authenticate(client, options) - if err != nil { - return nil, err - } - return client, nil -} - -// Authenticate or re-authenticate against the most recent identity service supported at the -// provided endpoint. -func Authenticate(client *gophercloud.ProviderClient, options gophercloud.AuthOptions) error { - versions := []*utils.Version{ - &utils.Version{ID: v20, Priority: 20, Suffix: "/v2.0/"}, - } - - chosen, endpoint, err := utils.ChooseVersion(client, versions) - if err != nil { - return err - } - - switch chosen.ID { - case v20: - return v2auth(client, endpoint, options) - default: - // The switch statement must be out of date from the versions list. - return fmt.Errorf("Unrecognized identity version: %s", chosen.ID) - } -} - -// AuthenticateV2 explicitly authenticates with v2 of the identity service. -func AuthenticateV2(client *gophercloud.ProviderClient, options gophercloud.AuthOptions) error { - return v2auth(client, "", options) -} - -func v2auth(client *gophercloud.ProviderClient, endpoint string, options gophercloud.AuthOptions) error { - v2Client := NewIdentityV2(client) - if endpoint != "" { - v2Client.Endpoint = endpoint - } - - result := tokens2.Create(v2Client, tokens2.WrapOptions(options)) - - token, err := result.ExtractToken() - if err != nil { - return err - } - - catalog, err := result.ExtractServiceCatalog() - if err != nil { - return err - } - - if options.AllowReauth { - client.ReauthFunc = func() error { - return AuthenticateV2(client, options) - } - } - client.TokenID = token.ID - client.EndpointLocator = func(opts gophercloud.EndpointOpts) (string, error) { - return os.V2EndpointURL(catalog, opts) - } - - return nil -} - -// NewIdentityV2 creates a ServiceClient that may be used to access the v2 identity service. -func NewIdentityV2(client *gophercloud.ProviderClient) *gophercloud.ServiceClient { - v2Endpoint := client.IdentityBase + "v2.0/" - - return &gophercloud.ServiceClient{ - ProviderClient: client, - Endpoint: v2Endpoint, - } -} - -// NewComputeV2 creates a ServiceClient that may be used to access the v2 compute service. -func NewComputeV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("compute") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - - return &gophercloud.ServiceClient{ - ProviderClient: client, - Endpoint: url, - }, nil -} - -// NewObjectCDNV1 creates a ServiceClient that may be used with the Rackspace v1 CDN. -func NewObjectCDNV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("rax:object-cdn") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewObjectStorageV1 creates a ServiceClient that may be used with the Rackspace v1 object storage package. -func NewObjectStorageV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - return os.NewObjectStorageV1(client, eo) -} - -// NewBlockStorageV1 creates a ServiceClient that can be used to access the -// Rackspace Cloud Block Storage v1 API. -func NewBlockStorageV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("volume") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewLBV1 creates a ServiceClient that can be used to access the Rackspace -// Cloud Load Balancer v1 API. -func NewLBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("rax:load-balancer") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewNetworkV2 creates a ServiceClient that can be used to access the Rackspace -// Networking v2 API. -func NewNetworkV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("network") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewCDNV1 creates a ServiceClient that may be used to access the Rackspace v1 -// CDN service. -func NewCDNV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("rax:cdn") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewOrchestrationV1 creates a ServiceClient that may be used to access the v1 orchestration service. -func NewOrchestrationV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("orchestration") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewRackConnectV3 creates a ServiceClient that may be used to access the v3 RackConnect service. -func NewRackConnectV3(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("rax:rackconnect") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} - -// NewDBV1 creates a ServiceClient that may be used to access the v1 DB service. -func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - eo.ApplyDefaults("rax:database") - url, err := client.EndpointLocator(eo) - if err != nil { - return nil, err - } - return &gophercloud.ServiceClient{ProviderClient: client, Endpoint: url}, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate.go deleted file mode 100644 index 2580459f0..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate.go +++ /dev/null @@ -1,12 +0,0 @@ -package bootfromvolume - -import ( - "github.com/rackspace/gophercloud" - osBFV "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume" - osServers "github.com/rackspace/gophercloud/openstack/compute/v2/servers" -) - -// Create requests the creation of a server from the given block device mapping. -func Create(client *gophercloud.ServiceClient, opts osServers.CreateOptsBuilder) osServers.CreateResult { - return osBFV.Create(client, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go deleted file mode 100644 index 081ea478c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go +++ /dev/null @@ -1,43 +0,0 @@ -package flavors - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/compute/v2/flavors" - "github.com/rackspace/gophercloud/pagination" -) - -// ListOpts helps control the results returned by the List() function. For example, a flavor with a -// minDisk field of 10 will not be returned if you specify MinDisk set to 20. -type ListOpts struct { - - // MinDisk and MinRAM, if provided, elide flavors that do not meet your criteria. - MinDisk int `q:"minDisk"` - MinRAM int `q:"minRam"` - - // Marker specifies the ID of the last flavor in the previous page. - Marker string `q:"marker"` - - // Limit instructs List to refrain from sending excessively large lists of flavors. - Limit int `q:"limit"` -} - -// ToFlavorListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToFlavorListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// ListDetail enumerates the server images available to your account. -func ListDetail(client *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.ListDetail(client, opts) -} - -// Get returns details about a single flavor, identity by ID. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, id), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/doc.go deleted file mode 100644 index 278229ab9..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package flavors provides information and interaction with the flavor -// API resource for the Rackspace Cloud Servers service. -package flavors diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go deleted file mode 100644 index 957dccfd7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go +++ /dev/null @@ -1,137 +0,0 @@ -// +build fixtures - -package flavors - -// ListOutput is a sample response of a flavor List request. -const ListOutput = ` -{ - "flavors": [ - { - "OS-FLV-EXT-DATA:ephemeral": 0, - "OS-FLV-WITH-EXT-SPECS:extra_specs": { - "class": "performance1", - "disk_io_index": "40", - "number_of_data_disks": "0", - "policy_class": "performance_flavor", - "resize_policy_class": "performance_flavor" - }, - "disk": 20, - "id": "performance1-1", - "links": [ - { - "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-1", - "rel": "self" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-1", - "rel": "bookmark" - } - ], - "name": "1 GB Performance", - "ram": 1024, - "rxtx_factor": 200, - "swap": "", - "vcpus": 1 - }, - { - "OS-FLV-EXT-DATA:ephemeral": 20, - "OS-FLV-WITH-EXT-SPECS:extra_specs": { - "class": "performance1", - "disk_io_index": "40", - "number_of_data_disks": "1", - "policy_class": "performance_flavor", - "resize_policy_class": "performance_flavor" - }, - "disk": 40, - "id": "performance1-2", - "links": [ - { - "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-2", - "rel": "self" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-2", - "rel": "bookmark" - } - ], - "name": "2 GB Performance", - "ram": 2048, - "rxtx_factor": 400, - "swap": "", - "vcpus": 2 - } - ] -}` - -// GetOutput is a sample response from a flavor Get request. Its contents correspond to the -// Performance1Flavor struct. -const GetOutput = ` -{ - "flavor": { - "OS-FLV-EXT-DATA:ephemeral": 0, - "OS-FLV-WITH-EXT-SPECS:extra_specs": { - "class": "performance1", - "disk_io_index": "40", - "number_of_data_disks": "0", - "policy_class": "performance_flavor", - "resize_policy_class": "performance_flavor" - }, - "disk": 20, - "id": "performance1-1", - "links": [ - { - "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-1", - "rel": "self" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-1", - "rel": "bookmark" - } - ], - "name": "1 GB Performance", - "ram": 1024, - "rxtx_factor": 200, - "swap": "", - "vcpus": 1 - } -} -` - -// Performance1Flavor is the expected result of parsing GetOutput, or the first element of -// ListOutput. -var Performance1Flavor = Flavor{ - ID: "performance1-1", - Disk: 20, - RAM: 1024, - Name: "1 GB Performance", - RxTxFactor: 200.0, - Swap: 0, - VCPUs: 1, - ExtraSpecs: ExtraSpecs{ - NumDataDisks: 0, - Class: "performance1", - DiskIOIndex: 0, - PolicyClass: "performance_flavor", - }, -} - -// Performance2Flavor is the second result expected from parsing ListOutput. -var Performance2Flavor = Flavor{ - ID: "performance1-2", - Disk: 40, - RAM: 2048, - Name: "2 GB Performance", - RxTxFactor: 400.0, - Swap: 0, - VCPUs: 2, - ExtraSpecs: ExtraSpecs{ - NumDataDisks: 0, - Class: "performance1", - DiskIOIndex: 0, - PolicyClass: "performance_flavor", - }, -} - -// ExpectedFlavorSlice is the slice of Flavor structs that are expected to be parsed from -// ListOutput. -var ExpectedFlavorSlice = []Flavor{Performance1Flavor, Performance2Flavor} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/results.go deleted file mode 100644 index af444a766..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/results.go +++ /dev/null @@ -1,104 +0,0 @@ -package flavors - -import ( - "reflect" - - "github.com/rackspace/gophercloud" - "github.com/mitchellh/mapstructure" - os "github.com/rackspace/gophercloud/openstack/compute/v2/flavors" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtraSpecs provide additional information about the flavor. -type ExtraSpecs struct { - // The number of data disks - NumDataDisks int `mapstructure:"number_of_data_disks"` - // The flavor class - Class string `mapstructure:"class"` - // Relative measure of disk I/O performance from 0-99, where higher is faster - DiskIOIndex int `mapstructure:"disk_io_index"` - PolicyClass string `mapstructure:"policy_class"` -} - -// Flavor records represent (virtual) hardware configurations for server resources in a region. -type Flavor struct { - // The Id field contains the flavor's unique identifier. - // For example, this identifier will be useful when specifying which hardware configuration to use for a new server instance. - ID string `mapstructure:"id"` - - // The Disk and RA< fields provide a measure of storage space offered by the flavor, in GB and MB, respectively. - Disk int `mapstructure:"disk"` - RAM int `mapstructure:"ram"` - - // The Name field provides a human-readable moniker for the flavor. - Name string `mapstructure:"name"` - - RxTxFactor float64 `mapstructure:"rxtx_factor"` - - // Swap indicates how much space is reserved for swap. - // If not provided, this field will be set to 0. - Swap int `mapstructure:"swap"` - - // VCPUs indicates how many (virtual) CPUs are available for this flavor. - VCPUs int `mapstructure:"vcpus"` - - // ExtraSpecs provides extra information about the flavor - ExtraSpecs ExtraSpecs `mapstructure:"OS-FLV-WITH-EXT-SPECS:extra_specs"` -} - -// GetResult temporarily holds the response from a Get call. -type GetResult struct { - gophercloud.Result -} - -// Extract provides access to the individual Flavor returned by the Get function. -func (gr GetResult) Extract() (*Flavor, error) { - if gr.Err != nil { - return nil, gr.Err - } - - var result struct { - Flavor Flavor `mapstructure:"flavor"` - } - - cfg := &mapstructure.DecoderConfig{ - DecodeHook: defaulter, - Result: &result, - } - decoder, err := mapstructure.NewDecoder(cfg) - if err != nil { - return nil, err - } - err = decoder.Decode(gr.Body) - return &result.Flavor, err -} - -func defaulter(from, to reflect.Kind, v interface{}) (interface{}, error) { - if (from == reflect.String) && (to == reflect.Int) { - return 0, nil - } - return v, nil -} - -// ExtractFlavors provides access to the list of flavors in a page acquired from the List operation. -func ExtractFlavors(page pagination.Page) ([]Flavor, error) { - casted := page.(os.FlavorPage).Body - var container struct { - Flavors []Flavor `mapstructure:"flavors"` - } - - cfg := &mapstructure.DecoderConfig{ - DecodeHook: defaulter, - Result: &container, - } - decoder, err := mapstructure.NewDecoder(cfg) - if err != nil { - return container.Flavors, err - } - err = decoder.Decode(casted) - if err != nil { - return container.Flavors, err - } - - return container.Flavors, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/urls.go deleted file mode 100644 index f4e2c3dac..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/urls.go +++ /dev/null @@ -1,9 +0,0 @@ -package flavors - -import ( - "github.com/rackspace/gophercloud" -) - -func getURL(client *gophercloud.ServiceClient, id string) string { - return client.ServiceURL("flavors", id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/delegate.go deleted file mode 100644 index 18e1f315a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/delegate.go +++ /dev/null @@ -1,22 +0,0 @@ -package images - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/compute/v2/images" - "github.com/rackspace/gophercloud/pagination" -) - -// ListDetail enumerates the available server images. -func ListDetail(client *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.ListDetail(client, opts) -} - -// Get acquires additional detail about a specific image by ID. -func Get(client *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(client, id) -} - -// ExtractImages interprets a page as a collection of server images. -func ExtractImages(page pagination.Page) ([]os.Image, error) { - return os.ExtractImages(page) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/doc.go deleted file mode 100644 index cfae80671..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package images provides information and interaction with the image -// API resource for the Rackspace Cloud Servers service. -package images diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/fixtures.go deleted file mode 100644 index ccfbdc6a1..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/images/fixtures.go +++ /dev/null @@ -1,200 +0,0 @@ -// +build fixtures - -package images - -import ( - os "github.com/rackspace/gophercloud/openstack/compute/v2/images" -) - -// ListOutput is an example response from an /images/detail request. -const ListOutput = ` -{ - "images": [ - { - "OS-DCF:diskConfig": "MANUAL", - "OS-EXT-IMG-SIZE:size": 1.017415075e+09, - "created": "2014-10-01T15:49:02Z", - "id": "30aa010e-080e-4d4b-a7f9-09fc55b07d69", - "links": [ - { - "href": "https://iad.servers.api.rackspacecloud.com/v2/111222/images/30aa010e-080e-4d4b-a7f9-09fc55b07d69", - "rel": "self" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/111222/images/30aa010e-080e-4d4b-a7f9-09fc55b07d69", - "rel": "bookmark" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/111222/images/30aa010e-080e-4d4b-a7f9-09fc55b07d69", - "rel": "alternate", - "type": "application/vnd.openstack.image" - } - ], - "metadata": { - "auto_disk_config": "disabled", - "cache_in_nova": "True", - "com.rackspace__1__build_core": "1", - "com.rackspace__1__build_managed": "1", - "com.rackspace__1__build_rackconnect": "1", - "com.rackspace__1__options": "0", - "com.rackspace__1__platform_target": "PublicCloud", - "com.rackspace__1__release_build_date": "2014-10-01_15-46-08", - "com.rackspace__1__release_id": "100", - "com.rackspace__1__release_version": "10", - "com.rackspace__1__source": "kickstart", - "com.rackspace__1__visible_core": "1", - "com.rackspace__1__visible_managed": "0", - "com.rackspace__1__visible_rackconnect": "0", - "image_type": "base", - "org.openstack__1__architecture": "x64", - "org.openstack__1__os_distro": "org.archlinux", - "org.openstack__1__os_version": "2014.8", - "os_distro": "arch", - "os_type": "linux", - "vm_mode": "hvm" - }, - "minDisk": 20, - "minRam": 512, - "name": "Arch 2014.10 (PVHVM)", - "progress": 100, - "status": "ACTIVE", - "updated": "2014-10-01T19:37:58Z" - }, - { - "OS-DCF:diskConfig": "AUTO", - "OS-EXT-IMG-SIZE:size": 1.060306463e+09, - "created": "2014-10-01T12:58:11Z", - "id": "e19a734c-c7e6-443a-830c-242209c4d65d", - "links": [ - { - "href": "https://iad.servers.api.rackspacecloud.com/v2/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "self" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "bookmark" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "alternate", - "type": "application/vnd.openstack.image" - } - ], - "metadata": { - "auto_disk_config": "True", - "cache_in_nova": "True", - "com.rackspace__1__build_core": "1", - "com.rackspace__1__build_managed": "1", - "com.rackspace__1__build_rackconnect": "1", - "com.rackspace__1__options": "0", - "com.rackspace__1__platform_target": "PublicCloud", - "com.rackspace__1__release_build_date": "2014-10-01_12-31-03", - "com.rackspace__1__release_id": "1007", - "com.rackspace__1__release_version": "6", - "com.rackspace__1__source": "kickstart", - "com.rackspace__1__visible_core": "1", - "com.rackspace__1__visible_managed": "1", - "com.rackspace__1__visible_rackconnect": "1", - "image_type": "base", - "org.openstack__1__architecture": "x64", - "org.openstack__1__os_distro": "com.ubuntu", - "org.openstack__1__os_version": "14.04", - "os_distro": "ubuntu", - "os_type": "linux", - "vm_mode": "xen" - }, - "minDisk": 20, - "minRam": 512, - "name": "Ubuntu 14.04 LTS (Trusty Tahr)", - "progress": 100, - "status": "ACTIVE", - "updated": "2014-10-01T15:51:44Z" - } - ] -} -` - -// GetOutput is an example response from an /images request. -const GetOutput = ` -{ - "image": { - "OS-DCF:diskConfig": "AUTO", - "OS-EXT-IMG-SIZE:size": 1060306463, - "created": "2014-10-01T12:58:11Z", - "id": "e19a734c-c7e6-443a-830c-242209c4d65d", - "links": [ - { - "href": "https://iad.servers.api.rackspacecloud.com/v2/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "self" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "bookmark" - }, - { - "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "alternate", - "type": "application/vnd.openstack.image" - } - ], - "metadata": { - "auto_disk_config": "True", - "cache_in_nova": "True", - "com.rackspace__1__build_core": "1", - "com.rackspace__1__build_managed": "1", - "com.rackspace__1__build_rackconnect": "1", - "com.rackspace__1__options": "0", - "com.rackspace__1__platform_target": "PublicCloud", - "com.rackspace__1__release_build_date": "2014-10-01_12-31-03", - "com.rackspace__1__release_id": "1007", - "com.rackspace__1__release_version": "6", - "com.rackspace__1__source": "kickstart", - "com.rackspace__1__visible_core": "1", - "com.rackspace__1__visible_managed": "1", - "com.rackspace__1__visible_rackconnect": "1", - "image_type": "base", - "org.openstack__1__architecture": "x64", - "org.openstack__1__os_distro": "com.ubuntu", - "org.openstack__1__os_version": "14.04", - "os_distro": "ubuntu", - "os_type": "linux", - "vm_mode": "xen" - }, - "minDisk": 20, - "minRam": 512, - "name": "Ubuntu 14.04 LTS (Trusty Tahr)", - "progress": 100, - "status": "ACTIVE", - "updated": "2014-10-01T15:51:44Z" - } -} -` - -// ArchImage is the first Image structure that should be parsed from ListOutput. -var ArchImage = os.Image{ - ID: "30aa010e-080e-4d4b-a7f9-09fc55b07d69", - Name: "Arch 2014.10 (PVHVM)", - Created: "2014-10-01T15:49:02Z", - Updated: "2014-10-01T19:37:58Z", - MinDisk: 20, - MinRAM: 512, - Progress: 100, - Status: "ACTIVE", -} - -// UbuntuImage is the second Image structure that should be parsed from ListOutput and -// the only image that should be extracted from GetOutput. -var UbuntuImage = os.Image{ - ID: "e19a734c-c7e6-443a-830c-242209c4d65d", - Name: "Ubuntu 14.04 LTS (Trusty Tahr)", - Created: "2014-10-01T12:58:11Z", - Updated: "2014-10-01T15:51:44Z", - MinDisk: 20, - MinRAM: 512, - Progress: 100, - Status: "ACTIVE", -} - -// ExpectedImageSlice is the collection of images that should be parsed from ListOutput, -// in order. -var ExpectedImageSlice = []os.Image{ArchImage, UbuntuImage} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/keypairs/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/keypairs/delegate.go deleted file mode 100644 index 3e53525dc..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/keypairs/delegate.go +++ /dev/null @@ -1,33 +0,0 @@ -package keypairs - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager that allows you to iterate over a collection of KeyPairs. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// Create requests the creation of a new keypair on the server, or to import a pre-existing -// keypair. -func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(client, opts) -} - -// Get returns public data about a previously uploaded KeyPair. -func Get(client *gophercloud.ServiceClient, name string) os.GetResult { - return os.Get(client, name) -} - -// Delete requests the deletion of a previous stored KeyPair from the server. -func Delete(client *gophercloud.ServiceClient, name string) os.DeleteResult { - return os.Delete(client, name) -} - -// ExtractKeyPairs interprets a page of results as a slice of KeyPairs. -func ExtractKeyPairs(page pagination.Page) ([]os.KeyPair, error) { - return os.ExtractKeyPairs(page) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/keypairs/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/keypairs/doc.go deleted file mode 100644 index 31713752e..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/keypairs/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package keypairs provides information and interaction with the keypair -// API resource for the Rackspace Cloud Servers service. -package keypairs diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/doc.go deleted file mode 100644 index 8e5c77382..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package networks provides information and interaction with the network -// API resource for the Rackspace Cloud Servers service. -package networks diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/requests.go deleted file mode 100644 index cebbffd36..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/requests.go +++ /dev/null @@ -1,89 +0,0 @@ -package networks - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// networks. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return NetworkPage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(c, listURL(c), createPage) -} - -// Get retrieves a specific network based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, id), &res.Body, nil) - return res -} - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type CreateOptsBuilder interface { - ToNetworkCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // REQUIRED. See Network object for more info. - CIDR string - // REQUIRED. See Network object for more info. - Label string -} - -// ToNetworkCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error) { - n := make(map[string]interface{}) - - if opts.CIDR == "" { - return nil, errors.New("Required field CIDR not set.") - } - if opts.Label == "" { - return nil, errors.New("Required field Label not set.") - } - - n["label"] = opts.Label - n["cidr"] = opts.CIDR - return map[string]interface{}{"network": n}, nil -} - -// Create accepts a CreateOpts struct and creates a new network using the values -// provided. This operation does not actually require a request body, i.e. the -// CreateOpts struct argument can be empty. -// -// The tenant ID that is contained in the URI is the tenant that creates the -// network. An admin user, however, has the option of specifying another tenant -// ID in the CreateOpts struct. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToNetworkCreateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Post(createURL(c), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201, 202}, - }) - return res -} - -// Delete accepts a unique ID and deletes the network associated with it. -func Delete(c *gophercloud.ServiceClient, networkID string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, networkID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/results.go deleted file mode 100644 index eb6a76c00..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/results.go +++ /dev/null @@ -1,81 +0,0 @@ -package networks - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a network resource. -func (r commonResult) Extract() (*Network, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Network *Network `json:"network"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Network, err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Network represents, well, a network. -type Network struct { - // UUID for the network - ID string `mapstructure:"id" json:"id"` - - // Human-readable name for the network. Might not be unique. - Label string `mapstructure:"label" json:"label"` - - // Classless Inter-Domain Routing - CIDR string `mapstructure:"cidr" json:"cidr"` -} - -// NetworkPage is the page returned by a pager when traversing over a -// collection of networks. -type NetworkPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if the NetworkPage contains no Networks. -func (r NetworkPage) IsEmpty() (bool, error) { - networks, err := ExtractNetworks(r) - if err != nil { - return true, err - } - return len(networks) == 0, nil -} - -// ExtractNetworks accepts a Page struct, specifically a NetworkPage struct, -// and extracts the elements into a slice of Network structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractNetworks(page pagination.Page) ([]Network, error) { - var resp struct { - Networks []Network `mapstructure:"networks" json:"networks"` - } - - err := mapstructure.Decode(page.(NetworkPage).Body, &resp) - - return resp.Networks, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/urls.go deleted file mode 100644 index 19a21aa90..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/networks/urls.go +++ /dev/null @@ -1,27 +0,0 @@ -package networks - -import "github.com/rackspace/gophercloud" - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("os-networksv2", id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("os-networksv2") -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} - -func listURL(c *gophercloud.ServiceClient) string { - return rootURL(c) -} - -func createURL(c *gophercloud.ServiceClient) string { - return rootURL(c) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/delegate.go deleted file mode 100644 index 7810d156a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/delegate.go +++ /dev/null @@ -1,116 +0,0 @@ -package servers - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/compute/v2/servers" - "github.com/rackspace/gophercloud/pagination" -) - -// List makes a request against the API to list servers accessible to you. -func List(client *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(client, opts) -} - -// Create requests a server to be provisioned to the user in the current tenant. -func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(client, opts) -} - -// Update requests an existing server to be updated with the supplied options. -func Update(client *gophercloud.ServiceClient, id string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(client, id, opts) -} - -// Delete requests that a server previously provisioned be removed from your account. -func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(client, id) -} - -// Get requests details on a single server, by ID. -func Get(client *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(client, id) -} - -// ChangeAdminPassword alters the administrator or root password for a specified server. -func ChangeAdminPassword(client *gophercloud.ServiceClient, id, newPassword string) os.ActionResult { - return os.ChangeAdminPassword(client, id, newPassword) -} - -// Reboot requests that a given server reboot. Two methods exist for rebooting a server: -// -// os.HardReboot (aka PowerCycle) restarts the server instance by physically cutting power to the -// machine, or if a VM, terminating it at the hypervisor level. It's done. Caput. Full stop. Then, -// after a brief wait, power is restored or the VM instance restarted. -// -// os.SoftReboot (aka OSReboot) simply tells the OS to restart under its own procedures. E.g., in -// Linux, asking it to enter runlevel 6, or executing "sudo shutdown -r now", or by asking Windows to restart the machine. -func Reboot(client *gophercloud.ServiceClient, id string, how os.RebootMethod) os.ActionResult { - return os.Reboot(client, id, how) -} - -// Rebuild will reprovision the server according to the configuration options provided in the -// RebuildOpts struct. -func Rebuild(client *gophercloud.ServiceClient, id string, opts os.RebuildOptsBuilder) os.RebuildResult { - return os.Rebuild(client, id, opts) -} - -// Resize instructs the provider to change the flavor of the server. -// Note that this implies rebuilding it. -// Unfortunately, one cannot pass rebuild parameters to the resize function. -// When the resize completes, the server will be in RESIZE_VERIFY state. -// While in this state, you can explore the use of the new server's configuration. -// If you like it, call ConfirmResize() to commit the resize permanently. -// Otherwise, call RevertResize() to restore the old configuration. -func Resize(client *gophercloud.ServiceClient, id string, opts os.ResizeOptsBuilder) os.ActionResult { - return os.Resize(client, id, opts) -} - -// ConfirmResize confirms a previous resize operation on a server. -// See Resize() for more details. -func ConfirmResize(client *gophercloud.ServiceClient, id string) os.ActionResult { - return os.ConfirmResize(client, id) -} - -// WaitForStatus will continually poll a server until it successfully transitions to a specified -// status. It will do this for at most the number of seconds specified. -func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error { - return os.WaitForStatus(c, id, status, secs) -} - -// ExtractServers interprets the results of a single page from a List() call, producing a slice of Server entities. -func ExtractServers(page pagination.Page) ([]os.Server, error) { - return os.ExtractServers(page) -} - -// ListAddresses makes a request against the API to list the servers IP addresses. -func ListAddresses(client *gophercloud.ServiceClient, id string) pagination.Pager { - return os.ListAddresses(client, id) -} - -// ExtractAddresses interprets the results of a single page from a ListAddresses() call, producing a map of Address slices. -func ExtractAddresses(page pagination.Page) (map[string][]os.Address, error) { - return os.ExtractAddresses(page) -} - -// ListAddressesByNetwork makes a request against the API to list the servers IP addresses -// for the given network. -func ListAddressesByNetwork(client *gophercloud.ServiceClient, id, network string) pagination.Pager { - return os.ListAddressesByNetwork(client, id, network) -} - -// ExtractNetworkAddresses interprets the results of a single page from a ListAddressesByNetwork() call, producing a map of Address slices. -func ExtractNetworkAddresses(page pagination.Page) ([]os.Address, error) { - return os.ExtractNetworkAddresses(page) -} - -// Metadata requests all the metadata for the given server ID. -func Metadata(client *gophercloud.ServiceClient, id string) os.GetMetadataResult { - return os.Metadata(client, id) -} - -// UpdateMetadata updates (or creates) all the metadata specified by opts for the given server ID. -// This operation does not affect already-existing metadata that is not specified -// by opts. -func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts os.UpdateMetadataOptsBuilder) os.UpdateMetadataResult { - return os.UpdateMetadata(client, id, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/doc.go deleted file mode 100644 index c9f77f694..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package servers provides information and interaction with the server -// API resource for the Rackspace Cloud Servers service. -package servers diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/fixtures.go deleted file mode 100644 index 75cccd041..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/fixtures.go +++ /dev/null @@ -1,574 +0,0 @@ -// +build fixtures - -package servers - -import ( - os "github.com/rackspace/gophercloud/openstack/compute/v2/servers" -) - -// ListOutput is the recorded output of a Rackspace servers.List request. -const ListOutput = ` -{ - "servers": [ - { - "OS-DCF:diskConfig": "MANUAL", - "OS-EXT-STS:power_state": 1, - "OS-EXT-STS:task_state": null, - "OS-EXT-STS:vm_state": "active", - "accessIPv4": "1.2.3.4", - "accessIPv6": "1111:4822:7818:121:2000:9b5e:7438:a2d0", - "addresses": { - "private": [ - { - "addr": "10.208.230.113", - "version": 4 - } - ], - "public": [ - { - "addr": "2001:4800:7818:101:2000:9b5e:7428:a2d0", - "version": 6 - }, - { - "addr": "104.130.131.164", - "version": 4 - } - ] - }, - "created": "2014-09-23T12:34:58Z", - "flavor": { - "id": "performance1-8", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-8", - "rel": "bookmark" - } - ] - }, - "hostId": "e8951a524bc465b0898aeac7674da6fe1495e253ae1ea17ddb2c2475", - "id": "59818cee-bc8c-44eb-8073-673ee65105f7", - "image": { - "id": "255df5fb-e3d4-45a3-9a07-c976debf7c14", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/255df5fb-e3d4-45a3-9a07-c976debf7c14", - "rel": "bookmark" - } - ] - }, - "key_name": "mykey", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/59818cee-bc8c-44eb-8073-673ee65105f7", - "rel": "self" - }, - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/59818cee-bc8c-44eb-8073-673ee65105f7", - "rel": "bookmark" - } - ], - "metadata": {}, - "name": "devstack", - "progress": 100, - "status": "ACTIVE", - "tenant_id": "111111", - "updated": "2014-09-23T12:38:19Z", - "user_id": "14ae7bb21d81422694655f3cc30f2930" - }, - { - "OS-DCF:diskConfig": "MANUAL", - "OS-EXT-STS:power_state": 1, - "OS-EXT-STS:task_state": null, - "OS-EXT-STS:vm_state": "active", - "accessIPv4": "1.1.2.3", - "accessIPv6": "2222:4444:7817:101:be76:4eff:f0e5:9e02", - "addresses": { - "private": [ - { - "addr": "10.10.20.30", - "version": 4 - } - ], - "public": [ - { - "addr": "1.1.2.3", - "version": 4 - }, - { - "addr": "2222:4444:7817:101:be76:4eff:f0e5:9e02", - "version": 6 - } - ] - }, - "created": "2014-07-21T19:32:55Z", - "flavor": { - "id": "performance1-2", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-2", - "rel": "bookmark" - } - ] - }, - "hostId": "f859679906d6b1a38c1bd516b78f4dcc7d5fcf012578fa3ce460716c", - "id": "25f1c7f5-e00a-4715-b354-16e24b2f4630", - "image": { - "id": "bb02b1a3-bc77-4d17-ab5b-421d89850fca", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/bb02b1a3-bc77-4d17-ab5b-421d89850fca", - "rel": "bookmark" - } - ] - }, - "key_name": "otherkey", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/25f1c7f5-e00a-4715-b355-16e24b2f4630", - "rel": "self" - }, - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/25f1c7f5-e00a-4715-b355-16e24b2f4630", - "rel": "bookmark" - } - ], - "metadata": {}, - "name": "peril-dfw", - "progress": 100, - "status": "ACTIVE", - "tenant_id": "111111", - "updated": "2014-07-21T19:34:24Z", - "user_id": "14ae7bb21d81422694655f3cc30f2930" - } - ] -} -` - -// GetOutput is the recorded output of a Rackspace servers.Get request. -const GetOutput = ` -{ - "server": { - "OS-DCF:diskConfig": "AUTO", - "OS-EXT-STS:power_state": 1, - "OS-EXT-STS:task_state": null, - "OS-EXT-STS:vm_state": "active", - "accessIPv4": "1.2.4.8", - "accessIPv6": "2001:4800:6666:105:2a0f:c056:f594:7777", - "addresses": { - "private": [ - { - "addr": "10.20.40.80", - "version": 4 - } - ], - "public": [ - { - "addr": "1.2.4.8", - "version": 4 - }, - { - "addr": "2001:4800:6666:105:2a0f:c056:f594:7777", - "version": 6 - } - ] - }, - "created": "2014-10-21T14:42:16Z", - "flavor": { - "id": "performance1-1", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-1", - "rel": "bookmark" - } - ] - }, - "hostId": "430d2ae02de0a7af77012c94778145eccf67e75b1fac0528aa10d4a7", - "id": "8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "image": { - "id": "e19a734c-c7e6-443a-830c-242209c4d65d", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "bookmark" - } - ] - }, - "key_name": null, - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "self" - }, - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "bookmark" - } - ], - "metadata": {}, - "name": "Gophercloud-pxpGGuey", - "progress": 100, - "status": "ACTIVE", - "tenant_id": "111111", - "updated": "2014-10-21T14:42:57Z", - "user_id": "14ae7bb21d81423694655f4dd30f2930" - } -} -` - -// UpdateOutput is the recorded output of a Rackspace servers.Update request. -const UpdateOutput = ` -{ - "server": { - "OS-DCF:diskConfig": "AUTO", - "OS-EXT-STS:power_state": 1, - "OS-EXT-STS:task_state": null, - "OS-EXT-STS:vm_state": "active", - "accessIPv4": "1.2.4.8", - "accessIPv6": "2001:4800:6666:105:2a0f:c056:f594:7777", - "addresses": { - "private": [ - { - "addr": "10.20.40.80", - "version": 4 - } - ], - "public": [ - { - "addr": "1.2.4.8", - "version": 4 - }, - { - "addr": "2001:4800:6666:105:2a0f:c056:f594:7777", - "version": 6 - } - ] - }, - "created": "2014-10-21T14:42:16Z", - "flavor": { - "id": "performance1-1", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-1", - "rel": "bookmark" - } - ] - }, - "hostId": "430d2ae02de0a7af77012c94778145eccf67e75b1fac0528aa10d4a7", - "id": "8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "image": { - "id": "e19a734c-c7e6-443a-830c-242209c4d65d", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "bookmark" - } - ] - }, - "key_name": null, - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "self" - }, - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "bookmark" - } - ], - "metadata": {}, - "name": "test-server-updated", - "progress": 100, - "status": "ACTIVE", - "tenant_id": "111111", - "updated": "2014-10-21T14:42:57Z", - "user_id": "14ae7bb21d81423694655f4dd30f2930" - } -} -` - -// CreateOutput contains a sample of Rackspace's response to a Create call. -const CreateOutput = ` -{ - "server": { - "OS-DCF:diskConfig": "AUTO", - "adminPass": "v7tADqbE5pr9", - "id": "bb63327b-6a2f-34bc-b0ef-4b6d97ea637e", - "links": [ - { - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/bb63327b-6a2f-34bc-b0ef-4b6d97ea637e", - "rel": "self" - }, - { - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/bb63327b-6a2f-34bc-b0ef-4b6d97ea637e", - "rel": "bookmark" - } - ] - } -} -` - -// DevstackServer is the expected first result from parsing ListOutput. -var DevstackServer = os.Server{ - ID: "59818cee-bc8c-44eb-8073-673ee65105f7", - Name: "devstack", - TenantID: "111111", - UserID: "14ae7bb21d81422694655f3cc30f2930", - HostID: "e8951a524bc465b0898aeac7674da6fe1495e253ae1ea17ddb2c2475", - Updated: "2014-09-23T12:38:19Z", - Created: "2014-09-23T12:34:58Z", - AccessIPv4: "1.2.3.4", - AccessIPv6: "1111:4822:7818:121:2000:9b5e:7438:a2d0", - Progress: 100, - Status: "ACTIVE", - Image: map[string]interface{}{ - "id": "255df5fb-e3d4-45a3-9a07-c976debf7c14", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/255df5fb-e3d4-45a3-9a07-c976debf7c14", - "rel": "bookmark", - }, - }, - }, - Flavor: map[string]interface{}{ - "id": "performance1-8", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-8", - "rel": "bookmark", - }, - }, - }, - Addresses: map[string]interface{}{ - "private": []interface{}{ - map[string]interface{}{ - "addr": "10.20.30.40", - "version": float64(4.0), - }, - }, - "public": []interface{}{ - map[string]interface{}{ - "addr": "1111:4822:7818:121:2000:9b5e:7438:a2d0", - "version": float64(6.0), - }, - map[string]interface{}{ - "addr": "1.2.3.4", - "version": float64(4.0), - }, - }, - }, - Metadata: map[string]interface{}{}, - Links: []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/59918cee-bd9d-44eb-8173-673ee75105f7", - "rel": "self", - }, - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/59818cee-bc8c-44eb-8073-673ee65105f7", - "rel": "bookmark", - }, - }, - KeyName: "mykey", - AdminPass: "", -} - -// PerilServer is the expected second result from parsing ListOutput. -var PerilServer = os.Server{ - ID: "25f1c7f5-e00a-4715-b354-16e24b2f4630", - Name: "peril-dfw", - TenantID: "111111", - UserID: "14ae7bb21d81422694655f3cc30f2930", - HostID: "f859679906d6b1a38c1bd516b78f4dcc7d5fcf012578fa3ce460716c", - Updated: "2014-07-21T19:34:24Z", - Created: "2014-07-21T19:32:55Z", - AccessIPv4: "1.1.2.3", - AccessIPv6: "2222:4444:7817:101:be76:4eff:f0e5:9e02", - Progress: 100, - Status: "ACTIVE", - Image: map[string]interface{}{ - "id": "bb02b1a3-bc77-4d17-ab5b-421d89850fca", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/bb02b1a3-bc77-4d17-ab5b-421d89850fca", - "rel": "bookmark", - }, - }, - }, - Flavor: map[string]interface{}{ - "id": "performance1-2", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-2", - "rel": "bookmark", - }, - }, - }, - Addresses: map[string]interface{}{ - "private": []interface{}{ - map[string]interface{}{ - "addr": "10.10.20.30", - "version": float64(4.0), - }, - }, - "public": []interface{}{ - map[string]interface{}{ - "addr": "2222:4444:7817:101:be76:4eff:f0e5:9e02", - "version": float64(6.0), - }, - map[string]interface{}{ - "addr": "1.1.2.3", - "version": float64(4.0), - }, - }, - }, - Metadata: map[string]interface{}{}, - Links: []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/25f1c7f5-e00a-4715-b355-16e24b2f4630", - "rel": "self", - }, - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/25f1c7f5-e00a-4715-b355-16e24b2f4630", - "rel": "bookmark", - }, - }, - KeyName: "otherkey", - AdminPass: "", -} - -// GophercloudServer is the expected result from parsing GetOutput. -var GophercloudServer = os.Server{ - ID: "8c65cb68-0681-4c30-bc88-6b83a8a26aee", - Name: "Gophercloud-pxpGGuey", - TenantID: "111111", - UserID: "14ae7bb21d81423694655f4dd30f2930", - HostID: "430d2ae02de0a7af77012c94778145eccf67e75b1fac0528aa10d4a7", - Updated: "2014-10-21T14:42:57Z", - Created: "2014-10-21T14:42:16Z", - AccessIPv4: "1.2.4.8", - AccessIPv6: "2001:4800:6666:105:2a0f:c056:f594:7777", - Progress: 100, - Status: "ACTIVE", - Image: map[string]interface{}{ - "id": "e19a734c-c7e6-443a-830c-242209c4d65d", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "bookmark", - }, - }, - }, - Flavor: map[string]interface{}{ - "id": "performance1-1", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-1", - "rel": "bookmark", - }, - }, - }, - Addresses: map[string]interface{}{ - "private": []interface{}{ - map[string]interface{}{ - "addr": "10.20.40.80", - "version": float64(4.0), - }, - }, - "public": []interface{}{ - map[string]interface{}{ - "addr": "2001:4800:6666:105:2a0f:c056:f594:7777", - "version": float64(6.0), - }, - map[string]interface{}{ - "addr": "1.2.4.8", - "version": float64(4.0), - }, - }, - }, - Metadata: map[string]interface{}{}, - Links: []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "self", - }, - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "bookmark", - }, - }, - KeyName: "", - AdminPass: "", -} - -// GophercloudUpdatedServer is the expected result from parsing UpdateOutput. -var GophercloudUpdatedServer = os.Server{ - ID: "8c65cb68-0681-4c30-bc88-6b83a8a26aee", - Name: "test-server-updated", - TenantID: "111111", - UserID: "14ae7bb21d81423694655f4dd30f2930", - HostID: "430d2ae02de0a7af77012c94778145eccf67e75b1fac0528aa10d4a7", - Updated: "2014-10-21T14:42:57Z", - Created: "2014-10-21T14:42:16Z", - AccessIPv4: "1.2.4.8", - AccessIPv6: "2001:4800:6666:105:2a0f:c056:f594:7777", - Progress: 100, - Status: "ACTIVE", - Image: map[string]interface{}{ - "id": "e19a734c-c7e6-443a-830c-242209c4d65d", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/images/e19a734c-c7e6-443a-830c-242209c4d65d", - "rel": "bookmark", - }, - }, - }, - Flavor: map[string]interface{}{ - "id": "performance1-1", - "links": []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/flavors/performance1-1", - "rel": "bookmark", - }, - }, - }, - Addresses: map[string]interface{}{ - "private": []interface{}{ - map[string]interface{}{ - "addr": "10.20.40.80", - "version": float64(4.0), - }, - }, - "public": []interface{}{ - map[string]interface{}{ - "addr": "2001:4800:6666:105:2a0f:c056:f594:7777", - "version": float64(6.0), - }, - map[string]interface{}{ - "addr": "1.2.4.8", - "version": float64(4.0), - }, - }, - }, - Metadata: map[string]interface{}{}, - Links: []interface{}{ - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/v2/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "self", - }, - map[string]interface{}{ - "href": "https://dfw.servers.api.rackspacecloud.com/111111/servers/8c65cb68-0681-4c30-bc88-6b83a8a26aee", - "rel": "bookmark", - }, - }, - KeyName: "", - AdminPass: "", -} - -// CreatedServer is the partial Server struct that can be parsed from CreateOutput. -var CreatedServer = os.Server{ - ID: "bb63327b-6a2f-34bc-b0ef-4b6d97ea637e", - AdminPass: "v7tADqbE5pr9", - Links: []interface{}{}, -} - -// ExpectedServerSlice is the collection of servers, in order, that should be parsed from ListOutput. -var ExpectedServerSlice = []os.Server{DevstackServer, PerilServer} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go deleted file mode 100644 index d4472a080..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go +++ /dev/null @@ -1,178 +0,0 @@ -package servers - -import ( - "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume" - "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig" - os "github.com/rackspace/gophercloud/openstack/compute/v2/servers" -) - -// CreateOpts specifies all of the options that Rackspace accepts in its Create request, including -// the union of all extensions that Rackspace supports. -type CreateOpts struct { - // Name [required] is the name to assign to the newly launched server. - Name string - - // ImageRef [optional; required if ImageName is not provided] is the ID or full - // URL to the image that contains the server's OS and initial state. - // Also optional if using the boot-from-volume extension. - ImageRef string - - // ImageName [optional; required if ImageRef is not provided] is the name of the - // image that contains the server's OS and initial state. - // Also optional if using the boot-from-volume extension. - ImageName string - - // FlavorRef [optional; required if FlavorName is not provided] is the ID or - // full URL to the flavor that describes the server's specs. - FlavorRef string - - // FlavorName [optional; required if FlavorRef is not provided] is the name of - // the flavor that describes the server's specs. - FlavorName string - - // SecurityGroups [optional] lists the names of the security groups to which this server should belong. - SecurityGroups []string - - // UserData [optional] contains configuration information or scripts to use upon launch. - // Create will base64-encode it for you. - UserData []byte - - // AvailabilityZone [optional] in which to launch the server. - AvailabilityZone string - - // Networks [optional] dictates how this server will be attached to available networks. - // By default, the server will be attached to all isolated networks for the tenant. - Networks []os.Network - - // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server. - Metadata map[string]string - - // Personality [optional] includes files to inject into the server at launch. - // Create will base64-encode file contents for you. - Personality os.Personality - - // ConfigDrive [optional] enables metadata injection through a configuration drive. - ConfigDrive bool - - // AdminPass [optional] sets the root user password. If not set, a randomly-generated - // password will be created and returned in the response. - AdminPass string - - // Rackspace-specific extensions begin here. - - // KeyPair [optional] specifies the name of the SSH KeyPair to be injected into the newly launched - // server. See the "keypairs" extension in OpenStack compute v2. - KeyPair string - - // DiskConfig [optional] controls how the created server's disk is partitioned. See the "diskconfig" - // extension in OpenStack compute v2. - DiskConfig diskconfig.DiskConfig - - // BlockDevice [optional] will create the server from a volume, which is created from an image, - // a snapshot, or another volume. - BlockDevice []bootfromvolume.BlockDevice -} - -// ToServerCreateMap constructs a request body using all of the OpenStack extensions that are -// active on Rackspace. -func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) { - base := os.CreateOpts{ - Name: opts.Name, - ImageRef: opts.ImageRef, - ImageName: opts.ImageName, - FlavorRef: opts.FlavorRef, - FlavorName: opts.FlavorName, - SecurityGroups: opts.SecurityGroups, - UserData: opts.UserData, - AvailabilityZone: opts.AvailabilityZone, - Networks: opts.Networks, - Metadata: opts.Metadata, - Personality: opts.Personality, - ConfigDrive: opts.ConfigDrive, - AdminPass: opts.AdminPass, - } - - drive := diskconfig.CreateOptsExt{ - CreateOptsBuilder: base, - DiskConfig: opts.DiskConfig, - } - - res, err := drive.ToServerCreateMap() - if err != nil { - return nil, err - } - - if len(opts.BlockDevice) != 0 { - bfv := bootfromvolume.CreateOptsExt{ - CreateOptsBuilder: drive, - BlockDevice: opts.BlockDevice, - } - - res, err = bfv.ToServerCreateMap() - if err != nil { - return nil, err - } - } - - // key_name doesn't actually come from the extension (or at least isn't documented there) so - // we need to add it manually. - serverMap := res["server"].(map[string]interface{}) - if opts.KeyPair != "" { - serverMap["key_name"] = opts.KeyPair - } - - return res, nil -} - -// RebuildOpts represents all of the configuration options used in a server rebuild operation that -// are supported by Rackspace. -type RebuildOpts struct { - // Required. The ID of the image you want your server to be provisioned on - ImageID string - - // Name to set the server to - Name string - - // Required. The server's admin password - AdminPass string - - // AccessIPv4 [optional] provides a new IPv4 address for the instance. - AccessIPv4 string - - // AccessIPv6 [optional] provides a new IPv6 address for the instance. - AccessIPv6 string - - // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server. - Metadata map[string]string - - // Personality [optional] includes files to inject into the server at launch. - // Rebuild will base64-encode file contents for you. - Personality os.Personality - - // Rackspace-specific stuff begins here. - - // DiskConfig [optional] controls how the created server's disk is partitioned. See the "diskconfig" - // extension in OpenStack compute v2. - DiskConfig diskconfig.DiskConfig -} - -// ToServerRebuildMap constructs a request body using all of the OpenStack extensions that are -// active on Rackspace. -func (opts RebuildOpts) ToServerRebuildMap() (map[string]interface{}, error) { - base := os.RebuildOpts{ - ImageID: opts.ImageID, - Name: opts.Name, - AdminPass: opts.AdminPass, - AccessIPv4: opts.AccessIPv4, - AccessIPv6: opts.AccessIPv6, - Metadata: opts.Metadata, - Personality: opts.Personality, - } - - drive := diskconfig.RebuildOptsExt{ - RebuildOptsBuilder: base, - DiskConfig: opts.DiskConfig, - } - - return drive.ToServerRebuildMap() -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/requests.go deleted file mode 100644 index 1ff7c5ae5..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/requests.go +++ /dev/null @@ -1,45 +0,0 @@ -package virtualinterfaces - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// networks. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, instanceID string) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return VirtualInterfacePage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(c, listURL(c, instanceID), createPage) -} - -// Create creates a new virtual interface for a network and attaches the network -// to the server instance. -func Create(c *gophercloud.ServiceClient, instanceID, networkID string) CreateResult { - var res CreateResult - - reqBody := map[string]map[string]string{ - "virtual_interface": { - "network_id": networkID, - }, - } - - // Send request to API - _, res.Err = c.Post(createURL(c, instanceID), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201, 202}, - }) - return res -} - -// Delete deletes the interface with interfaceID attached to the instance with -// instanceID. -func Delete(c *gophercloud.ServiceClient, instanceID, interfaceID string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, instanceID, interfaceID), &gophercloud.RequestOpts{ - OkCodes: []int{200, 204}, - }) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/results.go deleted file mode 100644 index 26fa7f31c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/results.go +++ /dev/null @@ -1,81 +0,0 @@ -package virtualinterfaces - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a network resource. -func (r commonResult) Extract() (*VirtualInterface, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - VirtualInterfaces []VirtualInterface `mapstructure:"virtual_interfaces" json:"virtual_interfaces"` - } - - err := mapstructure.Decode(r.Body, &res) - - return &res.VirtualInterfaces[0], err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// IPAddress represents a vitual address attached to a VirtualInterface. -type IPAddress struct { - Address string `mapstructure:"address" json:"address"` - NetworkID string `mapstructure:"network_id" json:"network_id"` - NetworkLabel string `mapstructure:"network_label" json:"network_label"` -} - -// VirtualInterface represents a virtual interface. -type VirtualInterface struct { - // UUID for the virtual interface - ID string `mapstructure:"id" json:"id"` - - MACAddress string `mapstructure:"mac_address" json:"mac_address"` - - IPAddresses []IPAddress `mapstructure:"ip_addresses" json:"ip_addresses"` -} - -// VirtualInterfacePage is the page returned by a pager when traversing over a -// collection of virtual interfaces. -type VirtualInterfacePage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if the NetworkPage contains no Networks. -func (r VirtualInterfacePage) IsEmpty() (bool, error) { - networks, err := ExtractVirtualInterfaces(r) - if err != nil { - return true, err - } - return len(networks) == 0, nil -} - -// ExtractVirtualInterfaces accepts a Page struct, specifically a VirtualInterfacePage struct, -// and extracts the elements into a slice of VirtualInterface structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractVirtualInterfaces(page pagination.Page) ([]VirtualInterface, error) { - var resp struct { - VirtualInterfaces []VirtualInterface `mapstructure:"virtual_interfaces" json:"virtual_interfaces"` - } - - err := mapstructure.Decode(page.(VirtualInterfacePage).Body, &resp) - - return resp.VirtualInterfaces, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/urls.go deleted file mode 100644 index 9e5693e84..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/urls.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualinterfaces - -import "github.com/rackspace/gophercloud" - -func listURL(c *gophercloud.ServiceClient, instanceID string) string { - return c.ServiceURL("servers", instanceID, "os-virtual-interfacesv2") -} - -func createURL(c *gophercloud.ServiceClient, instanceID string) string { - return c.ServiceURL("servers", instanceID, "os-virtual-interfacesv2") -} - -func deleteURL(c *gophercloud.ServiceClient, instanceID, interfaceID string) string { - return c.ServiceURL("servers", instanceID, "os-virtual-interfacesv2", interfaceID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate.go deleted file mode 100644 index c6003e0e5..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate.go +++ /dev/null @@ -1,27 +0,0 @@ -package volumeattach - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager that allows you to iterate over a collection of VolumeAttachments. -func List(client *gophercloud.ServiceClient, serverID string) pagination.Pager { - return os.List(client, serverID) -} - -// Create requests the creation of a new volume attachment on the server -func Create(client *gophercloud.ServiceClient, serverID string, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(client, serverID, opts) -} - -// Get returns public data about a previously created VolumeAttachment. -func Get(client *gophercloud.ServiceClient, serverID, aID string) os.GetResult { - return os.Get(client, serverID, aID) -} - -// Delete requests the deletion of a previous stored VolumeAttachment from the server. -func Delete(client *gophercloud.ServiceClient, serverID, aID string) os.DeleteResult { - return os.Delete(client, serverID, aID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/doc.go deleted file mode 100644 index 2164908e3..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package volumeattach provides the ability to attach and detach volume -// to instances to Rackspace servers -package volumeattach diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/doc.go deleted file mode 100644 index 664eeadb8..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package backups provides information and interaction with the backup API -// resource in the Rackspace Database service. -// -// A backup is a copy of a database instance that can be used to restore it to -// some defined point in history. -package backups diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/fixtures.go deleted file mode 100644 index 45c2376d6..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/fixtures.go +++ /dev/null @@ -1,66 +0,0 @@ -package backups - -import "time" - -var ( - timestamp = "2015-11-12T14:22:42Z" - timeVal, _ = time.Parse(time.RFC3339, timestamp) -) - -var getResp = ` -{ - "backup": { - "created": "` + timestamp + `", - "description": "My Backup", - "id": "61f12fef-edb1-4561-8122-e7c00ef26a82", - "instance_id": "d4603f69-ec7e-4e9b-803f-600b9205576f", - "locationRef": null, - "name": "snapshot", - "parent_id": null, - "size": 100, - "status": "NEW", - "datastore": { - "version": "5.1", - "type": "MySQL", - "version_id": "20000000-0000-0000-0000-000000000002" - }, - "updated": "` + timestamp + `" - } -} -` - -var createReq = ` -{ - "backup": { - "description": "My Backup", - "instance": "d4603f69-ec7e-4e9b-803f-600b9205576f", - "name": "snapshot" - } -} -` - -var createResp = getResp - -var listResp = ` -{ - "backups": [ - { - "status": "COMPLETED", - "updated": "` + timestamp + `", - "description": "Backup from Restored Instance", - "datastore": { - "version": "5.1", - "type": "MySQL", - "version_id": "20000000-0000-0000-0000-000000000002" - }, - "id": "87972694-4be2-40f5-83f8-501656e0032a", - "size": 0.141026, - "name": "restored_backup", - "created": "` + timestamp + `", - "instance_id": "29af2cd9-0674-48ab-b87a-b160f00208e6", - "parent_id": null, - "locationRef": "http://localhost/path/to/backup" - } - ] -} -` diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/requests.go deleted file mode 100644 index 9170d7865..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/requests.go +++ /dev/null @@ -1,138 +0,0 @@ -package backups - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsBuilder is the top-level interface for creating JSON maps. -type CreateOptsBuilder interface { - ToBackupCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is responsible for configuring newly provisioned backups. -type CreateOpts struct { - // [REQUIRED] The name of the backup. The only restriction is the name must - // be less than 64 characters long. - Name string - - // [REQUIRED] The ID of the instance being backed up. - InstanceID string - - // [OPTIONAL] A human-readable explanation of the backup. - Description string -} - -// ToBackupCreateMap will create a JSON map for the Create operation. -func (opts CreateOpts) ToBackupCreateMap() (map[string]interface{}, error) { - if opts.Name == "" { - return nil, errors.New("Name is a required field") - } - if opts.InstanceID == "" { - return nil, errors.New("InstanceID is a required field") - } - - backup := map[string]interface{}{ - "name": opts.Name, - "instance": opts.InstanceID, - } - - if opts.Description != "" { - backup["description"] = opts.Description - } - - return map[string]interface{}{"backup": backup}, nil -} - -// Create asynchronously creates a new backup for a specified database instance. -// During the backup process, write access on MyISAM databases will be -// temporarily disabled; innoDB databases will be unaffected. During this time, -// you will not be able to add or delete databases or users; nor delete, stop -// or reboot the instance itself. Only one backup is permitted at once. -// -// Backups are not deleted when database instances are deleted; you must -// manually delete any backups created using Delete(). Backups are saved to your -// Cloud Files account in a new container called z_CLOUDDB_BACKUPS. It is -// strongly recommended you do not alter this container or its contents; usual -// storage costs apply. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToBackupCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("POST", baseURL(client), gophercloud.RequestOpts{ - JSONBody: &reqBody, - JSONResponse: &res.Body, - OkCodes: []int{202}, - }) - - return res -} - -// ListOptsBuilder is the top-level interface for creating query strings. -type ListOptsBuilder interface { - ToBackupListQuery() (string, error) -} - -// ListOpts allows you to refine a list search by certain parameters. -type ListOpts struct { - // The type of datastore by which to filter. - Datastore string `q:"datastore"` -} - -// ToBackupListQuery converts a ListOpts struct into a query string. -func (opts ListOpts) ToBackupListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List will list all the saved backups for all database instances. -func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := baseURL(client) - - if opts != nil { - query, err := opts.ToBackupListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - pageFn := func(r pagination.PageResult) pagination.Page { - return BackupPage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, url, pageFn) -} - -// Get will retrieve details for a particular backup based on its unique ID. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - - _, res.Err = client.Request("GET", resourceURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res -} - -// Delete will permanently delete a backup. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - - _, res.Err = client.Request("DELETE", resourceURL(client, id), gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/results.go deleted file mode 100644 index 04faf3227..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/results.go +++ /dev/null @@ -1,149 +0,0 @@ -package backups - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/db/v1/datastores" - "github.com/rackspace/gophercloud/pagination" -) - -// Status represents the various states a Backup can be in. -type Status string - -// Enum types for the status. -const ( - StatusNew Status = "NEW" - StatusBuilding Status = "BUILDING" - StatusCompleted Status = "COMPLETED" - StatusFailed Status = "FAILED" - StatusDeleteFailed Status = "DELETE_FAILED" -) - -// Backup represents a Backup API resource. -type Backup struct { - Description string - ID string - InstanceID string `json:"instance_id" mapstructure:"instance_id"` - LocationRef string - Name string - ParentID string `json:"parent_id" mapstructure:"parent_id"` - Size float64 - Status Status - Created time.Time `mapstructure:"-"` - Updated time.Time `mapstructure:"-"` - Datastore datastores.DatastorePartial -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -type commonResult struct { - gophercloud.Result -} - -// Extract will retrieve a Backup struct from an operation's result. -func (r commonResult) Extract() (*Backup, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Backup Backup `mapstructure:"backup"` - } - - err := mapstructure.Decode(r.Body, &response) - val := r.Body.(map[string]interface{})["backup"].(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Backup, err - } - response.Backup.Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Backup, err - } - response.Backup.Updated = updatedTime - } - - return &response.Backup, err -} - -// BackupPage represents a page of backups. -type BackupPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an BackupPage struct is empty. -func (r BackupPage) IsEmpty() (bool, error) { - is, err := ExtractBackups(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractBackups will retrieve a slice of Backup structs from a paginated collection. -func ExtractBackups(page pagination.Page) ([]Backup, error) { - casted := page.(BackupPage).Body - - var resp struct { - Backups []Backup `mapstructure:"backups" json:"backups"` - } - - if err := mapstructure.Decode(casted, &resp); err != nil { - return nil, err - } - - var vals []interface{} - switch casted.(type) { - case map[string]interface{}: - vals = casted.(map[string]interface{})["backups"].([]interface{}) - case map[string][]interface{}: - vals = casted.(map[string][]interface{})["backups"] - default: - return resp.Backups, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i, v := range vals { - val := v.(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Backups, err - } - resp.Backups[i].Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Backups, err - } - resp.Backups[i].Updated = updatedTime - } - } - - return resp.Backups, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/urls.go deleted file mode 100644 index 553444e88..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package backups - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("backups") -} - -func resourceURL(c *gophercloud.ServiceClient, backupID string) string { - return c.ServiceURL("backups", backupID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/delegate.go deleted file mode 100644 index d8cb48ac5..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/delegate.go +++ /dev/null @@ -1,79 +0,0 @@ -package configurations - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/db/v1/configurations" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all of the available configurations. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// Create will create a new configuration group. -func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(client, opts) -} - -// Get will retrieve the details for a specified configuration group. -func Get(client *gophercloud.ServiceClient, configID string) os.GetResult { - return os.Get(client, configID) -} - -// Update will modify an existing configuration group by performing a merge -// between new and existing values. If the key already exists, the new value -// will overwrite. All other keys will remain unaffected. -func Update(client *gophercloud.ServiceClient, configID string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(client, configID, opts) -} - -// Replace will modify an existing configuration group by overwriting the -// entire parameter group with the new values provided. Any existing keys not -// included in UpdateOptsBuilder will be deleted. -func Replace(client *gophercloud.ServiceClient, configID string, opts os.UpdateOptsBuilder) os.ReplaceResult { - return os.Replace(client, configID, opts) -} - -// Delete will permanently delete a configuration group. Please note that -// config groups cannot be deleted whilst still attached to running instances - -// you must detach and then delete them. -func Delete(client *gophercloud.ServiceClient, configID string) os.DeleteResult { - return os.Delete(client, configID) -} - -// ListInstances will list all the instances associated with a particular -// configuration group. -func ListInstances(client *gophercloud.ServiceClient, configID string) pagination.Pager { - return os.ListInstances(client, configID) -} - -// ListDatastoreParams will list all the available and supported parameters -// that can be used for a particular datastore ID and a particular version. -// For example, if you are wondering how you can configure a MySQL 5.6 instance, -// you can use this operation (you will need to retrieve the MySQL datastore ID -// by using the datastores API). -func ListDatastoreParams(client *gophercloud.ServiceClient, datastoreID, versionID string) pagination.Pager { - return os.ListDatastoreParams(client, datastoreID, versionID) -} - -// GetDatastoreParam will retrieve information about a specific configuration -// parameter. For example, you can use this operation to understand more about -// "innodb_file_per_table" configuration param for MySQL datastores. You will -// need the param's ID first, which can be attained by using the ListDatastoreParams -// operation. -func GetDatastoreParam(client *gophercloud.ServiceClient, datastoreID, versionID, paramID string) os.ParamResult { - return os.GetDatastoreParam(client, datastoreID, versionID, paramID) -} - -// ListGlobalParams is similar to ListDatastoreParams but does not require a -// DatastoreID. -func ListGlobalParams(client *gophercloud.ServiceClient, versionID string) pagination.Pager { - return os.ListGlobalParams(client, versionID) -} - -// GetGlobalParam is similar to GetDatastoreParam but does not require a -// DatastoreID. -func GetGlobalParam(client *gophercloud.ServiceClient, versionID, paramID string) os.ParamResult { - return os.GetGlobalParam(client, versionID, paramID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/doc.go deleted file mode 100644 index 48c51d60d..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/doc.go +++ /dev/null @@ -1 +0,0 @@ -package configurations diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/fixtures.go deleted file mode 100644 index d8a2233bc..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/configurations/fixtures.go +++ /dev/null @@ -1,159 +0,0 @@ -package configurations - -import ( - "fmt" - "time" - - os "github.com/rackspace/gophercloud/openstack/db/v1/configurations" -) - -var ( - timestamp = "2015-11-12T14:22:42Z" - timeVal, _ = time.Parse(time.RFC3339, timestamp) -) - -var singleConfigJSON = ` -{ - "created": "` + timestamp + `", - "datastore_name": "mysql", - "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "datastore_version_name": "5.6", - "description": "example_description", - "id": "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - "name": "example-configuration-name", - "updated": "` + timestamp + `" -} -` - -var singleConfigWithValuesJSON = ` -{ - "created": "` + timestamp + `", - "datastore_name": "mysql", - "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "datastore_version_name": "5.6", - "description": "example description", - "id": "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - "instance_count": 0, - "name": "example-configuration-name", - "updated": "` + timestamp + `", - "values": { - "collation_server": "latin1_swedish_ci", - "connect_timeout": 120 - } -} -` - -var ( - listConfigsJSON = fmt.Sprintf(`{"configurations": [%s]}`, singleConfigJSON) - getConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigJSON) - createConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigWithValuesJSON) -) - -var createReq = ` -{ - "configuration": { - "datastore": { - "type": "a00000a0-00a0-0a00-00a0-000a000000aa", - "version": "b00000b0-00b0-0b00-00b0-000b000000bb" - }, - "description": "example description", - "name": "example-configuration-name", - "values": { - "collation_server": "latin1_swedish_ci", - "connect_timeout": 120 - } - } -} -` - -var updateReq = ` -{ - "configuration": { - "values": { - "connect_timeout": 300 - } - } -} -` - -var listInstancesJSON = ` -{ - "instances": [ - { - "id": "d4603f69-ec7e-4e9b-803f-600b9205576f", - "name": "json_rack_instance" - } - ] -} -` - -var listParamsJSON = ` -{ - "configuration-parameters": [ - { - "max": 1, - "min": 0, - "name": "innodb_file_per_table", - "restart_required": true, - "type": "integer" - }, - { - "max": 4294967296, - "min": 0, - "name": "key_buffer_size", - "restart_required": false, - "type": "integer" - }, - { - "max": 65535, - "min": 2, - "name": "connect_timeout", - "restart_required": false, - "type": "integer" - }, - { - "max": 4294967296, - "min": 0, - "name": "join_buffer_size", - "restart_required": false, - "type": "integer" - } - ] -} -` - -var getParamJSON = ` -{ - "max": 1, - "min": 0, - "name": "innodb_file_per_table", - "restart_required": true, - "type": "integer" -} -` - -var exampleConfig = os.Config{ - Created: timeVal, - DatastoreName: "mysql", - DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb", - DatastoreVersionName: "5.6", - Description: "example_description", - ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - Name: "example-configuration-name", - Updated: timeVal, -} - -var exampleConfigWithValues = os.Config{ - Created: timeVal, - DatastoreName: "mysql", - DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb", - DatastoreVersionName: "5.6", - Description: "example description", - ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2", - Name: "example-configuration-name", - Updated: timeVal, - Values: map[string]interface{}{ - "collation_server": "latin1_swedish_ci", - "connect_timeout": 120, - }, -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/delegate.go deleted file mode 100644 index 56552d187..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/delegate.go +++ /dev/null @@ -1,19 +0,0 @@ -package databases - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/db/v1/databases" - "github.com/rackspace/gophercloud/pagination" -) - -func Create(client *gophercloud.ServiceClient, instanceID string, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(client, instanceID, opts) -} - -func List(client *gophercloud.ServiceClient, instanceID string) pagination.Pager { - return os.List(client, instanceID) -} - -func Delete(client *gophercloud.ServiceClient, instanceID, dbName string) os.DeleteResult { - return os.Delete(client, instanceID, dbName) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/doc.go deleted file mode 100644 index 1a178b61f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package databases provides information and interaction with the database API -// resource in the Rackspace Database service. -package databases diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/urls.go deleted file mode 100644 index 18cbec72e..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/databases/urls.go +++ /dev/null @@ -1 +0,0 @@ -package databases diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/datastores/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/datastores/delegate.go deleted file mode 100644 index 573496d38..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/datastores/delegate.go +++ /dev/null @@ -1,28 +0,0 @@ -package datastores - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/db/v1/datastores" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all available flavors. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// Get retrieves the details for a particular flavor. -func Get(client *gophercloud.ServiceClient, flavorID string) os.GetResult { - return os.Get(client, flavorID) -} - -// ListVersions will list all of the available versions for a specified -// datastore type. -func ListVersions(client *gophercloud.ServiceClient, datastoreID string) pagination.Pager { - return os.ListVersions(client, datastoreID) -} - -// GetVersion will retrieve the details of a specified datastore version. -func GetVersion(client *gophercloud.ServiceClient, datastoreID, versionID string) os.GetVersionResult { - return os.GetVersion(client, datastoreID, versionID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/datastores/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/datastores/doc.go deleted file mode 100644 index f36997a03..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/datastores/doc.go +++ /dev/null @@ -1 +0,0 @@ -package datastores diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/flavors/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/flavors/delegate.go deleted file mode 100644 index 689b81eac..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/flavors/delegate.go +++ /dev/null @@ -1,17 +0,0 @@ -package flavors - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/db/v1/flavors" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all available flavors. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// Get retrieves the details for a particular flavor. -func Get(client *gophercloud.ServiceClient, flavorID string) os.GetResult { - return os.Get(client, flavorID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/flavors/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/flavors/doc.go deleted file mode 100644 index 922a4e667..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/flavors/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package flavors provides information and interaction with the flavor API -// resource in the Rackspace Database service. -package flavors diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/delegate.go deleted file mode 100644 index f2656fe3b..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/delegate.go +++ /dev/null @@ -1,49 +0,0 @@ -package instances - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/db/v1/instances" -) - -// Get retrieves the status and information for a specified database instance. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - return GetResult{os.Get(client, id)} -} - -// Delete permanently destroys the database instance. -func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(client, id) -} - -// EnableRootUser enables the login from any host for the root user and -// provides the user with a generated root password. -func EnableRootUser(client *gophercloud.ServiceClient, id string) os.UserRootResult { - return os.EnableRootUser(client, id) -} - -// IsRootEnabled checks an instance to see if root access is enabled. It returns -// True if root user is enabled for the specified database instance or False -// otherwise. -func IsRootEnabled(client *gophercloud.ServiceClient, id string) (bool, error) { - return os.IsRootEnabled(client, id) -} - -// Restart will restart only the MySQL Instance. Restarting MySQL will -// erase any dynamic configuration settings that you have made within MySQL. -// The MySQL service will be unavailable until the instance restarts. -func Restart(client *gophercloud.ServiceClient, id string) os.ActionResult { - return os.Restart(client, id) -} - -// Resize changes the memory size of the instance, assuming a valid -// flavorRef is provided. It will also restart the MySQL service. -func Resize(client *gophercloud.ServiceClient, id, flavorRef string) os.ActionResult { - return os.Resize(client, id, flavorRef) -} - -// ResizeVolume will resize the attached volume for an instance. It supports -// only increasing the volume size and does not support decreasing the size. -// The volume size is in gigabytes (GB) and must be an integer. -func ResizeVolume(client *gophercloud.ServiceClient, id string, size int) os.ActionResult { - return os.ResizeVolume(client, id, size) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/doc.go deleted file mode 100644 index 0c8ad6336..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package instances provides information and interaction with the instance API -// resource in the Rackspace Database service. -package instances diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/fixtures.go deleted file mode 100644 index c5ff37aee..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/fixtures.go +++ /dev/null @@ -1,340 +0,0 @@ -package instances - -import ( - "fmt" - "time" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/db/v1/datastores" - "github.com/rackspace/gophercloud/openstack/db/v1/flavors" - os "github.com/rackspace/gophercloud/openstack/db/v1/instances" -) - -var ( - timestamp = "2015-11-12T14:22:42Z" - timeVal, _ = time.Parse(time.RFC3339, timestamp) -) - -var instance = ` -{ - "created": "` + timestamp + `", - "datastore": { - "type": "mysql", - "version": "5.6" - }, - "flavor": { - "id": "1", - "links": [ - { - "href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1", - "rel": "self" - }, - { - "href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1", - "rel": "bookmark" - } - ] - }, - "links": [ - { - "href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1", - "rel": "self" - } - ], - "hostname": "e09ad9a3f73309469cf1f43d11e79549caf9acf2.rackspaceclouddb.com", - "id": "{instanceID}", - "name": "json_rack_instance", - "status": "BUILD", - "updated": "` + timestamp + `", - "volume": { - "size": 2 - } -} -` - -var createReq = ` -{ - "instance": { - "databases": [ - { - "character_set": "utf8", - "collate": "utf8_general_ci", - "name": "sampledb" - }, - { - "name": "nextround" - } - ], - "flavorRef": "1", - "name": "json_rack_instance", - "users": [ - { - "databases": [ - { - "name": "sampledb" - } - ], - "name": "demouser", - "password": "demopassword" - } - ], - "volume": { - "size": 2 - }, - "restorePoint": { - "backupRef": "1234567890" - } - } -} -` - -var createReplicaReq = ` -{ - "instance": { - "volume": { - "size": 1 - }, - "flavorRef": "9", - "name": "t2s1_ALT_GUEST", - "replica_of": "6bdca2fc-418e-40bd-a595-62abda61862d" - } -} -` - -var createReplicaResp = ` -{ - "instance": { - "status": "BUILD", - "updated": "` + timestamp + `", - "name": "t2s1_ALT_GUEST", - "links": [ - { - "href": "https://ord.databases.api.rackspacecloud.com/v1.0/5919009/instances/8367c312-7c40-4a66-aab1-5767478914fc", - "rel": "self" - }, - { - "href": "https://ord.databases.api.rackspacecloud.com/instances/8367c312-7c40-4a66-aab1-5767478914fc", - "rel": "bookmark" - } - ], - "created": "` + timestamp + `", - "id": "8367c312-7c40-4a66-aab1-5767478914fc", - "volume": { - "size": 1 - }, - "flavor": { - "id": "9" - }, - "datastore": { - "version": "5.6", - "type": "mysql" - }, - "replica_of": { - "id": "6bdca2fc-418e-40bd-a595-62abda61862d" - } - } -} -` - -var listReplicasResp = ` -{ - "instances": [ - { - "status": "ACTIVE", - "name": "t1s1_ALT_GUEST", - "links": [ - { - "href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/3c691f06-bf9a-4618-b7ec-2817ce0cf254", - "rel": "self" - }, - { - "href": "https://ord.databases.api.rackspacecloud.com/instances/3c691f06-bf9a-4618-b7ec-2817ce0cf254", - "rel": "bookmark" - } - ], - "ip": [ - "10.0.0.3" - ], - "id": "3c691f06-bf9a-4618-b7ec-2817ce0cf254", - "volume": { - "size": 1 - }, - "flavor": { - "id": "9" - }, - "datastore": { - "version": "5.6", - "type": "mysql" - }, - "replica_of": { - "id": "8b499b45-52d6-402d-b398-f9d8f279c69a" - } - } - ] -} -` - -var getReplicaResp = ` -{ - "instance": { - "status": "ACTIVE", - "updated": "` + timestamp + `", - "name": "t1_ALT_GUEST", - "created": "` + timestamp + `", - "ip": [ - "10.0.0.2" - ], - "replicas": [ - { - "id": "3c691f06-bf9a-4618-b7ec-2817ce0cf254" - } - ], - "id": "8b499b45-52d6-402d-b398-f9d8f279c69a", - "volume": { - "used": 0.54, - "size": 1 - }, - "flavor": { - "id": "9" - }, - "datastore": { - "version": "5.6", - "type": "mysql" - } - } -} -` - -var detachReq = ` -{ - "instance": { - "replica_of": "", - "slave_of": "" - } -} -` - -var getConfigResp = ` -{ - "instance": { - "configuration": { - "basedir": "/usr", - "connect_timeout": "15", - "datadir": "/var/lib/mysql", - "default_storage_engine": "innodb", - "innodb_buffer_pool_instances": "1", - "innodb_buffer_pool_size": "175M", - "innodb_checksum_algorithm": "crc32", - "innodb_data_file_path": "ibdata1:10M:autoextend", - "innodb_file_per_table": "1", - "innodb_io_capacity": "200", - "innodb_log_file_size": "256M", - "innodb_log_files_in_group": "2", - "innodb_open_files": "8192", - "innodb_thread_concurrency": "0", - "join_buffer_size": "1M", - "key_buffer_size": "50M", - "local-infile": "0", - "log-error": "/var/log/mysql/mysqld.log", - "max_allowed_packet": "16M", - "max_connect_errors": "10000", - "max_connections": "40", - "max_heap_table_size": "16M", - "myisam-recover": "BACKUP", - "open_files_limit": "8192", - "performance_schema": "off", - "pid_file": "/var/run/mysqld/mysqld.pid", - "port": "3306", - "query_cache_limit": "1M", - "query_cache_size": "8M", - "query_cache_type": "1", - "read_buffer_size": "256K", - "read_rnd_buffer_size": "1M", - "server_id": "1", - "skip-external-locking": "1", - "skip_name_resolve": "1", - "sort_buffer_size": "256K", - "table_open_cache": "4096", - "thread_stack": "192K", - "tmp_table_size": "16M", - "tmpdir": "/var/tmp", - "user": "mysql", - "wait_timeout": "3600" - } - } -} -` - -var associateReq = `{"instance": {"configuration": "{configGroupID}"}}` - -var listBackupsResp = ` -{ - "backups": [ - { - "status": "COMPLETED", - "updated": "` + timestamp + `", - "description": "Backup from Restored Instance", - "datastore": { - "version": "5.1", - "type": "MySQL", - "version_id": "20000000-0000-0000-0000-000000000002" - }, - "id": "87972694-4be2-40f5-83f8-501656e0032a", - "size": 0.141026, - "name": "restored_backup", - "created": "` + timestamp + `", - "instance_id": "29af2cd9-0674-48ab-b87a-b160f00208e6", - "parent_id": null, - "locationRef": "http://localhost/path/to/backup" - } - ] -} -` - -var ( - createResp = fmt.Sprintf(`{"instance":%s}`, instance) - getResp = fmt.Sprintf(`{"instance":%s}`, instance) - associateResp = fmt.Sprintf(`{"instance":%s}`, instance) - listInstancesResp = fmt.Sprintf(`{"instances":[%s]}`, instance) -) - -var instanceID = "{instanceID}" - -var expectedInstance = &Instance{ - Created: timeVal, - Updated: timeVal, - Datastore: datastores.DatastorePartial{Type: "mysql", Version: "5.6"}, - Flavor: flavors.Flavor{ - ID: "1", - Links: []gophercloud.Link{ - gophercloud.Link{Href: "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1", Rel: "self"}, - gophercloud.Link{Href: "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1", Rel: "bookmark"}, - }, - }, - Hostname: "e09ad9a3f73309469cf1f43d11e79549caf9acf2.rackspaceclouddb.com", - ID: instanceID, - Links: []gophercloud.Link{ - gophercloud.Link{Href: "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1", Rel: "self"}, - }, - Name: "json_rack_instance", - Status: "BUILD", - Volume: os.Volume{Size: 2}, -} - -var expectedReplica = &Instance{ - Status: "BUILD", - Updated: timeVal, - Name: "t2s1_ALT_GUEST", - Links: []gophercloud.Link{ - gophercloud.Link{Rel: "self", Href: "https://ord.databases.api.rackspacecloud.com/v1.0/5919009/instances/8367c312-7c40-4a66-aab1-5767478914fc"}, - gophercloud.Link{Rel: "bookmark", Href: "https://ord.databases.api.rackspacecloud.com/instances/8367c312-7c40-4a66-aab1-5767478914fc"}, - }, - Created: timeVal, - ID: "8367c312-7c40-4a66-aab1-5767478914fc", - Volume: os.Volume{Size: 1}, - Flavor: flavors.Flavor{ID: "9"}, - Datastore: datastores.DatastorePartial{Version: "5.6", Type: "mysql"}, - ReplicaOf: &Instance{ - ID: "6bdca2fc-418e-40bd-a595-62abda61862d", - }, -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/requests.go deleted file mode 100644 index f4df692a4..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/requests.go +++ /dev/null @@ -1,199 +0,0 @@ -package instances - -import ( - "github.com/rackspace/gophercloud" - osDBs "github.com/rackspace/gophercloud/openstack/db/v1/databases" - os "github.com/rackspace/gophercloud/openstack/db/v1/instances" - osUsers "github.com/rackspace/gophercloud/openstack/db/v1/users" - "github.com/rackspace/gophercloud/pagination" - "github.com/rackspace/gophercloud/rackspace/db/v1/backups" -) - -// CreateOpts is the struct responsible for configuring a new database instance. -type CreateOpts struct { - // Either the integer UUID (in string form) of the flavor, or its URI - // reference as specified in the response from the List() call. Required. - FlavorRef string - - // Specifies the volume size in gigabytes (GB). The value must be between 1 - // and 300. Required. - Size int - - // Name of the instance to create. The length of the name is limited to - // 255 characters and any characters are permitted. Optional. - Name string - - // A slice of database information options. - Databases osDBs.CreateOptsBuilder - - // A slice of user information options. - Users osUsers.CreateOptsBuilder - - // ID of the configuration group to associate with the instance. Optional. - ConfigID string - - // Options to configure the type of datastore the instance will use. This is - // optional, and if excluded will default to MySQL. - Datastore *os.DatastoreOpts - - // Specifies the backup ID from which to restore the database instance. There - // are some things to be aware of before using this field. When you execute - // the Restore Backup operation, a new database instance is created to store - // the backup whose ID is specified by the restorePoint attribute. This will - // mean that: - // - All users, passwords and access that were on the instance at the time of - // the backup will be restored along with the databases. - // - You can create new users or databases if you want, but they cannot be - // the same as the ones from the instance that was backed up. - RestorePoint string - - ReplicaOf string -} - -func (opts CreateOpts) ToInstanceCreateMap() (map[string]interface{}, error) { - instance, err := os.CreateOpts{ - FlavorRef: opts.FlavorRef, - Size: opts.Size, - Name: opts.Name, - Databases: opts.Databases, - Users: opts.Users, - }.ToInstanceCreateMap() - - if err != nil { - return nil, err - } - - instance = instance["instance"].(map[string]interface{}) - - if opts.ConfigID != "" { - instance["configuration"] = opts.ConfigID - } - - if opts.Datastore != nil { - ds, err := opts.Datastore.ToMap() - if err != nil { - return nil, err - } - instance["datastore"] = ds - } - - if opts.RestorePoint != "" { - instance["restorePoint"] = map[string]string{"backupRef": opts.RestorePoint} - } - - if opts.ReplicaOf != "" { - instance["replica_of"] = opts.ReplicaOf - } - - return map[string]interface{}{"instance": instance}, nil -} - -// Create asynchronously provisions a new database instance. It requires the -// user to specify a flavor and a volume size. The API service then provisions -// the instance with the requested flavor and sets up a volume of the specified -// size, which is the storage for the database instance. -// -// Although this call only allows the creation of 1 instance per request, you -// can create an instance with multiple databases and users. The default -// binding for a MySQL instance is port 3306. -func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) CreateResult { - return CreateResult{os.Create(client, opts)} -} - -// ListOpts specifies all of the query options to be used when returning a list -// of database instances. -type ListOpts struct { - // IncludeHA includes or excludes High Availability instances from the result set - IncludeHA bool `q:"include_ha"` - - // IncludeReplicas includes or excludes Replica instances from the result set - IncludeReplicas bool `q:"include_replicas"` -} - -// ToInstanceListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToInstanceListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List retrieves the status and information for all database instances. -func List(client *gophercloud.ServiceClient, opts *ListOpts) pagination.Pager { - url := baseURL(client) - - if opts != nil { - query, err := opts.ToInstanceListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - createPageFn := func(r pagination.PageResult) pagination.Page { - return os.InstancePage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, url, createPageFn) -} - -// GetDefaultConfig lists the default configuration settings from the template -// that was applied to the specified instance. In a sense, this is the vanilla -// configuration setting applied to an instance. Further configuration can be -// applied by associating an instance with a configuration group. -func GetDefaultConfig(client *gophercloud.ServiceClient, id string) ConfigResult { - var res ConfigResult - - _, res.Err = client.Request("GET", configURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res -} - -// AssociateWithConfigGroup associates a specified instance to a specified -// configuration group. If any of the parameters within a configuration group -// require a restart, then the instance will transition into a restart. -func AssociateWithConfigGroup(client *gophercloud.ServiceClient, instanceID, configGroupID string) UpdateResult { - reqBody := map[string]string{ - "configuration": configGroupID, - } - - var res UpdateResult - - _, res.Err = client.Request("PUT", resourceURL(client, instanceID), gophercloud.RequestOpts{ - JSONBody: map[string]map[string]string{"instance": reqBody}, - OkCodes: []int{202}, - }) - - return res -} - -// DetachFromConfigGroup will detach an instance from all config groups. -func DetachFromConfigGroup(client *gophercloud.ServiceClient, instanceID string) UpdateResult { - return AssociateWithConfigGroup(client, instanceID, "") -} - -// ListBackups will list all the backups for a specified database instance. -func ListBackups(client *gophercloud.ServiceClient, instanceID string) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return backups.BackupPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(client, backupsURL(client, instanceID), pageFn) -} - -// DetachReplica will detach a specified replica instance from its source -// instance, effectively allowing it to operate independently. Detaching a -// replica will restart the MySQL service on the instance. -func DetachReplica(client *gophercloud.ServiceClient, replicaID string) DetachResult { - var res DetachResult - - _, res.Err = client.Request("PATCH", resourceURL(client, replicaID), gophercloud.RequestOpts{ - JSONBody: map[string]interface{}{"instance": map[string]string{"replica_of": "", "slave_of": ""}}, - OkCodes: []int{202}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/results.go deleted file mode 100644 index cdcc9c716..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/results.go +++ /dev/null @@ -1,191 +0,0 @@ -package instances - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/db/v1/datastores" - "github.com/rackspace/gophercloud/openstack/db/v1/flavors" - os "github.com/rackspace/gophercloud/openstack/db/v1/instances" - "github.com/rackspace/gophercloud/pagination" -) - -// Instance represents a remote MySQL instance. -type Instance struct { - // Indicates the datetime that the instance was created - Created time.Time `mapstructure:"-"` - - // Indicates the most recent datetime that the instance was updated. - Updated time.Time `mapstructure:"-"` - - // Indicates how the instance stores data. - Datastore datastores.DatastorePartial - - // Indicates the hardware flavor the instance uses. - Flavor flavors.Flavor - - // A DNS-resolvable hostname associated with the database instance (rather - // than an IPv4 address). Since the hostname always resolves to the correct - // IP address of the database instance, this relieves the user from the task - // of maintaining the mapping. Note that although the IP address may likely - // change on resizing, migrating, and so forth, the hostname always resolves - // to the correct database instance. - Hostname string - - // Indicates the unique identifier for the instance resource. - ID string - - // Exposes various links that reference the instance resource. - Links []gophercloud.Link - - // The human-readable name of the instance. - Name string - - // The build status of the instance. - Status string - - // Information about the attached volume of the instance. - Volume os.Volume - - // IP indicates the various IP addresses which allow access. - IP []string - - // Indicates whether this instance is a replica of another source instance. - ReplicaOf *Instance `mapstructure:"replica_of" json:"replica_of"` - - // Indicates whether this instance is the source of other replica instances. - Replicas []Instance -} - -func commonExtract(err error, body interface{}) (*Instance, error) { - if err != nil { - return nil, err - } - - var response struct { - Instance Instance `mapstructure:"instance"` - } - - err = mapstructure.Decode(body, &response) - - val := body.(map[string]interface{})["instance"].(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Instance, err - } - response.Instance.Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &response.Instance, err - } - response.Instance.Updated = updatedTime - } - - return &response.Instance, err -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - os.CreateResult -} - -// Extract will retrieve an instance from a create result. -func (r CreateResult) Extract() (*Instance, error) { - return commonExtract(r.Err, r.Body) -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - os.GetResult -} - -// Extract will extract an Instance from a GetResult. -func (r GetResult) Extract() (*Instance, error) { - return commonExtract(r.Err, r.Body) -} - -// ConfigResult represents the result of getting default configuration for an -// instance. -type ConfigResult struct { - gophercloud.Result -} - -// DetachResult represents the result of detaching a replica from its source. -type DetachResult struct { - gophercloud.ErrResult -} - -// Extract will extract the configuration information (in the form of a map) -// about a particular instance. -func (r ConfigResult) Extract() (map[string]string, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Instance struct { - Config map[string]string `mapstructure:"configuration"` - } `mapstructure:"instance"` - } - - err := mapstructure.Decode(r.Body, &response) - return response.Instance.Config, err -} - -// UpdateResult represents the result of an Update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -// ExtractInstances retrieves a slice of instances from a paginated collection. -func ExtractInstances(page pagination.Page) ([]Instance, error) { - casted := page.(os.InstancePage).Body - - var resp struct { - Instances []Instance `mapstructure:"instances"` - } - - if err := mapstructure.Decode(casted, &resp); err != nil { - return nil, err - } - - var vals []interface{} - switch casted.(type) { - case map[string]interface{}: - vals = casted.(map[string]interface{})["instances"].([]interface{}) - case map[string][]interface{}: - vals = casted.(map[string][]interface{})["instances"] - default: - return resp.Instances, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i, v := range vals { - val := v.(map[string]interface{}) - - if t, ok := val["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Instances, err - } - resp.Instances[i].Created = creationTime - } - - if t, ok := val["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return resp.Instances, err - } - resp.Instances[i].Updated = updatedTime - } - } - - return resp.Instances, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/urls.go deleted file mode 100644 index 5955f4cde..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/instances/urls.go +++ /dev/null @@ -1,23 +0,0 @@ -package instances - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("instances") -} - -func createURL(c *gophercloud.ServiceClient) string { - return baseURL(c) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("instances", id) -} - -func configURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("instances", id, "configuration") -} - -func backupsURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("instances", id, "backups") -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/delegate.go deleted file mode 100644 index 8298c4605..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/delegate.go +++ /dev/null @@ -1,16 +0,0 @@ -package users - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/db/v1/users" -) - -// Create will create a new database user for the specified database instance. -func Create(client *gophercloud.ServiceClient, instanceID string, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(client, instanceID, opts) -} - -// Delete will permanently remove a user from a specified database instance. -func Delete(client *gophercloud.ServiceClient, instanceID, userName string) os.DeleteResult { - return os.Delete(client, instanceID, userName) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/doc.go deleted file mode 100644 index 84f2eb327..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package users provides information and interaction with the user API -// resource in the Rackspace Database service. -package users diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/fixtures.go deleted file mode 100644 index 5314e854f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/fixtures.go +++ /dev/null @@ -1,77 +0,0 @@ -package users - -const singleDB = `{"databases": [{"name": "databaseE"}]}` - -var changePwdReq = ` -{ - "users": [ - { - "name": "dbuser1", - "password": "newpassword" - }, - { - "name": "dbuser2", - "password": "anotherpassword" - } - ] -} -` - -var updateReq = ` -{ - "user": { - "name": "new_username", - "password": "new_password" - } -} -` - -var getResp = ` -{ - "user": { - "name": "exampleuser", - "host": "foo", - "databases": [ - { - "name": "databaseA" - }, - { - "name": "databaseB" - } - ] - } -} -` - -var listResp = ` -{ -"users": [ - { - "name": "dbuser1", - "host": "localhost", - "databases": [ - { - "name": "databaseA" - } - ] - }, - { - "name": "dbuser2", - "host": "localhost", - "databases": [ - { - "name": "databaseB" - }, - { - "name": "databaseC" - } - ] - } -] -} -` - -var ( - listUserAccessResp = singleDB - grantUserAccessReq = singleDB -) diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/requests.go deleted file mode 100644 index 74e47ab23..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/requests.go +++ /dev/null @@ -1,176 +0,0 @@ -package users - -import ( - "errors" - - "github.com/rackspace/gophercloud" - db "github.com/rackspace/gophercloud/openstack/db/v1/databases" - os "github.com/rackspace/gophercloud/openstack/db/v1/users" - "github.com/rackspace/gophercloud/pagination" -) - -// List will list all available users for a specified database instance. -func List(client *gophercloud.ServiceClient, instanceID string) pagination.Pager { - createPageFn := func(r pagination.PageResult) pagination.Page { - return UserPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, baseURL(client, instanceID), createPageFn) -} - -/* -ChangePassword changes the password for one or more users. For example, to -change the respective passwords for two users: - - opts := os.BatchCreateOpts{ - os.CreateOpts{Name: "db_user_1", Password: "new_password_1"}, - os.CreateOpts{Name: "db_user_2", Password: "new_password_2"}, - } - - ChangePassword(client, "instance_id", opts) -*/ -func ChangePassword(client *gophercloud.ServiceClient, instanceID string, opts os.CreateOptsBuilder) UpdatePasswordsResult { - var res UpdatePasswordsResult - - reqBody, err := opts.ToUserCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("PUT", baseURL(client, instanceID), gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{202}, - }) - - return res -} - -// UpdateOpts is the struct responsible for updating an existing user. -type UpdateOpts struct { - // [OPTIONAL] Specifies a name for the user. Valid names can be composed - // of the following characters: letters (either case); numbers; these - // characters '@', '?', '#', ' ' but NEVER beginning a name string; '_' is - // permitted anywhere. Prohibited characters that are forbidden include: - // single quotes, double quotes, back quotes, semicolons, commas, backslashes, - // and forward slashes. Spaces at the front or end of a user name are also - // not permitted. - Name string - - // [OPTIONAL] Specifies a password for the user. - Password string - - // [OPTIONAL] Specifies the host from which a user is allowed to connect to - // the database. Possible values are a string containing an IPv4 address or - // "%" to allow connecting from any host. Optional; the default is "%". - Host string -} - -// ToMap is a convenience function for creating sub-maps for individual users. -func (opts UpdateOpts) ToMap() (map[string]interface{}, error) { - if opts.Name == "root" { - return nil, errors.New("root is a reserved user name and cannot be used") - } - - user := map[string]interface{}{} - - if opts.Name != "" { - user["name"] = opts.Name - } - - if opts.Password != "" { - user["password"] = opts.Password - } - - if opts.Host != "" { - user["host"] = opts.Host - } - - return user, nil -} - -// Update will modify the attributes of a specified user. Attributes that can -// be updated are: user name, password, and host. -func Update(client *gophercloud.ServiceClient, instanceID, userName string, opts UpdateOpts) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToMap() - if err != nil { - res.Err = err - return res - } - reqBody = map[string]interface{}{"user": reqBody} - - _, res.Err = client.Request("PUT", userURL(client, instanceID, userName), gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{202}, - }) - - return res -} - -// Get will retrieve the details for a particular user. -func Get(client *gophercloud.ServiceClient, instanceID, userName string) GetResult { - var res GetResult - - _, res.Err = client.Request("GET", userURL(client, instanceID, userName), gophercloud.RequestOpts{ - JSONResponse: &res.Body, - OkCodes: []int{200}, - }) - - return res -} - -// ListAccess will list all of the databases a user has access to. -func ListAccess(client *gophercloud.ServiceClient, instanceID, userName string) pagination.Pager { - pageFn := func(r pagination.PageResult) pagination.Page { - return AccessPage{pagination.LinkedPageBase{PageResult: r}} - } - - return pagination.NewPager(client, dbsURL(client, instanceID, userName), pageFn) -} - -/* -GrantAccess for the specified user to one or more databases on a specified -instance. For example, to add a user to multiple databases: - - opts := db.BatchCreateOpts{ - db.CreateOpts{Name: "database_1"}, - db.CreateOpts{Name: "database_3"}, - db.CreateOpts{Name: "database_19"}, - } - - GrantAccess(client, "instance_id", "user_name", opts) -*/ -func GrantAccess(client *gophercloud.ServiceClient, instanceID, userName string, opts db.CreateOptsBuilder) GrantAccessResult { - var res GrantAccessResult - - reqBody, err := opts.ToDBCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Request("PUT", dbsURL(client, instanceID, userName), gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{202}, - }) - - return res -} - -/* -RevokeAccess will revoke access for the specified user to one or more databases -on a specified instance. For example: - - RevokeAccess(client, "instance_id", "user_name", "db_name") -*/ -func RevokeAccess(client *gophercloud.ServiceClient, instanceID, userName, dbName string) RevokeAccessResult { - var res RevokeAccessResult - - _, res.Err = client.Request("DELETE", dbURL(client, instanceID, userName, dbName), gophercloud.RequestOpts{ - OkCodes: []int{202}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/results.go deleted file mode 100644 index 85b3a7aaa..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/results.go +++ /dev/null @@ -1,149 +0,0 @@ -package users - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - db "github.com/rackspace/gophercloud/openstack/db/v1/databases" - "github.com/rackspace/gophercloud/pagination" -) - -// User represents a database user -type User struct { - // The user name - Name string - - // The user password - Password string - - // Specifies the host from which a user is allowed to connect to the database. - // Possible values are a string containing an IPv4 address or "%" to allow - // connecting from any host. - Host string - - // The databases associated with this user - Databases []db.Database -} - -// UpdatePasswordsResult represents the result of changing a user password. -type UpdatePasswordsResult struct { - gophercloud.ErrResult -} - -// UpdateResult represents the result of updating a user. -type UpdateResult struct { - gophercloud.ErrResult -} - -// GetResult represents the result of getting a user. -type GetResult struct { - gophercloud.Result -} - -// Extract will retrieve a User struct from a getresult. -func (r GetResult) Extract() (*User, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - User User `mapstructure:"user"` - } - - err := mapstructure.Decode(r.Body, &response) - return &response.User, err -} - -// AccessPage represents a single page of a paginated user collection. -type AccessPage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks to see whether the collection is empty. -func (page AccessPage) IsEmpty() (bool, error) { - users, err := ExtractDBs(page) - if err != nil { - return true, err - } - return len(users) == 0, nil -} - -// NextPageURL will retrieve the next page URL. -func (page AccessPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"databases_links"` - } - - var r resp - err := mapstructure.Decode(page.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// ExtractDBs will convert a generic pagination struct into a more -// relevant slice of DB structs. -func ExtractDBs(page pagination.Page) ([]db.Database, error) { - casted := page.(AccessPage).Body - - var response struct { - DBs []db.Database `mapstructure:"databases"` - } - - err := mapstructure.Decode(casted, &response) - return response.DBs, err -} - -// UserPage represents a single page of a paginated user collection. -type UserPage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks to see whether the collection is empty. -func (page UserPage) IsEmpty() (bool, error) { - users, err := ExtractUsers(page) - if err != nil { - return true, err - } - return len(users) == 0, nil -} - -// NextPageURL will retrieve the next page URL. -func (page UserPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"users_links"` - } - - var r resp - err := mapstructure.Decode(page.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// ExtractUsers will convert a generic pagination struct into a more -// relevant slice of User structs. -func ExtractUsers(page pagination.Page) ([]User, error) { - casted := page.(UserPage).Body - - var response struct { - Users []User `mapstructure:"users"` - } - - err := mapstructure.Decode(casted, &response) - - return response.Users, err -} - -// GrantAccessResult represents the result of granting access to a user. -type GrantAccessResult struct { - gophercloud.ErrResult -} - -// RevokeAccessResult represents the result of revoking access to a user. -type RevokeAccessResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/urls.go deleted file mode 100644 index bac8788ff..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/users/urls.go +++ /dev/null @@ -1,19 +0,0 @@ -package users - -import "github.com/rackspace/gophercloud" - -func baseURL(c *gophercloud.ServiceClient, instanceID string) string { - return c.ServiceURL("instances", instanceID, "users") -} - -func userURL(c *gophercloud.ServiceClient, instanceID, userName string) string { - return c.ServiceURL("instances", instanceID, "users", userName) -} - -func dbsURL(c *gophercloud.ServiceClient, instanceID, userName string) string { - return c.ServiceURL("instances", instanceID, "users", userName, "databases") -} - -func dbURL(c *gophercloud.ServiceClient, instanceID, userName, dbName string) string { - return c.ServiceURL("instances", instanceID, "users", userName, "databases", dbName) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/extensions/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/extensions/delegate.go deleted file mode 100644 index fc547cde5..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/extensions/delegate.go +++ /dev/null @@ -1,24 +0,0 @@ -package extensions - -import ( - "github.com/rackspace/gophercloud" - common "github.com/rackspace/gophercloud/openstack/common/extensions" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtractExtensions accepts a Page struct, specifically an ExtensionPage struct, and extracts the -// elements into a slice of os.Extension structs. -func ExtractExtensions(page pagination.Page) ([]common.Extension, error) { - return common.ExtractExtensions(page) -} - -// Get retrieves information for a specific extension using its alias. -func Get(c *gophercloud.ServiceClient, alias string) common.GetResult { - return common.Get(c, alias) -} - -// List returns a Pager which allows you to iterate over the full collection of extensions. -// It does not accept query parameters. -func List(c *gophercloud.ServiceClient) pagination.Pager { - return common.List(c) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/extensions/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/extensions/doc.go deleted file mode 100644 index b02a95b53..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/extensions/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package extensions provides information and interaction with the all the -// extensions available for the Rackspace Identity service. -package extensions diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/roles/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/roles/delegate.go deleted file mode 100644 index a6ee8515c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/roles/delegate.go +++ /dev/null @@ -1,50 +0,0 @@ -package roles - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - os "github.com/rackspace/gophercloud/openstack/identity/v2/extensions/admin/roles" -) - -// List is the operation responsible for listing all available global roles -// that a user can adopt. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// AddUserRole is the operation responsible for assigning a particular role to -// a user. This is confined to the scope of the user's tenant - so the tenant -// ID is a required argument. -func AddUserRole(client *gophercloud.ServiceClient, userID, roleID string) UserRoleResult { - var result UserRoleResult - - _, result.Err = client.Request("PUT", userRoleURL(client, userID, roleID), gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - - return result -} - -// DeleteUserRole is the operation responsible for deleting a particular role -// from a user. This is confined to the scope of the user's tenant - so the -// tenant ID is a required argument. -func DeleteUserRole(client *gophercloud.ServiceClient, userID, roleID string) UserRoleResult { - var result UserRoleResult - - _, result.Err = client.Request("DELETE", userRoleURL(client, userID, roleID), gophercloud.RequestOpts{ - OkCodes: []int{204}, - }) - - return result -} - -// UserRoleResult represents the result of either an AddUserRole or -// a DeleteUserRole operation. -type UserRoleResult struct { - gophercloud.ErrResult -} - -func userRoleURL(c *gophercloud.ServiceClient, userID, roleID string) string { - return c.ServiceURL(os.UserPath, userID, os.RolePath, os.ExtPath, roleID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/roles/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/roles/fixtures.go deleted file mode 100644 index 5f22d0f64..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/roles/fixtures.go +++ /dev/null @@ -1,49 +0,0 @@ -package roles - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func MockListRoleResponse(t *testing.T) { - th.Mux.HandleFunc("/OS-KSADM/roles", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "roles": [ - { - "id": "123", - "name": "compute:admin", - "description": "Nova Administrator", - "serviceId": "cke5372ebabeeabb70a0e702a4626977x4406e5" - } - ] -} - `) - }) -} - -func MockAddUserRoleResponse(t *testing.T) { - th.Mux.HandleFunc("/users/{user_id}/roles/OS-KSADM/{role_id}", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusCreated) - }) -} - -func MockDeleteUserRoleResponse(t *testing.T) { - th.Mux.HandleFunc("/users/{user_id}/roles/OS-KSADM/{role_id}", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tenants/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tenants/delegate.go deleted file mode 100644 index 6cdd0cfbd..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tenants/delegate.go +++ /dev/null @@ -1,17 +0,0 @@ -package tenants - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/identity/v2/tenants" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtractTenants interprets a page of List results as a more usable slice of Tenant structs. -func ExtractTenants(page pagination.Page) ([]os.Tenant, error) { - return os.ExtractTenants(page) -} - -// List enumerates the tenants to which the current token grants access. -func List(client *gophercloud.ServiceClient, opts *os.ListOpts) pagination.Pager { - return os.List(client, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tenants/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tenants/doc.go deleted file mode 100644 index c1825c21d..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tenants/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package tenants provides information and interaction with the tenant -// API resource for the Rackspace Identity service. -package tenants diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tokens/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tokens/delegate.go deleted file mode 100644 index 4f9885af0..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tokens/delegate.go +++ /dev/null @@ -1,60 +0,0 @@ -package tokens - -import ( - "errors" - - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/identity/v2/tokens" -) - -var ( - // ErrPasswordProvided is returned if both a password and an API key are provided to Create. - ErrPasswordProvided = errors.New("Please provide either a password or an API key.") -) - -// AuthOptions wraps the OpenStack AuthOptions struct to be able to customize the request body -// when API key authentication is used. -type AuthOptions struct { - os.AuthOptions -} - -// WrapOptions embeds a root AuthOptions struct in a package-specific one. -func WrapOptions(original gophercloud.AuthOptions) AuthOptions { - return AuthOptions{AuthOptions: os.WrapOptions(original)} -} - -// ToTokenCreateMap serializes an AuthOptions into a request body. If an API key is provided, it -// will be used, otherwise -func (auth AuthOptions) ToTokenCreateMap() (map[string]interface{}, error) { - if auth.APIKey == "" { - return auth.AuthOptions.ToTokenCreateMap() - } - - // Verify that other required attributes are present. - if auth.Username == "" { - return nil, os.ErrUsernameRequired - } - - authMap := make(map[string]interface{}) - - authMap["RAX-KSKEY:apiKeyCredentials"] = map[string]interface{}{ - "username": auth.Username, - "apiKey": auth.APIKey, - } - - if auth.TenantID != "" { - authMap["tenantId"] = auth.TenantID - } - if auth.TenantName != "" { - authMap["tenantName"] = auth.TenantName - } - - return map[string]interface{}{"auth": authMap}, nil -} - -// Create authenticates to Rackspace's identity service and attempts to acquire a Token. Rather -// than interact with this service directly, users should generally call -// rackspace.AuthenticatedClient(). -func Create(client *gophercloud.ServiceClient, auth AuthOptions) os.CreateResult { - return os.Create(client, auth) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tokens/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tokens/doc.go deleted file mode 100644 index 44043e5e1..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/tokens/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package tokens provides information and interaction with the token -// API resource for the Rackspace Identity service. -package tokens diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/delegate.go deleted file mode 100644 index 6135bec10..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/delegate.go +++ /dev/null @@ -1,142 +0,0 @@ -package users - -import ( - "errors" - - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/identity/v2/users" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a pager that allows traversal over a collection of users. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return os.List(client) -} - -// CommonOpts are the options which are shared between CreateOpts and -// UpdateOpts -type CommonOpts struct { - // Required. The username to assign to the user. When provided, the username - // must: - // - start with an alphabetical (A-Za-z) character - // - have a minimum length of 1 character - // - // The username may contain upper and lowercase characters, as well as any of - // the following special character: . - @ _ - Username string - - // Required. Email address for the user account. - Email string - - // Required. Indicates whether the user can authenticate after the user - // account is created. If no value is specified, the default value is true. - Enabled os.EnabledState - - // Optional. The password to assign to the user. If provided, the password - // must: - // - start with an alphabetical (A-Za-z) character - // - have a minimum length of 8 characters - // - contain at least one uppercase character, one lowercase character, and - // one numeric character. - // - // The password may contain any of the following special characters: . - @ _ - Password string -} - -// CreateOpts represents the options needed when creating new users. -type CreateOpts CommonOpts - -// ToUserCreateMap assembles a request body based on the contents of a CreateOpts. -func (opts CreateOpts) ToUserCreateMap() (map[string]interface{}, error) { - m := make(map[string]interface{}) - - if opts.Username == "" { - return m, errors.New("Username is a required field") - } - if opts.Enabled == nil { - return m, errors.New("Enabled is a required field") - } - if opts.Email == "" { - return m, errors.New("Email is a required field") - } - - if opts.Username != "" { - m["username"] = opts.Username - } - if opts.Email != "" { - m["email"] = opts.Email - } - if opts.Enabled != nil { - m["enabled"] = opts.Enabled - } - if opts.Password != "" { - m["OS-KSADM:password"] = opts.Password - } - - return map[string]interface{}{"user": m}, nil -} - -// Create is the operation responsible for creating new users. -func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) CreateResult { - return CreateResult{os.Create(client, opts)} -} - -// Get requests details on a single user, either by ID. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - return GetResult{os.Get(client, id)} -} - -// UpdateOptsBuilder allows extensions to add additional attributes to the Update request. -type UpdateOptsBuilder interface { - ToUserUpdateMap() map[string]interface{} -} - -// UpdateOpts specifies the base attributes that may be updated on an existing server. -type UpdateOpts CommonOpts - -// ToUserUpdateMap formats an UpdateOpts structure into a request body. -func (opts UpdateOpts) ToUserUpdateMap() map[string]interface{} { - m := make(map[string]interface{}) - - if opts.Username != "" { - m["username"] = opts.Username - } - if opts.Enabled != nil { - m["enabled"] = &opts.Enabled - } - if opts.Email != "" { - m["email"] = opts.Email - } - - return map[string]interface{}{"user": m} -} - -// Update is the operation responsible for updating exist users by their UUID. -func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var result UpdateResult - - _, result.Err = client.Request("POST", os.ResourceURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &result.Body, - JSONBody: opts.ToUserUpdateMap(), - OkCodes: []int{200}, - }) - - return result -} - -// Delete is the operation responsible for permanently deleting an API user. -func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(client, id) -} - -// ResetAPIKey resets the User's API key. -func ResetAPIKey(client *gophercloud.ServiceClient, id string) ResetAPIKeyResult { - var result ResetAPIKeyResult - - _, result.Err = client.Request("POST", resetAPIKeyURL(client, id), gophercloud.RequestOpts{ - JSONResponse: &result.Body, - OkCodes: []int{200}, - }) - - return result -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/fixtures.go deleted file mode 100644 index 973f39ea8..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/fixtures.go +++ /dev/null @@ -1,154 +0,0 @@ -package users - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func mockListResponse(t *testing.T) { - th.Mux.HandleFunc("/users", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "users":[ - { - "id": "u1000", - "username": "jqsmith", - "email": "john.smith@example.org", - "enabled": true - }, - { - "id": "u1001", - "username": "jqsmith", - "email": "jane.smith@example.org", - "enabled": true - } - ] -} - `) - }) -} - -func mockCreateUser(t *testing.T) { - th.Mux.HandleFunc("/users", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "user": { - "username": "new_user", - "enabled": false, - "email": "new_user@foo.com", - "OS-KSADM:password": "foo" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "user": { - "RAX-AUTH:defaultRegion": "DFW", - "RAX-AUTH:domainId": "5830280", - "id": "123456", - "username": "new_user", - "email": "new_user@foo.com", - "enabled": false - } -} -`) - }) -} - -func mockGetUser(t *testing.T) { - th.Mux.HandleFunc("/users/new_user", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "user": { - "RAX-AUTH:defaultRegion": "DFW", - "RAX-AUTH:domainId": "5830280", - "RAX-AUTH:multiFactorEnabled": "true", - "id": "c39e3de9be2d4c779f1dfd6abacc176d", - "username": "jqsmith", - "email": "john.smith@example.org", - "enabled": true - } -} -`) - }) -} - -func mockUpdateUser(t *testing.T) { - th.Mux.HandleFunc("/users/c39e3de9be2d4c779f1dfd6abacc176d", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "user": { - "email": "new_email@foo.com", - "enabled": true - } -} -`) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "user": { - "RAX-AUTH:defaultRegion": "DFW", - "RAX-AUTH:domainId": "5830280", - "RAX-AUTH:multiFactorEnabled": "true", - "id": "123456", - "username": "jqsmith", - "email": "new_email@foo.com", - "enabled": true - } -} -`) - }) -} - -func mockDeleteUser(t *testing.T) { - th.Mux.HandleFunc("/users/c39e3de9be2d4c779f1dfd6abacc176d", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusNoContent) - }) -} - -func mockResetAPIKey(t *testing.T) { - th.Mux.HandleFunc("/users/99/OS-KSADM/credentials/RAX-KSKEY:apiKeyCredentials/RAX-AUTH/reset", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, ` -{ - "RAX-KSKEY:apiKeyCredentials": { - "username": "joesmith", - "apiKey": "mooH1eiLahd5ahYood7r" - } -}`) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/results.go deleted file mode 100644 index 6936ecba8..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/results.go +++ /dev/null @@ -1,129 +0,0 @@ -package users - -import ( - "strconv" - - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/identity/v2/users" - - "github.com/mitchellh/mapstructure" -) - -// User represents a user resource that exists on the API. -type User struct { - // The UUID for this user. - ID string - - // The human name for this user. - Name string - - // The username for this user. - Username string - - // Indicates whether the user is enabled (true) or disabled (false). - Enabled bool - - // The email address for this user. - Email string - - // The ID of the tenant to which this user belongs. - TenantID string `mapstructure:"tenant_id"` - - // Specifies the default region for the user account. This value is inherited - // from the user administrator when the account is created. - DefaultRegion string `mapstructure:"RAX-AUTH:defaultRegion"` - - // Identifies the domain that contains the user account. This value is - // inherited from the user administrator when the account is created. - DomainID string `mapstructure:"RAX-AUTH:domainId"` - - // The password value that the user needs for authentication. If the Add user - // request included a password value, this attribute is not included in the - // response. - Password string `mapstructure:"OS-KSADM:password"` - - // Indicates whether the user has enabled multi-factor authentication. - MultiFactorEnabled bool `mapstructure:"RAX-AUTH:multiFactorEnabled"` -} - -// CreateResult represents the result of a Create operation -type CreateResult struct { - os.CreateResult -} - -// GetResult represents the result of a Get operation -type GetResult struct { - os.GetResult -} - -// UpdateResult represents the result of an Update operation -type UpdateResult struct { - os.UpdateResult -} - -func commonExtract(resp interface{}, err error) (*User, error) { - if err != nil { - return nil, err - } - - var respStruct struct { - User *User `json:"user"` - } - - // Since the API returns a string instead of a bool, we need to hack the JSON - json := resp.(map[string]interface{}) - user := json["user"].(map[string]interface{}) - if s, ok := user["RAX-AUTH:multiFactorEnabled"].(string); ok && s != "" { - if b, err := strconv.ParseBool(s); err == nil { - user["RAX-AUTH:multiFactorEnabled"] = b - } - } - - err = mapstructure.Decode(json, &respStruct) - - return respStruct.User, err -} - -// Extract will get the Snapshot object out of the GetResult object. -func (r GetResult) Extract() (*User, error) { - return commonExtract(r.Body, r.Err) -} - -// Extract will get the Snapshot object out of the CreateResult object. -func (r CreateResult) Extract() (*User, error) { - return commonExtract(r.Body, r.Err) -} - -// Extract will get the Snapshot object out of the UpdateResult object. -func (r UpdateResult) Extract() (*User, error) { - return commonExtract(r.Body, r.Err) -} - -// ResetAPIKeyResult represents the server response to the ResetAPIKey method. -type ResetAPIKeyResult struct { - gophercloud.Result -} - -// ResetAPIKeyValue represents an API Key that has been reset. -type ResetAPIKeyValue struct { - // The Username for this API Key reset. - Username string `mapstructure:"username"` - - // The new API Key for this user. - APIKey string `mapstructure:"apiKey"` -} - -// Extract will get the Error or ResetAPIKeyValue object out of the ResetAPIKeyResult object. -func (r ResetAPIKeyResult) Extract() (*ResetAPIKeyValue, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - ResetAPIKeyValue ResetAPIKeyValue `mapstructure:"RAX-KSKEY:apiKeyCredentials"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.ResetAPIKeyValue, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/urls.go deleted file mode 100644 index bc1aaefb0..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/urls.go +++ /dev/null @@ -1,7 +0,0 @@ -package users - -import "github.com/rackspace/gophercloud" - -func resetAPIKeyURL(client *gophercloud.ServiceClient, id string) string { - return client.ServiceURL("users", id, "OS-KSADM", "credentials", "RAX-KSKEY:apiKeyCredentials", "RAX-AUTH", "reset") -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/doc.go deleted file mode 100644 index 42325fe83..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/doc.go +++ /dev/null @@ -1,12 +0,0 @@ -/* -Package acl provides information and interaction with the access lists feature -of the Rackspace Cloud Load Balancer service. - -The access list management feature allows fine-grained network access controls -to be applied to the load balancer's virtual IP address. A single IP address, -multiple IP addresses, or entire network subnets can be added. Items that are -configured with the ALLOW type always takes precedence over items with the DENY -type. To reject traffic from all items except for those with the ALLOW type, -add a networkItem with an address of "0.0.0.0/0" and a DENY type. -*/ -package acl diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/fixtures.go deleted file mode 100644 index e3c941c81..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/fixtures.go +++ /dev/null @@ -1,109 +0,0 @@ -package acl - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(lbID int) string { - return "/loadbalancers/" + strconv.Itoa(lbID) + "/accesslist" -} - -func mockListResponse(t *testing.T, id int) { - th.Mux.HandleFunc(_rootURL(id), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "accessList": [ - { - "address": "206.160.163.21", - "id": 21, - "type": "DENY" - }, - { - "address": "206.160.163.22", - "id": 22, - "type": "DENY" - }, - { - "address": "206.160.163.23", - "id": 23, - "type": "DENY" - }, - { - "address": "206.160.163.24", - "id": 24, - "type": "DENY" - } - ] -} - `) - }) -} - -func mockCreateResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "accessList": [ - { - "address": "206.160.163.21", - "type": "DENY" - }, - { - "address": "206.160.165.11", - "type": "DENY" - } - ] -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDeleteAllResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockBatchDeleteResponse(t *testing.T, lbID int, ids []int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - r.ParseForm() - - for k, v := range ids { - fids := r.Form["id"] - th.AssertEquals(t, strconv.Itoa(v), fids[k]) - } - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDeleteResponse(t *testing.T, lbID, networkID int) { - th.Mux.HandleFunc(_rootURL(lbID)+"/"+strconv.Itoa(networkID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/requests.go deleted file mode 100644 index d4ce7c01f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/requests.go +++ /dev/null @@ -1,111 +0,0 @@ -package acl - -import ( - "errors" - "fmt" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List is the operation responsible for returning a paginated collection of -// network items that define a load balancer's access list. -func List(client *gophercloud.ServiceClient, lbID int) pagination.Pager { - url := rootURL(client, lbID) - - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return AccessListPage{pagination.SinglePageBase(r)} - }) -} - -// CreateOptsBuilder is the interface responsible for generating the JSON -// for a Create operation. -type CreateOptsBuilder interface { - ToAccessListCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is a slice of CreateOpt structs, that allow the user to create -// multiple nodes in a single operation (one node per CreateOpt). -type CreateOpts []CreateOpt - -// CreateOpt represents the options to create a single node. -type CreateOpt struct { - // Required - the IP address or CIDR for item to add to access list. - Address string - - // Required - the type of the node. Either ALLOW or DENY. - Type Type -} - -// ToAccessListCreateMap converts a slice of options into a map that can be -// used for the JSON. -func (opts CreateOpts) ToAccessListCreateMap() (map[string]interface{}, error) { - type itemMap map[string]interface{} - items := []itemMap{} - - for k, v := range opts { - if v.Address == "" { - return itemMap{}, fmt.Errorf("Address is a required attribute, none provided for %d CreateOpt element", k) - } - if v.Type != ALLOW && v.Type != DENY { - return itemMap{}, fmt.Errorf("Type must be ALLOW or DENY") - } - - item := make(itemMap) - item["address"] = v.Address - item["type"] = v.Type - - items = append(items, item) - } - - return itemMap{"accessList": items}, nil -} - -// Create is the operation responsible for adding network items to the access -// rules for a particular load balancer. If network items already exist, the -// new item will be appended. A single IP address or subnet range is considered -// unique and cannot be duplicated. -func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToAccessListCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(rootURL(client, loadBalancerID), reqBody, nil, nil) - return res -} - -// BulkDelete will delete multiple network items from a load balancer's access -// list in a single operation. -func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, itemIDs []int) DeleteResult { - var res DeleteResult - - if len(itemIDs) > 10 || len(itemIDs) == 0 { - res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 item IDs") - return res - } - - url := rootURL(c, loadBalancerID) - url += gophercloud.IDSliceToQueryString("id", itemIDs) - - _, res.Err = c.Delete(url, nil) - return res -} - -// Delete will remove a single network item from a load balancer's access list. -func Delete(c *gophercloud.ServiceClient, lbID, itemID int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(resourceURL(c, lbID, itemID), nil) - return res -} - -// DeleteAll will delete the entire contents of a load balancer's access list, -// effectively resetting it and allowing all traffic. -func DeleteAll(c *gophercloud.ServiceClient, lbID int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(rootURL(c, lbID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/results.go deleted file mode 100644 index 9ea5ea2f4..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/results.go +++ /dev/null @@ -1,72 +0,0 @@ -package acl - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// AccessList represents the rules of network access to a particular load -// balancer. -type AccessList []NetworkItem - -// NetworkItem describes how an IP address or entire subnet may interact with a -// load balancer. -type NetworkItem struct { - // The IP address or subnet (CIDR) that defines the network item. - Address string - - // The numeric unique ID for this item. - ID int - - // Either ALLOW or DENY. - Type Type -} - -// Type defines how an item may connect to the load balancer. -type Type string - -// Convenience consts. -const ( - ALLOW Type = "ALLOW" - DENY Type = "DENY" -) - -// AccessListPage is the page returned by a pager for traversing over a -// collection of network items in an access list. -type AccessListPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an AccessListPage struct is empty. -func (p AccessListPage) IsEmpty() (bool, error) { - is, err := ExtractAccessList(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractAccessList accepts a Page struct, specifically an AccessListPage -// struct, and extracts the elements into a slice of NetworkItem structs. In -// other words, a generic collection is mapped into a relevant slice. -func ExtractAccessList(page pagination.Page) (AccessList, error) { - var resp struct { - List AccessList `mapstructure:"accessList" json:"accessList"` - } - - err := mapstructure.Decode(page.(AccessListPage).Body, &resp) - - return resp.List, err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - gophercloud.ErrResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/urls.go deleted file mode 100644 index e373fa1d8..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/acl/urls.go +++ /dev/null @@ -1,20 +0,0 @@ -package acl - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - path = "loadbalancers" - aclPath = "accesslist" -) - -func resourceURL(c *gophercloud.ServiceClient, lbID, networkID int) string { - return c.ServiceURL(path, strconv.Itoa(lbID), aclPath, strconv.Itoa(networkID)) -} - -func rootURL(c *gophercloud.ServiceClient, lbID int) string { - return c.ServiceURL(path, strconv.Itoa(lbID), aclPath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/doc.go deleted file mode 100644 index 05f003285..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/doc.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Package lbs provides information and interaction with the Load Balancer API -resource for the Rackspace Cloud Load Balancer service. - -A load balancer is a logical device which belongs to a cloud account. It is -used to distribute workloads between multiple back-end systems or services, -based on the criteria defined as part of its configuration. This configuration -is defined using the Create operation, and can be updated with Update. - -To conserve IPv4 address space, it is highly recommended that you share Virtual -IPs between load balancers. If you have at least one load balancer, you may -create subsequent ones that share a single virtual IPv4 and/or a single IPv6 by -passing in a virtual IP ID to the Update operation (instead of a type). This -feature is also highly desirable if you wish to load balance both an insecure -and secure protocol using one IP or DNS name. In order to share a virtual IP, -each Load Balancer must utilize a unique port. - -All load balancers have a Status attribute that shows the current configuration -status of the device. This status is immutable by the caller and is updated -automatically based on state changes within the service. When a load balancer -is first created, it is placed into a BUILD state while the configuration is -being generated and applied based on the request. Once the configuration is -applied and finalized, it is in an ACTIVE status. In the event of a -configuration change or update, the status of the load balancer changes to -PENDING_UPDATE to signify configuration changes are in progress but have not yet -been finalized. Load balancers in a SUSPENDED status are configured to reject -traffic and do not forward requests to back-end nodes. - -An HTTP load balancer has the X-Forwarded-For (XFF) HTTP header set by default. -This header contains the originating IP address of a client connecting to a web -server through an HTTP proxy or load balancer, which many web applications are -already designed to use when determining the source address for a request. - -It also includes the X-Forwarded-Proto (XFP) HTTP header, which has been added -for identifying the originating protocol of an HTTP request as "http" or -"https" depending on which protocol the client requested. This is useful when -using SSL termination. - -Finally, it also includes the X-Forwarded-Port HTTP header, which has been -added for being able to generate secure URLs containing the specified port. -This header, along with the X-Forwarded-For header, provides the needed -information to the underlying application servers. -*/ -package lbs diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/fixtures.go deleted file mode 100644 index 6325310db..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/fixtures.go +++ /dev/null @@ -1,584 +0,0 @@ -package lbs - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func mockListLBResponse(t *testing.T) { - th.Mux.HandleFunc("/loadbalancers", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "loadBalancers":[ - { - "name":"lb-site1", - "id":71, - "protocol":"HTTP", - "port":80, - "algorithm":"RANDOM", - "status":"ACTIVE", - "nodeCount":3, - "virtualIps":[ - { - "id":403, - "address":"206.55.130.1", - "type":"PUBLIC", - "ipVersion":"IPV4" - } - ], - "created":{ - "time":"2010-11-30T03:23:42Z" - }, - "updated":{ - "time":"2010-11-30T03:23:44Z" - } - }, - { - "name":"lb-site2", - "id":72, - "created":{ - "time":"2011-11-30T03:23:42Z" - }, - "updated":{ - "time":"2011-11-30T03:23:44Z" - } - }, - { - "name":"lb-site3", - "id":73, - "created":{ - "time":"2012-11-30T03:23:42Z" - }, - "updated":{ - "time":"2012-11-30T03:23:44Z" - } - } - ] -} - `) - }) -} - -func mockCreateLBResponse(t *testing.T) { - th.Mux.HandleFunc("/loadbalancers", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "loadBalancer": { - "name": "a-new-loadbalancer", - "port": 80, - "protocol": "HTTP", - "virtualIps": [ - { - "id": 2341 - }, - { - "id": 900001 - } - ], - "nodes": [ - { - "address": "10.1.1.1", - "port": 80, - "condition": "ENABLED" - } - ] - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - - fmt.Fprintf(w, ` -{ - "loadBalancer": { - "name": "a-new-loadbalancer", - "id": 144, - "protocol": "HTTP", - "halfClosed": false, - "port": 83, - "algorithm": "RANDOM", - "status": "BUILD", - "timeout": 30, - "cluster": { - "name": "ztm-n01.staging1.lbaas.rackspace.net" - }, - "nodes": [ - { - "address": "10.1.1.1", - "id": 653, - "port": 80, - "status": "ONLINE", - "condition": "ENABLED", - "weight": 1 - } - ], - "virtualIps": [ - { - "address": "206.10.10.210", - "id": 39, - "type": "PUBLIC", - "ipVersion": "IPV4" - }, - { - "address": "2001:4801:79f1:0002:711b:be4c:0000:0021", - "id": 900001, - "type": "PUBLIC", - "ipVersion": "IPV6" - } - ], - "created": { - "time": "2010-11-30T03:23:42Z" - }, - "updated": { - "time": "2010-11-30T03:23:44Z" - }, - "connectionLogging": { - "enabled": false - } - } -} - `) - }) -} - -func mockBatchDeleteLBResponse(t *testing.T, ids []int) { - th.Mux.HandleFunc("/loadbalancers", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - r.ParseForm() - - for k, v := range ids { - fids := r.Form["id"] - th.AssertEquals(t, strconv.Itoa(v), fids[k]) - } - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDeleteLBResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockGetLBResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "loadBalancer": { - "id": 2000, - "name": "sample-loadbalancer", - "protocol": "HTTP", - "port": 80, - "algorithm": "RANDOM", - "status": "ACTIVE", - "timeout": 30, - "connectionLogging": { - "enabled": true - }, - "virtualIps": [ - { - "id": 1000, - "address": "206.10.10.210", - "type": "PUBLIC", - "ipVersion": "IPV4" - } - ], - "nodes": [ - { - "id": 1041, - "address": "10.1.1.1", - "port": 80, - "condition": "ENABLED", - "status": "ONLINE" - }, - { - "id": 1411, - "address": "10.1.1.2", - "port": 80, - "condition": "ENABLED", - "status": "ONLINE" - } - ], - "sessionPersistence": { - "persistenceType": "HTTP_COOKIE" - }, - "connectionThrottle": { - "maxConnections": 100 - }, - "cluster": { - "name": "c1.dfw1" - }, - "created": { - "time": "2010-11-30T03:23:42Z" - }, - "updated": { - "time": "2010-11-30T03:23:44Z" - }, - "sourceAddresses": { - "ipv6Public": "2001:4801:79f1:1::1/64", - "ipv4Servicenet": "10.0.0.0", - "ipv4Public": "10.12.99.28" - } - } -} - `) - }) -} - -func mockUpdateLBResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "loadBalancer": { - "name": "a-new-loadbalancer", - "protocol": "TCP", - "halfClosed": true, - "algorithm": "RANDOM", - "port": 8080, - "timeout": 100, - "httpsRedirect": false - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockListProtocolsResponse(t *testing.T) { - th.Mux.HandleFunc("/loadbalancers/protocols", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "protocols": [ - { - "name": "DNS_TCP", - "port": 53 - }, - { - "name": "DNS_UDP", - "port": 53 - }, - { - "name": "FTP", - "port": 21 - }, - { - "name": "HTTP", - "port": 80 - }, - { - "name": "HTTPS", - "port": 443 - }, - { - "name": "IMAPS", - "port": 993 - }, - { - "name": "IMAPv4", - "port": 143 - }, - { - "name": "LDAP", - "port": 389 - }, - { - "name": "LDAPS", - "port": 636 - }, - { - "name": "MYSQL", - "port": 3306 - }, - { - "name": "POP3", - "port": 110 - }, - { - "name": "POP3S", - "port": 995 - }, - { - "name": "SMTP", - "port": 25 - }, - { - "name": "TCP", - "port": 0 - }, - { - "name": "TCP_CLIENT_FIRST", - "port": 0 - }, - { - "name": "UDP", - "port": 0 - }, - { - "name": "UDP_STREAM", - "port": 0 - }, - { - "name": "SFTP", - "port": 22 - }, - { - "name": "TCP_STREAM", - "port": 0 - } - ] -} - `) - }) -} - -func mockListAlgorithmsResponse(t *testing.T) { - th.Mux.HandleFunc("/loadbalancers/algorithms", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "algorithms": [ - { - "name": "LEAST_CONNECTIONS" - }, - { - "name": "RANDOM" - }, - { - "name": "ROUND_ROBIN" - }, - { - "name": "WEIGHTED_LEAST_CONNECTIONS" - }, - { - "name": "WEIGHTED_ROUND_ROBIN" - } - ] -} - `) - }) -} - -func mockGetLoggingResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/connectionlogging", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "connectionLogging": { - "enabled": true - } -} - `) - }) -} - -func mockEnableLoggingResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/connectionlogging", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "connectionLogging":{ - "enabled":true - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDisableLoggingResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/connectionlogging", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "connectionLogging":{ - "enabled":false - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockGetErrorPageResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/errorpage", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "errorpage": { - "content": "DEFAULT ERROR PAGE" - } -} - `) - }) -} - -func mockSetErrorPageResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/errorpage", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "errorpage": { - "content": "New error page" - } -} - `) - - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "errorpage": { - "content": "New error page" - } -} - `) - }) -} - -func mockDeleteErrorPageResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/errorpage", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusOK) - }) -} - -func mockGetStatsResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/stats", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "connectTimeOut": 10, - "connectError": 20, - "connectFailure": 30, - "dataTimedOut": 40, - "keepAliveTimedOut": 50, - "maxConn": 60, - "currentConn": 40, - "connectTimeOutSsl": 10, - "connectErrorSsl": 20, - "connectFailureSsl": 30, - "dataTimedOutSsl": 40, - "keepAliveTimedOutSsl": 50, - "maxConnSsl": 60, - "currentConnSsl": 40 -} - `) - }) -} - -func mockGetCachingResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/contentcaching", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "contentCaching": { - "enabled": true - } -} - `) - }) -} - -func mockEnableCachingResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/contentcaching", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "contentCaching":{ - "enabled":true - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDisableCachingResponse(t *testing.T, id int) { - th.Mux.HandleFunc("/loadbalancers/"+strconv.Itoa(id)+"/contentcaching", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "contentCaching":{ - "enabled":false - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/requests.go deleted file mode 100644 index 46f5f02a4..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/requests.go +++ /dev/null @@ -1,497 +0,0 @@ -package lbs - -import ( - "errors" - - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - "github.com/rackspace/gophercloud/rackspace/lb/v1/acl" - "github.com/rackspace/gophercloud/rackspace/lb/v1/monitors" - "github.com/rackspace/gophercloud/rackspace/lb/v1/nodes" - "github.com/rackspace/gophercloud/rackspace/lb/v1/sessions" - "github.com/rackspace/gophercloud/rackspace/lb/v1/throttle" - "github.com/rackspace/gophercloud/rackspace/lb/v1/vips" -) - -var ( - errNameRequired = errors.New("Name is a required attribute") - errTimeoutExceeded = errors.New("Timeout must be less than 120") -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToLBListQuery() (string, error) -} - -// ListOpts allows the filtering and sorting of paginated collections through -// the API. -type ListOpts struct { - ChangesSince string `q:"changes-since"` - Status Status `q:"status"` - NodeAddr string `q:"nodeaddress"` - Marker string `q:"marker"` - Limit int `q:"limit"` -} - -// ToLBListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToLBListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// List is the operation responsible for returning a paginated collection of -// load balancers. You may pass in a ListOpts struct to filter results. -func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(client) - if opts != nil { - query, err := opts.ToLBListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return LBPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type CreateOptsBuilder interface { - ToLBCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // Required - name of the load balancer to create. The name must be 128 - // characters or fewer in length, and all UTF-8 characters are valid. - Name string - - // Optional - nodes to be added. - Nodes []nodes.Node - - // Required - protocol of the service that is being load balanced. - // See http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/protocols.html - // for a full list of supported protocols. - Protocol string - - // Optional - enables or disables Half-Closed support for the load balancer. - // Half-Closed support provides the ability for one end of the connection to - // terminate its output, while still receiving data from the other end. Only - // available for TCP/TCP_CLIENT_FIRST protocols. - HalfClosed gophercloud.EnabledState - - // Optional - the type of virtual IPs you want associated with the load - // balancer. - VIPs []vips.VIP - - // Optional - the access list management feature allows fine-grained network - // access controls to be applied to the load balancer virtual IP address. - AccessList *acl.AccessList - - // Optional - algorithm that defines how traffic should be directed between - // back-end nodes. - Algorithm string - - // Optional - current connection logging configuration. - ConnectionLogging *ConnectionLogging - - // Optional - specifies a limit on the number of connections per IP address - // to help mitigate malicious or abusive traffic to your applications. - ConnThrottle *throttle.ConnectionThrottle - - // Optional - the type of health monitor check to perform to ensure that the - // service is performing properly. - HealthMonitor *monitors.Monitor - - // Optional - arbitrary information that can be associated with each LB. - Metadata map[string]interface{} - - // Optional - port number for the service you are load balancing. - Port int - - // Optional - the timeout value for the load balancer and communications with - // its nodes. Defaults to 30 seconds with a maximum of 120 seconds. - Timeout int - - // Optional - specifies whether multiple requests from clients are directed - // to the same node. - SessionPersistence *sessions.SessionPersistence - - // Optional - enables or disables HTTP to HTTPS redirection for the load - // balancer. When enabled, any HTTP request returns status code 301 (Moved - // Permanently), and the requester is redirected to the requested URL via the - // HTTPS protocol on port 443. For example, http://example.com/page.html - // would be redirected to https://example.com/page.html. Only available for - // HTTPS protocol (port=443), or HTTP protocol with a properly configured SSL - // termination (secureTrafficOnly=true, securePort=443). - HTTPSRedirect gophercloud.EnabledState -} - -// ToLBCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToLBCreateMap() (map[string]interface{}, error) { - lb := make(map[string]interface{}) - - if opts.Name == "" { - return lb, errNameRequired - } - if opts.Timeout > 120 { - return lb, errTimeoutExceeded - } - - lb["name"] = opts.Name - - if len(opts.Nodes) > 0 { - nodes := []map[string]interface{}{} - for _, n := range opts.Nodes { - nodes = append(nodes, map[string]interface{}{ - "address": n.Address, - "port": n.Port, - "condition": n.Condition, - }) - } - lb["nodes"] = nodes - } - - if opts.Protocol != "" { - lb["protocol"] = opts.Protocol - } - if opts.HalfClosed != nil { - lb["halfClosed"] = opts.HalfClosed - } - if len(opts.VIPs) > 0 { - lb["virtualIps"] = opts.VIPs - } - if opts.AccessList != nil { - lb["accessList"] = &opts.AccessList - } - if opts.Algorithm != "" { - lb["algorithm"] = opts.Algorithm - } - if opts.ConnectionLogging != nil { - lb["connectionLogging"] = &opts.ConnectionLogging - } - if opts.ConnThrottle != nil { - lb["connectionThrottle"] = &opts.ConnThrottle - } - if opts.HealthMonitor != nil { - lb["healthMonitor"] = &opts.HealthMonitor - } - if len(opts.Metadata) != 0 { - lb["metadata"] = opts.Metadata - } - if opts.Port > 0 { - lb["port"] = opts.Port - } - if opts.Timeout > 0 { - lb["timeout"] = opts.Timeout - } - if opts.SessionPersistence != nil { - lb["sessionPersistence"] = &opts.SessionPersistence - } - if opts.HTTPSRedirect != nil { - lb["httpsRedirect"] = &opts.HTTPSRedirect - } - - return map[string]interface{}{"loadBalancer": lb}, nil -} - -// Create is the operation responsible for asynchronously provisioning a new -// load balancer based on the configuration defined in CreateOpts. Once the -// request is validated and progress has started on the provisioning process, a -// response struct is returned. When extracted (with Extract()), you have -// to the load balancer's unique ID and status. -// -// Once an ID is attained, you can check on the progress of the operation by -// calling Get and passing in the ID. If the corresponding request cannot be -// fulfilled due to insufficient or invalid data, an HTTP 400 (Bad Request) -// error response is returned with information regarding the nature of the -// failure in the body of the response. Failures in the validation process are -// non-recoverable and require the caller to correct the cause of the failure. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToLBCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get is the operation responsible for providing detailed information -// regarding a specific load balancer which is configured and associated with -// your account. This operation is not capable of returning details for a load -// balancer which has been deleted. -func Get(c *gophercloud.ServiceClient, id int) GetResult { - var res GetResult - - _, res.Err = c.Get(resourceURL(c, id), &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} - -// BulkDelete removes all the load balancers referenced in the slice of IDs. -// Any and all configuration data associated with these load balancers is -// immediately purged and is not recoverable. -// -// If one of the items in the list cannot be removed due to its current status, -// a 400 Bad Request error is returned along with the IDs of the ones the -// system identified as potential failures for this request. -func BulkDelete(c *gophercloud.ServiceClient, ids []int) DeleteResult { - var res DeleteResult - - if len(ids) > 10 || len(ids) == 0 { - res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 LB IDs") - return res - } - - url := rootURL(c) - url += gophercloud.IDSliceToQueryString("id", ids) - - _, res.Err = c.Delete(url, nil) - return res -} - -// Delete removes a single load balancer. -func Delete(c *gophercloud.ServiceClient, id int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(resourceURL(c, id), nil) - return res -} - -// UpdateOptsBuilder represents a type that can be converted into a JSON-like -// map structure. -type UpdateOptsBuilder interface { - ToLBUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts represents the options for updating an existing load balancer. -type UpdateOpts struct { - // Optional - new name of the load balancer. - Name string - - // Optional - the new protocol you want your load balancer to have. - // See http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/protocols.html - // for a full list of supported protocols. - Protocol string - - // Optional - see the HalfClosed field in CreateOpts for more information. - HalfClosed gophercloud.EnabledState - - // Optional - see the Algorithm field in CreateOpts for more information. - Algorithm string - - // Optional - see the Port field in CreateOpts for more information. - Port int - - // Optional - see the Timeout field in CreateOpts for more information. - Timeout int - - // Optional - see the HTTPSRedirect field in CreateOpts for more information. - HTTPSRedirect gophercloud.EnabledState -} - -// ToLBUpdateMap casts an UpdateOpts struct to a map. -func (opts UpdateOpts) ToLBUpdateMap() (map[string]interface{}, error) { - lb := make(map[string]interface{}) - - if opts.Name != "" { - lb["name"] = opts.Name - } - if opts.Protocol != "" { - lb["protocol"] = opts.Protocol - } - if opts.HalfClosed != nil { - lb["halfClosed"] = opts.HalfClosed - } - if opts.Algorithm != "" { - lb["algorithm"] = opts.Algorithm - } - if opts.Port > 0 { - lb["port"] = opts.Port - } - if opts.Timeout > 0 { - lb["timeout"] = opts.Timeout - } - if opts.HTTPSRedirect != nil { - lb["httpsRedirect"] = &opts.HTTPSRedirect - } - - return map[string]interface{}{"loadBalancer": lb}, nil -} - -// Update is the operation responsible for asynchronously updating the -// attributes of a specific load balancer. Upon successful validation of the -// request, the service returns a 202 Accepted response, and the load balancer -// enters a PENDING_UPDATE state. A user can poll the load balancer with Get to -// wait for the changes to be applied. When this happens, the load balancer will -// return to an ACTIVE state. -func Update(c *gophercloud.ServiceClient, id int, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToLBUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(resourceURL(c, id), reqBody, nil, nil) - return res -} - -// ListProtocols is the operation responsible for returning a paginated -// collection of load balancer protocols. -func ListProtocols(client *gophercloud.ServiceClient) pagination.Pager { - url := protocolsURL(client) - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return ProtocolPage{pagination.SinglePageBase(r)} - }) -} - -// ListAlgorithms is the operation responsible for returning a paginated -// collection of load balancer algorithms. -func ListAlgorithms(client *gophercloud.ServiceClient) pagination.Pager { - url := algorithmsURL(client) - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return AlgorithmPage{pagination.SinglePageBase(r)} - }) -} - -// IsLoggingEnabled returns true if the load balancer has connection logging -// enabled and false if not. -func IsLoggingEnabled(client *gophercloud.ServiceClient, id int) (bool, error) { - var body interface{} - - _, err := client.Get(loggingURL(client, id), &body, nil) - if err != nil { - return false, err - } - - var resp struct { - CL struct { - Enabled bool `mapstructure:"enabled"` - } `mapstructure:"connectionLogging"` - } - - err = mapstructure.Decode(body, &resp) - return resp.CL.Enabled, err -} - -func toConnLoggingMap(state bool) map[string]map[string]bool { - return map[string]map[string]bool{ - "connectionLogging": map[string]bool{"enabled": state}, - } -} - -// EnableLogging will enable connection logging for a specified load balancer. -func EnableLogging(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult { - var res gophercloud.ErrResult - _, res.Err = client.Put(loggingURL(client, id), toConnLoggingMap(true), nil, nil) - return res -} - -// DisableLogging will disable connection logging for a specified load balancer. -func DisableLogging(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult { - var res gophercloud.ErrResult - _, res.Err = client.Put(loggingURL(client, id), toConnLoggingMap(false), nil, nil) - return res -} - -// GetErrorPage will retrieve the current error page for the load balancer. -func GetErrorPage(client *gophercloud.ServiceClient, id int) ErrorPageResult { - var res ErrorPageResult - _, res.Err = client.Get(errorPageURL(client, id), &res.Body, nil) - return res -} - -// SetErrorPage will set the HTML of the load balancer's error page to a -// specific value. -func SetErrorPage(client *gophercloud.ServiceClient, id int, html string) ErrorPageResult { - var res ErrorPageResult - - type stringMap map[string]string - reqBody := map[string]stringMap{"errorpage": stringMap{"content": html}} - - _, res.Err = client.Put(errorPageURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} - -// DeleteErrorPage will delete the current error page for the load balancer. -func DeleteErrorPage(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult { - var res gophercloud.ErrResult - _, res.Err = client.Delete(errorPageURL(client, id), &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// GetStats will retrieve detailed stats related to the load balancer's usage. -func GetStats(client *gophercloud.ServiceClient, id int) StatsResult { - var res StatsResult - _, res.Err = client.Get(statsURL(client, id), &res.Body, nil) - return res -} - -// IsContentCached will check to see whether the specified load balancer caches -// content. When content caching is enabled, recently-accessed files are stored -// on the load balancer for easy retrieval by web clients. Content caching -// improves the performance of high traffic web sites by temporarily storing -// data that was recently accessed. While it's cached, requests for that data -// are served by the load balancer, which in turn reduces load off the back-end -// nodes. The result is improved response times for those requests and less -// load on the web server. -func IsContentCached(client *gophercloud.ServiceClient, id int) (bool, error) { - var body interface{} - - _, err := client.Get(cacheURL(client, id), &body, nil) - if err != nil { - return false, err - } - - var resp struct { - CC struct { - Enabled bool `mapstructure:"enabled"` - } `mapstructure:"contentCaching"` - } - - err = mapstructure.Decode(body, &resp) - return resp.CC.Enabled, err -} - -func toCachingMap(state bool) map[string]map[string]bool { - return map[string]map[string]bool{ - "contentCaching": map[string]bool{"enabled": state}, - } -} - -// EnableCaching will enable content-caching for the specified load balancer. -func EnableCaching(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult { - var res gophercloud.ErrResult - _, res.Err = client.Put(cacheURL(client, id), toCachingMap(true), nil, nil) - return res -} - -// DisableCaching will disable content-caching for the specified load balancer. -func DisableCaching(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult { - var res gophercloud.ErrResult - _, res.Err = client.Put(cacheURL(client, id), toCachingMap(false), nil, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/results.go deleted file mode 100644 index 98f3962d7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/results.go +++ /dev/null @@ -1,420 +0,0 @@ -package lbs - -import ( - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - "github.com/rackspace/gophercloud/rackspace/lb/v1/acl" - "github.com/rackspace/gophercloud/rackspace/lb/v1/nodes" - "github.com/rackspace/gophercloud/rackspace/lb/v1/sessions" - "github.com/rackspace/gophercloud/rackspace/lb/v1/throttle" - "github.com/rackspace/gophercloud/rackspace/lb/v1/vips" -) - -// Protocol represents the network protocol which the load balancer accepts. -type Protocol struct { - // The name of the protocol, e.g. HTTP, LDAP, FTP, etc. - Name string - - // The port number for the protocol. - Port int -} - -// Algorithm defines how traffic should be directed between back-end nodes. -type Algorithm struct { - // The name of the algorithm, e.g RANDOM, ROUND_ROBIN, etc. - Name string -} - -// Status represents the potential state of a load balancer resource. -type Status string - -const ( - // ACTIVE indicates that the LB is configured properly and ready to serve - // traffic to incoming requests via the configured virtual IPs. - ACTIVE Status = "ACTIVE" - - // BUILD indicates that the LB is being provisioned for the first time and - // configuration is being applied to bring the service online. The service - // cannot yet serve incoming requests. - BUILD Status = "BUILD" - - // PENDINGUPDATE indicates that the LB is online but configuration changes - // are being applied to update the service based on a previous request. - PENDINGUPDATE Status = "PENDING_UPDATE" - - // PENDINGDELETE indicates that the LB is online but configuration changes - // are being applied to begin deletion of the service based on a previous - // request. - PENDINGDELETE Status = "PENDING_DELETE" - - // SUSPENDED indicates that the LB has been taken offline and disabled. - SUSPENDED Status = "SUSPENDED" - - // ERROR indicates that the system encountered an error when attempting to - // configure the load balancer. - ERROR Status = "ERROR" - - // DELETED indicates that the LB has been deleted. - DELETED Status = "DELETED" -) - -// Datetime represents the structure of a Created or Updated field. -type Datetime struct { - Time time.Time `mapstructure:"-"` -} - -// LoadBalancer represents a load balancer API resource. -type LoadBalancer struct { - // Human-readable name for the load balancer. - Name string - - // The unique ID for the load balancer. - ID int - - // Represents the service protocol being load balanced. See Protocol type for - // a list of accepted values. - // See http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/protocols.html - // for a full list of supported protocols. - Protocol string - - // Defines how traffic should be directed between back-end nodes. The default - // algorithm is RANDOM. See Algorithm type for a list of accepted values. - Algorithm string - - // The current status of the load balancer. - Status Status - - // The number of load balancer nodes. - NodeCount int `mapstructure:"nodeCount"` - - // Slice of virtual IPs associated with this load balancer. - VIPs []vips.VIP `mapstructure:"virtualIps"` - - // Datetime when the LB was created. - Created Datetime - - // Datetime when the LB was created. - Updated Datetime - - // Port number for the service you are load balancing. - Port int - - // HalfClosed provides the ability for one end of the connection to - // terminate its output while still receiving data from the other end. This - // is only available on TCP/TCP_CLIENT_FIRST protocols. - HalfClosed bool - - // Timeout represents the timeout value between a load balancer and its - // nodes. Defaults to 30 seconds with a maximum of 120 seconds. - Timeout int - - // The cluster name. - Cluster Cluster - - // Nodes shows all the back-end nodes which are associated with the load - // balancer. These are the devices which are delivered traffic. - Nodes []nodes.Node - - // Current connection logging configuration. - ConnectionLogging ConnectionLogging - - // SessionPersistence specifies whether multiple requests from clients are - // directed to the same node. - SessionPersistence sessions.SessionPersistence - - // ConnectionThrottle specifies a limit on the number of connections per IP - // address to help mitigate malicious or abusive traffic to your applications. - ConnectionThrottle throttle.ConnectionThrottle - - // The source public and private IP addresses. - SourceAddrs SourceAddrs `mapstructure:"sourceAddresses"` - - // Represents the access rules for this particular load balancer. IP addresses - // or subnet ranges, depending on their type (ALLOW or DENY), can be permitted - // or blocked. - AccessList acl.AccessList -} - -// SourceAddrs represents the source public and private IP addresses. -type SourceAddrs struct { - IPv4Public string `json:"ipv4Public" mapstructure:"ipv4Public"` - IPv4Private string `json:"ipv4Servicenet" mapstructure:"ipv4Servicenet"` - IPv6Public string `json:"ipv6Public" mapstructure:"ipv6Public"` - IPv6Private string `json:"ipv6Servicenet" mapstructure:"ipv6Servicenet"` -} - -// ConnectionLogging - temp -type ConnectionLogging struct { - Enabled bool -} - -// Cluster - temp -type Cluster struct { - Name string -} - -// LBPage is the page returned by a pager when traversing over a collection of -// LBs. -type LBPage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks whether a NetworkPage struct is empty. -func (p LBPage) IsEmpty() (bool, error) { - is, err := ExtractLBs(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractLBs accepts a Page struct, specifically a LBPage struct, and extracts -// the elements into a slice of LoadBalancer structs. In other words, a generic -// collection is mapped into a relevant slice. -func ExtractLBs(page pagination.Page) ([]LoadBalancer, error) { - var resp struct { - LBs []LoadBalancer `mapstructure:"loadBalancers" json:"loadBalancers"` - } - - coll := page.(LBPage).Body - err := mapstructure.Decode(coll, &resp) - - s := reflect.ValueOf(coll.(map[string]interface{})["loadBalancers"]) - - for i := 0; i < s.Len(); i++ { - val := (s.Index(i).Interface()).(map[string]interface{}) - - ts, err := extractTS(val, "created") - if err != nil { - return resp.LBs, err - } - resp.LBs[i].Created.Time = ts - - ts, err = extractTS(val, "updated") - if err != nil { - return resp.LBs, err - } - resp.LBs[i].Updated.Time = ts - } - - return resp.LBs, err -} - -func extractTS(body map[string]interface{}, key string) (time.Time, error) { - val := body[key].(map[string]interface{}) - return time.Parse(time.RFC3339, val["time"].(string)) -} - -type commonResult struct { - gophercloud.Result -} - -// Extract interprets any commonResult as a LB, if possible. -func (r commonResult) Extract() (*LoadBalancer, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - LB LoadBalancer `mapstructure:"loadBalancer"` - } - - err := mapstructure.Decode(r.Body, &response) - - json := r.Body.(map[string]interface{}) - lb := json["loadBalancer"].(map[string]interface{}) - - ts, err := extractTS(lb, "created") - if err != nil { - return nil, err - } - response.LB.Created.Time = ts - - ts, err = extractTS(lb, "updated") - if err != nil { - return nil, err - } - response.LB.Updated.Time = ts - - return &response.LB, err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// UpdateResult represents the result of an update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// ProtocolPage is the page returned by a pager when traversing over a -// collection of LB protocols. -type ProtocolPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether a ProtocolPage struct is empty. -func (p ProtocolPage) IsEmpty() (bool, error) { - is, err := ExtractProtocols(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractProtocols accepts a Page struct, specifically a ProtocolPage struct, -// and extracts the elements into a slice of Protocol structs. In other -// words, a generic collection is mapped into a relevant slice. -func ExtractProtocols(page pagination.Page) ([]Protocol, error) { - var resp struct { - Protocols []Protocol `mapstructure:"protocols" json:"protocols"` - } - err := mapstructure.Decode(page.(ProtocolPage).Body, &resp) - return resp.Protocols, err -} - -// AlgorithmPage is the page returned by a pager when traversing over a -// collection of LB algorithms. -type AlgorithmPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether an AlgorithmPage struct is empty. -func (p AlgorithmPage) IsEmpty() (bool, error) { - is, err := ExtractAlgorithms(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractAlgorithms accepts a Page struct, specifically an AlgorithmPage struct, -// and extracts the elements into a slice of Algorithm structs. In other -// words, a generic collection is mapped into a relevant slice. -func ExtractAlgorithms(page pagination.Page) ([]Algorithm, error) { - var resp struct { - Algorithms []Algorithm `mapstructure:"algorithms" json:"algorithms"` - } - err := mapstructure.Decode(page.(AlgorithmPage).Body, &resp) - return resp.Algorithms, err -} - -// ErrorPage represents the HTML file that is shown to an end user who is -// attempting to access a load balancer node that is offline/unavailable. -// -// During provisioning, every load balancer is configured with a default error -// page that gets displayed when traffic is requested for an offline node. -// -// You can add a single custom error page with an HTTP-based protocol to a load -// balancer. Page updates override existing content. If a custom error page is -// deleted, or the load balancer is changed to a non-HTTP protocol, the default -// error page is restored. -type ErrorPage struct { - Content string -} - -// ErrorPageResult represents the result of an error page operation - -// specifically getting or creating one. -type ErrorPageResult struct { - gophercloud.Result -} - -// Extract interprets any commonResult as an ErrorPage, if possible. -func (r ErrorPageResult) Extract() (*ErrorPage, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - ErrorPage ErrorPage `mapstructure:"errorpage"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.ErrorPage, err -} - -// Stats represents all the key information about a load balancer's usage. -type Stats struct { - // The number of connections closed by this load balancer because its - // ConnectTimeout interval was exceeded. - ConnectTimeout int `mapstructure:"connectTimeOut"` - - // The number of transaction or protocol errors for this load balancer. - ConnectError int - - // Number of connection failures for this load balancer. - ConnectFailure int - - // Number of connections closed by this load balancer because its Timeout - // interval was exceeded. - DataTimedOut int - - // Number of connections closed by this load balancer because the - // 'keepalive_timeout' interval was exceeded. - KeepAliveTimedOut int - - // The maximum number of simultaneous TCP connections this load balancer has - // processed at any one time. - MaxConnections int `mapstructure:"maxConn"` - - // Number of simultaneous connections active at the time of the request. - CurrentConnections int `mapstructure:"currentConn"` - - // Number of SSL connections closed by this load balancer because the - // ConnectTimeout interval was exceeded. - SSLConnectTimeout int `mapstructure:"connectTimeOutSsl"` - - // Number of SSL transaction or protocol erros in this load balancer. - SSLConnectError int `mapstructure:"connectErrorSsl"` - - // Number of SSL connection failures in this load balancer. - SSLConnectFailure int `mapstructure:"connectFailureSsl"` - - // Number of SSL connections closed by this load balancer because the - // Timeout interval was exceeded. - SSLDataTimedOut int `mapstructure:"dataTimedOutSsl"` - - // Number of SSL connections closed by this load balancer because the - // 'keepalive_timeout' interval was exceeded. - SSLKeepAliveTimedOut int `mapstructure:"keepAliveTimedOutSsl"` - - // Maximum number of simultaneous SSL connections this load balancer has - // processed at any one time. - SSLMaxConnections int `mapstructure:"maxConnSsl"` - - // Number of simultaneous SSL connections active at the time of the request. - SSLCurrentConnections int `mapstructure:"currentConnSsl"` -} - -// StatsResult represents the result of a Stats operation. -type StatsResult struct { - gophercloud.Result -} - -// Extract interprets any commonResult as a Stats struct, if possible. -func (r StatsResult) Extract() (*Stats, error) { - if r.Err != nil { - return nil, r.Err - } - res := &Stats{} - err := mapstructure.Decode(r.Body, res) - return res, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/urls.go deleted file mode 100644 index 471a86b0a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/lbs/urls.go +++ /dev/null @@ -1,49 +0,0 @@ -package lbs - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - path = "loadbalancers" - protocolsPath = "protocols" - algorithmsPath = "algorithms" - logPath = "connectionlogging" - epPath = "errorpage" - stPath = "stats" - cachePath = "contentcaching" -) - -func resourceURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id)) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(path) -} - -func protocolsURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(path, protocolsPath) -} - -func algorithmsURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(path, algorithmsPath) -} - -func loggingURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), logPath) -} - -func errorPageURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), epPath) -} - -func statsURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), stPath) -} - -func cacheURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), cachePath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/doc.go deleted file mode 100644 index 2c5be75ae..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Package monitors provides information and interaction with the Health Monitor -API resource for the Rackspace Cloud Load Balancer service. - -The load balancing service includes a health monitoring resource that -periodically checks your back-end nodes to ensure they are responding correctly. -If a node does not respond, it is removed from rotation until the health monitor -determines that the node is functional. In addition to being performed -periodically, a health check also executes against every new node that is -added, to ensure that the node is operating properly before allowing it to -service traffic. Only one health monitor is allowed to be enabled on a load -balancer at a time. - -As part of a good strategy for monitoring connections, secondary nodes should -also be created which provide failover for effectively routing traffic in case -the primary node fails. This is an additional feature that ensures that you -remain up in case your primary node fails. - -There are three types of health monitor: CONNECT, HTTP and HTTPS. -*/ -package monitors diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/fixtures.go deleted file mode 100644 index a565abced..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/fixtures.go +++ /dev/null @@ -1,87 +0,0 @@ -package monitors - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(lbID int) string { - return "/loadbalancers/" + strconv.Itoa(lbID) + "/healthmonitor" -} - -func mockGetResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "healthMonitor": { - "type": "CONNECT", - "delay": 10, - "timeout": 10, - "attemptsBeforeDeactivation": 3 - } -} - `) - }) -} - -func mockUpdateConnectResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "healthMonitor": { - "type": "CONNECT", - "delay": 10, - "timeout": 10, - "attemptsBeforeDeactivation": 3 - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockUpdateHTTPResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "healthMonitor": { - "attemptsBeforeDeactivation": 3, - "bodyRegex": "{regex}", - "delay": 10, - "path": "/foo", - "statusRegex": "200", - "timeout": 10, - "type": "HTTPS" - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDeleteResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/requests.go deleted file mode 100644 index d4ba27653..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/requests.go +++ /dev/null @@ -1,160 +0,0 @@ -package monitors - -import ( - "errors" - - "github.com/rackspace/gophercloud" -) - -var ( - errAttemptLimit = errors.New("AttemptLimit field must be an int greater than 1 and less than 10") - errDelay = errors.New("Delay field must be an int greater than 1 and less than 10") - errTimeout = errors.New("Timeout field must be an int greater than 1 and less than 10") -) - -// UpdateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Update operation in this package. -type UpdateOptsBuilder interface { - ToMonitorUpdateMap() (map[string]interface{}, error) -} - -// UpdateConnectMonitorOpts represents the options needed to update a CONNECT -// monitor. -type UpdateConnectMonitorOpts struct { - // Required - number of permissible monitor failures before removing a node - // from rotation. Must be a number between 1 and 10. - AttemptLimit int - - // Required - the minimum number of seconds to wait before executing the - // health monitor. Must be a number between 1 and 3600. - Delay int - - // Required - maximum number of seconds to wait for a connection to be - // established before timing out. Must be a number between 1 and 300. - Timeout int -} - -// ToMonitorUpdateMap produces a map for updating CONNECT monitors. -func (opts UpdateConnectMonitorOpts) ToMonitorUpdateMap() (map[string]interface{}, error) { - type m map[string]interface{} - - if !gophercloud.IntWithinRange(opts.AttemptLimit, 1, 10) { - return m{}, errAttemptLimit - } - if !gophercloud.IntWithinRange(opts.Delay, 1, 3600) { - return m{}, errDelay - } - if !gophercloud.IntWithinRange(opts.Timeout, 1, 300) { - return m{}, errTimeout - } - - return m{"healthMonitor": m{ - "attemptsBeforeDeactivation": opts.AttemptLimit, - "delay": opts.Delay, - "timeout": opts.Timeout, - "type": CONNECT, - }}, nil -} - -// UpdateHTTPMonitorOpts represents the options needed to update a HTTP monitor. -type UpdateHTTPMonitorOpts struct { - // Required - number of permissible monitor failures before removing a node - // from rotation. Must be a number between 1 and 10. - AttemptLimit int `mapstructure:"attemptsBeforeDeactivation"` - - // Required - the minimum number of seconds to wait before executing the - // health monitor. Must be a number between 1 and 3600. - Delay int - - // Required - maximum number of seconds to wait for a connection to be - // established before timing out. Must be a number between 1 and 300. - Timeout int - - // Required - a regular expression that will be used to evaluate the contents - // of the body of the response. - BodyRegex string - - // Required - the HTTP path that will be used in the sample request. - Path string - - // Required - a regular expression that will be used to evaluate the HTTP - // status code returned in the response. - StatusRegex string - - // Optional - the name of a host for which the health monitors will check. - HostHeader string - - // Required - either HTTP or HTTPS - Type Type -} - -// ToMonitorUpdateMap produces a map for updating HTTP(S) monitors. -func (opts UpdateHTTPMonitorOpts) ToMonitorUpdateMap() (map[string]interface{}, error) { - type m map[string]interface{} - - if !gophercloud.IntWithinRange(opts.AttemptLimit, 1, 10) { - return m{}, errAttemptLimit - } - if !gophercloud.IntWithinRange(opts.Delay, 1, 3600) { - return m{}, errDelay - } - if !gophercloud.IntWithinRange(opts.Timeout, 1, 300) { - return m{}, errTimeout - } - if opts.Type != HTTP && opts.Type != HTTPS { - return m{}, errors.New("Type must either by HTTP or HTTPS") - } - if opts.BodyRegex == "" { - return m{}, errors.New("BodyRegex is a required field") - } - if opts.Path == "" { - return m{}, errors.New("Path is a required field") - } - if opts.StatusRegex == "" { - return m{}, errors.New("StatusRegex is a required field") - } - - json := m{ - "attemptsBeforeDeactivation": opts.AttemptLimit, - "delay": opts.Delay, - "timeout": opts.Timeout, - "type": opts.Type, - "bodyRegex": opts.BodyRegex, - "path": opts.Path, - "statusRegex": opts.StatusRegex, - } - - if opts.HostHeader != "" { - json["hostHeader"] = opts.HostHeader - } - - return m{"healthMonitor": json}, nil -} - -// Update is the operation responsible for updating a health monitor. -func Update(c *gophercloud.ServiceClient, id int, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToMonitorUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(rootURL(c, id), reqBody, nil, nil) - return res -} - -// Get is the operation responsible for showing details of a health monitor. -func Get(c *gophercloud.ServiceClient, id int) GetResult { - var res GetResult - _, res.Err = c.Get(rootURL(c, id), &res.Body, nil) - return res -} - -// Delete is the operation responsible for deleting a health monitor. -func Delete(c *gophercloud.ServiceClient, id int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(rootURL(c, id), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/results.go deleted file mode 100644 index eec556f34..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/results.go +++ /dev/null @@ -1,90 +0,0 @@ -package monitors - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" -) - -// Type represents the type of Monitor. -type Type string - -// Useful constants. -const ( - CONNECT Type = "CONNECT" - HTTP Type = "HTTP" - HTTPS Type = "HTTPS" -) - -// Monitor represents a health monitor API resource. A monitor comes in three -// forms: CONNECT, HTTP or HTTPS. -// -// A CONNECT monitor establishes a basic connection to each node on its defined -// port to ensure that the service is listening properly. The connect monitor -// is the most basic type of health check and does no post-processing or -// protocol-specific health checks. -// -// HTTP and HTTPS health monitors are generally considered more intelligent and -// powerful than CONNECT. It is capable of processing an HTTP or HTTPS response -// to determine the condition of a node. It supports the same basic properties -// as CONNECT and includes additional attributes that are used to evaluate the -// HTTP response. -type Monitor struct { - // Number of permissible monitor failures before removing a node from - // rotation. - AttemptLimit int `mapstructure:"attemptsBeforeDeactivation"` - - // The minimum number of seconds to wait before executing the health monitor. - Delay int - - // Maximum number of seconds to wait for a connection to be established - // before timing out. - Timeout int - - // Type of the health monitor. - Type Type - - // A regular expression that will be used to evaluate the contents of the - // body of the response. - BodyRegex string - - // The name of a host for which the health monitors will check. - HostHeader string - - // The HTTP path that will be used in the sample request. - Path string - - // A regular expression that will be used to evaluate the HTTP status code - // returned in the response. - StatusRegex string -} - -// UpdateResult represents the result of an Update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// DeleteResult represents the result of an Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// Extract interprets any GetResult as a Monitor. -func (r GetResult) Extract() (*Monitor, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - M Monitor `mapstructure:"healthMonitor"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.M, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/urls.go deleted file mode 100644 index 0a1e6df5f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/monitors/urls.go +++ /dev/null @@ -1,16 +0,0 @@ -package monitors - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - path = "loadbalancers" - monitorPath = "healthmonitor" -) - -func rootURL(c *gophercloud.ServiceClient, lbID int) string { - return c.ServiceURL(path, strconv.Itoa(lbID), monitorPath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/doc.go deleted file mode 100644 index 49c431894..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/doc.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Package nodes provides information and interaction with the Node API resource -for the Rackspace Cloud Load Balancer service. - -Nodes are responsible for servicing the requests received through the load -balancer's virtual IP. A node is usually a virtual machine. By default, the -load balancer employs a basic health check that ensures the node is listening -on its defined port. The node is checked at the time of addition and at regular -intervals as defined by the load balancer's health check configuration. If a -back-end node is not listening on its port, or does not meet the conditions of -the defined check, then connections will not be forwarded to the node, and its -status is changed to OFFLINE. Only nodes that are in an ONLINE status receive -and can service traffic from the load balancer. - -All nodes have an associated status that indicates whether the node is -ONLINE, OFFLINE, or DRAINING. Only nodes that are in ONLINE status can receive -and service traffic from the load balancer. The OFFLINE status represents a -node that cannot accept or service traffic. A node in DRAINING status -represents a node that stops the traffic manager from sending any additional -new connections to the node, but honors established sessions. If the traffic -manager receives a request and session persistence requires that the node is -used, the traffic manager uses it. The status is determined by the passive or -active health monitors. - -If the WEIGHTED_ROUND_ROBIN load balancer algorithm mode is selected, then the -caller should assign the relevant weights to the node as part of the weight -attribute of the node element. When the algorithm of the load balancer is -changed to WEIGHTED_ROUND_ROBIN and the nodes do not already have an assigned -weight, the service automatically sets the weight to 1 for all nodes. - -One or more secondary nodes can be added to a specified load balancer so that -if all the primary nodes fail, traffic can be redirected to secondary nodes. -The type attribute allows configuring the node as either PRIMARY or SECONDARY. -*/ -package nodes diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go deleted file mode 100644 index 8899fc5e9..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go +++ /dev/null @@ -1,243 +0,0 @@ -package nodes - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(lbID int) string { - return "/loadbalancers/" + strconv.Itoa(lbID) + "/nodes" -} - -func _nodeURL(lbID, nodeID int) string { - return _rootURL(lbID) + "/" + strconv.Itoa(nodeID) -} - -func mockListResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "nodes": [ - { - "id": 410, - "address": "10.1.1.1", - "port": 80, - "condition": "ENABLED", - "status": "ONLINE", - "weight": 3, - "type": "PRIMARY" - }, - { - "id": 411, - "address": "10.1.1.2", - "port": 80, - "condition": "ENABLED", - "status": "ONLINE", - "weight": 8, - "type": "SECONDARY" - } - ] -} - `) - }) -} - -func mockCreateResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "nodes": [ - { - "address": "10.2.2.3", - "port": 80, - "condition": "ENABLED", - "type": "PRIMARY" - }, - { - "address": "10.2.2.4", - "port": 81, - "condition": "ENABLED", - "type": "SECONDARY" - } - ] -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - - fmt.Fprintf(w, ` -{ - "nodes": [ - { - "address": "10.2.2.3", - "id": 185, - "port": 80, - "status": "ONLINE", - "condition": "ENABLED", - "weight": 1, - "type": "PRIMARY" - }, - { - "address": "10.2.2.4", - "id": 186, - "port": 81, - "status": "ONLINE", - "condition": "ENABLED", - "weight": 1, - "type": "SECONDARY" - } - ] -} - `) - }) -} - -func mockCreateErrResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "nodes": [ - { - "address": "10.2.2.3", - "port": 80, - "condition": "ENABLED", - "type": "PRIMARY" - }, - { - "address": "10.2.2.4", - "port": 81, - "condition": "ENABLED", - "type": "SECONDARY" - } - ] -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(422) // Unprocessable Entity - - fmt.Fprintf(w, ` -{ - "code": 422, - "message": "Load Balancer '%d' has a status of 'PENDING_UPDATE' and is considered immutable." -} - `, lbID) - }) -} - -func mockBatchDeleteResponse(t *testing.T, lbID int, ids []int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - r.ParseForm() - - for k, v := range ids { - fids := r.Form["id"] - th.AssertEquals(t, strconv.Itoa(v), fids[k]) - } - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDeleteResponse(t *testing.T, lbID, nodeID int) { - th.Mux.HandleFunc(_nodeURL(lbID, nodeID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockGetResponse(t *testing.T, lbID, nodeID int) { - th.Mux.HandleFunc(_nodeURL(lbID, nodeID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "node": { - "id": 410, - "address": "10.1.1.1", - "port": 80, - "condition": "ENABLED", - "status": "ONLINE", - "weight": 12, - "type": "PRIMARY" - } -} - `) - }) -} - -func mockUpdateResponse(t *testing.T, lbID, nodeID int) { - th.Mux.HandleFunc(_nodeURL(lbID, nodeID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "node": { - "condition": "DRAINING", - "weight": 10, - "type": "SECONDARY" - } -} - `) - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockListEventsResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID)+"/events", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "nodeServiceEvents": [ - { - "detailedMessage": "Node is ok", - "nodeId": 373, - "id": 7, - "type": "UPDATE_NODE", - "description": "Node '373' status changed to 'ONLINE' for load balancer '323'", - "category": "UPDATE", - "severity": "INFO", - "relativeUri": "/406271/loadbalancers/323/nodes/373/events", - "accountId": 406271, - "loadbalancerId": 323, - "title": "Node Status Updated", - "author": "Rackspace Cloud", - "created": "10-30-2012 10:18:23" - } - ] -} -`) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go deleted file mode 100644 index 9da376f83..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go +++ /dev/null @@ -1,286 +0,0 @@ -package nodes - -import ( - "errors" - "fmt" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List is the operation responsible for returning a paginated collection of -// load balancer nodes. It requires the node ID, its parent load balancer ID, -// and optional limit integer (passed in either as a pointer or a nil poitner). -func List(client *gophercloud.ServiceClient, loadBalancerID int, limit *int) pagination.Pager { - url := rootURL(client, loadBalancerID) - if limit != nil { - url += fmt.Sprintf("?limit=%d", limit) - } - - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return NodePage{pagination.SinglePageBase(r)} - }) -} - -// CreateOptsBuilder is the interface responsible for generating the JSON -// for a Create operation. -type CreateOptsBuilder interface { - ToNodeCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is a slice of CreateOpt structs, that allow the user to create -// multiple nodes in a single operation (one node per CreateOpt). -type CreateOpts []CreateOpt - -// CreateOpt represents the options to create a single node. -type CreateOpt struct { - // Required - the IP address or CIDR for this back-end node. It can either be - // a private IP (ServiceNet) or a public IP. - Address string - - // Optional - the port on which traffic is sent and received. - Port int - - // Optional - the condition of the node. See the consts in Results.go. - Condition Condition - - // Optional - the type of the node. See the consts in Results.go. - Type Type - - // Optional - a pointer to an integer between 0 and 100. - Weight *int -} - -func validateWeight(weight *int) error { - if weight != nil && (*weight > 100 || *weight < 0) { - return errors.New("Weight must be a valid int between 0 and 100") - } - return nil -} - -// ToNodeCreateMap converts a slice of options into a map that can be used for -// the JSON. -func (opts CreateOpts) ToNodeCreateMap() (map[string]interface{}, error) { - type nodeMap map[string]interface{} - nodes := []nodeMap{} - - for k, v := range opts { - if v.Address == "" { - return nodeMap{}, fmt.Errorf("ID is a required attribute, none provided for %d CreateOpt element", k) - } - if weightErr := validateWeight(v.Weight); weightErr != nil { - return nodeMap{}, weightErr - } - - node := make(map[string]interface{}) - node["address"] = v.Address - - if v.Port > 0 { - node["port"] = v.Port - } - if v.Condition != "" { - node["condition"] = v.Condition - } - if v.Type != "" { - node["type"] = v.Type - } - if v.Weight != nil { - node["weight"] = &v.Weight - } - - nodes = append(nodes, node) - } - - return nodeMap{"nodes": nodes}, nil -} - -// Create is the operation responsible for creating a new node on a load -// balancer. Since every load balancer exists in both ServiceNet and the public -// Internet, both private and public IP addresses can be used for nodes. -// -// If nodes need time to boot up services before they become operational, you -// can temporarily prevent traffic from being sent to that node by setting the -// Condition field to DRAINING. Health checks will still be performed; but once -// your node is ready, you can update its condition to ENABLED and have it -// handle traffic. -func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToNodeCreateMap() - if err != nil { - res.Err = err - return res - } - - resp, err := client.Post(rootURL(client, loadBalancerID), reqBody, &res.Body, nil) - - if err != nil { - res.Err = err - return res - } - - pr := pagination.PageResultFromParsed(resp, res.Body) - return CreateResult{pagination.SinglePageBase(pr)} -} - -// BulkDelete is the operation responsible for batch deleting multiple nodes in -// a single operation. It accepts a slice of integer IDs and will remove them -// from the load balancer. The maximum limit is 10 node removals at once. -func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, nodeIDs []int) DeleteResult { - var res DeleteResult - - if len(nodeIDs) > 10 || len(nodeIDs) == 0 { - res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 node IDs") - return res - } - - url := rootURL(c, loadBalancerID) - url += gophercloud.IDSliceToQueryString("id", nodeIDs) - - _, res.Err = c.Delete(url, nil) - return res -} - -// Get is the operation responsible for showing details for a single node. -func Get(c *gophercloud.ServiceClient, lbID, nodeID int) GetResult { - var res GetResult - _, res.Err = c.Get(resourceURL(c, lbID, nodeID), &res.Body, nil) - return res -} - -// UpdateOptsBuilder represents a type that can be converted into a JSON-like -// map structure. -type UpdateOptsBuilder interface { - ToNodeUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts represent the options for updating an existing node. -type UpdateOpts struct { - // Optional - the condition of the node. See the consts in Results.go. - Condition Condition - - // Optional - the type of the node. See the consts in Results.go. - Type Type - - // Optional - a pointer to an integer between 0 and 100. - Weight *int -} - -// ToNodeUpdateMap converts an options struct into a JSON-like map. -func (opts UpdateOpts) ToNodeUpdateMap() (map[string]interface{}, error) { - node := make(map[string]interface{}) - - if opts.Condition != "" { - node["condition"] = opts.Condition - } - if opts.Weight != nil { - if weightErr := validateWeight(opts.Weight); weightErr != nil { - return node, weightErr - } - node["weight"] = &opts.Weight - } - if opts.Type != "" { - node["type"] = opts.Type - } - - return map[string]interface{}{"node": node}, nil -} - -// Update is the operation responsible for updating an existing node. A node's -// IP, port, and status are immutable attributes and cannot be modified. -func Update(c *gophercloud.ServiceClient, lbID, nodeID int, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToNodeUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(resourceURL(c, lbID, nodeID), reqBody, nil, nil) - return res -} - -// Delete is the operation responsible for permanently deleting a node. -func Delete(c *gophercloud.ServiceClient, lbID, nodeID int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(resourceURL(c, lbID, nodeID), nil) - return res -} - -// ListEventsOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListEventsOptsBuilder interface { - ToEventsListQuery() (string, error) -} - -// ListEventsOpts allows the filtering and sorting of paginated collections through -// the API. -type ListEventsOpts struct { - Marker string `q:"marker"` - Limit int `q:"limit"` -} - -// ToEventsListQuery formats a ListOpts into a query string. -func (opts ListEventsOpts) ToEventsListQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// ListEvents is the operation responsible for listing all the events -// associated with the activity between the node and the load balancer. The -// events report errors found with the node. The detailedMessage provides the -// detailed reason for the error. -func ListEvents(client *gophercloud.ServiceClient, loadBalancerID int, opts ListEventsOptsBuilder) pagination.Pager { - url := eventsURL(client, loadBalancerID) - - if opts != nil { - query, err := opts.ToEventsListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return NodeEventPage{pagination.SinglePageBase(r)} - }) -} - -// GetByIPPort locates a load balancer node by IP and port. -func GetByIPPort( - client *gophercloud.ServiceClient, - loadBalancerID int, - address string, - port int, -) (*Node, error) { - - // nil until found - var found *Node - - List(client, loadBalancerID, nil).EachPage(func(page pagination.Page) (bool, error) { - lbNodes, err := ExtractNodes(page) - if err != nil { - return false, err - } - - for _, trialNode := range lbNodes { - if trialNode.Address == address && trialNode.Port == port { - found = &trialNode - return false, nil - } - - } - - return true, nil - }) - - if found == nil { - return nil, errors.New("Unable to get node by IP and Port") - } - - return found, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go deleted file mode 100644 index 57835dc4b..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go +++ /dev/null @@ -1,213 +0,0 @@ -package nodes - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Node represents a back-end device, usually a virtual machine, that can -// handle traffic. It is assigned traffic based on its parent load balancer. -type Node struct { - // The IP address or CIDR for this back-end node. - Address string - - // The unique ID for this node. - ID int - - // The port on which traffic is sent and received. - Port int - - // The node's status. - Status Status - - // The node's condition. - Condition Condition - - // The priority at which this node will receive traffic if a weighted - // algorithm is used by its parent load balancer. Ranges from 1 to 100. - Weight int - - // Type of node. - Type Type -} - -// Type indicates whether the node is of a PRIMARY or SECONDARY nature. -type Type string - -const ( - // PRIMARY nodes are in the normal rotation to receive traffic from the load - // balancer. - PRIMARY Type = "PRIMARY" - - // SECONDARY nodes are only in the rotation to receive traffic from the load - // balancer when all the primary nodes fail. This provides a failover feature - // that automatically routes traffic to the secondary node in the event that - // the primary node is disabled or in a failing state. Note that active - // health monitoring must be enabled on the load balancer to enable the - // failover feature to the secondary node. - SECONDARY Type = "SECONDARY" -) - -// Condition represents the condition of a node. -type Condition string - -const ( - // ENABLED indicates that the node is permitted to accept new connections. - ENABLED Condition = "ENABLED" - - // DISABLED indicates that the node is not permitted to accept any new - // connections regardless of session persistence configuration. Existing - // connections are forcibly terminated. - DISABLED Condition = "DISABLED" - - // DRAINING indicates that the node is allowed to service existing - // established connections and connections that are being directed to it as a - // result of the session persistence configuration. - DRAINING Condition = "DRAINING" -) - -// Status indicates whether the node can accept service traffic. If a node is -// not listening on its port or does not meet the conditions of the defined -// active health check for the load balancer, then the load balancer does not -// forward connections, and its status is listed as OFFLINE. -type Status string - -const ( - // ONLINE indicates that the node is healthy and capable of receiving traffic - // from the load balancer. - ONLINE Status = "ONLINE" - - // OFFLINE indicates that the node is not in a position to receive service - // traffic. It is usually switched into this state when a health check is not - // satisfied with the node's response time. - OFFLINE Status = "OFFLINE" -) - -// NodePage is the page returned by a pager when traversing over a collection -// of nodes. -type NodePage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether a NodePage struct is empty. -func (p NodePage) IsEmpty() (bool, error) { - is, err := ExtractNodes(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -func commonExtractNodes(body interface{}) ([]Node, error) { - var resp struct { - Nodes []Node `mapstructure:"nodes" json:"nodes"` - } - - err := mapstructure.Decode(body, &resp) - - return resp.Nodes, err -} - -// ExtractNodes accepts a Page struct, specifically a NodePage struct, and -// extracts the elements into a slice of Node structs. In other words, a -// generic collection is mapped into a relevant slice. -func ExtractNodes(page pagination.Page) ([]Node, error) { - return commonExtractNodes(page.(NodePage).Body) -} - -// CreateResult represents the result of a create operation. Since multiple -// nodes can be added in one operation, this result represents multiple nodes -// and should be treated as a typical pagination Page. Use its ExtractNodes -// method to get out a slice of Node structs. -type CreateResult struct { - pagination.SinglePageBase -} - -// ExtractNodes extracts a slice of Node structs from a CreateResult. -func (res CreateResult) ExtractNodes() ([]Node, error) { - if res.Err != nil { - return nil, res.Err - } - return commonExtractNodes(res.Body) -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -type commonResult struct { - gophercloud.Result -} - -// GetResult represents the result of a get operation. -type GetResult struct { - commonResult -} - -// UpdateResult represents the result of an update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -func (r commonResult) Extract() (*Node, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Node Node `mapstructure:"node"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.Node, err -} - -// NodeEvent represents a service event that occurred between a node and a -// load balancer. -type NodeEvent struct { - ID int - DetailedMessage string - NodeID int - Type string - Description string - Category string - Severity string - RelativeURI string - AccountID int - LoadBalancerID int - Title string - Author string - Created string -} - -// NodeEventPage is a concrete type which embeds the common SinglePageBase -// struct, and is used when traversing node event collections. -type NodeEventPage struct { - pagination.SinglePageBase -} - -// IsEmpty is a concrete function which indicates whether an NodeEventPage is -// empty or not. -func (r NodeEventPage) IsEmpty() (bool, error) { - is, err := ExtractNodeEvents(r) - if err != nil { - return true, err - } - return len(is) == 0, nil -} - -// ExtractNodeEvents accepts a Page struct, specifically a NodeEventPage -// struct, and extracts the elements into a slice of NodeEvent structs. In -// other words, the collection is mapped into a relevant slice. -func ExtractNodeEvents(page pagination.Page) ([]NodeEvent, error) { - var resp struct { - Events []NodeEvent `mapstructure:"nodeServiceEvents" json:"nodeServiceEvents"` - } - - err := mapstructure.Decode(page.(NodeEventPage).Body, &resp) - - return resp.Events, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/urls.go deleted file mode 100644 index 2cefee264..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package nodes - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - lbPath = "loadbalancers" - nodePath = "nodes" - eventPath = "events" -) - -func resourceURL(c *gophercloud.ServiceClient, lbID, nodeID int) string { - return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, strconv.Itoa(nodeID)) -} - -func rootURL(c *gophercloud.ServiceClient, lbID int) string { - return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath) -} - -func eventsURL(c *gophercloud.ServiceClient, lbID int) string { - return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, eventPath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/doc.go deleted file mode 100644 index dcec0a87e..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/doc.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Package sessions provides information and interaction with the Session -Persistence feature of the Rackspace Cloud Load Balancer service. - -Session persistence is a feature of the load balancing service that forces -multiple requests from clients (of the same protocol) to be directed to the -same node. This is common with many web applications that do not inherently -share application state between back-end servers. - -There are two modes to choose from: HTTP_COOKIE and SOURCE_IP. You can only set -one of the session persistence modes on a load balancer, and it can only -support one protocol. If you set HTTP_COOKIE mode for an HTTP load balancer, it -supports session persistence for HTTP requests only. Likewise, if you set -SOURCE_IP mode for an HTTPS load balancer, it supports session persistence for -only HTTPS requests. - -To support session persistence for both HTTP and HTTPS requests concurrently, -choose one of the following options: - -- Use two load balancers, one configured for session persistence for HTTP -requests and the other configured for session persistence for HTTPS requests. -That way, the load balancers support session persistence for both HTTP and -HTTPS requests concurrently, with each load balancer supporting one of the -protocols. - -- Use one load balancer, configure it for session persistence for HTTP requests, -and then enable SSL termination for that load balancer. The load balancer -supports session persistence for both HTTP and HTTPS requests concurrently. -*/ -package sessions diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go deleted file mode 100644 index 077ef0470..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go +++ /dev/null @@ -1,59 +0,0 @@ -package sessions - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(id int) string { - return "/loadbalancers/" + strconv.Itoa(id) + "/sessionpersistence" -} - -func mockGetResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "sessionPersistence": { - "persistenceType": "HTTP_COOKIE" - } -} -`) - }) -} - -func mockEnableResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "sessionPersistence": { - "persistenceType": "HTTP_COOKIE" - } -} - `) - - w.WriteHeader(http.StatusAccepted) - fmt.Fprintf(w, `{}`) - }) -} - -func mockDisableResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/requests.go deleted file mode 100644 index a93d766cd..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/requests.go +++ /dev/null @@ -1,63 +0,0 @@ -package sessions - -import ( - "errors" - - "github.com/rackspace/gophercloud" -) - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. -type CreateOptsBuilder interface { - ToSPCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // Required - can either be HTTPCOOKIE or SOURCEIP - Type Type -} - -// ToSPCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToSPCreateMap() (map[string]interface{}, error) { - sp := make(map[string]interface{}) - - if opts.Type == "" { - return sp, errors.New("Type is a required field") - } - - sp["persistenceType"] = opts.Type - return map[string]interface{}{"sessionPersistence": sp}, nil -} - -// Enable is the operation responsible for enabling session persistence for a -// particular load balancer. -func Enable(c *gophercloud.ServiceClient, lbID int, opts CreateOptsBuilder) EnableResult { - var res EnableResult - - reqBody, err := opts.ToSPCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(rootURL(c, lbID), reqBody, &res.Body, nil) - return res -} - -// Get is the operation responsible for showing details of the session -// persistence configuration for a particular load balancer. -func Get(c *gophercloud.ServiceClient, lbID int) GetResult { - var res GetResult - _, res.Err = c.Get(rootURL(c, lbID), &res.Body, nil) - return res -} - -// Disable is the operation responsible for disabling session persistence for a -// particular load balancer. -func Disable(c *gophercloud.ServiceClient, lbID int) DisableResult { - var res DisableResult - _, res.Err = c.Delete(rootURL(c, lbID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/results.go deleted file mode 100644 index fe90e722c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/results.go +++ /dev/null @@ -1,58 +0,0 @@ -package sessions - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" -) - -// Type represents the type of session persistence being used. -type Type string - -const ( - // HTTPCOOKIE is a session persistence mechanism that inserts an HTTP cookie - // and is used to determine the destination back-end node. This is supported - // for HTTP load balancing only. - HTTPCOOKIE Type = "HTTP_COOKIE" - - // SOURCEIP is a session persistence mechanism that keeps track of the source - // IP address that is mapped and is able to determine the destination - // back-end node. This is supported for HTTPS pass-through and non-HTTP load - // balancing only. - SOURCEIP Type = "SOURCE_IP" -) - -// SessionPersistence indicates how a load balancer is using session persistence -type SessionPersistence struct { - Type Type `mapstructure:"persistenceType"` -} - -// EnableResult represents the result of an enable operation. -type EnableResult struct { - gophercloud.ErrResult -} - -// DisableResult represents the result of a disable operation. -type DisableResult struct { - gophercloud.ErrResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract interprets a GetResult as an SP, if possible. -func (r GetResult) Extract() (*SessionPersistence, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - SP SessionPersistence `mapstructure:"sessionPersistence"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.SP, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/urls.go deleted file mode 100644 index c4a896d90..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/urls.go +++ /dev/null @@ -1,16 +0,0 @@ -package sessions - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - path = "loadbalancers" - spPath = "sessionpersistence" -) - -func rootURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), spPath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/doc.go deleted file mode 100644 index 6a2c174ae..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Package ssl provides information and interaction with the SSL Termination -feature of the Rackspace Cloud Load Balancer service. - -You may only enable and configure SSL termination on load balancers with -non-secure protocols, such as HTTP, but not HTTPS. - -SSL-terminated load balancers decrypt the traffic at the traffic manager and -pass unencrypted traffic to the back-end node. Because of this, the customer's -back-end nodes don't know what protocol the client requested. For this reason, -the X-Forwarded-Proto (XFP) header has been added for identifying the -originating protocol of an HTTP request as "http" or "https" depending on what -protocol the client requested. - -Not every service returns certificates in the proper order. Please verify that -your chain of certificates matches that of walking up the chain from the domain -to the CA root. - -If used for HTTP to HTTPS redirection, the LoadBalancer's securePort attribute -must be set to 443, and its secureTrafficOnly attribute must be true. -*/ -package ssl diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go deleted file mode 100644 index 5a52962d4..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go +++ /dev/null @@ -1,196 +0,0 @@ -package ssl - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(id int) string { - return "/loadbalancers/" + strconv.Itoa(id) + "/ssltermination" -} - -func _certURL(id, certID int) string { - url := _rootURL(id) + "/certificatemappings" - if certID > 0 { - url += "/" + strconv.Itoa(certID) - } - return url -} - -func mockGetResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "sslTermination": { - "certificate": "-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "enabled": true, - "secureTrafficOnly": false, - "intermediateCertificate": "-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n", - "securePort": 443 - } -} -`) - }) -} - -func mockUpdateResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "sslTermination": { - "enabled": true, - "securePort": 443, - "secureTrafficOnly": false, - "privateKey": "foo", - "certificate": "-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "intermediateCertificate": "-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n" - } -} - `) - - w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, `{}`) - }) -} - -func mockDeleteResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusOK) - }) -} - -func mockListCertsResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_certURL(lbID, 0), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "certificateMappings": [ - { - "certificateMapping": { - "id": 123, - "hostName": "rackspace.com" - } - }, - { - "certificateMapping": { - "id": 124, - "hostName": "*.rackspace.com" - } - } - ] -} -`) - }) -} - -func mockAddCertResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_certURL(lbID, 0), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "certificateMapping": { - "hostName": "rackspace.com", - "privateKey":"-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAwIudSMpRZx7TS0/AtDVX3DgXwLD9g+XrNaoazlhwhpYALgzJ\nLAbAnOxT6OT0gTpkPus/B7QhW6y6Auf2cdBeW31XoIwPsSoyNhxgErGBxzNARRB9\nlI1HCa1ojFrcULluj4W6rpaOycI5soDBJiJHin/hbZBPZq6vhPCuNP7Ya48Zd/2X\nCQ9ft3XKfmbs1SdrdROIhigse/SGRbMrCorn/vhNIuohr7yOlHG3GcVcUI9k6ZSZ\nBbqF+ZA4ApSF/Q6/cumieEgofhkYbx5fg02s9Jwr4IWnIR2bSHs7UQ6sVgKYzjs7\nPd3Unpa74jFw6/H6shABoO2CIYLotGmQbFgnpwIDAQABAoIBAQCBCQ+PCIclJHNV\ntUzfeCA5ZR4F9JbxHdRTUnxEbOB8UWotckQfTScoAvj4yvdQ42DrCZxj/UOdvFOs\nPufZvlp91bIz1alugWjE+p8n5+2hIaegoTyHoWZKBfxak0myj5KYfHZvKlbmv1ML\nXV4TwEVRfAIG+v87QTY/UUxuF5vR+BpKIbgUJLfPUFFvJUdl84qsJ44pToxaYUd/\nh5YAGC00U4ay1KVSAUnTkkPNZ0lPG/rWU6w6WcTvNRLMd8DzFLTKLOgQfHhbExAF\n+sXPWjWSzbBRP1O7fHqq96QQh4VFiY/7w9W+sDKQyV6Ul17OSXs6aZ4f+lq4rJTI\n1FG96YiBAoGBAO1tiH0h1oWDBYfJB3KJJ6CQQsDGwtHo/DEgznFVP4XwEVbZ98Ha\nBfBCn3sAybbaikyCV1Hwj7kfHMZPDHbrcUSFX7quu/2zPK+wO3lZKXSyu4YsguSa\nRedInN33PpdnlPhLyQdWSuD5sVHJDF6xn22vlyxeILH3ooLg2WOFMPmVAoGBAM+b\nUG/a7iyfpAQKYyuFAsXz6SeFaDY+ZYeX45L112H8Pu+Ie/qzon+bzLB9FIH8GP6+\nQpQgmm/p37U2gD1zChUv7iW6OfQBKk9rWvMpfRF6d7YHquElejhizfTZ+ntBV/VY\ndOYEczxhrdW7keLpatYaaWUy/VboRZmlz/9JGqVLAoGAHfqNmFc0cgk4IowEj7a3\ntTNh6ltub/i+FynwRykfazcDyXaeLPDtfQe8gVh5H8h6W+y9P9BjJVnDVVrX1RAn\nbiJ1EupLPF5sVDapW8ohTOXgfbGTGXBNUUW+4Nv+IDno+mz/RhjkPYHpnM0I7c/5\ntGzOZsC/2hjNgT8I0+MWav0CgYEAuULdJeQVlKalI6HtW2Gn1uRRVJ49H+LQkY6e\nW3+cw2jo9LI0CMWSphNvNrN3wIMp/vHj0fHCP0pSApDvIWbuQXfzKaGko7UCf7rK\nf6GvZRCHkV4IREBAb97j8bMvThxClMNqFfU0rFZyXP+0MOyhFQyertswrgQ6T+Fi\n2mnvKD8CgYAmJHP3NTDRMoMRyAzonJ6nEaGUbAgNmivTaUWMe0+leCvAdwD89gzC\nTKbm3eDUg/6Va3X6ANh3wsfIOe4RXXxcbcFDk9R4zO2M5gfLSjYm5Q87EBZ2hrdj\nM2gLI7dt6thx0J8lR8xRHBEMrVBdgwp0g1gQzo5dAV88/kpkZVps8Q==\n-----END RSA PRIVATE KEY-----\n", - "certificate":"-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "intermediateCertificate":"-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n" - } -} - `) - - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "certificateMapping": { - "id": 123, - "hostName": "rackspace.com", - "certificate":"-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "intermediateCertificate":"-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n" - } -} - `) - }) -} - -func mockGetCertResponse(t *testing.T, lbID, certID int) { - th.Mux.HandleFunc(_certURL(lbID, certID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "certificateMapping": { - "id": 123, - "hostName": "rackspace.com", - "certificate":"-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "intermediateCertificate":"-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n" - } -} -`) - }) -} - -func mockUpdateCertResponse(t *testing.T, lbID, certID int) { - th.Mux.HandleFunc(_certURL(lbID, certID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "certificateMapping": { - "hostName": "rackspace.com", - "privateKey":"-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAwIudSMpRZx7TS0/AtDVX3DgXwLD9g+XrNaoazlhwhpYALgzJ\nLAbAnOxT6OT0gTpkPus/B7QhW6y6Auf2cdBeW31XoIwPsSoyNhxgErGBxzNARRB9\nlI1HCa1ojFrcULluj4W6rpaOycI5soDBJiJHin/hbZBPZq6vhPCuNP7Ya48Zd/2X\nCQ9ft3XKfmbs1SdrdROIhigse/SGRbMrCorn/vhNIuohr7yOlHG3GcVcUI9k6ZSZ\nBbqF+ZA4ApSF/Q6/cumieEgofhkYbx5fg02s9Jwr4IWnIR2bSHs7UQ6sVgKYzjs7\nPd3Unpa74jFw6/H6shABoO2CIYLotGmQbFgnpwIDAQABAoIBAQCBCQ+PCIclJHNV\ntUzfeCA5ZR4F9JbxHdRTUnxEbOB8UWotckQfTScoAvj4yvdQ42DrCZxj/UOdvFOs\nPufZvlp91bIz1alugWjE+p8n5+2hIaegoTyHoWZKBfxak0myj5KYfHZvKlbmv1ML\nXV4TwEVRfAIG+v87QTY/UUxuF5vR+BpKIbgUJLfPUFFvJUdl84qsJ44pToxaYUd/\nh5YAGC00U4ay1KVSAUnTkkPNZ0lPG/rWU6w6WcTvNRLMd8DzFLTKLOgQfHhbExAF\n+sXPWjWSzbBRP1O7fHqq96QQh4VFiY/7w9W+sDKQyV6Ul17OSXs6aZ4f+lq4rJTI\n1FG96YiBAoGBAO1tiH0h1oWDBYfJB3KJJ6CQQsDGwtHo/DEgznFVP4XwEVbZ98Ha\nBfBCn3sAybbaikyCV1Hwj7kfHMZPDHbrcUSFX7quu/2zPK+wO3lZKXSyu4YsguSa\nRedInN33PpdnlPhLyQdWSuD5sVHJDF6xn22vlyxeILH3ooLg2WOFMPmVAoGBAM+b\nUG/a7iyfpAQKYyuFAsXz6SeFaDY+ZYeX45L112H8Pu+Ie/qzon+bzLB9FIH8GP6+\nQpQgmm/p37U2gD1zChUv7iW6OfQBKk9rWvMpfRF6d7YHquElejhizfTZ+ntBV/VY\ndOYEczxhrdW7keLpatYaaWUy/VboRZmlz/9JGqVLAoGAHfqNmFc0cgk4IowEj7a3\ntTNh6ltub/i+FynwRykfazcDyXaeLPDtfQe8gVh5H8h6W+y9P9BjJVnDVVrX1RAn\nbiJ1EupLPF5sVDapW8ohTOXgfbGTGXBNUUW+4Nv+IDno+mz/RhjkPYHpnM0I7c/5\ntGzOZsC/2hjNgT8I0+MWav0CgYEAuULdJeQVlKalI6HtW2Gn1uRRVJ49H+LQkY6e\nW3+cw2jo9LI0CMWSphNvNrN3wIMp/vHj0fHCP0pSApDvIWbuQXfzKaGko7UCf7rK\nf6GvZRCHkV4IREBAb97j8bMvThxClMNqFfU0rFZyXP+0MOyhFQyertswrgQ6T+Fi\n2mnvKD8CgYAmJHP3NTDRMoMRyAzonJ6nEaGUbAgNmivTaUWMe0+leCvAdwD89gzC\nTKbm3eDUg/6Va3X6ANh3wsfIOe4RXXxcbcFDk9R4zO2M5gfLSjYm5Q87EBZ2hrdj\nM2gLI7dt6thx0J8lR8xRHBEMrVBdgwp0g1gQzo5dAV88/kpkZVps8Q==\n-----END RSA PRIVATE KEY-----\n", - "certificate":"-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "intermediateCertificate":"-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n" - } -} - `) - - w.WriteHeader(http.StatusAccepted) - - fmt.Fprintf(w, ` -{ - "certificateMapping": { - "id": 123, - "hostName": "rackspace.com", - "certificate":"-----BEGIN CERTIFICATE-----\nMIIEXTCCA0WgAwIBAgIGATTEAjK3MA0GCSqGSIb3DQEBBQUAMIGDMRkwFwYDVQQD\nExBUZXN0IENBIFNUdWIgS2V5MRcwFQYDVQQLEw5QbGF0Zm9ybSBMYmFhczEaMBgG\nA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFDASBgNVBAcTC1NhbiBBbnRvbmlvMQ4w\nDAYDVQQIEwVUZXhhczELMAkGA1UEBhMCVVMwHhcNMTIwMTA5MTk0NjQ1WhcNMTQw\nMTA4MTk0NjQ1WjCBgjELMAkGA1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRQwEgYD\nVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMRUmFja3NwYWNlIEhvc3RpbmcxFzAV\nBgNVBAsTDlBsYXRmb3JtIExiYWFzMRgwFgYDVQQDEw9UZXN0IENsaWVudCBLZXkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAi51IylFnHtNLT8C0NVfc\nOBfAsP2D5es1qhrOWHCGlgAuDMksBsCc7FPo5PSBOmQ+6z8HtCFbrLoC5/Zx0F5b\nfVegjA+xKjI2HGASsYHHM0BFEH2UjUcJrWiMWtxQuW6Phbqulo7JwjmygMEmIkeK\nf+FtkE9mrq+E8K40/thrjxl3/ZcJD1+3dcp+ZuzVJ2t1E4iGKCx79IZFsysKiuf+\n+E0i6iGvvI6UcbcZxVxQj2TplJkFuoX5kDgClIX9Dr9y6aJ4SCh+GRhvHl+DTaz0\nnCvghachHZtIeztRDqxWApjOOzs93dSelrviMXDr8fqyEAGg7YIhgui0aZBsWCen\nAgMBAAGjgdUwgdIwgbAGA1UdIwSBqDCBpYAUNpx1Pc6cGA7KqEwHMmHBTZMA7lSh\ngYmkgYYwgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVU4IBATAd\nBgNVHQ4EFgQULueOfsjZZOHwJHZwBy6u0swnpccwDQYJKoZIhvcNAQEFBQADggEB\nAFNuqSVUaotUJoWDv4z7Kbi6JFpTjDht5ORw4BdVYlRD4h9DACAFzPrPV2ym/Osp\nhNMdZq6msZku7MdOSQVhdeGWrSNk3M8O9Hg7cVzPNXOF3iNoo3irQ5tURut44xs4\nWw5YWQqS9WyUY5snD8tm7Y1rQTPfhg+678xIq/zWCv/u+FSnfVv1nlhLVQkEeG/Y\ngh1uMaTIpUKTGEjIAGtpGP7wwIcXptR/HyfzhTUSTaWc1Ef7zoKT9LL5z3IV1hC2\njVWz+RwYs98LjMuksJFoHqRfWyYhCIym0jb6GTwaEmpxAjc+d7OLNQdnoEGoUYGP\nYjtfkRYg265ESMA+Kww4Xy8=\n-----END CERTIFICATE-----\n", - "intermediateCertificate":"-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzEZMBcGA1UEAxMQVGVz\ndCBDQSBTVHViIEtleTEXMBUGA1UECxMOUGxhdGZvcm0gTGJhYXMxGjAYBgNVBAoT\nEVJhY2tzcGFjZSBIb3N0aW5nMRQwEgYDVQQHEwtTYW4gQW50b25pbzEOMAwGA1UE\nCBMFVGV4YXMxCzAJBgNVBAYTAlVTMB4XDTEyMDEwOTE5NDU0OVoXDTE0MDEwODE5\nNDU0OVowgYMxGTAXBgNVBAMTEFRlc3QgQ0EgU1R1YiBLZXkxFzAVBgNVBAsTDlBs\nYXRmb3JtIExiYWFzMRowGAYDVQQKExFSYWNrc3BhY2UgSG9zdGluZzEUMBIGA1UE\nBxMLU2FuIEFudG9uaW8xDjAMBgNVBAgTBVRleGFzMQswCQYDVQQGEwJVUzCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNh55lwTVwQvNoEZjq1zGdYz9jA\nXXdjizn8AJhjHLOAallfPtvCfTEgKanhdoyz5FnhQE8HbDAop/KNS1lN2UMvdl5f\nZNLTSjJrNtedqxQwxN/i3bpyBxNVejUH2NjV1mmyj+5CJYwCzWalvI/gLPq/A3as\nO2EQqtf3U8unRgn0zXLRdYxV9MrUzNAmdipPNvNrsVdrCgA42rgF/8KsyRVQfJCX\nfN7PGCfrsC3YaUvhymraWxNnXIzMYTNa9wEeBZLUw8SlEtpa1Zsvui+TPXu3USNZ\nVnWH8Lb6ENlnoX0VBwo62fjOG3JzhNKoJawi3bRqyDdINOvafr7iPrrs/T8CAwEA\nAaMyMDAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUNpx1Pc6cGA7KqEwHMmHB\nTZMA7lQwDQYJKoZIhvcNAQEFBQADggEBAMoRgH3iTG3t317viLKoY+lNMHUgHuR7\nb3mn9MidJKyYVewe6hCDIN6WY4fUojmMW9wFJWJIo0hRMNHL3n3tq8HP2j20Mxy8\nacPdfGZJa+jiBw72CrIGdobKaFduIlIEDBA1pNdZIJ+EulrtqrMesnIt92WaypIS\n8JycbIgDMCiyC0ENHEk8UWlC6429c7OZAsplMTbHME/1R4btxjkdfrYZJjdJ2yL2\n8cjZDUDMCPTdW/ycP07Gkq30RB5tACB5aZdaCn2YaKC8FsEdhff4X7xEOfOEHWEq\nSRxADDj8Lx1MT6QpR07hCiDyHfTCtbqzI0iGjX63Oh7xXSa0f+JVTa8=\n-----END CERTIFICATE-----\n" - } -} - `) - }) -} - -func mockDeleteCertResponse(t *testing.T, lbID, certID int) { - th.Mux.HandleFunc(_certURL(lbID, certID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusOK) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/requests.go deleted file mode 100644 index bb53ef896..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/requests.go +++ /dev/null @@ -1,247 +0,0 @@ -package ssl - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -var ( - errPrivateKey = errors.New("PrivateKey is a required field") - errCertificate = errors.New("Certificate is a required field") - errIntCertificate = errors.New("IntCertificate is a required field") -) - -// UpdateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Update operation in this package. -type UpdateOptsBuilder interface { - ToSSLUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts struct { - // Required - consult the SSLTermConfig struct for more info. - SecurePort int - - // Required - consult the SSLTermConfig struct for more info. - PrivateKey string - - // Required - consult the SSLTermConfig struct for more info. - Certificate string - - // Required - consult the SSLTermConfig struct for more info. - IntCertificate string - - // Optional - consult the SSLTermConfig struct for more info. - Enabled *bool - - // Optional - consult the SSLTermConfig struct for more info. - SecureTrafficOnly *bool -} - -// ToSSLUpdateMap casts a CreateOpts struct to a map. -func (opts UpdateOpts) ToSSLUpdateMap() (map[string]interface{}, error) { - ssl := make(map[string]interface{}) - - if opts.SecurePort == 0 { - return ssl, errors.New("SecurePort needs to be an integer greater than 0") - } - if opts.PrivateKey == "" { - return ssl, errPrivateKey - } - if opts.Certificate == "" { - return ssl, errCertificate - } - if opts.IntCertificate == "" { - return ssl, errIntCertificate - } - - ssl["securePort"] = opts.SecurePort - ssl["privateKey"] = opts.PrivateKey - ssl["certificate"] = opts.Certificate - ssl["intermediateCertificate"] = opts.IntCertificate - - if opts.Enabled != nil { - ssl["enabled"] = &opts.Enabled - } - - if opts.SecureTrafficOnly != nil { - ssl["secureTrafficOnly"] = &opts.SecureTrafficOnly - } - - return map[string]interface{}{"sslTermination": ssl}, nil -} - -// Update is the operation responsible for updating the SSL Termination -// configuration for a load balancer. -func Update(c *gophercloud.ServiceClient, lbID int, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToSSLUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(rootURL(c, lbID), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Get is the operation responsible for showing the details of the SSL -// Termination configuration for a load balancer. -func Get(c *gophercloud.ServiceClient, lbID int) GetResult { - var res GetResult - _, res.Err = c.Get(rootURL(c, lbID), &res.Body, nil) - return res -} - -// Delete is the operation responsible for deleting the SSL Termination -// configuration for a load balancer. -func Delete(c *gophercloud.ServiceClient, lbID int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(rootURL(c, lbID), &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// ListCerts will list all of the certificate mappings associated with a -// SSL-terminated HTTP load balancer. -func ListCerts(c *gophercloud.ServiceClient, lbID int) pagination.Pager { - url := certURL(c, lbID) - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return CertPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// CreateCertOptsBuilder is the interface options structs have to satisfy in -// order to be used in the AddCert operation in this package. -type CreateCertOptsBuilder interface { - ToCertCreateMap() (map[string]interface{}, error) -} - -// CreateCertOpts represents the options used when adding a new certificate mapping. -type CreateCertOpts struct { - HostName string - PrivateKey string - Certificate string - IntCertificate string -} - -// ToCertCreateMap will cast an CreateCertOpts struct to a map for JSON serialization. -func (opts CreateCertOpts) ToCertCreateMap() (map[string]interface{}, error) { - cm := make(map[string]interface{}) - - if opts.HostName == "" { - return cm, errors.New("HostName is a required option") - } - if opts.PrivateKey == "" { - return cm, errPrivateKey - } - if opts.Certificate == "" { - return cm, errCertificate - } - - cm["hostName"] = opts.HostName - cm["privateKey"] = opts.PrivateKey - cm["certificate"] = opts.Certificate - - if opts.IntCertificate != "" { - cm["intermediateCertificate"] = opts.IntCertificate - } - - return map[string]interface{}{"certificateMapping": cm}, nil -} - -// CreateCert will add a new SSL certificate and allow an SSL-terminated HTTP -// load balancer to use it. This feature is useful because it allows multiple -// certificates to be used. The maximum number of certificates that can be -// stored per LB is 20. -func CreateCert(c *gophercloud.ServiceClient, lbID int, opts CreateCertOptsBuilder) CreateCertResult { - var res CreateCertResult - - reqBody, err := opts.ToCertCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(certURL(c, lbID), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} - -// GetCert will show the details of an existing SSL certificate. -func GetCert(c *gophercloud.ServiceClient, lbID, certID int) GetCertResult { - var res GetCertResult - _, res.Err = c.Get(certResourceURL(c, lbID, certID), &res.Body, nil) - return res -} - -// UpdateCertOptsBuilder is the interface options structs have to satisfy in -// order to be used in the UpdateCert operation in this package. -type UpdateCertOptsBuilder interface { - ToCertUpdateMap() (map[string]interface{}, error) -} - -// UpdateCertOpts represents the options needed to update a SSL certificate. -type UpdateCertOpts struct { - HostName string - PrivateKey string - Certificate string - IntCertificate string -} - -// ToCertUpdateMap will cast an UpdateCertOpts struct into a map for JSON -// seralization. -func (opts UpdateCertOpts) ToCertUpdateMap() (map[string]interface{}, error) { - cm := make(map[string]interface{}) - - if opts.HostName != "" { - cm["hostName"] = opts.HostName - } - if opts.PrivateKey != "" { - cm["privateKey"] = opts.PrivateKey - } - if opts.Certificate != "" { - cm["certificate"] = opts.Certificate - } - if opts.IntCertificate != "" { - cm["intermediateCertificate"] = opts.IntCertificate - } - - return map[string]interface{}{"certificateMapping": cm}, nil -} - -// UpdateCert is the operation responsible for updating the details of an -// existing SSL certificate. -func UpdateCert(c *gophercloud.ServiceClient, lbID, certID int, opts UpdateCertOptsBuilder) UpdateCertResult { - var res UpdateCertResult - - reqBody, err := opts.ToCertUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(certResourceURL(c, lbID, certID), reqBody, &res.Body, nil) - return res -} - -// DeleteCert is the operation responsible for permanently removing a SSL -// certificate. -func DeleteCert(c *gophercloud.ServiceClient, lbID, certID int) DeleteResult { - var res DeleteResult - - _, res.Err = c.Delete(certResourceURL(c, lbID, certID), &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/results.go deleted file mode 100644 index ead9fcd37..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/results.go +++ /dev/null @@ -1,148 +0,0 @@ -package ssl - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// SSLTermConfig represents the SSL configuration for a particular load balancer. -type SSLTermConfig struct { - // The port on which the SSL termination load balancer listens for secure - // traffic. The value must be unique to the existing LB protocol/port - // combination - SecurePort int `mapstructure:"securePort"` - - // The private key for the SSL certificate which is validated and verified - // against the provided certificates. - PrivateKey string `mapstructure:"privatekey"` - - // The certificate used for SSL termination, which is validated and verified - // against the key and intermediate certificate if provided. - Certificate string - - // The intermediate certificate (for the user). The intermediate certificate - // is validated and verified against the key and certificate credentials - // provided. A user may only provide this value when accompanied by a - // Certificate, PrivateKey, and SecurePort. It may not be added or updated as - // a single attribute in a future operation. - IntCertificate string `mapstructure:"intermediatecertificate"` - - // Determines if the load balancer is enabled to terminate SSL traffic or not. - // If this is set to false, the load balancer retains its specified SSL - // attributes but does not terminate SSL traffic. - Enabled bool - - // Determines if the load balancer can only accept secure traffic. If set to - // true, the load balancer will not accept non-secure traffic. - SecureTrafficOnly bool -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// UpdateResult represents the result of an update operation. -type UpdateResult struct { - gophercloud.ErrResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract interprets a GetResult as a SSLTermConfig struct, if possible. -func (r GetResult) Extract() (*SSLTermConfig, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - SSL SSLTermConfig `mapstructure:"sslTermination"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.SSL, err -} - -// Certificate represents an SSL certificate associated with an SSL-terminated -// HTTP load balancer. -type Certificate struct { - ID int - HostName string - Certificate string - IntCertificate string `mapstructure:"intermediateCertificate"` -} - -// CertPage represents a page of certificates. -type CertPage struct { - pagination.LinkedPageBase -} - -// IsEmpty checks whether a CertMappingPage struct is empty. -func (p CertPage) IsEmpty() (bool, error) { - is, err := ExtractCerts(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractCerts accepts a Page struct, specifically a CertPage struct, and -// extracts the elements into a slice of Cert structs. In other words, a generic -// collection is mapped into a relevant slice. -func ExtractCerts(page pagination.Page) ([]Certificate, error) { - type NestedMap struct { - Cert Certificate `mapstructure:"certificateMapping" json:"certificateMapping"` - } - var resp struct { - Certs []NestedMap `mapstructure:"certificateMappings" json:"certificateMappings"` - } - - err := mapstructure.Decode(page.(CertPage).Body, &resp) - - slice := []Certificate{} - for _, cert := range resp.Certs { - slice = append(slice, cert.Cert) - } - - return slice, err -} - -type certResult struct { - gophercloud.Result -} - -// Extract interprets a result as a CertMapping struct, if possible. -func (r certResult) Extract() (*Certificate, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Cert Certificate `mapstructure:"certificateMapping"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.Cert, err -} - -// CreateCertResult represents the result of an CreateCert operation. -type CreateCertResult struct { - certResult -} - -// GetCertResult represents the result of a GetCert operation. -type GetCertResult struct { - certResult -} - -// UpdateCertResult represents the result of an UpdateCert operation. -type UpdateCertResult struct { - certResult -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/urls.go deleted file mode 100644 index aa814b358..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package ssl - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - path = "loadbalancers" - sslPath = "ssltermination" - certPath = "certificatemappings" -) - -func rootURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), sslPath) -} - -func certURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), sslPath, certPath) -} - -func certResourceURL(c *gophercloud.ServiceClient, id, certID int) string { - return c.ServiceURL(path, strconv.Itoa(id), sslPath, certPath, strconv.Itoa(certID)) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/doc.go deleted file mode 100644 index 1ed605d36..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -/* -Package throttle provides information and interaction with the Connection -Throttling feature of the Rackspace Cloud Load Balancer service. -*/ -package throttle diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go deleted file mode 100644 index f3e49fa68..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go +++ /dev/null @@ -1,62 +0,0 @@ -package throttle - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(id int) string { - return "/loadbalancers/" + strconv.Itoa(id) + "/connectionthrottle" -} - -func mockGetResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "connectionThrottle": { - "maxConnections": 100 - } -} -`) - }) -} - -func mockCreateResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "PUT") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "connectionThrottle": { - "maxConnectionRate": 0, - "maxConnections": 200, - "minConnections": 0, - "rateInterval": 0 - } -} - `) - - w.WriteHeader(http.StatusAccepted) - fmt.Fprintf(w, `{}`) - }) -} - -func mockDeleteResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/requests.go deleted file mode 100644 index 0446b97a1..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/requests.go +++ /dev/null @@ -1,76 +0,0 @@ -package throttle - -import ( - "errors" - - "github.com/rackspace/gophercloud" -) - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. -type CreateOptsBuilder interface { - ToCTCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // Required - the maximum amount of connections per IP address to allow per LB. - MaxConnections int - - // Deprecated as of v1.22. - MaxConnectionRate int - - // Deprecated as of v1.22. - MinConnections int - - // Deprecated as of v1.22. - RateInterval int -} - -// ToCTCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToCTCreateMap() (map[string]interface{}, error) { - ct := make(map[string]interface{}) - - if opts.MaxConnections < 0 || opts.MaxConnections > 100000 { - return ct, errors.New("MaxConnections must be an int between 0 and 100000") - } - - ct["maxConnections"] = opts.MaxConnections - ct["maxConnectionRate"] = opts.MaxConnectionRate - ct["minConnections"] = opts.MinConnections - ct["rateInterval"] = opts.RateInterval - - return map[string]interface{}{"connectionThrottle": ct}, nil -} - -// Create is the operation responsible for creating or updating the connection -// throttling configuration for a load balancer. -func Create(c *gophercloud.ServiceClient, lbID int, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToCTCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(rootURL(c, lbID), reqBody, &res.Body, nil) - return res -} - -// Get is the operation responsible for showing the details of the connection -// throttling configuration for a load balancer. -func Get(c *gophercloud.ServiceClient, lbID int) GetResult { - var res GetResult - _, res.Err = c.Get(rootURL(c, lbID), &res.Body, nil) - return res -} - -// Delete is the operation responsible for deleting the connection throttling -// configuration for a load balancer. -func Delete(c *gophercloud.ServiceClient, lbID int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(rootURL(c, lbID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/results.go deleted file mode 100644 index db93c6f3f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/results.go +++ /dev/null @@ -1,43 +0,0 @@ -package throttle - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" -) - -// ConnectionThrottle represents the connection throttle configuration for a -// particular load balancer. -type ConnectionThrottle struct { - MaxConnections int -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - gophercloud.ErrResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} - -// GetResult represents the result of a get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract interprets a GetResult as a SP, if possible. -func (r GetResult) Extract() (*ConnectionThrottle, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - CT ConnectionThrottle `mapstructure:"connectionThrottle"` - } - - err := mapstructure.Decode(r.Body, &response) - - return &response.CT, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/urls.go deleted file mode 100644 index b77f0ac1c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/urls.go +++ /dev/null @@ -1,16 +0,0 @@ -package throttle - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - path = "loadbalancers" - ctPath = "connectionthrottle" -) - -func rootURL(c *gophercloud.ServiceClient, id int) string { - return c.ServiceURL(path, strconv.Itoa(id), ctPath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/doc.go deleted file mode 100644 index 5c3846d44..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/doc.go +++ /dev/null @@ -1,13 +0,0 @@ -/* -Package vips provides information and interaction with the Virtual IP API -resource for the Rackspace Cloud Load Balancer service. - -A virtual IP (VIP) makes a load balancer accessible by clients. The load -balancing service supports either a public VIP, routable on the public Internet, -or a ServiceNet address, routable only within the region in which the load -balancer resides. - -All load balancers must have at least one virtual IP associated with them at -all times. -*/ -package vips diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/fixtures.go deleted file mode 100644 index 158759f7f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/fixtures.go +++ /dev/null @@ -1,88 +0,0 @@ -package vips - -import ( - "fmt" - "net/http" - "strconv" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -func _rootURL(lbID int) string { - return "/loadbalancers/" + strconv.Itoa(lbID) + "/virtualips" -} - -func mockListResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "GET") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "virtualIps": [ - { - "id": 1000, - "address": "206.10.10.210", - "type": "PUBLIC" - } - ] -} - `) - }) -} - -func mockCreateResponse(t *testing.T, lbID int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "POST") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - th.TestJSONRequest(t, r, ` -{ - "type":"PUBLIC", - "ipVersion":"IPV6" -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - - fmt.Fprintf(w, ` -{ - "address":"fd24:f480:ce44:91bc:1af2:15ff:0000:0002", - "id":9000134, - "type":"PUBLIC", - "ipVersion":"IPV6" -} - `) - }) -} - -func mockBatchDeleteResponse(t *testing.T, lbID int, ids []int) { - th.Mux.HandleFunc(_rootURL(lbID), func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - r.ParseForm() - - for k, v := range ids { - fids := r.Form["id"] - th.AssertEquals(t, strconv.Itoa(v), fids[k]) - } - - w.WriteHeader(http.StatusAccepted) - }) -} - -func mockDeleteResponse(t *testing.T, lbID, vipID int) { - url := _rootURL(lbID) + "/" + strconv.Itoa(vipID) - th.Mux.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "DELETE") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/requests.go deleted file mode 100644 index 2bc924f29..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/requests.go +++ /dev/null @@ -1,97 +0,0 @@ -package vips - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List is the operation responsible for returning a paginated collection of -// load balancer virtual IP addresses. -func List(client *gophercloud.ServiceClient, loadBalancerID int) pagination.Pager { - url := rootURL(client, loadBalancerID) - return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return VIPPage{pagination.SinglePageBase(r)} - }) -} - -// CreateOptsBuilder is the interface options structs have to satisfy in order -// to be used in the main Create operation in this package. Since many -// extensions decorate or modify the common logic, it is useful for them to -// satisfy a basic interface in order for them to be used. -type CreateOptsBuilder interface { - ToVIPCreateMap() (map[string]interface{}, error) -} - -// CreateOpts is the common options struct used in this package's Create -// operation. -type CreateOpts struct { - // Optional - the ID of an existing virtual IP. By doing this, you are - // allowing load balancers to share IPV6 addresses. - ID string - - // Optional - the type of address. - Type Type - - // Optional - the version of address. - Version Version -} - -// ToVIPCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToVIPCreateMap() (map[string]interface{}, error) { - lb := make(map[string]interface{}) - - if opts.ID != "" { - lb["id"] = opts.ID - } - if opts.Type != "" { - lb["type"] = opts.Type - } - if opts.Version != "" { - lb["ipVersion"] = opts.Version - } - - return lb, nil -} - -// Create is the operation responsible for assigning a new Virtual IP to an -// existing load balancer resource. Currently, only version 6 IP addresses may -// be added. -func Create(c *gophercloud.ServiceClient, lbID int, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToVIPCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(rootURL(c, lbID), reqBody, &res.Body, nil) - return res -} - -// BulkDelete is the operation responsible for batch deleting multiple VIPs in -// a single operation. It accepts a slice of integer IDs and will remove them -// from the load balancer. The maximum limit is 10 VIP removals at once. -func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, vipIDs []int) DeleteResult { - var res DeleteResult - - if len(vipIDs) > 10 || len(vipIDs) == 0 { - res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 VIP IDs") - return res - } - - url := rootURL(c, loadBalancerID) - url += gophercloud.IDSliceToQueryString("id", vipIDs) - - _, res.Err = c.Delete(url, nil) - return res -} - -// Delete is the operation responsible for permanently deleting a VIP. -func Delete(c *gophercloud.ServiceClient, lbID, vipID int) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(resourceURL(c, lbID, vipID), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/results.go deleted file mode 100644 index 678b2aff7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/results.go +++ /dev/null @@ -1,89 +0,0 @@ -package vips - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// VIP represents a Virtual IP API resource. -type VIP struct { - Address string `json:"address,omitempty"` - ID int `json:"id,omitempty"` - Type Type `json:"type,omitempty"` - Version Version `json:"ipVersion,omitempty" mapstructure:"ipVersion"` -} - -// Version represents the version of a VIP. -type Version string - -// Convenient constants to use for type -const ( - IPV4 Version = "IPV4" - IPV6 Version = "IPV6" -) - -// Type represents the type of a VIP. -type Type string - -const ( - // PUBLIC indicates a VIP type that is routable on the public Internet. - PUBLIC Type = "PUBLIC" - - // PRIVATE indicates a VIP type that is routable only on ServiceNet. - PRIVATE Type = "SERVICENET" -) - -// VIPPage is the page returned by a pager when traversing over a collection -// of VIPs. -type VIPPage struct { - pagination.SinglePageBase -} - -// IsEmpty checks whether a VIPPage struct is empty. -func (p VIPPage) IsEmpty() (bool, error) { - is, err := ExtractVIPs(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractVIPs accepts a Page struct, specifically a VIPPage struct, and -// extracts the elements into a slice of VIP structs. In other words, a -// generic collection is mapped into a relevant slice. -func ExtractVIPs(page pagination.Page) ([]VIP, error) { - var resp struct { - VIPs []VIP `mapstructure:"virtualIps" json:"virtualIps"` - } - - err := mapstructure.Decode(page.(VIPPage).Body, &resp) - - return resp.VIPs, err -} - -type commonResult struct { - gophercloud.Result -} - -func (r commonResult) Extract() (*VIP, error) { - if r.Err != nil { - return nil, r.Err - } - - resp := &VIP{} - err := mapstructure.Decode(r.Body, resp) - - return resp, err -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/urls.go deleted file mode 100644 index 28f063a0f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/lb/v1/vips/urls.go +++ /dev/null @@ -1,20 +0,0 @@ -package vips - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -const ( - lbPath = "loadbalancers" - vipPath = "virtualips" -) - -func resourceURL(c *gophercloud.ServiceClient, lbID, nodeID int) string { - return c.ServiceURL(lbPath, strconv.Itoa(lbID), vipPath, strconv.Itoa(nodeID)) -} - -func rootURL(c *gophercloud.ServiceClient, lbID int) string { - return c.ServiceURL(lbPath, strconv.Itoa(lbID), vipPath) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/common/common_tests.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/common/common_tests.go deleted file mode 100644 index 129cd63ae..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/common/common_tests.go +++ /dev/null @@ -1,12 +0,0 @@ -package common - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/testhelper/client" -) - -const TokenID = client.TokenID - -func ServiceClient() *gophercloud.ServiceClient { - return client.ServiceClient() -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate.go deleted file mode 100644 index dcb0855db..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate.go +++ /dev/null @@ -1,41 +0,0 @@ -package networks - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/networking/v2/networks" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// networks. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} - -// Get retrieves a specific network based on its unique ID. -func Get(c *gophercloud.ServiceClient, networkID string) os.GetResult { - return os.Get(c, networkID) -} - -// Create accepts a CreateOpts struct and creates a new network using the values -// provided. This operation does not actually require a request body, i.e. the -// CreateOpts struct argument can be empty. -// -// The tenant ID that is contained in the URI is the tenant that creates the -// network. An admin user, however, has the option of specifying another tenant -// ID in the CreateOpts struct. -func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, opts) -} - -// Update accepts a UpdateOpts struct and updates an existing network using the -// values provided. For more information, see the Create function. -func Update(c *gophercloud.ServiceClient, networkID string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, networkID, opts) -} - -// Delete accepts a unique ID and deletes the network associated with it. -func Delete(c *gophercloud.ServiceClient, networkID string) os.DeleteResult { - return os.Delete(c, networkID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/ports/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/ports/delegate.go deleted file mode 100644 index 95728d185..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/ports/delegate.go +++ /dev/null @@ -1,43 +0,0 @@ -package ports - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/networking/v2/ports" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// ports. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those ports that are owned by the tenant -// who submits the request, unless the request is submitted by a user with -// administrative rights. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} - -// Get retrieves a specific port based on its unique ID. -func Get(c *gophercloud.ServiceClient, networkID string) os.GetResult { - return os.Get(c, networkID) -} - -// Create accepts a CreateOpts struct and creates a new network using the values -// provided. You must remember to provide a NetworkID value. -// -// NOTE: Currently the SecurityGroup option is not implemented to work with -// Rackspace. -func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, opts) -} - -// Update accepts a UpdateOpts struct and updates an existing port using the -// values provided. -func Update(c *gophercloud.ServiceClient, networkID string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, networkID, opts) -} - -// Delete accepts a unique ID and deletes the port associated with it. -func Delete(c *gophercloud.ServiceClient, networkID string) os.DeleteResult { - return os.Delete(c, networkID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/doc.go deleted file mode 100644 index 31f744ccd..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Package security contains functionality to work with security group and -// security group rules Neutron resources. -// -// Security groups and security group rules allows administrators and tenants -// the ability to specify the type of traffic and direction (ingress/egress) -// that is allowed to pass through a port. A security group is a container for -// security group rules. -// -// When a port is created in Networking it is associated with a security group. -// If a security group is not specified the port is associated with a 'default' -// security group. By default, this group drops all ingress traffic and allows -// all egress. Rules can be added to this group in order to change the behaviour. -// -// The basic characteristics of Neutron Security Groups are: -// -// For ingress traffic (to an instance) -// - Only traffic matched with security group rules are allowed. -// - When there is no rule defined, all traffic is dropped. -// -// For egress traffic (from an instance) -// - Only traffic matched with security group rules are allowed. -// - When there is no rule defined, all egress traffic are dropped. -// - When a new security group is created, rules to allow all egress traffic -// is automatically added. -// -// "default security group" is defined for each tenant. -// - For the default security group a rule which allows intercommunication -// among hosts associated with the default security group is defined by default. -// - As a result, all egress traffic and intercommunication in the default -// group are allowed and all ingress from outside of the default group is -// dropped by default (in the default security group). -package security diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/groups/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/groups/delegate.go deleted file mode 100644 index 1e9a23a05..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/groups/delegate.go +++ /dev/null @@ -1,30 +0,0 @@ -package groups - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// security groups. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, opts os.ListOpts) pagination.Pager { - return os.List(c, opts) -} - -// Create is an operation which provisions a new security group with default -// security group rules for the IPv4 and IPv6 ether types. -func Create(c *gophercloud.ServiceClient, opts os.CreateOpts) os.CreateResult { - return os.Create(c, opts) -} - -// Get retrieves a particular security group based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(c, id) -} - -// Delete will permanently delete a particular security group based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/rules/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/rules/delegate.go deleted file mode 100644 index 23b4b318e..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/security/rules/delegate.go +++ /dev/null @@ -1,30 +0,0 @@ -package rules - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// security group rules. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -func List(c *gophercloud.ServiceClient, opts os.ListOpts) pagination.Pager { - return os.List(c, opts) -} - -// Create is an operation which provisions a new security group with default -// security group rules for the IPv4 and IPv6 ether types. -func Create(c *gophercloud.ServiceClient, opts os.CreateOpts) os.CreateResult { - return os.Create(c, opts) -} - -// Get retrieves a particular security group based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(c, id) -} - -// Delete will permanently delete a particular security group based on its unique ID. -func Delete(c *gophercloud.ServiceClient, id string) os.DeleteResult { - return os.Delete(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/subnets/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/subnets/delegate.go deleted file mode 100644 index a7fb7bb15..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/networking/v2/subnets/delegate.go +++ /dev/null @@ -1,40 +0,0 @@ -package subnets - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/networking/v2/subnets" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager which allows you to iterate over a collection of -// subnets. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those subnets that are owned by the tenant -// who submits the request, unless the request is submitted by a user with -// administrative rights. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} - -// Get retrieves a specific subnet based on its unique ID. -func Get(c *gophercloud.ServiceClient, networkID string) os.GetResult { - return os.Get(c, networkID) -} - -// Create accepts a CreateOpts struct and creates a new subnet using the values -// provided. You must remember to provide a valid NetworkID, CIDR and IP version. -func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, opts) -} - -// Update accepts a UpdateOpts struct and updates an existing subnet using the -// values provided. -func Update(c *gophercloud.ServiceClient, networkID string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, networkID, opts) -} - -// Delete accepts a unique ID and deletes the subnet associated with it. -func Delete(c *gophercloud.ServiceClient, networkID string) os.DeleteResult { - return os.Delete(c, networkID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/accounts/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/accounts/delegate.go deleted file mode 100644 index 94739308f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/accounts/delegate.go +++ /dev/null @@ -1,39 +0,0 @@ -package accounts - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts" -) - -// Get is a function that retrieves an account's metadata. To extract just the -// custom metadata, call the ExtractMetadata method on the GetResult. To extract -// all the headers that are returned (including the metadata), call the -// ExtractHeader method on the GetResult. -func Get(c *gophercloud.ServiceClient) os.GetResult { - return os.Get(c, nil) -} - -// UpdateOpts is a structure that contains parameters for updating, creating, or -// deleting an account's metadata. -type UpdateOpts struct { - Metadata map[string]string - TempURLKey string `h:"X-Account-Meta-Temp-URL-Key"` - TempURLKey2 string `h:"X-Account-Meta-Temp-URL-Key-2"` -} - -// ToAccountUpdateMap formats an UpdateOpts into a map[string]string of headers. -func (opts UpdateOpts) ToAccountUpdateMap() (map[string]string, error) { - headers, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - for k, v := range opts.Metadata { - headers["X-Account-Meta-"+k] = v - } - return headers, err -} - -// Update will update an account's metadata with the Metadata in the UpdateOptsBuilder. -func Update(c *gophercloud.ServiceClient, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/accounts/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/accounts/doc.go deleted file mode 100644 index 293a93088..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/accounts/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package accounts provides information and interaction with the account -// API resource for the Rackspace Cloud Files service. -package accounts diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/doc.go deleted file mode 100644 index 9c89e22b2..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package bulk provides functionality for working with bulk operations in the -// Rackspace Cloud Files service. -package bulk diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go deleted file mode 100644 index 0aeec155b..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go +++ /dev/null @@ -1,51 +0,0 @@ -package bulk - -import ( - "net/url" - "strings" - - "github.com/rackspace/gophercloud" -) - -// DeleteOptsBuilder allows extensions to add additional parameters to the -// Delete request. -type DeleteOptsBuilder interface { - ToBulkDeleteBody() (string, error) -} - -// DeleteOpts is a structure that holds parameters for deleting an object. -type DeleteOpts []string - -// ToBulkDeleteBody formats a DeleteOpts into a request body. -func (opts DeleteOpts) ToBulkDeleteBody() (string, error) { - return url.QueryEscape(strings.Join(opts, "\n")), nil -} - -// Delete will delete objects or containers in bulk. -func Delete(c *gophercloud.ServiceClient, opts DeleteOptsBuilder) DeleteResult { - var res DeleteResult - - if opts == nil { - return res - } - - reqString, err := opts.ToBulkDeleteBody() - if err != nil { - res.Err = err - return res - } - - reqBody := strings.NewReader(reqString) - - resp, err := c.Request("DELETE", deleteURL(c), gophercloud.RequestOpts{ - MoreHeaders: map[string]string{"Content-Type": "text/plain"}, - OkCodes: []int{200}, - JSONBody: reqBody, - JSONResponse: &res.Body, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/results.go deleted file mode 100644 index fddc125ac..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/results.go +++ /dev/null @@ -1,28 +0,0 @@ -package bulk - -import ( - "github.com/rackspace/gophercloud" - - "github.com/mitchellh/mapstructure" -) - -// DeleteResult represents the result of a bulk delete operation. -type DeleteResult struct { - gophercloud.Result -} - -// DeleteRespBody is the form of the response body returned by a bulk delete request. -type DeleteRespBody struct { - NumberNotFound int `mapstructure:"Number Not Found"` - ResponseStatus string `mapstructure:"Response Status"` - Errors []string `mapstructure:"Errors"` - NumberDeleted int `mapstructure:"Number Deleted"` - ResponseBody string `mapstructure:"Response Body"` -} - -// ExtractBody will extract the body returned by the bulk extract request. -func (dr DeleteResult) ExtractBody() (DeleteRespBody, error) { - var resp DeleteRespBody - err := mapstructure.Decode(dr.Body, &resp) - return resp, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/urls.go deleted file mode 100644 index 2e112033b..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package bulk - -import "github.com/rackspace/gophercloud" - -func deleteURL(c *gophercloud.ServiceClient) string { - return c.Endpoint + "?bulk-delete" -} - -func extractURL(c *gophercloud.ServiceClient, ext string) string { - return c.Endpoint + "?extract-archive=" + ext -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/delegate.go deleted file mode 100644 index 89adb8396..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/delegate.go +++ /dev/null @@ -1,38 +0,0 @@ -package cdncontainers - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtractNames interprets a page of List results when just the container -// names are requested. -func ExtractNames(page pagination.Page) ([]string, error) { - return os.ExtractNames(page) -} - -// ListOpts are options for listing Rackspace CDN containers. -type ListOpts struct { - EndMarker string `q:"end_marker"` - Format string `q:"format"` - Limit int `q:"limit"` - Marker string `q:"marker"` -} - -// ToContainerListParams formats a ListOpts into a query string and boolean -// representing whether to list complete information for each container. -func (opts ListOpts) ToContainerListParams() (bool, string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return false, "", err - } - return false, q.String(), nil -} - -// List is a function that retrieves containers associated with the account as -// well as account metadata. It returns a pager which can be iterated with the -// EachPage function. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/doc.go deleted file mode 100644 index 7b0930eee..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package cdncontainers provides information and interaction with the CDN -// Container API resource for the Rackspace Cloud Files service. -package cdncontainers diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go deleted file mode 100644 index 6acebb0aa..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go +++ /dev/null @@ -1,161 +0,0 @@ -package cdncontainers - -import ( - "strconv" - - "github.com/rackspace/gophercloud" -) - -// EnableOptsBuilder allows extensions to add additional parameters to the Enable -// request. -type EnableOptsBuilder interface { - ToCDNContainerEnableMap() (map[string]string, error) -} - -// EnableOpts is a structure that holds options for enabling a CDN container. -type EnableOpts struct { - // CDNEnabled indicates whether or not the container is CDN enabled. Set to - // `true` to enable the container. Note that changing this setting from true - // to false will disable the container in the CDN but only after the TTL has - // expired. - CDNEnabled bool `h:"X-Cdn-Enabled"` - // TTL is the time-to-live for the container (in seconds). - TTL int `h:"X-Ttl"` -} - -// ToCDNContainerEnableMap formats an EnableOpts into a map of headers. -func (opts EnableOpts) ToCDNContainerEnableMap() (map[string]string, error) { - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - return h, nil -} - -// Enable is a function that enables/disables a CDN container. -func Enable(c *gophercloud.ServiceClient, containerName string, opts EnableOptsBuilder) EnableResult { - var res EnableResult - h := c.AuthenticatedHeaders() - - if opts != nil { - headers, err := opts.ToCDNContainerEnableMap() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - } - - resp, err := c.Request("PUT", enableURL(c, containerName), gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{201, 202, 204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// Get is a function that retrieves the metadata of a container. To extract just -// the custom metadata, pass the GetResult response to the ExtractMetadata -// function. -func Get(c *gophercloud.ServiceClient, containerName string) GetResult { - var res GetResult - resp, err := c.Request("HEAD", getURL(c, containerName), gophercloud.RequestOpts{ - OkCodes: []int{200, 204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// State is the state of an option. It is a pointer to a boolean to enable checking for -// a zero-value of nil instead of false, which is a valid option. -type State *bool - -var ( - iTrue = true - iFalse = false - - // Enabled is used for a true value for options in request bodies. - Enabled State = &iTrue - // Disabled is used for a false value for options in request bodies. - Disabled State = &iFalse -) - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToContainerUpdateMap() (map[string]string, error) -} - -// UpdateOpts is a structure that holds parameters for updating, creating, or -// deleting a container's metadata. -type UpdateOpts struct { - // Whether or not to CDN-enable a container. Prefer using XCDNEnabled, which - // is of type *bool underneath. - // TODO v2.0: change type to Enabled/Disabled (*bool) - CDNEnabled bool `h:"X-Cdn-Enabled"` - // Whether or not to enable log retention. Prefer using XLogRetention, which - // is of type *bool underneath. - // TODO v2.0: change type to Enabled/Disabled (*bool) - LogRetention bool `h:"X-Log-Retention"` - XCDNEnabled *bool - XLogRetention *bool - TTL int `h:"X-Ttl"` -} - -// ToContainerUpdateMap formats a CreateOpts into a map of headers. -func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error) { - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - h["X-Cdn-Enabled"] = strconv.FormatBool(opts.CDNEnabled) - h["X-Log-Retention"] = strconv.FormatBool(opts.LogRetention) - - if opts.XCDNEnabled != nil { - h["X-Cdn-Enabled"] = strconv.FormatBool(*opts.XCDNEnabled) - } - - if opts.XLogRetention != nil { - h["X-Log-Retention"] = strconv.FormatBool(*opts.XLogRetention) - } - - return h, nil -} - -// Update is a function that creates, updates, or deletes a container's -// metadata. -func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - h := c.AuthenticatedHeaders() - - if opts != nil { - headers, err := opts.ToContainerUpdateMap() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - } - - resp, err := c.Request("POST", updateURL(c, containerName), gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{202, 204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/results.go deleted file mode 100644 index cb0ad3096..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/results.go +++ /dev/null @@ -1,149 +0,0 @@ -package cdncontainers - -import ( - "strings" - "time" - - "github.com/rackspace/gophercloud" -) - -// EnableHeader represents the headers returned in the response from an Enable request. -type EnableHeader struct { - CDNIosURI string `mapstructure:"X-Cdn-Ios-Uri"` - CDNSslURI string `mapstructure:"X-Cdn-Ssl-Uri"` - CDNStreamingURI string `mapstructure:"X-Cdn-Streaming-Uri"` - CDNUri string `mapstructure:"X-Cdn-Uri"` - ContentLength int `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// EnableResult represents the result of an Enable operation. -type EnableResult struct { - gophercloud.HeaderResult -} - -// Extract will return extract an EnableHeader from the response to an Enable -// request. To obtain a map of headers, call the ExtractHeader method on the EnableResult. -func (er EnableResult) Extract() (EnableHeader, error) { - var eh EnableHeader - if er.Err != nil { - return eh, er.Err - } - - if err := gophercloud.DecodeHeader(er.Header, &eh); err != nil { - return eh, err - } - - if date, ok := er.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, er.Header["Date"][0]) - if err != nil { - return eh, err - } - eh.Date = t - } - - return eh, nil -} - -// GetHeader represents the headers returned in the response from a Get request. -type GetHeader struct { - CDNEnabled bool `mapstructure:"X-Cdn-Enabled"` - CDNIosURI string `mapstructure:"X-Cdn-Ios-Uri"` - CDNSslURI string `mapstructure:"X-Cdn-Ssl-Uri"` - CDNStreamingURI string `mapstructure:"X-Cdn-Streaming-Uri"` - CDNUri string `mapstructure:"X-Cdn-Uri"` - ContentLength int `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - LogRetention bool `mapstructure:"X-Log-Retention"` - TransID string `mapstructure:"X-Trans-Id"` - TTL int `mapstructure:"X-Ttl"` -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Get. To obtain -// a map of headers, call the ExtractHeader method on the GetResult. -func (gr GetResult) Extract() (GetHeader, error) { - var gh GetHeader - if gr.Err != nil { - return gh, gr.Err - } - - if err := gophercloud.DecodeHeader(gr.Header, &gh); err != nil { - return gh, err - } - - if date, ok := gr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, gr.Header["Date"][0]) - if err != nil { - return gh, err - } - gh.Date = t - } - - return gh, nil -} - -// ExtractMetadata is a function that takes a GetResult (of type *http.Response) -// and returns the custom metadata associated with the container. -func (gr GetResult) ExtractMetadata() (map[string]string, error) { - if gr.Err != nil { - return nil, gr.Err - } - metadata := make(map[string]string) - for k, v := range gr.Header { - if strings.HasPrefix(k, "X-Container-Meta-") { - key := strings.TrimPrefix(k, "X-Container-Meta-") - metadata[key] = v[0] - } - } - return metadata, nil -} - -// UpdateHeader represents the headers returned in the response from a Update request. -type UpdateHeader struct { - CDNIosURI string `mapstructure:"X-Cdn-Ios-Uri"` - CDNSslURI string `mapstructure:"X-Cdn-Ssl-Uri"` - CDNStreamingURI string `mapstructure:"X-Cdn-Streaming-Uri"` - CDNUri string `mapstructure:"X-Cdn-Uri"` - ContentLength int `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// UpdateResult represents the result of an update operation. To extract the -// the headers from the HTTP response, you can invoke the 'ExtractHeader' -// method on the result struct. -type UpdateResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Update. To obtain -// a map of headers, call the ExtractHeader method on the UpdateResult. -func (ur UpdateResult) Extract() (UpdateHeader, error) { - var uh UpdateHeader - if ur.Err != nil { - return uh, ur.Err - } - - if err := gophercloud.DecodeHeader(ur.Header, &uh); err != nil { - return uh, err - } - - if date, ok := ur.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, ur.Header["Date"][0]) - if err != nil { - return uh, err - } - uh.Date = t - } - - return uh, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/urls.go deleted file mode 100644 index 541249a92..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/urls.go +++ /dev/null @@ -1,15 +0,0 @@ -package cdncontainers - -import "github.com/rackspace/gophercloud" - -func enableURL(c *gophercloud.ServiceClient, containerName string) string { - return c.ServiceURL(containerName) -} - -func getURL(c *gophercloud.ServiceClient, container string) string { - return c.ServiceURL(container) -} - -func updateURL(c *gophercloud.ServiceClient, container string) string { - return getURL(c, container) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/delegate.go deleted file mode 100644 index e9d2ff1d6..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/delegate.go +++ /dev/null @@ -1,11 +0,0 @@ -package cdnobjects - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects" -) - -// Delete is a function that deletes an object from the CDN. -func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts os.DeleteOptsBuilder) os.DeleteResult { - return os.Delete(c, containerName, objectName, nil) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/doc.go deleted file mode 100644 index 90cd5c97f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package cdnobjects provides information and interaction with the CDN -// Object API resource for the Rackspace Cloud Files service. -package cdnobjects diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/request.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/request.go deleted file mode 100644 index 540e0cd29..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdnobjects/request.go +++ /dev/null @@ -1,15 +0,0 @@ -package cdnobjects - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers" -) - -// CDNURL returns the unique CDN URI for the given container and object. -func CDNURL(c *gophercloud.ServiceClient, containerName, objectName string) (string, error) { - h, err := cdncontainers.Get(c, containerName).Extract() - if err != nil { - return "", err - } - return h.CDNUri + "/" + objectName, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/containers/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/containers/delegate.go deleted file mode 100644 index 77ed00257..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/containers/delegate.go +++ /dev/null @@ -1,93 +0,0 @@ -package containers - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtractInfo interprets a page of List results when full container info -// is requested. -func ExtractInfo(page pagination.Page) ([]os.Container, error) { - return os.ExtractInfo(page) -} - -// ExtractNames interprets a page of List results when just the container -// names are requested. -func ExtractNames(page pagination.Page) ([]string, error) { - return os.ExtractNames(page) -} - -// List is a function that retrieves containers associated with the account as -// well as account metadata. It returns a pager which can be iterated with the -// EachPage function. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} - -// CreateOpts is a structure that holds parameters for creating a container. -type CreateOpts struct { - Metadata map[string]string - ContainerRead string `h:"X-Container-Read"` - ContainerWrite string `h:"X-Container-Write"` - VersionsLocation string `h:"X-Versions-Location"` -} - -// ToContainerCreateMap formats a CreateOpts into a map of headers. -func (opts CreateOpts) ToContainerCreateMap() (map[string]string, error) { - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - for k, v := range opts.Metadata { - h["X-Container-Meta-"+k] = v - } - return h, nil -} - -// Create is a function that creates a new container. -func Create(c *gophercloud.ServiceClient, containerName string, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, containerName, opts) -} - -// Delete is a function that deletes a container. -func Delete(c *gophercloud.ServiceClient, containerName string) os.DeleteResult { - return os.Delete(c, containerName) -} - -// UpdateOpts is a structure that holds parameters for updating or creating a -// container's metadata. -type UpdateOpts struct { - Metadata map[string]string - ContainerRead string `h:"X-Container-Read"` - ContainerWrite string `h:"X-Container-Write"` - ContentType string `h:"Content-Type"` - DetectContentType bool `h:"X-Detect-Content-Type"` - RemoveVersionsLocation string `h:"X-Remove-Versions-Location"` - VersionsLocation string `h:"X-Versions-Location"` -} - -// ToContainerUpdateMap formats a CreateOpts into a map of headers. -func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error) { - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - for k, v := range opts.Metadata { - h["X-Container-Meta-"+k] = v - } - return h, nil -} - -// Update is a function that creates, updates, or deletes a container's -// metadata. -func Update(c *gophercloud.ServiceClient, containerName string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, containerName, opts) -} - -// Get is a function that retrieves the metadata of a container. To extract just -// the custom metadata, pass the GetResult response to the ExtractMetadata -// function. -func Get(c *gophercloud.ServiceClient, containerName string) os.GetResult { - return os.Get(c, containerName) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/containers/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/containers/doc.go deleted file mode 100644 index d132a0738..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/containers/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package containers provides information and interaction with the Container -// API resource for the Rackspace Cloud Files service. -package containers diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go deleted file mode 100644 index 94c820ba7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go +++ /dev/null @@ -1,94 +0,0 @@ -package objects - -import ( - "io" - - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects" - "github.com/rackspace/gophercloud/pagination" -) - -// ExtractInfo is a function that takes a page of objects and returns their full information. -func ExtractInfo(page pagination.Page) ([]os.Object, error) { - return os.ExtractInfo(page) -} - -// ExtractNames is a function that takes a page of objects and returns only their names. -func ExtractNames(page pagination.Page) ([]string, error) { - return os.ExtractNames(page) -} - -// List is a function that retrieves objects in the container as -// well as container metadata. It returns a pager which can be iterated with the -// EachPage function. -func List(c *gophercloud.ServiceClient, containerName string, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, containerName, opts) -} - -// Download is a function that retrieves the content and metadata for an object. -// To extract just the content, pass the DownloadResult response to the -// ExtractContent function. -func Download(c *gophercloud.ServiceClient, containerName, objectName string, opts os.DownloadOptsBuilder) os.DownloadResult { - return os.Download(c, containerName, objectName, opts) -} - -// Create is a function that creates a new object or replaces an existing object. -func Create(c *gophercloud.ServiceClient, containerName, objectName string, content io.ReadSeeker, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, containerName, objectName, content, opts) -} - -// CopyOpts is a structure that holds parameters for copying one object to -// another. -type CopyOpts struct { - Metadata map[string]string - ContentDisposition string `h:"Content-Disposition"` - ContentEncoding string `h:"Content-Encoding"` - ContentLength int `h:"Content-Length"` - ContentType string `h:"Content-Type"` - CopyFrom string `h:"X-Copy_From"` - Destination string `h:"Destination"` - DetectContentType bool `h:"X-Detect-Content-Type"` -} - -// ToObjectCopyMap formats a CopyOpts into a map of headers. -func (opts CopyOpts) ToObjectCopyMap() (map[string]string, error) { - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - for k, v := range opts.Metadata { - h["X-Object-Meta-"+k] = v - } - // `Content-Length` is required and a value of "0" is acceptable, but calling `gophercloud.BuildHeaders` - // will remove the `Content-Length` header if it's set to 0 (or equivalently not set). This will add - // the header if it's not already set. - if _, ok := h["Content-Length"]; !ok { - h["Content-Length"] = "0" - } - return h, nil -} - -// Copy is a function that copies one object to another. -func Copy(c *gophercloud.ServiceClient, containerName, objectName string, opts os.CopyOptsBuilder) os.CopyResult { - return os.Copy(c, containerName, objectName, opts) -} - -// Delete is a function that deletes an object. -func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts os.DeleteOptsBuilder) os.DeleteResult { - return os.Delete(c, containerName, objectName, opts) -} - -// Get is a function that retrieves the metadata of an object. To extract just the custom -// metadata, pass the GetResult response to the ExtractMetadata function. -func Get(c *gophercloud.ServiceClient, containerName, objectName string, opts os.GetOptsBuilder) os.GetResult { - return os.Get(c, containerName, objectName, opts) -} - -// Update is a function that creates, updates, or deletes an object's metadata. -func Update(c *gophercloud.ServiceClient, containerName, objectName string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, containerName, objectName, opts) -} - -func CreateTempURL(c *gophercloud.ServiceClient, containerName, objectName string, opts os.CreateTempURLOpts) (string, error) { - return os.CreateTempURL(c, containerName, objectName, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/doc.go deleted file mode 100644 index 781984bee..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package objects provides information and interaction with the Object -// API resource for the Rackspace Cloud Files service. -package objects diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/buildinfo/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/buildinfo/delegate.go deleted file mode 100644 index c834e5c7d..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/buildinfo/delegate.go +++ /dev/null @@ -1,11 +0,0 @@ -package buildinfo - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/orchestration/v1/buildinfo" -) - -// Get retreives build info data for the Heat deployment. -func Get(c *gophercloud.ServiceClient) os.GetResult { - return os.Get(c) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/buildinfo/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/buildinfo/doc.go deleted file mode 100644 index 183e8dfa7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/buildinfo/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package buildinfo provides build information about heat deployments. -package buildinfo diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackevents/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackevents/delegate.go deleted file mode 100644 index 08675deac..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackevents/delegate.go +++ /dev/null @@ -1,27 +0,0 @@ -package stackevents - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents" - "github.com/rackspace/gophercloud/pagination" -) - -// Find retreives stack events for the given stack name. -func Find(c *gophercloud.ServiceClient, stackName string) os.FindResult { - return os.Find(c, stackName) -} - -// List makes a request against the API to list resources for the given stack. -func List(c *gophercloud.ServiceClient, stackName, stackID string, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, stackName, stackID, opts) -} - -// ListResourceEvents makes a request against the API to list resources for the given stack. -func ListResourceEvents(c *gophercloud.ServiceClient, stackName, stackID, resourceName string, opts os.ListResourceEventsOptsBuilder) pagination.Pager { - return os.ListResourceEvents(c, stackName, stackID, resourceName, opts) -} - -// Get retreives data for the given stack resource. -func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) os.GetResult { - return os.Get(c, stackName, stackID, resourceName, eventID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackevents/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackevents/doc.go deleted file mode 100644 index dfd6ef660..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackevents/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package stackevents provides operations for finding, listing, and retrieving -// stack events. -package stackevents diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackresources/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackresources/delegate.go deleted file mode 100644 index cb7be28b7..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackresources/delegate.go +++ /dev/null @@ -1,42 +0,0 @@ -package stackresources - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources" - "github.com/rackspace/gophercloud/pagination" -) - -// Find retreives stack resources for the given stack name. -func Find(c *gophercloud.ServiceClient, stackName string) os.FindResult { - return os.Find(c, stackName) -} - -// List makes a request against the API to list resources for the given stack. -func List(c *gophercloud.ServiceClient, stackName, stackID string, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, stackName, stackID, opts) -} - -// Get retreives data for the given stack resource. -func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) os.GetResult { - return os.Get(c, stackName, stackID, resourceName) -} - -// Metadata retreives the metadata for the given stack resource. -func Metadata(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) os.MetadataResult { - return os.Metadata(c, stackName, stackID, resourceName) -} - -// ListTypes makes a request against the API to list resource types. -func ListTypes(c *gophercloud.ServiceClient) pagination.Pager { - return os.ListTypes(c) -} - -// Schema retreives the schema for the given resource type. -func Schema(c *gophercloud.ServiceClient, resourceType string) os.SchemaResult { - return os.Schema(c, resourceType) -} - -// Template retreives the template representation for the given resource type. -func Template(c *gophercloud.ServiceClient, resourceType string) os.TemplateResult { - return os.Template(c, resourceType) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackresources/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackresources/doc.go deleted file mode 100644 index e4f8b08dc..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stackresources/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package stackresources provides operations for working with stack resources. -// A resource is a template artifact that represents some component of your -// desired architecture (a Cloud Server, a group of scaled Cloud Servers, a load -// balancer, some configuration management system, and so forth). -package stackresources diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/delegate.go deleted file mode 100644 index f7e387f8f..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/delegate.go +++ /dev/null @@ -1,49 +0,0 @@ -package stacks - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks" - "github.com/rackspace/gophercloud/pagination" -) - -// Create accepts an os.CreateOpts struct and creates a new stack using the values -// provided. -func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult { - return os.Create(c, opts) -} - -// Adopt accepts an os.AdoptOpts struct and creates a new stack from existing stack -// resources using the values provided. -func Adopt(c *gophercloud.ServiceClient, opts os.AdoptOptsBuilder) os.AdoptResult { - return os.Adopt(c, opts) -} - -// List accepts an os.ListOpts struct and lists stacks based on the options provided. -func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager { - return os.List(c, opts) -} - -// Get retreives a stack based on the stack name and stack ID. -func Get(c *gophercloud.ServiceClient, stackName, stackID string) os.GetResult { - return os.Get(c, stackName, stackID) -} - -// Update accepts an os.UpdateOpts struct and updates a stack based on the options provided. -func Update(c *gophercloud.ServiceClient, stackName, stackID string, opts os.UpdateOptsBuilder) os.UpdateResult { - return os.Update(c, stackName, stackID, opts) -} - -// Delete deletes a stack based on the stack name and stack ID provided. -func Delete(c *gophercloud.ServiceClient, stackName, stackID string) os.DeleteResult { - return os.Delete(c, stackName, stackID) -} - -// Preview provides a preview of a stack based on the options provided. -func Preview(c *gophercloud.ServiceClient, opts os.PreviewOptsBuilder) os.PreviewResult { - return os.Preview(c, opts) -} - -// Abandon abandons a stack, keeping the resources available. -func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) os.AbandonResult { - return os.Abandon(c, stackName, stackID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/doc.go deleted file mode 100644 index 19231b513..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package stacks provides operation for working with Heat stacks. A stack is a -// group of resources (servers, load balancers, databases, and so forth) -// combined to fulfill a useful purpose. Based on a template, Heat orchestration -// engine creates an instantiated set of resources (a stack) to run the -// application framework or component specified (in the template). A stack is a -// running instance of a template. The result of creating a stack is a deployment -// of the application framework or component. -package stacks diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/fixtures.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/fixtures.go deleted file mode 100644 index c9afeb156..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacks/fixtures.go +++ /dev/null @@ -1,32 +0,0 @@ -package stacks - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks" -) - -// CreateExpected represents the expected object from a Create request. -var CreateExpected = &os.CreatedStack{ - ID: "b663e18a-4767-4cdf-9db5-9c8cc13cc38a", - Links: []gophercloud.Link{ - gophercloud.Link{ - Href: "https://ord.orchestration.api.rackspacecloud.com/v1/864477/stacks/stackcreated/b663e18a-4767-4cdf-9db5-9c8cc13cc38a", - Rel: "self", - }, - }, -} - -// CreateOutput represents the response body from a Create request. -const CreateOutput = ` -{ - "stack": { - "id": "b663e18a-4767-4cdf-9db5-9c8cc13cc38a", - "links": [ - { - "href": "https://ord.orchestration.api.rackspacecloud.com/v1/864477/stacks/stackcreated/b663e18a-4767-4cdf-9db5-9c8cc13cc38a", - "rel": "self" - } - ] - } -} -` diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacktemplates/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacktemplates/delegate.go deleted file mode 100644 index 3b5d46e1c..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacktemplates/delegate.go +++ /dev/null @@ -1,16 +0,0 @@ -package stacktemplates - -import ( - "github.com/rackspace/gophercloud" - os "github.com/rackspace/gophercloud/openstack/orchestration/v1/stacktemplates" -) - -// Get retreives data for the given stack template. -func Get(c *gophercloud.ServiceClient, stackName, stackID string) os.GetResult { - return os.Get(c, stackName, stackID) -} - -// Validate validates the given stack template. -func Validate(c *gophercloud.ServiceClient, opts os.ValidateOptsBuilder) os.ValidateResult { - return os.Validate(c, opts) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacktemplates/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacktemplates/doc.go deleted file mode 100644 index 5af0bd62a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/orchestration/v1/stacktemplates/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package stacktemplates provides operations for working with Heat templates. -// A Cloud Orchestration template is a portable file, written in a user-readable -// language, that describes how a set of resources should be assembled and what -// software should be installed in order to produce a working stack. The template -// specifies what resources should be used, what attributes can be set, and other -// parameters that are critical to the successful, repeatable automation of a -// specific application stack. -package stacktemplates diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/requests.go deleted file mode 100644 index 58843030a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/requests.go +++ /dev/null @@ -1,24 +0,0 @@ -package cloudnetworks - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns all cloud networks that are associated with RackConnect. The ID -// returned for each network is the same as the ID returned by the networks package. -func List(c *gophercloud.ServiceClient) pagination.Pager { - url := listURL(c) - createPage := func(r pagination.PageResult) pagination.Page { - return CloudNetworkPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// Get retrieves a specific cloud network (that is associated with RackConnect) -// based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, id), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/results.go deleted file mode 100644 index f554a0d75..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/results.go +++ /dev/null @@ -1,113 +0,0 @@ -package cloudnetworks - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// CloudNetwork represents a network associated with a RackConnect configuration. -type CloudNetwork struct { - // Specifies the ID of the newtork. - ID string `mapstructure:"id"` - // Specifies the user-provided name of the network. - Name string `mapstructure:"name"` - // Specifies the IP range for this network. - CIDR string `mapstructure:"cidr"` - // Specifies the time the network was created. - CreatedAt time.Time `mapstructure:"-"` - // Specifies the time the network was last updated. - UpdatedAt time.Time `mapstructure:"-"` -} - -// CloudNetworkPage is the page returned by a pager when traversing over a -// collection of CloudNetworks. -type CloudNetworkPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a CloudNetworkPage contains no CloudNetworks. -func (r CloudNetworkPage) IsEmpty() (bool, error) { - cns, err := ExtractCloudNetworks(r) - if err != nil { - return true, err - } - return len(cns) == 0, nil -} - -// ExtractCloudNetworks extracts and returns CloudNetworks. It is used while iterating over -// a cloudnetworks.List call. -func ExtractCloudNetworks(page pagination.Page) ([]CloudNetwork, error) { - var res []CloudNetwork - casted := page.(CloudNetworkPage).Body - err := mapstructure.Decode(casted, &res) - - var rawNets []interface{} - switch casted.(type) { - case interface{}: - rawNets = casted.([]interface{}) - default: - return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i := range rawNets { - thisNet := (rawNets[i]).(map[string]interface{}) - - if t, ok := thisNet["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CreatedAt = creationTime - } - - if t, ok := thisNet["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].UpdatedAt = updatedTime - } - } - - return res, err -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract is a function that extracts a CloudNetwork from a GetResult. -func (r GetResult) Extract() (*CloudNetwork, error) { - if r.Err != nil { - return nil, r.Err - } - var res CloudNetwork - - err := mapstructure.Decode(r.Body, &res) - - b := r.Body.(map[string]interface{}) - - if date, ok := b["created"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.CreatedAt = t - } - - if date, ok := b["updated"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.UpdatedAt = t - } - - return &res, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/urls.go deleted file mode 100644 index bd6b098da..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/cloudnetworks/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudnetworks - -import "github.com/rackspace/gophercloud" - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("cloud_networks") -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("cloud_networks", id) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/doc.go deleted file mode 100644 index 3a8279e10..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package rackconnect allows Rackspace cloud accounts to leverage version 3 of -// RackConnect, Rackspace's hybrid connectivity solution connecting dedicated -// and cloud servers. -package rackconnect diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/doc.go deleted file mode 100644 index f4319b8ff..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/doc.go +++ /dev/null @@ -1,14 +0,0 @@ -// Package lbpools provides access to load balancer pools associated with a -// RackConnect configuration. Load Balancer Pools must be configured in advance -// by your Network Security team to be eligible for use with RackConnect. -// If you do not see a pool that you expect to see, contact your Support team -// for further assistance. The Load Balancer Pool id returned by these calls is -// automatically generated by the RackConnect automation and will remain constant -// unless the Load Balancer Pool is renamed on your hardware load balancer. -// All Load Balancer Pools will currently return a status of ACTIVE. Future -// features may introduce additional statuses. -// Node status values are ADDING, ACTIVE, REMOVING, ADD_FAILED, and REMOVE_FAILED. -// The cloud_servers node count will only include Cloud Servers from the specified -// cloud account. Any dedicated servers or cloud servers from another cloud account -// on the same RackConnect Configuration will be counted as external nodes. -package lbpools diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/requests.go deleted file mode 100644 index c300c56c1..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/requests.go +++ /dev/null @@ -1,146 +0,0 @@ -package lbpools - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns all load balancer pools that are associated with RackConnect. -func List(c *gophercloud.ServiceClient) pagination.Pager { - url := listURL(c) - createPage := func(r pagination.PageResult) pagination.Page { - return PoolPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// Get retrieves a specific load balancer pool (that is associated with RackConnect) -// based on its unique ID. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, id), &res.Body, nil) - return res -} - -// ListNodes returns all load balancer pool nodes that are associated with RackConnect -// for the given LB pool ID. -func ListNodes(c *gophercloud.ServiceClient, id string) pagination.Pager { - url := listNodesURL(c, id) - createPage := func(r pagination.PageResult) pagination.Page { - return NodePage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// CreateNode adds the cloud server with the given serverID to the load balancer -// pool with the given poolID. -func CreateNode(c *gophercloud.ServiceClient, poolID, serverID string) CreateNodeResult { - var res CreateNodeResult - reqBody := map[string]interface{}{ - "cloud_server": map[string]string{ - "id": serverID, - }, - } - _, res.Err = c.Post(createNodeURL(c, poolID), reqBody, &res.Body, nil) - return res -} - -// ListNodesDetails returns all load balancer pool nodes that are associated with RackConnect -// for the given LB pool ID with all their details. -func ListNodesDetails(c *gophercloud.ServiceClient, id string) pagination.Pager { - url := listNodesDetailsURL(c, id) - createPage := func(r pagination.PageResult) pagination.Page { - return NodeDetailsPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// GetNode retrieves a specific LB pool node (that is associated with RackConnect) -// based on its unique ID and the LB pool's unique ID. -func GetNode(c *gophercloud.ServiceClient, poolID, nodeID string) GetNodeResult { - var res GetNodeResult - _, res.Err = c.Get(nodeURL(c, poolID, nodeID), &res.Body, nil) - return res -} - -// DeleteNode removes the node with the given nodeID from the LB pool with the -// given poolID. -func DeleteNode(c *gophercloud.ServiceClient, poolID, nodeID string) DeleteNodeResult { - var res DeleteNodeResult - _, res.Err = c.Delete(deleteNodeURL(c, poolID, nodeID), nil) - return res -} - -// GetNodeDetails retrieves a specific LB pool node's details based on its unique -// ID and the LB pool's unique ID. -func GetNodeDetails(c *gophercloud.ServiceClient, poolID, nodeID string) GetNodeDetailsResult { - var res GetNodeDetailsResult - _, res.Err = c.Get(nodeDetailsURL(c, poolID, nodeID), &res.Body, nil) - return res -} - -// NodeOpts are options for bulk adding/deleting nodes to LB pools. -type NodeOpts struct { - ServerID string - PoolID string -} - -// NodesOpts are a slice of NodeOpts, passed as options for bulk operations. -type NodesOpts []NodeOpts - -// ToLBPoolCreateNodesMap serializes a NodesOpts into a map to send in the request. -func (o NodesOpts) ToLBPoolCreateNodesMap() ([]map[string]interface{}, error) { - m := make([]map[string]interface{}, len(o)) - for i := range o { - m[i] = map[string]interface{}{ - "cloud_server": map[string]string{ - "id": o[i].ServerID, - }, - "load_balancer_pool": map[string]string{ - "id": o[i].PoolID, - }, - } - } - return m, nil -} - -// CreateNodes adds the cloud servers with the given serverIDs to the corresponding -// load balancer pools with the given poolIDs. -func CreateNodes(c *gophercloud.ServiceClient, opts NodesOpts) CreateNodesResult { - var res CreateNodesResult - reqBody, err := opts.ToLBPoolCreateNodesMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(createNodesURL(c), reqBody, &res.Body, nil) - return res -} - -// DeleteNodes removes the cloud servers with the given serverIDs to the corresponding -// load balancer pools with the given poolIDs. -func DeleteNodes(c *gophercloud.ServiceClient, opts NodesOpts) DeleteNodesResult { - var res DeleteNodesResult - reqBody, err := opts.ToLBPoolCreateNodesMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Request("DELETE", createNodesURL(c), gophercloud.RequestOpts{ - JSONBody: &reqBody, - OkCodes: []int{204}, - }) - return res -} - -// ListNodesDetailsForServer is similar to ListNodesDetails but only returns nodes -// for the given serverID. -func ListNodesDetailsForServer(c *gophercloud.ServiceClient, serverID string) pagination.Pager { - url := listNodesForServerURL(c, serverID) - createPage := func(r pagination.PageResult) pagination.Page { - return NodeDetailsForServerPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/results.go deleted file mode 100644 index e5e914b1e..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/results.go +++ /dev/null @@ -1,505 +0,0 @@ -package lbpools - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Pool represents a load balancer pool associated with a RackConnect configuration. -type Pool struct { - // The unique ID of the load balancer pool. - ID string `mapstructure:"id"` - // The name of the load balancer pool. - Name string `mapstructure:"name"` - // The node counts associated witht the load balancer pool. - NodeCounts struct { - // The number of nodes associated with this LB pool for this account. - CloudServers int `mapstructure:"cloud_servers"` - // The number of nodes associated with this LB pool from other accounts. - External int `mapstructure:"external"` - // The total number of nodes associated with this LB pool. - Total int `mapstructure:"total"` - } `mapstructure:"node_counts"` - // The port of the LB pool - Port int `mapstructure:"port"` - // The status of the LB pool - Status string `mapstructure:"status"` - // The details of the status of the LB pool - StatusDetail string `mapstructure:"status_detail"` - // The virtual IP of the LB pool - VirtualIP string `mapstructure:"virtual_ip"` -} - -// PoolPage is the page returned by a pager when traversing over a -// collection of Pools. -type PoolPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a PoolPage contains no Pools. -func (r PoolPage) IsEmpty() (bool, error) { - cns, err := ExtractPools(r) - if err != nil { - return true, err - } - return len(cns) == 0, nil -} - -// ExtractPools extracts and returns Pools. It is used while iterating over -// an lbpools.List call. -func ExtractPools(page pagination.Page) ([]Pool, error) { - var res []Pool - err := mapstructure.Decode(page.(PoolPage).Body, &res) - return res, err -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - gophercloud.Result -} - -// Extract is a function that extracts an LBPool from a GetResult. -func (r GetResult) Extract() (*Pool, error) { - if r.Err != nil { - return nil, r.Err - } - var res Pool - err := mapstructure.Decode(r.Body, &res) - return &res, err -} - -// Node represents a load balancer pool node associated with a RackConnect configuration. -type Node struct { - // The unique ID of the LB node. - ID string `mapstructure:"id"` - // The cloud server (node) of the load balancer pool. - CloudServer struct { - // The cloud server ID. - ID string `mapstructure:"id"` - } `mapstructure:"cloud_server"` - // The load balancer pool. - LoadBalancerPool struct { - // The LB pool ID. - ID string `mapstructure:"id"` - } `mapstructure:"load_balancer_pool"` - // The status of the LB pool. - Status string `mapstructure:"status"` - // The details of the status of the LB pool. - StatusDetail string `mapstructure:"status_detail"` - // The time the LB node was created. - CreatedAt time.Time `mapstructure:"-"` - // The time the LB node was last updated. - UpdatedAt time.Time `mapstructure:"-"` -} - -// NodePage is the page returned by a pager when traversing over a -// collection of Nodes. -type NodePage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a NodePage contains no Nodes. -func (r NodePage) IsEmpty() (bool, error) { - n, err := ExtractNodes(r) - if err != nil { - return true, err - } - return len(n) == 0, nil -} - -// ExtractNodes extracts and returns a slice of Nodes. It is used while iterating over -// an lbpools.ListNodes call. -func ExtractNodes(page pagination.Page) ([]Node, error) { - var res []Node - casted := page.(NodePage).Body - err := mapstructure.Decode(casted, &res) - - var rawNodes []interface{} - switch casted.(type) { - case interface{}: - rawNodes = casted.([]interface{}) - default: - return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i := range rawNodes { - thisNode := (rawNodes[i]).(map[string]interface{}) - - if t, ok := thisNode["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CreatedAt = creationTime - } - - if t, ok := thisNode["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].UpdatedAt = updatedTime - } - } - - return res, err -} - -// NodeResult represents a result that can be extracted as a Node. -type NodeResult struct { - gophercloud.Result -} - -// CreateNodeResult represents the result of an CreateNode operation. -type CreateNodeResult struct { - NodeResult -} - -// GetNodeResult represents the result of an GetNode operation. -type GetNodeResult struct { - NodeResult -} - -// Extract is a function that extracts a Node from a NodeResult. -func (r NodeResult) Extract() (*Node, error) { - if r.Err != nil { - return nil, r.Err - } - var res Node - err := mapstructure.Decode(r.Body, &res) - - b := r.Body.(map[string]interface{}) - - if date, ok := b["created"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.CreatedAt = t - } - - if date, ok := b["updated"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.UpdatedAt = t - } - - return &res, err -} - -// NodeDetails represents a load balancer pool node associated with a RackConnect configuration -// with all its details. -type NodeDetails struct { - // The unique ID of the LB node. - ID string `mapstructure:"id"` - // The cloud server (node) of the load balancer pool. - CloudServer struct { - // The cloud server ID. - ID string `mapstructure:"id"` - // The name of the server. - Name string `mapstructure:"name"` - // The cloud network for the cloud server. - CloudNetwork struct { - // The network ID. - ID string `mapstructure:"id"` - // The network name. - Name string `mapstructure:"name"` - // The network's private IPv4 address. - PrivateIPv4 string `mapstructure:"private_ip_v4"` - // The IP range for the network. - CIDR string `mapstructure:"cidr"` - // The datetime the network was created. - CreatedAt time.Time `mapstructure:"-"` - // The last datetime the network was updated. - UpdatedAt time.Time `mapstructure:"-"` - } `mapstructure:"cloud_network"` - // The datetime the server was created. - CreatedAt time.Time `mapstructure:"-"` - // The datetime the server was last updated. - UpdatedAt time.Time `mapstructure:"-"` - } `mapstructure:"cloud_server"` - // The load balancer pool. - LoadBalancerPool Pool `mapstructure:"load_balancer_pool"` - // The status of the LB pool. - Status string `mapstructure:"status"` - // The details of the status of the LB pool. - StatusDetail string `mapstructure:"status_detail"` - // The time the LB node was created. - CreatedAt time.Time `mapstructure:"-"` - // The time the LB node was last updated. - UpdatedAt time.Time `mapstructure:"-"` -} - -// NodeDetailsPage is the page returned by a pager when traversing over a -// collection of NodeDetails. -type NodeDetailsPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a NodeDetailsPage contains no NodeDetails. -func (r NodeDetailsPage) IsEmpty() (bool, error) { - n, err := ExtractNodesDetails(r) - if err != nil { - return true, err - } - return len(n) == 0, nil -} - -// ExtractNodesDetails extracts and returns a slice of NodeDetails. It is used while iterating over -// an lbpools.ListNodesDetails call. -func ExtractNodesDetails(page pagination.Page) ([]NodeDetails, error) { - var res []NodeDetails - casted := page.(NodeDetailsPage).Body - err := mapstructure.Decode(casted, &res) - - var rawNodesDetails []interface{} - switch casted.(type) { - case interface{}: - rawNodesDetails = casted.([]interface{}) - default: - return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i := range rawNodesDetails { - thisNodeDetails := (rawNodesDetails[i]).(map[string]interface{}) - - if t, ok := thisNodeDetails["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CreatedAt = creationTime - } - - if t, ok := thisNodeDetails["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].UpdatedAt = updatedTime - } - - if cs, ok := thisNodeDetails["cloud_server"].(map[string]interface{}); ok { - if t, ok := cs["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.CreatedAt = creationTime - } - if t, ok := cs["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.UpdatedAt = updatedTime - } - if cn, ok := cs["cloud_network"].(map[string]interface{}); ok { - if t, ok := cn["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.CloudNetwork.CreatedAt = creationTime - } - if t, ok := cn["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.CloudNetwork.UpdatedAt = updatedTime - } - } - } - } - - return res, err -} - -// GetNodeDetailsResult represents the result of an NodeDetails operation. -type GetNodeDetailsResult struct { - gophercloud.Result -} - -// Extract is a function that extracts a NodeDetails from a NodeDetailsResult. -func (r GetNodeDetailsResult) Extract() (*NodeDetails, error) { - if r.Err != nil { - return nil, r.Err - } - var res NodeDetails - err := mapstructure.Decode(r.Body, &res) - - b := r.Body.(map[string]interface{}) - - if date, ok := b["created"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.CreatedAt = t - } - - if date, ok := b["updated"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.UpdatedAt = t - } - - if cs, ok := b["cloud_server"].(map[string]interface{}); ok { - if t, ok := cs["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.CreatedAt = creationTime - } - if t, ok := cs["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.UpdatedAt = updatedTime - } - if cn, ok := cs["cloud_network"].(map[string]interface{}); ok { - if t, ok := cn["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.CloudNetwork.CreatedAt = creationTime - } - if t, ok := cn["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.CloudNetwork.UpdatedAt = updatedTime - } - } - } - - return &res, err -} - -// DeleteNodeResult represents the result of a DeleteNode operation. -type DeleteNodeResult struct { - gophercloud.ErrResult -} - -// CreateNodesResult represents the result of a CreateNodes operation. -type CreateNodesResult struct { - gophercloud.Result -} - -// Extract is a function that extracts a slice of Nodes from a CreateNodesResult. -func (r CreateNodesResult) Extract() ([]Node, error) { - if r.Err != nil { - return nil, r.Err - } - var res []Node - err := mapstructure.Decode(r.Body, &res) - - b := r.Body.([]interface{}) - for i := range b { - if date, ok := b[i].(map[string]interface{})["created"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res[i].CreatedAt = t - } - if date, ok := b[i].(map[string]interface{})["updated"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res[i].UpdatedAt = t - } - } - - return res, err -} - -// DeleteNodesResult represents the result of a DeleteNodes operation. -type DeleteNodesResult struct { - gophercloud.ErrResult -} - -// NodeDetailsForServer represents a load balancer pool node associated with a RackConnect configuration -// with all its details for a particular server. -type NodeDetailsForServer struct { - // The unique ID of the LB node. - ID string `mapstructure:"id"` - // The load balancer pool. - LoadBalancerPool Pool `mapstructure:"load_balancer_pool"` - // The status of the LB pool. - Status string `mapstructure:"status"` - // The details of the status of the LB pool. - StatusDetail string `mapstructure:"status_detail"` - // The time the LB node was created. - CreatedAt time.Time `mapstructure:"-"` - // The time the LB node was last updated. - UpdatedAt time.Time `mapstructure:"-"` -} - -// NodeDetailsForServerPage is the page returned by a pager when traversing over a -// collection of NodeDetailsForServer. -type NodeDetailsForServerPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a NodeDetailsForServerPage contains no NodeDetailsForServer. -func (r NodeDetailsForServerPage) IsEmpty() (bool, error) { - n, err := ExtractNodesDetailsForServer(r) - if err != nil { - return true, err - } - return len(n) == 0, nil -} - -// ExtractNodesDetailsForServer extracts and returns a slice of NodeDetailsForServer. It is used while iterating over -// an lbpools.ListNodesDetailsForServer call. -func ExtractNodesDetailsForServer(page pagination.Page) ([]NodeDetailsForServer, error) { - var res []NodeDetailsForServer - casted := page.(NodeDetailsForServerPage).Body - err := mapstructure.Decode(casted, &res) - - var rawNodesDetails []interface{} - switch casted.(type) { - case interface{}: - rawNodesDetails = casted.([]interface{}) - default: - return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i := range rawNodesDetails { - thisNodeDetails := (rawNodesDetails[i]).(map[string]interface{}) - - if t, ok := thisNodeDetails["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CreatedAt = creationTime - } - - if t, ok := thisNodeDetails["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].UpdatedAt = updatedTime - } - } - - return res, err -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/urls.go deleted file mode 100644 index c238239f6..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/lbpools/urls.go +++ /dev/null @@ -1,49 +0,0 @@ -package lbpools - -import "github.com/rackspace/gophercloud" - -var root = "load_balancer_pools" - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(root) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(root, id) -} - -func listNodesURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(root, id, "nodes") -} - -func createNodeURL(c *gophercloud.ServiceClient, id string) string { - return listNodesURL(c, id) -} - -func listNodesDetailsURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(root, id, "nodes", "details") -} - -func nodeURL(c *gophercloud.ServiceClient, poolID, nodeID string) string { - return c.ServiceURL(root, poolID, "nodes", nodeID) -} - -func deleteNodeURL(c *gophercloud.ServiceClient, poolID, nodeID string) string { - return nodeURL(c, poolID, nodeID) -} - -func nodeDetailsURL(c *gophercloud.ServiceClient, poolID, nodeID string) string { - return c.ServiceURL(root, poolID, "nodes", nodeID, "details") -} - -func createNodesURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(root, "nodes") -} - -func deleteNodesURL(c *gophercloud.ServiceClient) string { - return createNodesURL(c) -} - -func listNodesForServerURL(c *gophercloud.ServiceClient, serverID string) string { - return c.ServiceURL(root, "nodes", "details?cloud_server_id="+serverID) -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/requests.go deleted file mode 100644 index 116426010..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/requests.go +++ /dev/null @@ -1,50 +0,0 @@ -package publicips - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns all public IPs. -func List(c *gophercloud.ServiceClient) pagination.Pager { - url := listURL(c) - createPage := func(r pagination.PageResult) pagination.Page { - return PublicIPPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// Create adds a public IP to the server with the given serverID. -func Create(c *gophercloud.ServiceClient, serverID string) CreateResult { - var res CreateResult - reqBody := map[string]interface{}{ - "cloud_server": map[string]string{ - "id": serverID, - }, - } - _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil) - return res -} - -// ListForServer returns all public IPs for the server with the given serverID. -func ListForServer(c *gophercloud.ServiceClient, serverID string) pagination.Pager { - url := listForServerURL(c, serverID) - createPage := func(r pagination.PageResult) pagination.Page { - return PublicIPPage{pagination.SinglePageBase(r)} - } - return pagination.NewPager(c, url, createPage) -} - -// Get retrieves the public IP with the given id. -func Get(c *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = c.Get(getURL(c, id), &res.Body, nil) - return res -} - -// Delete removes the public IP with the given id. -func Delete(c *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, id), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/results.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/results.go deleted file mode 100644 index 132cf770a..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/results.go +++ /dev/null @@ -1,221 +0,0 @@ -package publicips - -import ( - "fmt" - "reflect" - "time" - - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// PublicIP represents a public IP address. -type PublicIP struct { - // The unique ID of the public IP. - ID string `mapstructure:"id"` - // The IPv4 address of the public IP. - PublicIPv4 string `mapstructure:"public_ip_v4"` - // The cloud server (node) of the public IP. - CloudServer struct { - // The cloud server ID. - ID string `mapstructure:"id"` - // The name of the server. - Name string `mapstructure:"name"` - // The cloud network for the cloud server. - CloudNetwork struct { - // The network ID. - ID string `mapstructure:"id"` - // The network name. - Name string `mapstructure:"name"` - // The network's private IPv4 address. - PrivateIPv4 string `mapstructure:"private_ip_v4"` - // The IP range for the network. - CIDR string `mapstructure:"cidr"` - // The datetime the network was created. - CreatedAt time.Time `mapstructure:"-"` - // The last datetime the network was updated. - UpdatedAt time.Time `mapstructure:"-"` - } `mapstructure:"cloud_network"` - // The datetime the server was created. - CreatedAt time.Time `mapstructure:"-"` - // The datetime the server was last updated. - UpdatedAt time.Time `mapstructure:"-"` - } `mapstructure:"cloud_server"` - // The status of the public IP. - Status string `mapstructure:"status"` - // The details of the status of the public IP. - StatusDetail string `mapstructure:"status_detail"` - // The time the public IP was created. - CreatedAt time.Time `mapstructure:"-"` - // The time the public IP was last updated. - UpdatedAt time.Time `mapstructure:"-"` -} - -// PublicIPPage is the page returned by a pager when traversing over a -// collection of PublicIPs. -type PublicIPPage struct { - pagination.SinglePageBase -} - -// IsEmpty returns true if a PublicIPPage contains no PublicIPs. -func (r PublicIPPage) IsEmpty() (bool, error) { - n, err := ExtractPublicIPs(r) - if err != nil { - return true, err - } - return len(n) == 0, nil -} - -// ExtractPublicIPs extracts and returns a slice of PublicIPs. It is used while iterating over -// a publicips.List call. -func ExtractPublicIPs(page pagination.Page) ([]PublicIP, error) { - var res []PublicIP - casted := page.(PublicIPPage).Body - err := mapstructure.Decode(casted, &res) - - var rawNodesDetails []interface{} - switch casted.(type) { - case interface{}: - rawNodesDetails = casted.([]interface{}) - default: - return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted)) - } - - for i := range rawNodesDetails { - thisNodeDetails := (rawNodesDetails[i]).(map[string]interface{}) - - if t, ok := thisNodeDetails["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CreatedAt = creationTime - } - - if t, ok := thisNodeDetails["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].UpdatedAt = updatedTime - } - - if cs, ok := thisNodeDetails["cloud_server"].(map[string]interface{}); ok { - if t, ok := cs["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.CreatedAt = creationTime - } - if t, ok := cs["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.UpdatedAt = updatedTime - } - if cn, ok := cs["cloud_network"].(map[string]interface{}); ok { - if t, ok := cn["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.CloudNetwork.CreatedAt = creationTime - } - if t, ok := cn["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return res, err - } - res[i].CloudServer.CloudNetwork.UpdatedAt = updatedTime - } - } - } - } - - return res, err -} - -// PublicIPResult represents a result that can be extracted into a PublicIP. -type PublicIPResult struct { - gophercloud.Result -} - -// CreateResult represents the result of a Create operation. -type CreateResult struct { - PublicIPResult -} - -// GetResult represents the result of a Get operation. -type GetResult struct { - PublicIPResult -} - -// Extract is a function that extracts a PublicIP from a PublicIPResult. -func (r PublicIPResult) Extract() (*PublicIP, error) { - if r.Err != nil { - return nil, r.Err - } - var res PublicIP - err := mapstructure.Decode(r.Body, &res) - - b := r.Body.(map[string]interface{}) - - if date, ok := b["created"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.CreatedAt = t - } - - if date, ok := b["updated"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) - if err != nil { - return nil, err - } - res.UpdatedAt = t - } - - if cs, ok := b["cloud_server"].(map[string]interface{}); ok { - if t, ok := cs["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.CreatedAt = creationTime - } - if t, ok := cs["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.UpdatedAt = updatedTime - } - if cn, ok := cs["cloud_network"].(map[string]interface{}); ok { - if t, ok := cn["created"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.CloudNetwork.CreatedAt = creationTime - } - if t, ok := cn["updated"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) - if err != nil { - return &res, err - } - res.CloudServer.CloudNetwork.UpdatedAt = updatedTime - } - } - } - - return &res, err -} - -// DeleteResult represents the result of a Delete operation. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/urls.go b/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/urls.go deleted file mode 100644 index 6f310be4e..000000000 --- a/vendor/github.com/rackspace/gophercloud/rackspace/rackconnect/v3/publicips/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package publicips - -import "github.com/rackspace/gophercloud" - -var root = "public_ips" - -func listURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(root) -} - -func createURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(root) -} - -func listForServerURL(c *gophercloud.ServiceClient, serverID string) string { - return c.ServiceURL(root + "?cloud_server_id=" + serverID) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(root, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return getURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/script/acceptancetest b/vendor/github.com/rackspace/gophercloud/script/acceptancetest deleted file mode 100644 index f9c89f4df..000000000 --- a/vendor/github.com/rackspace/gophercloud/script/acceptancetest +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# -# Run the acceptance tests. - -exec go test -p=1 -tags 'acceptance fixtures' github.com/rackspace/gophercloud/acceptance/... $@ diff --git a/vendor/github.com/rackspace/gophercloud/script/bootstrap b/vendor/github.com/rackspace/gophercloud/script/bootstrap deleted file mode 100644 index 6bae6e8f1..000000000 --- a/vendor/github.com/rackspace/gophercloud/script/bootstrap +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# This script helps new contributors set up their local workstation for -# gophercloud development and contributions. - -# Create the environment -export GOPATH=$HOME/go/gophercloud -mkdir -p $GOPATH - -# Download gophercloud into that environment -go get github.com/rackspace/gophercloud -cd $GOPATH/src/github.com/rackspace/gophercloud -git checkout master - -# Write out the env.sh convenience file. -cd $GOPATH -cat <env.sh -#!/bin/bash -export GOPATH=$(pwd) -export GOPHERCLOUD=$GOPATH/src/github.com/rackspace/gophercloud -EOF -chmod a+x env.sh - -# Make changes immediately available as a convenience. -. ./env.sh - diff --git a/vendor/github.com/rackspace/gophercloud/script/cibuild b/vendor/github.com/rackspace/gophercloud/script/cibuild deleted file mode 100644 index 1cb389e7d..000000000 --- a/vendor/github.com/rackspace/gophercloud/script/cibuild +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# -# Test script to be invoked by Travis. - -exec script/unittest -v diff --git a/vendor/github.com/rackspace/gophercloud/script/test b/vendor/github.com/rackspace/gophercloud/script/test deleted file mode 100644 index 1e03dff8a..000000000 --- a/vendor/github.com/rackspace/gophercloud/script/test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# -# Run all the tests. - -exec go test -tags 'acceptance fixtures' ./... $@ diff --git a/vendor/github.com/rackspace/gophercloud/script/unittest b/vendor/github.com/rackspace/gophercloud/script/unittest deleted file mode 100644 index d3440a902..000000000 --- a/vendor/github.com/rackspace/gophercloud/script/unittest +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# -# Run the unit tests. - -exec go test -tags fixtures ./... $@ diff --git a/vendor/github.com/rackspace/gophercloud/testhelper/fixture/helper.go b/vendor/github.com/rackspace/gophercloud/testhelper/fixture/helper.go deleted file mode 100644 index d54355d75..000000000 --- a/vendor/github.com/rackspace/gophercloud/testhelper/fixture/helper.go +++ /dev/null @@ -1,31 +0,0 @@ -package fixture - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -func SetupHandler(t *testing.T, url, method, requestBody, responseBody string, status int) { - th.Mux.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, method) - th.TestHeader(t, r, "X-Auth-Token", client.TokenID) - - if requestBody != "" { - th.TestJSONRequest(t, r, requestBody) - } - - if responseBody != "" { - w.Header().Add("Content-Type", "application/json") - } - - w.WriteHeader(status) - - if responseBody != "" { - fmt.Fprintf(w, responseBody) - } - }) -} diff --git a/vendor/github.com/soniah/dnsmadeeasy/examples/README.md b/vendor/github.com/soniah/dnsmadeeasy/examples/README.md deleted file mode 100644 index 2b2cbc7bb..000000000 --- a/vendor/github.com/soniah/dnsmadeeasy/examples/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Examples - -These are examples of using *dnsmadeeasy*. Parameters are passed by -environment variables. For example: - -`% export DME_AKEY=aaaaaa1a-11a1-1aa1-a101-11a1a11aa1aa \ -DME_SKEY=11a0a11a-a1a1-111a-a11a-a11110a11111 DME_DOMAINID=123456 -% DME_IP=1.1.1.1 go run create.go` diff --git a/vendor/github.com/soniah/dnsmadeeasy/examples/create.go b/vendor/github.com/soniah/dnsmadeeasy/examples/create.go deleted file mode 100644 index 3d439a4e2..000000000 --- a/vendor/github.com/soniah/dnsmadeeasy/examples/create.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "fmt" - dme "github.com/soniah/dnsmadeeasy" - "log" - "os" -) - -func main() { - akey := os.Getenv("DME_AKEY") - skey := os.Getenv("DME_SKEY") - domainID := os.Getenv("DME_DOMAINID") - ip := os.Getenv("DME_IP") - - fmt.Println("Using these values:") - fmt.Println("akey:", akey) - fmt.Println("skey:", skey) - fmt.Println("domainid:", domainID) - fmt.Println("ip:", ip) - - if len(akey) == 0 || len(skey) == 0 || len(domainID) == 0 || len(ip) == 0 { - log.Fatalf("Environment variable(s) not set\n") - } - - client, err := dme.NewClient(akey, skey) - if err != nil { - log.Fatalf("err: %v", err) - } - client.URL = dme.SandboxURL - - cr := map[string]interface{}{ - "name": "test", - "type": "A", - "value": ip, - "ttl": 86400, - } - - result, err2 := client.CreateRecord(domainID, cr) - if err2 != nil { - log.Fatalf("Result: '%s' Error: %s", result, err2) - } - - log.Printf("Result: '%s'", result) -} diff --git a/vendor/github.com/soniah/dnsmadeeasy/examples/delete.go b/vendor/github.com/soniah/dnsmadeeasy/examples/delete.go deleted file mode 100644 index e6c04a203..000000000 --- a/vendor/github.com/soniah/dnsmadeeasy/examples/delete.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "fmt" - dme "github.com/soniah/dnsmadeeasy" - "log" - "os" -) - -func main() { - akey := os.Getenv("DME_AKEY") - skey := os.Getenv("DME_SKEY") - domainID := os.Getenv("DME_DOMAINID") - recordID := os.Getenv("DME_RECORDID") - - fmt.Println("Using these values:") - fmt.Println("akey:", akey) - fmt.Println("skey:", skey) - fmt.Println("domainid:", domainID) - fmt.Println("recordid:", recordID) - - if len(akey) == 0 || len(skey) == 0 || len(domainID) == 0 || len(recordID) == 0 { - log.Fatalf("Environment variable(s) not set\n") - } - - client, err := dme.NewClient(akey, skey) - client.URL = dme.SandboxURL - if err != nil { - log.Fatalf("err: %v", err) - } - - err2 := client.DeleteRecord(domainID, recordID) - if err2 != nil { - log.Fatalf("DeleteRecord result: %v", err2) - } - log.Print("Destroyed.") -} diff --git a/vendor/github.com/soniah/dnsmadeeasy/examples/read.go b/vendor/github.com/soniah/dnsmadeeasy/examples/read.go deleted file mode 100644 index 26dc98068..000000000 --- a/vendor/github.com/soniah/dnsmadeeasy/examples/read.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "fmt" - dme "github.com/soniah/dnsmadeeasy" - "log" - "os" -) - -func main() { - akey := os.Getenv("DME_AKEY") - skey := os.Getenv("DME_SKEY") - domainID := os.Getenv("DME_DOMAINID") - recordID := os.Getenv("DME_RECORDID") - - fmt.Println("Using these values:") - fmt.Println("akey:", akey) - fmt.Println("skey:", skey) - fmt.Println("domainid:", domainID) - fmt.Println("recordid:", recordID) - - if len(akey) == 0 || len(skey) == 0 || len(domainID) == 0 || len(recordID) == 0 { - log.Fatalf("Environment variable(s) not set\n") - } - - client, err := dme.NewClient(akey, skey) - client.URL = dme.SandboxURL - if err != nil { - log.Fatalf("err: %v", err) - } - - result, err2 := client.ReadRecord(domainID, recordID) - if err2 != nil { - log.Fatalf("ReadRecord result: %v error %v", result, err2) - } - - log.Printf("Result: %#v", *result) -} diff --git a/vendor/github.com/soniah/dnsmadeeasy/examples/update.go b/vendor/github.com/soniah/dnsmadeeasy/examples/update.go deleted file mode 100644 index 1eaef3ba2..000000000 --- a/vendor/github.com/soniah/dnsmadeeasy/examples/update.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -import ( - "fmt" - dme "github.com/soniah/dnsmadeeasy" - "log" - "os" -) - -func main() { - akey := os.Getenv("DME_AKEY") - skey := os.Getenv("DME_SKEY") - domainID := os.Getenv("DME_DOMAINID") - recordID := os.Getenv("DME_RECORDID") - - fmt.Println("Using these values:") - fmt.Println("akey:", akey) - fmt.Println("skey:", skey) - fmt.Println("domainid:", domainID) - fmt.Println("recordid:", recordID) - - if len(akey) == 0 || len(skey) == 0 || len(domainID) == 0 || len(recordID) == 0 { - log.Fatalf("Environment variable(s) not set\n") - } - - client, err := dme.NewClient(akey, skey) - client.URL = dme.SandboxURL - if err != nil { - log.Fatalf("err: %v", err) - } - - cr := map[string]interface{}{ - "name": "test-update", - } - - result, err2 := client.UpdateRecord(domainID, recordID, cr) - if err2 != nil { - log.Fatalf("UpdateRecord result: %v error %v", result, err2) - } - log.Print("Result: ", result) -} diff --git a/vendor/github.com/soniah/dnsmadeeasy/testutil/http.go b/vendor/github.com/soniah/dnsmadeeasy/testutil/http.go deleted file mode 100644 index ccc570cdd..000000000 --- a/vendor/github.com/soniah/dnsmadeeasy/testutil/http.go +++ /dev/null @@ -1,180 +0,0 @@ -package testutil - -import ( - "bytes" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "time" -) - -type HTTPServer struct { - URL string - Timeout time.Duration - started bool - request chan *http.Request - response chan ResponseFunc -} - -type Response struct { - Status int - Headers map[string]string - Body string -} - -var DefaultClient = &http.Client{ - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - }, -} - -func NewHTTPServer() *HTTPServer { - return &HTTPServer{URL: "http://localhost:4444", Timeout: 5 * time.Second} -} - -type ResponseFunc func(path string) Response - -func (s *HTTPServer) Start() { - if s.started { - return - } - s.started = true - s.request = make(chan *http.Request, 1024) - s.response = make(chan ResponseFunc, 1024) - u, err := url.Parse(s.URL) - if err != nil { - panic(err) - } - l, err := net.Listen("tcp", u.Host) - if err != nil { - panic(err) - } - go http.Serve(l, s) - - s.Response(203, nil, "") - for { - // Wait for it to be up. - resp, err := http.Get(s.URL) - if err == nil && resp.StatusCode == 203 { - break - } - time.Sleep(1e8) - } - s.WaitRequest() // Consume dummy request. -} - -// Flush discards all pending requests and responses. -func (s *HTTPServer) Flush() { - for { - select { - case <-s.request: - case <-s.response: - default: - return - } - } -} - -func body(req *http.Request) string { - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - return string(data) -} - -func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - req.ParseMultipartForm(1e6) - data, err := ioutil.ReadAll(req.Body) - if err != nil { - panic(err) - } - req.Body = ioutil.NopCloser(bytes.NewBuffer(data)) - s.request <- req - var resp Response - select { - case respFunc := <-s.response: - resp = respFunc(req.URL.Path) - case <-time.After(s.Timeout): - const msg = "ERROR: Timeout waiting for test to prepare a response\n" - fmt.Fprintf(os.Stderr, msg) - resp = Response{500, nil, msg} - } - if resp.Headers != nil { - h := w.Header() - for k, v := range resp.Headers { - h.Set(k, v) - } - } - if resp.Status != 0 { - w.WriteHeader(resp.Status) - } - w.Write([]byte(resp.Body)) -} - -// WaitRequests returns the next n requests made to the http server from -// the queue. If not enough requests were previously made, it waits until -// the timeout value for them to be made. -func (s *HTTPServer) WaitRequests(n int) []*http.Request { - reqs := make([]*http.Request, 0, n) - for i := 0; i < n; i++ { - select { - case req := <-s.request: - reqs = append(reqs, req) - case <-time.After(s.Timeout): - panic("Timeout waiting for request") - } - } - return reqs -} - -// WaitRequest returns the next request made to the http server from -// the queue. If no requests were previously made, it waits until the -// timeout value for one to be made. -func (s *HTTPServer) WaitRequest() *http.Request { - return s.WaitRequests(1)[0] -} - -// ResponseFunc prepares the test server to respond the following n -// requests using f to build each response. -func (s *HTTPServer) ResponseFunc(n int, f ResponseFunc) { - for i := 0; i < n; i++ { - s.response <- f - } -} - -// ResponseMap maps request paths to responses. -type ResponseMap map[string]Response - -// ResponseMap prepares the test server to respond the following n -// requests using the m to obtain the responses. -func (s *HTTPServer) ResponseMap(n int, m ResponseMap) { - f := func(path string) Response { - for rpath, resp := range m { - if rpath == path { - return resp - } - } - body := "Path not found in response map: " + path - return Response{Status: 500, Body: body} - } - s.ResponseFunc(n, f) -} - -// Responses prepares the test server to respond the following n requests -// using the provided response parameters. -func (s *HTTPServer) Responses(n int, status int, headers map[string]string, body string) { - f := func(path string) Response { - return Response{status, headers, body} - } - s.ResponseFunc(n, f) -} - -// Response prepares the test server to respond the following request -// using the provided response parameters. -func (s *HTTPServer) Response(status int, headers map[string]string, body string) { - s.Responses(1, status, headers, body) -} diff --git a/vendor/github.com/vmware/govmomi/event/history_collector.go b/vendor/github.com/vmware/govmomi/event/history_collector.go deleted file mode 100644 index 543c1ea8c..000000000 --- a/vendor/github.com/vmware/govmomi/event/history_collector.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package event - -import ( - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type HistoryCollector struct { - *object.HistoryCollector -} - -func NewHistoryCollector(c *vim25.Client, ref types.ManagedObjectReference) *HistoryCollector { - return &HistoryCollector{ - HistoryCollector: object.NewHistoryCollector(c, ref), - } -} - -func (h HistoryCollector) LatestPage(ctx context.Context) ([]types.BaseEvent, error) { - var o mo.EventHistoryCollector - - err := h.Properties(ctx, h.Reference(), []string{"latestPage"}, &o) - if err != nil { - return nil, err - } - - return o.LatestPage, nil -} - -func (h HistoryCollector) ReadNextEvents(ctx context.Context, maxCount int) ([]types.BaseEvent, error) { - req := types.ReadNextEvents{ - This: h.Reference(), - MaxCount: maxCount, - } - - res, err := methods.ReadNextEvents(ctx, h.Client(), &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (h HistoryCollector) ReadPreviousEvents(ctx context.Context, maxCount int) ([]types.BaseEvent, error) { - req := types.ReadPreviousEvents{ - This: h.Reference(), - MaxCount: maxCount, - } - - res, err := methods.ReadPreviousEvents(ctx, h.Client(), &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} diff --git a/vendor/github.com/vmware/govmomi/event/manager.go b/vendor/github.com/vmware/govmomi/event/manager.go deleted file mode 100644 index c137f4a44..000000000 --- a/vendor/github.com/vmware/govmomi/event/manager.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package event - -import ( - "reflect" - "sync" - - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Manager struct { - reference types.ManagedObjectReference - - c *vim25.Client - - eventCategory map[string]string - eventCategoryMu *sync.Mutex -} - -func NewManager(c *vim25.Client) *Manager { - m := Manager{ - reference: *c.ServiceContent.EventManager, - - c: c, - - eventCategory: make(map[string]string), - eventCategoryMu: new(sync.Mutex), - } - - return &m -} - -func (m Manager) CreateCollectorForEvents(ctx context.Context, filter types.EventFilterSpec) (*HistoryCollector, error) { - req := types.CreateCollectorForEvents{ - This: m.reference, - Filter: filter, - } - - res, err := methods.CreateCollectorForEvents(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return NewHistoryCollector(m.c, res.Returnval), nil -} - -func (m Manager) LogUserEvent(ctx context.Context, entity types.ManagedObjectReference, msg string) error { - req := types.LogUserEvent{ - This: m.reference, - Entity: entity, - Msg: msg, - } - - _, err := methods.LogUserEvent(ctx, m.c, &req) - if err != nil { - return err - } - - return nil -} - -func (m Manager) PostEvent(ctx context.Context, eventToPost types.BaseEvent, taskInfo types.TaskInfo) error { - req := types.PostEvent{ - This: m.reference, - EventToPost: eventToPost, - TaskInfo: &taskInfo, - } - - _, err := methods.PostEvent(ctx, m.c, &req) - if err != nil { - return err - } - - return nil -} - -func (m Manager) QueryEvents(ctx context.Context, filter types.EventFilterSpec) ([]types.BaseEvent, error) { - req := types.QueryEvents{ - This: m.reference, - Filter: filter, - } - - res, err := methods.QueryEvents(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (m Manager) RetrieveArgumentDescription(ctx context.Context, eventTypeID string) ([]types.EventArgDesc, error) { - req := types.RetrieveArgumentDescription{ - This: m.reference, - EventTypeId: eventTypeID, - } - - res, err := methods.RetrieveArgumentDescription(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (m Manager) eventCategoryMap(ctx context.Context) (map[string]string, error) { - m.eventCategoryMu.Lock() - defer m.eventCategoryMu.Unlock() - - if len(m.eventCategory) != 0 { - return m.eventCategory, nil - } - - var o mo.EventManager - - ps := []string{"description.eventInfo"} - err := property.DefaultCollector(m.c).RetrieveOne(ctx, m.reference, ps, &o) - if err != nil { - return nil, err - } - - for _, info := range o.Description.EventInfo { - m.eventCategory[info.Key] = info.Category - } - - return m.eventCategory, nil -} - -// EventCategory returns the category for an event, such as "info" or "error" for example. -func (m Manager) EventCategory(ctx context.Context, event types.BaseEvent) (string, error) { - // Most of the event details are included in the Event.FullFormattedMessage, but the category - // is only available via the EventManager description.eventInfo property. The value of this - // property is static, so we fetch and once and cache. - eventCategory, err := m.eventCategoryMap(ctx) - if err != nil { - return "", err - } - - class := reflect.TypeOf(event).Elem().Name() - - return eventCategory[class], nil -} diff --git a/vendor/github.com/vmware/govmomi/event/sort.go b/vendor/github.com/vmware/govmomi/event/sort.go deleted file mode 100644 index ac87b0eda..000000000 --- a/vendor/github.com/vmware/govmomi/event/sort.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package event - -import ( - "sort" - - "github.com/vmware/govmomi/vim25/types" -) - -// Sort events in accending order base on Key -// From the EventHistoryCollector.latestPage sdk docs: -// The "oldest event" is the one with the smallest key (event ID). -// The events in the returned page are unordered. -func Sort(events []types.BaseEvent) { - sort.Sort(baseEvent(events)) -} - -type baseEvent []types.BaseEvent - -func (d baseEvent) Len() int { - return len(d) -} - -func (d baseEvent) Less(i, j int) bool { - return d[i].GetEvent().Key < d[j].GetEvent().Key -} - -func (d baseEvent) Swap(i, j int) { - d[i], d[j] = d[j], d[i] -} diff --git a/vendor/github.com/vmware/govmomi/examples/datastores/main.go b/vendor/github.com/vmware/govmomi/examples/datastores/main.go deleted file mode 100644 index 5a76adfa9..000000000 --- a/vendor/github.com/vmware/govmomi/examples/datastores/main.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -/* -This example program shows how the `finder` and `property` packages can -be used to navigate a vSphere inventory structure using govmomi. -*/ - -package main - -import ( - "flag" - "fmt" - "net/url" - "os" - "strings" - "text/tabwriter" - - "github.com/vmware/govmomi" - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// GetEnvString returns string from environment variable. -func GetEnvString(v string, def string) string { - r := os.Getenv(v) - if r == "" { - return def - } - - return r -} - -// GetEnvBool returns boolean from environment variable. -func GetEnvBool(v string, def bool) bool { - r := os.Getenv(v) - if r == "" { - return def - } - - switch strings.ToLower(r[0:1]) { - case "t", "y", "1": - return true - } - - return false -} - -const ( - envURL = "GOVMOMI_URL" - envUserName = "GOVMOMI_USERNAME" - envPassword = "GOVMOMI_PASSWORD" - envInsecure = "GOVMOMI_INSECURE" -) - -var urlDescription = fmt.Sprintf("ESX or vCenter URL [%s]", envURL) -var urlFlag = flag.String("url", GetEnvString(envURL, "https://username:password@host/sdk"), urlDescription) - -var insecureDescription = fmt.Sprintf("Don't verify the server's certificate chain [%s]", envInsecure) -var insecureFlag = flag.Bool("insecure", GetEnvBool(envInsecure, false), insecureDescription) - -func processOverride(u *url.URL) { - envUsername := os.Getenv(envUserName) - envPassword := os.Getenv(envPassword) - - // Override username if provided - if envUsername != "" { - var password string - var ok bool - - if u.User != nil { - password, ok = u.User.Password() - } - - if ok { - u.User = url.UserPassword(envUsername, password) - } else { - u.User = url.User(envUsername) - } - } - - // Override password if provided - if envPassword != "" { - var username string - - if u.User != nil { - username = u.User.Username() - } - - u.User = url.UserPassword(username, envPassword) - } -} - -func exit(err error) { - fmt.Fprintf(os.Stderr, "Error: %s\n", err) - os.Exit(1) -} - -func main() { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - flag.Parse() - - // Parse URL from string - u, err := url.Parse(*urlFlag) - if err != nil { - exit(err) - } - - // Override username and/or password as required - processOverride(u) - - // Connect and log in to ESX or vCenter - c, err := govmomi.NewClient(ctx, u, *insecureFlag) - if err != nil { - exit(err) - } - - f := find.NewFinder(c.Client, true) - - // Find one and only datacenter - dc, err := f.DefaultDatacenter(ctx) - if err != nil { - exit(err) - } - - // Make future calls local to this datacenter - f.SetDatacenter(dc) - - // Find datastores in datacenter - dss, err := f.DatastoreList(ctx, "*") - if err != nil { - exit(err) - } - - pc := property.DefaultCollector(c.Client) - - // Convert datastores into list of references - var refs []types.ManagedObjectReference - for _, ds := range dss { - refs = append(refs, ds.Reference()) - } - - // Retrieve summary property for all datastores - var dst []mo.Datastore - err = pc.Retrieve(ctx, refs, []string{"summary"}, &dst) - if err != nil { - exit(err) - } - - // Print summary per datastore - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - fmt.Fprintf(tw, "Name:\tType:\tCapacity:\tFree:\n") - for _, ds := range dst { - fmt.Fprintf(tw, "%s\t", ds.Summary.Name) - fmt.Fprintf(tw, "%s\t", ds.Summary.Type) - fmt.Fprintf(tw, "%s\t", units.ByteSize(ds.Summary.Capacity)) - fmt.Fprintf(tw, "%s\t", units.ByteSize(ds.Summary.FreeSpace)) - fmt.Fprintf(tw, "\n") - } - tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/gen/Gemfile b/vendor/github.com/vmware/govmomi/gen/Gemfile deleted file mode 100644 index 26a4f1477..000000000 --- a/vendor/github.com/vmware/govmomi/gen/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "nokogiri" diff --git a/vendor/github.com/vmware/govmomi/gen/Gemfile.lock b/vendor/github.com/vmware/govmomi/gen/Gemfile.lock deleted file mode 100644 index 6cdeaae5a..000000000 --- a/vendor/github.com/vmware/govmomi/gen/Gemfile.lock +++ /dev/null @@ -1,12 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mini_portile (0.6.0) - nokogiri (1.6.3.1) - mini_portile (= 0.6.0) - -PLATFORMS - ruby - -DEPENDENCIES - nokogiri diff --git a/vendor/github.com/vmware/govmomi/gen/gen.sh b/vendor/github.com/vmware/govmomi/gen/gen.sh deleted file mode 100644 index 8373fcf82..000000000 --- a/vendor/github.com/vmware/govmomi/gen/gen.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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. - -set -e - -if [ ! -f rbvmomi/vmodl.db ]; then - git clone https://github.com/vmware/rbvmomi -fi - -dst=../vim25 - -pkgs=$(echo $dst/{types,methods,mo}) -mkdir -p $pkgs - -bundle exec ruby gen_from_wsdl.rb $dst -bundle exec ruby gen_from_vmodl.rb $dst - -for p in $pkgs -do - echo $p - cd $p - goimports -w *.go - go install - cd - -done diff --git a/vendor/github.com/vmware/govmomi/gen/gen_from_vmodl.rb b/vendor/github.com/vmware/govmomi/gen/gen_from_vmodl.rb deleted file mode 100644 index b8fcc6cae..000000000 --- a/vendor/github.com/vmware/govmomi/gen/gen_from_vmodl.rb +++ /dev/null @@ -1,216 +0,0 @@ -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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. - -$:.unshift(File.expand_path(File.dirname(__FILE__))) - -require "vim_wsdl" - -require "test/unit" - -PATH = File.expand_path("../rbvmomi", __FILE__) - -def read(file) - File.open(File.join(PATH, file)) -end - -class Prop - def initialize(vmodl, data) - @vmodl = vmodl - @data = data - end - - def slice? - @data["is-array"] - end - - def optional? - @data["is-optional"] - end - - def name - @data["name"] - end - - def var_field - n = name - n[0].capitalize + n[1..-1] - end - - def var_type_prefix(base=false) - if slice? - "[]" - else - if optional? && !base - "*" - else - "" - end - end - end - - def var_type - type = @data["wsdl_type"] - if @vmodl.managed_hash.has_key?(type) - type = "ManagedObjectReference" - end - - # Fix up type from vmodl - case type - when "TypeName", "MethodName" - type = "xsd:string" - when "ManagedObject" - type = "ManagedObjectReference" - when "xsd:anyType" - type = "AnyType" - end - - if type =~ /^xsd:(.*)$/ - type = $1 - case type - when "string" - when "int" - when "boolean" - type ="bool" - when "long" - type ="int64" - when "dateTime" - type ="time.Time" - prefix += "*" if !slice? && optional? - when "byte" - when "double" - type ="float64" - when "float" - type ="float32" - when "short" - type ="int16" - when "base64Binary" - type ="[]byte" - else - raise "unknown type: %s" % type - end - else - if Peek.base?(type) - type = "Base" + type - base = true - end - type = "types." + type - end - - var_type_prefix(base) + type - end - - def var_tag - "mo:\"%s\"" % name - end - - def dump(io) - io.print "%s %s `%s`\n" % [var_field, var_type, var_tag] - end -end - -class Managed - def initialize(vmodl, name, data) - @vmodl = vmodl - @name = name - @data = data - end - - def name - @name - end - - def props - @data["props"].map do |p| - Prop.new(@vmodl, p) - end - end - - def dump(io) - include_ref_getter = false - - io.print "type %s struct {\n" % name - - case @data["wsdl_base"] - when nil, "ManagedObject", "View" - include_ref_getter = true - io.print "Self types.ManagedObjectReference\n\n" - else - io.print "%s\n\n" % @data["wsdl_base"] - end - - props.each do |p| - p.dump(io) - end - io.print "}\n\n" - - if include_ref_getter - io.print "func (m %s) Reference() types.ManagedObjectReference {\n" % [name] - io.print "return m.Self\n" - io.print "}\n\n" - end - end - - def dump_init(io) - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end -end - -class Vmodl - def initialize(data) - @data = Marshal.load(data) - end - - def managed_hash - @managed_hash ||= begin - h = {} - managed.each do |m| - h[m.name] = m - end - h - end - end - - def managed - @data.map do |k,v| - next if !v.is_a?(Hash) - next if v["kind"] != "managed" - next if k =~ /^pbm/i - - Managed.new(self, k, v) - end.compact - end -end - -if !File.directory?(ARGV.first) - raise "first argument not a directory" -end - -wsdl = WSDL.new(WSDL.read "vim.wsdl") -wsdl.validate_assumptions! -wsdl.peek() - -File.open(File.join(ARGV.first, "mo/mo.go"), "w") do |io| - io.print WSDL.header("mo") - - vmodl = Vmodl.new(read "vmodl.db") - - vmodl. - managed. - sort_by { |m| m.name }. - each { |m| m.dump(io); m.dump_init(io); } -end - -exit(0) diff --git a/vendor/github.com/vmware/govmomi/gen/gen_from_wsdl.rb b/vendor/github.com/vmware/govmomi/gen/gen_from_wsdl.rb deleted file mode 100644 index 5004cfd0f..000000000 --- a/vendor/github.com/vmware/govmomi/gen/gen_from_wsdl.rb +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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. - -$:.unshift(File.expand_path(File.dirname(__FILE__))) - -require "vim_wsdl" - -if !File.directory?(ARGV.first) - raise "first argument not a directory" -end - -wsdl = WSDL.new(WSDL.read "vim.wsdl") -wsdl.validate_assumptions! -wsdl.peek() - -ifs = Peek.types.keys.select { |name| Peek.base?(name) }.size() -puts "%d classes, %d interfaces" % [Peek.types.size(), ifs] - -File.open(File.join(ARGV.first, "types/enum.go"), "w") do |io| - io.print WSDL.header("types") - - wsdl. - types. - sort_by { |x| x.name }. - uniq { |x| x.name }. - select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... - select { |t| t.is_enum? }. - each { |e| e.dump(io); e.dump_init(io) } -end - -File.open(File.join(ARGV.first, "types/types.go"), "w") do |io| - io.print WSDL.header("types") - - wsdl. - types. - sort_by { |x| x.name }. - uniq { |x| x.name }. - select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... - select { |t| !t.is_enum? }. - each { |e| e.dump(io); e.dump_init(io) } -end - -File.open(File.join(ARGV.first, "types/if.go"), "w") do |io| - io.print WSDL.header("types") - - Peek.dump_interfaces(io) -end - -File.open(File.join(ARGV.first, "methods/methods.go"), "w") do |io| - io.print WSDL.header("methods") - - wsdl. - operations. - sort_by { |x| x.name }. - select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... - each { |e| e.dump(io) } -end - -exit(0) diff --git a/vendor/github.com/vmware/govmomi/gen/vim_wsdl.rb b/vendor/github.com/vmware/govmomi/gen/vim_wsdl.rb deleted file mode 100644 index 285a30b85..000000000 --- a/vendor/github.com/vmware/govmomi/gen/vim_wsdl.rb +++ /dev/null @@ -1,745 +0,0 @@ -# Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. -# -# 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. - -require "nokogiri" -require "test/unit" - -class Peek - class Type - attr_accessor :parent, :children, :klass - - def initialize(name) - @name = name - @children = [] - end - - def base? - return !children.empty? - end - end - - @@types = {} - @@refs = {} - @@enums = {} - - def self.types - return @@types - end - - def self.refs - return @@refs - end - - def self.enums - return @@enums - end - - def self.ref(type) - refs[type] = true - end - - def self.enum(type) - enums[type] = true - end - - def self.enum?(type) - enums[type] - end - - def self.register(name) - raise unless name - types[name] ||= Type.new(name) - end - - def self.base?(name) - return unless c = types[name] - c.base? - end - - def self.dump_interfaces(io) - types.keys.sort.each do |name| - next unless base?(name) - - types[name].klass.dump_interface(io, name) - end - end -end - -class EnumValue - def initialize(type, value) - @type = type - @value = value - end - - def type_name - @type.name - end - - def var_name - n = @type.name - v = var_value - if v == "" - n += "Null" - else - n += (v[0].capitalize + v[1..-1]) - end - - return n - end - - def var_value - @value - end - - def dump(io) - io.print "%s = %s(\"%s\")\n" % [var_name, type_name, var_value] - end -end - -class Simple - include Test::Unit::Assertions - - attr_accessor :name, :type - - def initialize(node) - @node = node - end - - def name - @name || @node["name"] - end - - def type - @type || @node["type"] - end - - def is_enum? - false - end - - def dump_init(io) - # noop - end - - def var_name - n = self.name - n = n[1..-1] if n[0] == "_" # Strip leading _ - n = n[0].capitalize + n[1..-1] # Capitalize - return n - end - - def vim_type? - ns, _ = self.type.split(":", 2) - ns == "vim25" - end - - def vim_type(t = self.type) - ns, t = t.split(":", 2) - raise if ns != "vim25" - t - end - - def base_type? - vim_type? && Peek.base?(vim_type) - end - - def enum_type? - vim_type? && Peek.enum?(vim_type) - end - - def any_type? - self.type == "xsd:anyType" - end - - def var_type - t = self.type - prefix = "" - - prefix += "[]" if slice? - - if t =~ /^xsd:(.*)$/ - t = $1 - case t - when "string" - when "int" - when "boolean" - t = "bool" - if !slice? && optional? - prefix += "*" - self.need_omitempty = false - end - when "long" - t = "int64" - when "dateTime" - t = "time.Time" - if !slice? && optional? - prefix += "*" - self.need_omitempty = false - end - when "anyType" - t = "AnyType" - when "byte" - when "double" - t = "float64" - when "float" - t = "float32" - when "short" - t = "int16" - when "base64Binary" - t = "[]byte" - when "anyURI" - t = "url.URL" - else - raise "unknown type: %s" % t - end - else - t = vim_type - if base_type? - prefix += "Base" - else - prefix += "*" if !slice? && !enum_type? && optional? - end - end - - prefix + t - end - - def slice? - test_attr("maxOccurs", "unbounded") - end - - def optional? - test_attr("minOccurs", "0") - end - - def need_omitempty=(v) - @need_omitempty = v - end - - def need_omitempty? - var_type # HACK: trigger setting need_omitempty if necessary - if @need_omitempty.nil? - @need_omitempty = optional? - else - @need_omitempty - end - end - - def need_typeattr? - base_type? || any_type? - end - - protected - - def test_attr(attr, expected) - actual = @node.attr(attr) - if actual != nil - case actual - when expected - true - else - raise "%s=%s" % [value, type.attr(value)] - end - else - false - end - end -end - -class Element < Simple - def initialize(node) - super(node) - end - - def has_type? - !@node["type"].nil? - end - - def child - cs = @node.element_children - assert_equal 1, cs.length - assert_equal "complexType", cs.first.name - - t = ComplexType.new(cs.first) - t.name = self.name - t - end - - def dump(io) - if has_type? - io.print "type %s %s\n\n" % [name, var_type] - else - child.dump(io) - end - end - - def dump_init(io) - if has_type? - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - end - - def dump_field(io) - tag = name - tag += ",omitempty" if need_omitempty? - tag += ",typeattr" if need_typeattr? - io.print "%s %s `xml:\"%s\"`\n" % [var_name, var_type, tag] - end - - def peek(type=nil) - if has_type? - return if self.type =~ /^xsd:/ - - Peek.ref(vim_type) - else - child.peek() - end - end -end - -class Attribute < Simple - def dump_field(io) - tag = name - tag += ",omitempty" if need_omitempty? - tag += ",attr" - io.print "%s %s `xml:\"%s\"`\n" % [var_name, var_type, tag] - end -end - -class SimpleType < Simple - def is_enum? - true - end - - def dump(io) - enums = @node.xpath(".//xsd:enumeration").map do |n| - EnumValue.new(self, n["value"]) - end - - io.print "type %s string\n\n" % name - io.print "const (\n" - enums.each { |e| e.dump(io) } - io.print ")\n\n" - end - - def dump_init(io) - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - - def peek - Peek.enum(name) - end -end - -class ComplexType < Simple - class SimpleContent < Simple - def dump(io) - attr = Attribute.new(@node.at_xpath(".//xsd:attribute")) - attr.dump_field(io) - - # HACK DELUXE(PN) - extension = @node.at_xpath(".//xsd:extension") - type = extension["base"].split(":", 2)[1] - io.print "Value %s `xml:\",chardata\"`\n" % type - end - - def peek - end - end - - class ComplexContent < Simple - def base - extension = @node.at_xpath(".//xsd:extension") - assert_not_nil extension - - base = extension["base"] - assert_not_nil base - - vim_type(base) - end - - def dump(io) - Sequence.new(@node).dump(io, base) - end - - def dump_interface(io, name) - Sequence.new(@node).dump_interface(io, name) - end - - def peek - Sequence.new(@node).peek(base) - end - end - - class Sequence < Simple - def sequence - sequence = @node.at_xpath(".//xsd:sequence") - if sequence != nil - sequence.element_children.map do |n| - Element.new(n) - end - else - nil - end - end - - def dump(io, base = nil) - return unless elements = sequence - - io.print "%s\n\n" % base - - elements.each do |e| - e.dump_field(io) - end - end - - def dump_interface(io, name) - method = "Get%s() *%s" % [name, name] - io.print "func (b *%s) %s { return b }\n" % [name, method] - io.print "type Base%s interface {\n" % name - io.print "%s\n" % method - io.print "}\n\n" - io.print "func init() {\n" - io.print "t[\"Base%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - - def peek(base = nil) - return unless elements = sequence - name = @node.attr("name") - return unless name - - elements.each do |e| - e.peek(name) - end - - c = Peek.register(name) - if base - c.parent = base - Peek.register(c.parent).children << name - end - end - end - - def klass - @klass ||= begin - cs = @node.element_children - if !cs.empty? - assert_equal 1, cs.length - - case cs.first.name - when "simpleContent" - SimpleContent.new(@node) - when "complexContent" - ComplexContent.new(@node) - when "sequence" - Sequence.new(@node) - else - raise "don't know what to do for element: %s..." % cs.first.name - end - end - end - end - - def dump_init(io) - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - - def dump(io) - io.print "type %s struct {\n" % name - klass.dump(io) if klass - io.print "}\n\n" - end - - def peek - Peek.register(name).klass = klass - klass.peek if klass - end -end - -class Schema - include Test::Unit::Assertions - - def initialize(xml, parent = nil) - @xml = Nokogiri::XML.parse(xml) - end - - def targetNamespace - @xml.root["targetNamespace"] - end - - # We have some assumptions about structure, make sure they hold. - def validate_assumptions! - # Every enumeration is part of a restriction - @xml.xpath(".//xsd:enumeration").each do |n| - assert_equal "restriction", n.parent.name - end - - # See type == enum - @xml.xpath(".//xsd:restriction").each do |n| - # Every restriction has type xsd:string (it's an enum) - assert_equal "xsd:string", n["base"] - - # Every restriction is part of a simpleType - assert_equal "simpleType", n.parent.name - - # Every restriction is alone - assert_equal 1, n.parent.element_children.size - end - - # See type == complex_content - @xml.xpath(".//xsd:complexContent").each do |n| - # complexContent is child of complexType - assert_equal "complexType", n.parent.name - - end - - # See type == complex_type - @xml.xpath(".//xsd:complexType").each do |n| - cc = n.element_children - - # OK to have an empty complexType - next if cc.size == 0 - - # Require 1 element otherwise - assert_equal 1, cc.size - - case cc.first.name - when "complexContent" - # complexContent has 1 "extension" element - cc = cc.first.element_children - assert_equal 1, cc.size - assert_equal "extension", cc.first.name - - # extension has 1 "sequence" element - ec = cc.first.element_children - assert_equal 1, ec.size - assert_equal "sequence", ec.first.name - - # sequence has N "element" elements - sc = ec.first.element_children - assert sc.all? { |e| e.name == "element" } - when "simpleContent" - # simpleContent has 1 "extension" element - cc = cc.first.element_children - assert_equal 1, cc.size - assert_equal "extension", cc.first.name - - # extension has 1 or more "attribute" elements - ec = cc.first.element_children - assert_not_equal 0, ec.size - assert_equal "attribute", ec.first.name - when "sequence" - # sequence has N "element" elements - sc = cc.first.element_children - assert sc.all? { |e| e.name == "element" } - else - raise "unknown element: %s" % cc.first.name - end - end - - includes.each do |i| - i.validate_assumptions! - end - end - - def types - return to_enum(:types) unless block_given? - - includes.each do |i| - i.types do |t| - yield t - end - end - - @xml.root.children.each do |n| - case n.class.to_s - when "Nokogiri::XML::Text" - next - when "Nokogiri::XML::Element" - case n.name - when "include", "import" - next - when "element" - yield Element.new(n) - when "simpleType" - yield SimpleType.new(n) - when "complexType" - yield ComplexType.new(n) - else - raise "unknown child: %s" % n.name - end - else - raise "unknown type: %s" % n.class - end - end - end - - def includes - @includes ||= @xml.root.xpath(".//xmlns:include").map do |n| - Schema.new(WSDL.read n["schemaLocation"]) - end - end -end - - -class Operation - include Test::Unit::Assertions - - def initialize(wsdl, operation_node) - @wsdl = wsdl - @operation_node = operation_node - end - - def name - @operation_node["name"] - end - - def remove_ns(x) - ns, x = x.split(":", 2) - assert_equal "vim25", ns - x - end - - def find_type_for(type) - type = remove_ns(type) - - message = @wsdl.message(type) - assert_not_nil message - - part = message.at_xpath("./xmlns:part") - assert_not_nil message - - remove_ns(part["element"]) - end - - def input - type = @operation_node.at_xpath("./xmlns:input").attr("message") - find_type_for(type) - end - - def go_input - "types." + input - end - - def output - type = @operation_node.at_xpath("./xmlns:output").attr("message") - find_type_for(type) - end - - def go_output - "types." + output - end - - def dump(io) - io.print < /usr/local/bin/govc -chmod +x /usr/local/bin/govc -``` - -### Source - -You can install the latest govc version from source if you have the Go toolchain installed. - -```sh -go get github.com/vmware/govmomi/govc -``` - -(make sure `$GOPATH/bin` is in your `PATH`) - -## Usage - -govc exposes its functionality through subcommands. Option flags -to these subcommands are often shared. - -Common flags include: - -* `-u`: ESXi or vCenter URL (ex: `user:pass@host`) -* `-debug`: Trace requests and responses (to `~/.govmomi/debug`) - -Managed entities can be referred to by their absolute path or by their relative -path. For example, when specifying a datastore to use for a subcommand, you can -either specify it as `/mydatacenter/datastore/mydatastore`, or as -`mydatastore`. If you're not sure about the name of the datastore, or even the -full path to the datastore, you can specify a pattern to match. Both -`/*center/*/my*` (absolute) and `my*store` (relative) will resolve to the same -datastore, given there are no other datastores that match those globs. - -The relative path in this example can only be used if the command can -umambigously resolve a datacenter to use as origin for the query. If no -datacenter is specified, govc defaults to the only datacenter, if there is only -one. The datacenter itself can be specified as a pattern as well, enabling the -following arguments: `-dc='my*' -ds='*store'`. The datastore pattern is looked -up and matched relative to the datacenter which itself is specified as a -pattern. - -Besides specifying managed entities as arguments, they can also be specified -using environment variables. The following environment variables are used by govc -to set defaults: - -* `GOVC_USERNAME`: USERNAME to use. - -* `GOVC_PASSWORD`: PASSWORD to use. - -* `GOVC_URL`: URL of ESXi or vCenter instance to connect to. - - > The URL scheme defaults to `https` and the URL path defaults to `/sdk`. - > This means that specifying `user:pass@host` is equivalent to - > `https://user:pass@host/sdk`. - - > If password include special characters like `#` or `:` you can use - > `GOVC_USERNAME` and `GOVC_PASSWORD` to have a simple `GOVC_URL` - -* `GOVC_INSECURE`: Allow establishing insecure connections. - - > Use this option when the host you're connecting is using self-signed - > certificates, or is otherwise trusted. Set this option to `1` to enable. - -* `GOVC_DATACENTER` - -* `GOVC_DATASTORE` - -* `GOVC_NETWORK` - -* `GOVC_RESOURCE_POOL` - -* `GOVC_HOST` - -* `GOVC_GUEST_LOGIN`: Guest credentials for guest operations - -## Examples - -* About - ``` - $ export GOVC_URL="192.168.1.20" - $ export GOVC_USERNAME="domain\administrator" - $ export GOVC_PASSWORD="Password123#" - $ govc about - - Name: VMware vCenter Server - Vendor: VMware, Inc. - Version: 6.0.0 - Build: 2656761 - OS type: linux-x64 - API type: VirtualCenter - API version: 6.0 - Product ID: vpx - UUID: c9f0242f-10e3-4e10-85d7-5eea7c855188 - ``` - -* [Upload ssh public key to a VM](examples/lib/ssh.sh) - -* [Create and configure a vCenter VM](examples/vcsa.sh) - -## Projects using govc - -* [Kubernetes vSphere Provider](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/cluster/vsphere) - -## License - -govc is available under the [Apache 2 license](../LICENSE). diff --git a/vendor/github.com/vmware/govmomi/govc/about/command.go b/vendor/github.com/vmware/govmomi/govc/about/command.go deleted file mode 100644 index b993b38ba..000000000 --- a/vendor/github.com/vmware/govmomi/govc/about/command.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package about - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" -) - -type about struct { - *flags.ClientFlag -} - -func init() { - cli.Register("about", &about{}) -} - -func (cmd *about) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) -} - -func (cmd *about) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *about) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - a := c.ServiceContent.About - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - fmt.Fprintf(tw, "Name:\t%s\n", a.Name) - fmt.Fprintf(tw, "Vendor:\t%s\n", a.Vendor) - fmt.Fprintf(tw, "Version:\t%s\n", a.Version) - fmt.Fprintf(tw, "Build:\t%s\n", a.Build) - fmt.Fprintf(tw, "OS type:\t%s\n", a.OsType) - fmt.Fprintf(tw, "API type:\t%s\n", a.ApiType) - fmt.Fprintf(tw, "API version:\t%s\n", a.ApiVersion) - fmt.Fprintf(tw, "Product ID:\t%s\n", a.ProductLineId) - fmt.Fprintf(tw, "UUID:\t%s\n", a.InstanceUuid) - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/build.sh b/vendor/github.com/vmware/govmomi/govc/build.sh deleted file mode 100644 index 5e17a79a8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -e - -git_version=$(git describe) -if git_status=$(git status --porcelain 2>/dev/null) && [ -n "${git_status}" ]; then - git_version="${git_version}-dirty" -fi - -ldflags="-X github.com/vmware/govmomi/govc/version.gitVersion=${git_version}" - -BUILD_OS=${BUILD_OS:-darwin linux windows freebsd} -BUILD_ARCH=${BUILD_ARCH:-386 amd64} - -for os in ${BUILD_OS}; do - export GOOS="${os}" - for arch in ${BUILD_ARCH}; do - export GOARCH="${arch}" - - out="govc_${os}_${arch}" - if [ "${os}" == "windows" ]; then - out="${out}.exe" - fi - - set -x - go build \ - -o="${out}" \ - -pkgdir="./_pkg" \ - -compiler='gc' \ - -ldflags="${ldflags}" \ - github.com/vmware/govmomi/govc - set +x - done -done diff --git a/vendor/github.com/vmware/govmomi/govc/cli/command.go b/vendor/github.com/vmware/govmomi/govc/cli/command.go deleted file mode 100644 index 77b17ed17..000000000 --- a/vendor/github.com/vmware/govmomi/govc/cli/command.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cli - -import ( - "flag" - "fmt" - "io/ioutil" - "os" - "sort" - "text/tabwriter" - - "golang.org/x/net/context" -) - -type HasFlags interface { - // Register may be called more than once and should be idempotent. - Register(ctx context.Context, f *flag.FlagSet) - - // Process may be called more than once and should be idempotent. - Process(ctx context.Context) error -} - -type Command interface { - HasFlags - - Run(ctx context.Context, f *flag.FlagSet) error -} - -func generalHelp() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - - cmds := []string{} - for name := range commands { - cmds = append(cmds, name) - } - - sort.Strings(cmds) - - for _, name := range cmds { - fmt.Fprintf(os.Stderr, " %s\n", name) - } -} - -func commandHelp(name string, cmd Command, f *flag.FlagSet) { - type HasUsage interface { - Usage() string - } - - fmt.Fprintf(os.Stderr, "Usage: %s %s [OPTIONS]", os.Args[0], name) - if u, ok := cmd.(HasUsage); ok { - fmt.Fprintf(os.Stderr, " %s", u.Usage()) - } - fmt.Fprintf(os.Stderr, "\n") - - type HasDescription interface { - Description() string - } - - if u, ok := cmd.(HasDescription); ok { - fmt.Fprintf(os.Stderr, "%s\n", u.Description()) - } - - n := 0 - f.VisitAll(func(_ *flag.Flag) { - n += 1 - }) - - if n > 0 { - fmt.Fprintf(os.Stderr, "\nOptions:\n") - tw := tabwriter.NewWriter(os.Stderr, 2, 0, 2, ' ', 0) - f.VisitAll(func(f *flag.Flag) { - fmt.Fprintf(tw, "\t-%s=%s\t%s\n", f.Name, f.DefValue, f.Usage) - }) - tw.Flush() - } -} - -func Run(args []string) int { - var err error - - if len(args) == 0 { - generalHelp() - return 1 - } - - // Look up real command name in aliases table. - name, ok := aliases[args[0]] - if !ok { - name = args[0] - } - - cmd, ok := commands[name] - if !ok { - generalHelp() - return 1 - } - - fs := flag.NewFlagSet("", flag.ContinueOnError) - fs.SetOutput(ioutil.Discard) - - ctx := context.Background() - cmd.Register(ctx, fs) - - if err = fs.Parse(args[1:]); err != nil { - goto error - } - - if err = cmd.Process(ctx); err != nil { - goto error - } - - if err = cmd.Run(ctx, fs); err != nil { - goto error - } - - return 0 - -error: - if err == flag.ErrHelp { - commandHelp(args[0], cmd, fs) - } else { - fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], err) - } - - return 1 - -} diff --git a/vendor/github.com/vmware/govmomi/govc/cli/register.go b/vendor/github.com/vmware/govmomi/govc/cli/register.go deleted file mode 100644 index a20fc3ad0..000000000 --- a/vendor/github.com/vmware/govmomi/govc/cli/register.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cli - -var commands = map[string]Command{} - -var aliases = map[string]string{} - -func Register(name string, c Command) { - commands[name] = c -} - -func Alias(name string, alias string) { - aliases[alias] = name -} - -func Commands() map[string]Command { - return commands -} diff --git a/vendor/github.com/vmware/govmomi/govc/cluster/add.go b/vendor/github.com/vmware/govmomi/govc/cluster/add.go deleted file mode 100644 index 027e0c254..000000000 --- a/vendor/github.com/vmware/govmomi/govc/cluster/add.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cluster - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type add struct { - *flags.DatacenterFlag - *flags.HostConnectFlag - - cluster string - connect bool - license string -} - -func init() { - cli.Register("cluster.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) - cmd.HostConnectFlag.Register(ctx, f) - - f.StringVar(&cmd.cluster, "cluster", "*", "Path to cluster") - - f.StringVar(&cmd.license, "license", "", "Assign license key") - - f.BoolVar(&cmd.connect, "connect", true, "Immediately connect to host") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostConnectFlag.Process(ctx); err != nil { - return err - } - if cmd.HostName == "" { - return flag.ErrHelp - } - if cmd.UserName == "" { - return flag.ErrHelp - } - if cmd.Password == "" { - return flag.ErrHelp - } - return nil -} - -func (cmd *add) Description() string { - return `Add host to cluster. - -The host is added to the cluster specified by the 'cluster' flag.` -} - -func (cmd *add) Add(ctx context.Context, cluster *object.ClusterComputeResource) error { - spec := cmd.HostConnectSpec - - var license *string - if cmd.license != "" { - license = &cmd.license - } - - task, err := cluster.AddHost(ctx, spec, cmd.connect, license, nil) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("adding %s to cluster %s... ", spec.HostName, cluster.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() != 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - cluster, err := finder.ClusterComputeResource(ctx, cmd.cluster) - if err != nil { - return nil - } - - err = cmd.Add(ctx, cluster) - - if err == nil { - return nil - } - - // Check if we failed due to SSLVerifyFault and -noverify is set - if err := cmd.AcceptThumbprint(err); err != nil { - return err - } - - // Accepted unverified thumbprint, try again - return cmd.Add(ctx, cluster) -} diff --git a/vendor/github.com/vmware/govmomi/govc/cluster/change.go b/vendor/github.com/vmware/govmomi/govc/cluster/change.go deleted file mode 100644 index ea21a27dc..000000000 --- a/vendor/github.com/vmware/govmomi/govc/cluster/change.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cluster - -import ( - "flag" - "strings" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" -) - -type change struct { - *flags.DatacenterFlag - - types.ClusterConfigSpecEx -} - -func init() { - cli.Register("cluster.change", &change{}) -} - -func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.DrsConfig = new(types.ClusterDrsConfigInfo) - cmd.DasConfig = new(types.ClusterDasConfigInfo) - cmd.VsanConfig = new(types.VsanClusterConfigInfo) - cmd.VsanConfig.DefaultConfig = new(types.VsanClusterConfigInfoHostDefaultInfo) - - // DRS - f.Var(flags.NewOptionalBool(&cmd.DrsConfig.Enabled), "drs-enabled", "Enable DRS") - - drsModes := []string{ - string(types.DrsBehaviorManual), - string(types.DrsBehaviorPartiallyAutomated), - string(types.DrsBehaviorFullyAutomated), - } - f.StringVar((*string)(&cmd.DrsConfig.DefaultVmBehavior), "drs-mode", "", - "DRS behavior for virtual machines: "+strings.Join(drsModes, ", ")) - - // HA - f.Var(flags.NewOptionalBool(&cmd.DasConfig.Enabled), "ha-enabled", "Enable HA") - - // vSAN - f.Var(flags.NewOptionalBool(&cmd.VsanConfig.Enabled), "vsan-enabled", "Enable vSAN") - f.Var(flags.NewOptionalBool(&cmd.VsanConfig.DefaultConfig.AutoClaimStorage), "vsan-autoclaim", "") -} - -func (cmd *change) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *change) Usage() string { - return "CLUSTER..." -} - -func (cmd *change) Description() string { - return `Change configuration of the given clusters.` -} - -func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { - finder, err := cmd.Finder() - if err != nil { - return err - } - - for _, path := range f.Args() { - clusters, err := finder.ClusterComputeResourceList(ctx, path) - if err != nil { - return err - } - - for _, cluster := range clusters { - task, err := cluster.Reconfigure(ctx, &cmd.ClusterConfigSpecEx, true) - if err != nil { - return err - } - - _, err = task.WaitForResult(ctx, nil) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/cluster/create.go b/vendor/github.com/vmware/govmomi/govc/cluster/create.go deleted file mode 100644 index 3d92f01f0..000000000 --- a/vendor/github.com/vmware/govmomi/govc/cluster/create.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cluster - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type create struct { - *flags.DatacenterFlag - - parent string - - types.ClusterConfigSpecEx -} - -func init() { - cli.Register("cluster.create", &create{}) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.StringVar(&cmd.parent, "parent", "", "Path to parent folder for the new cluster") -} - -func (cmd *create) Usage() string { - return "CLUSTER" -} - -func (cmd *create) Description() string { - return `Create CLUSTER in datacenter. - -The cluster is added to the folder specified by the 'parent' flag. If not given, -this defaults to the hosts folder in the specified or default datacenter.` -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - var parent *object.Folder - - if f.NArg() != 1 { - return flag.ErrHelp - } - - if cmd.parent == "" { - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - folders, err := dc.Folders(ctx) - if err != nil { - return err - } - - parent = folders.HostFolder - } else { - finder, err := cmd.Finder() - if err != nil { - return err - } - - parent, err = finder.Folder(ctx, cmd.parent) - if err != nil { - return err - } - } - - _, err := parent.CreateCluster(ctx, f.Arg(0), cmd.ClusterConfigSpecEx) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/datacenter/create.go b/vendor/github.com/vmware/govmomi/govc/datacenter/create.go deleted file mode 100644 index 2b2065432..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datacenter/create.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datacenter - -import ( - "flag" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type create struct { - *flags.ClientFlag -} - -func init() { - cli.Register("datacenter.create", &create{}) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) -} - -func (cmd *create) Usage() string { - return "[DATACENTER NAME]..." -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - datacenters := f.Args() - if len(datacenters) < 1 { - return flag.ErrHelp - } - - client, err := cmd.ClientFlag.Client() - if err != nil { - return err - } - - finder := find.NewFinder(client, false) - rootFolder := object.NewRootFolder(client) - for _, datacenterToCreate := range datacenters { - _, err := finder.Datacenter(context.TODO(), datacenterToCreate) - if err == nil { - // The datacenter was found, no need to create it - continue - } - - switch err.(type) { - case *find.NotFoundError: - _, err = rootFolder.CreateDatacenter(context.TODO(), datacenterToCreate) - if err != nil { - return err - } - default: - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/datacenter/destroy.go b/vendor/github.com/vmware/govmomi/govc/datacenter/destroy.go deleted file mode 100644 index eed333bb0..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datacenter/destroy.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datacenter - -import ( - "flag" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.ClientFlag -} - -func init() { - cli.Register("datacenter.destroy", &destroy{}) -} - -func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) -} - -func (cmd *destroy) Usage() string { - return "[DATACENTER NAME]..." -} - -func (cmd *destroy) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { - if len(f.Args()) < 1 { - return flag.ErrHelp - } - datacentersToDestroy := f.Args() - - client, err := cmd.ClientFlag.Client() - if err != nil { - return err - } - - finder := find.NewFinder(client, false) - for _, datacenterToDestroy := range datacentersToDestroy { - foundDatacenters, err := finder.DatacenterList(context.TODO(), datacenterToDestroy) - if err != nil { - return err - } - for _, foundDatacenter := range foundDatacenters { - task, err := foundDatacenter.Destroy(context.TODO()) - if err != nil { - return err - } - - if err := task.Wait(context.TODO()); err != nil { - return err - } - } - } - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/cp.go b/vendor/github.com/vmware/govmomi/govc/datastore/cp.go deleted file mode 100644 index 7e206ade4..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/cp.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type cp struct { - *flags.OutputFlag - *flags.DatastoreFlag - - force bool -} - -func init() { - cli.Register("datastore.cp", &cp{}) -} - -func (cmd *cp) Register(ctx context.Context, f *flag.FlagSet) { - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - - f.BoolVar(&cmd.force, "f", false, "If true, overwrite any identically named file at the destination") -} - -func (cmd *cp) Process(ctx context.Context) error { - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *cp) Usage() string { - return "SRC DST" -} - -func (cmd *cp) Run(ctx context.Context, f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("SRC and DST arguments are required") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO: support cross-datacenter copy - - src, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - dst, err := cmd.DatastorePath(args[1]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - task, err := m.CopyDatastoreFile(context.TODO(), src, dc, dst, dc, cmd.force) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/create.go b/vendor/github.com/vmware/govmomi/govc/datastore/create.go deleted file mode 100644 index db58699e8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/create.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - "fmt" - "os" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.HostSystemFlag - - // Generic options - Type typeFlag - Name string - Force bool - - // Options for NAS - RemoteHost string - RemotePath string - AccessMode string - UserName string - Password string - - // Options for VMFS - DiskCanonicalName string -} - -func init() { - cli.Register("datastore.create", &create{}) -} - -var nasTypes = []string{ - string(types.HostFileSystemVolumeFileSystemTypeNFS), - string(types.HostFileSystemVolumeFileSystemTypeNFS41), - string(types.HostFileSystemVolumeFileSystemTypeCIFS), -} - -var vmfsTypes = []string{ - string(types.HostFileSystemVolumeFileSystemTypeVMFS), -} - -var allTypes = []string{} - -func init() { - allTypes = append(allTypes, nasTypes...) - allTypes = append(allTypes, vmfsTypes...) -} - -type typeFlag string - -func (t *typeFlag) Set(s string) error { - s = strings.ToLower(s) - for _, e := range allTypes { - if s == strings.ToLower(e) { - *t = typeFlag(e) - return nil - } - } - - return fmt.Errorf("unknown type") -} - -func (t *typeFlag) String() string { - return string(*t) -} - -func (t *typeFlag) partOf(m []string) bool { - for _, e := range m { - if t.String() == e { - return true - } - } - return false -} - -func (t *typeFlag) IsNasType() bool { - return t.partOf(nasTypes) -} - -func (t *typeFlag) IsVmfsType() bool { - return t.partOf(vmfsTypes) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - modes := []string{ - string(types.HostMountModeReadOnly), - string(types.HostMountModeReadWrite), - } - - f.StringVar(&cmd.Name, "name", "", "Datastore name") - f.Var(&cmd.Type, "type", fmt.Sprintf("Datastore type (%s)", strings.Join(allTypes, "|"))) - f.BoolVar(&cmd.Force, "force", false, "Ignore DuplicateName error if datastore is already mounted on a host") - - // Options for NAS - f.StringVar(&cmd.RemoteHost, "remote-host", "", "Remote hostname of the NAS datastore") - f.StringVar(&cmd.RemotePath, "remote-path", "", "Remote path of the NFS mount point") - f.StringVar(&cmd.AccessMode, "mode", modes[0], - fmt.Sprintf("Access mode for the mount point (%s)", strings.Join(modes, "|"))) - f.StringVar(&cmd.UserName, "username", "", "Username to use when connecting (CIFS only)") - f.StringVar(&cmd.Password, "password", "", "Password to use when connecting (CIFS only)") - - // Options for VMFS - f.StringVar(&cmd.DiskCanonicalName, "disk", "", "Canonical name of disk (VMFS only)") -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Usage() string { - return "HOST..." -} - -func (cmd *create) Description() string { - return `Create datastore on HOST. - -Examples: - govc datastore.create -type nfs -name nfsDatastore -remote-host 10.143.2.232 -remote-path /share cluster1 - govc datastore.create -type vmfs -name localDatastore -disk=mpx.vmhba0:C0:T0:L0 cluster1` -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - switch { - case cmd.Type.IsNasType(): - return cmd.CreateNasDatastore(ctx, hosts) - case cmd.Type.IsVmfsType(): - return cmd.CreateVmfsDatastore(ctx, hosts) - default: - return fmt.Errorf("unhandled type %#v", cmd.Type) - } -} - -func (cmd *create) GetHostNasVolumeSpec() types.HostNasVolumeSpec { - s := types.HostNasVolumeSpec{ - LocalPath: cmd.Name, - Type: cmd.Type.String(), - RemoteHost: cmd.RemoteHost, - RemotePath: cmd.RemotePath, - AccessMode: cmd.AccessMode, - UserName: cmd.UserName, - Password: cmd.Password, - } - - return s -} - -func (cmd *create) CreateNasDatastore(ctx context.Context, hosts []*object.HostSystem) error { - object := types.ManagedObjectReference{ - Type: "Datastore", - Value: fmt.Sprintf("%s:%s", cmd.RemoteHost, cmd.RemotePath), - } - - spec := cmd.GetHostNasVolumeSpec() - - for _, host := range hosts { - ds, err := host.ConfigManager().DatastoreSystem(ctx) - if err != nil { - return err - } - - _, err = ds.CreateNasDatastore(ctx, spec) - if err != nil { - if soap.IsSoapFault(err) { - switch fault := soap.ToSoapFault(err).VimFault().(type) { - case types.PlatformConfigFault: - if len(fault.FaultMessage) != 0 { - return errors.New(fault.FaultMessage[0].Message) - } - case types.DuplicateName: - if cmd.Force && fault.Object == object { - fmt.Fprintf(os.Stderr, "%s: '%s' already mounted\n", - host.InventoryPath, cmd.Name) - continue - } - } - } - - return fmt.Errorf("%s: %s", host.InventoryPath, err) - } - } - - return nil -} - -func (cmd *create) CreateVmfsDatastore(ctx context.Context, hosts []*object.HostSystem) error { - for _, host := range hosts { - ds, err := host.ConfigManager().DatastoreSystem(ctx) - if err != nil { - return err - } - - // Find the specified disk - disks, err := ds.QueryAvailableDisksForVmfs(ctx) - if err != nil { - return err - } - - var disk *types.HostScsiDisk - for _, e := range disks { - if e.CanonicalName == cmd.DiskCanonicalName { - disk = &e - break - } - } - - if disk == nil { - return fmt.Errorf("no eligible disk found for name %#v", cmd.DiskCanonicalName) - } - - // Query for creation options and pick the right one - options, err := ds.QueryVmfsDatastoreCreateOptions(ctx, disk.DevicePath) - if err != nil { - return err - } - - var option *types.VmfsDatastoreOption - for _, e := range options { - if _, ok := e.Info.(*types.VmfsDatastoreAllExtentOption); ok { - option = &e - break - } - } - - if option == nil { - return fmt.Errorf("cannot use entire disk for datastore for name %#v", cmd.DiskCanonicalName) - } - - spec := *option.Spec.(*types.VmfsDatastoreCreateSpec) - spec.Vmfs.VolumeName = cmd.Name - _, err = ds.CreateVmfsDatastore(ctx, spec) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/download.go b/vendor/github.com/vmware/govmomi/govc/datastore/download.go deleted file mode 100644 index 27bfa93c8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/download.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/soap" -) - -type download struct { - *flags.DatastoreFlag -} - -func init() { - cli.Register("datastore.download", &download{}) -} - -func (cmd *download) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) -} - -func (cmd *download) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *download) Usage() string { - return "REMOTE LOCAL" -} - -func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("invalid arguments") - } - - ds, err := cmd.Datastore() - if err != nil { - return err - } - - p := soap.DefaultDownload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger("Downloading... ") - p.Progress = logger - defer logger.Wait() - } - - return ds.DownloadFile(context.TODO(), args[0], args[1], &p) -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/info.go b/vendor/github.com/vmware/govmomi/govc/datastore/info.go deleted file mode 100644 index 6e9dd7997..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/info.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.DatacenterFlag -} - -func init() { - cli.Register("datastore.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Usage() string { - return "[PATH]..." -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - args := f.Args() - if len(args) == 0 { - args = []string{"*"} - } - - var res infoResult - var props []string - - if cmd.OutputFlag.JSON { - props = nil // Load everything - } else { - props = []string{"info", "summary"} // Load summary - } - - for _, arg := range args { - objects, err := finder.DatastoreList(ctx, arg) - if err != nil { - return err - } - res.objects = append(res.objects, objects...) - } - - if len(res.objects) != 0 { - refs := make([]types.ManagedObjectReference, 0, len(res.objects)) - for _, o := range res.objects { - refs = append(refs, o.Reference()) - } - - pc := property.DefaultCollector(c) - err = pc.Retrieve(ctx, refs, props, &res.Datastores) - if err != nil { - return err - } - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - Datastores []mo.Datastore - objects []*object.Datastore -} - -func (r *infoResult) Write(w io.Writer) error { - // Maintain order via r.objects as Property collector does not always return results in order. - objects := make(map[types.ManagedObjectReference]mo.Datastore, len(r.Datastores)) - for _, o := range r.Datastores { - objects[o.Reference()] = o - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, o := range r.objects { - ds := objects[o.Reference()] - s := ds.Summary - fmt.Fprintf(tw, "Name:\t%s\n", s.Name) - fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) - fmt.Fprintf(tw, " Type:\t%s\n", s.Type) - fmt.Fprintf(tw, " URL:\t%s\n", s.Url) - fmt.Fprintf(tw, " Capacity:\t%.1f GB\n", float64(s.Capacity)/(1<<30)) - fmt.Fprintf(tw, " Free:\t%.1f GB\n", float64(s.FreeSpace)/(1<<30)) - - switch info := ds.Info.(type) { - case *types.NasDatastoreInfo: - fmt.Fprintf(tw, " Remote:\t%s:%s\n", info.Nas.RemoteHost, info.Nas.RemotePath) - } - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/ls.go b/vendor/github.com/vmware/govmomi/govc/datastore/ls.go deleted file mode 100644 index 570c592a1..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/ls.go +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "path" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ls struct { - *flags.DatastoreFlag - *flags.OutputFlag - - long bool - slash bool - all bool -} - -func init() { - cli.Register("datastore.ls", &ls{}) -} - -func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - f.BoolVar(&cmd.long, "l", false, "Long listing format") - f.BoolVar(&cmd.slash, "p", false, "Write a slash (`/') after each filename if that file is a directory") - f.BoolVar(&cmd.all, "a", false, "Include entries whose names begin with a dot (.)") -} - -func (cmd *ls) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ls) Usage() string { - return "[FILE]..." -} - -func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { - ds, err := cmd.Datastore() - if err != nil { - return err - } - - b, err := ds.Browser(context.TODO()) - if err != nil { - return err - } - - args := f.Args() - if len(args) == 0 { - args = []string{""} - } - - result := &listOutput{ - rs: make([]types.HostDatastoreBrowserSearchResults, 0), - cmd: cmd, - } - - for _, arg := range args { - spec := types.HostDatastoreBrowserSearchSpec{ - MatchPattern: []string{"*"}, - } - - if cmd.long { - spec.Details = &types.FileQueryFlags{ - FileType: true, - FileSize: true, - FileOwner: types.NewBool(true), // TODO: omitempty is generated, but seems to be required - Modification: true, - } - } - - for i := 0; ; i++ { - r, err := cmd.ListPath(b, arg, spec) - if err != nil { - // Treat the argument as a match pattern if not found as directory - if i == 0 && types.IsFileNotFound(err) { - spec.MatchPattern[0] = path.Base(arg) - arg = path.Dir(arg) - continue - } - - return err - } - - // Treat an empty result against match pattern as file not found - if i == 1 && len(r.File) == 0 { - return fmt.Errorf("File %s/%s was not found", r.FolderPath, spec.MatchPattern[0]) - } - - result.add(r) - break - } - } - - return cmd.WriteResult(result) -} - -func (cmd *ls) ListPath(b *object.HostDatastoreBrowser, path string, spec types.HostDatastoreBrowserSearchSpec) (types.HostDatastoreBrowserSearchResults, error) { - var res types.HostDatastoreBrowserSearchResults - - path, err := cmd.DatastorePath(path) - if err != nil { - return res, err - } - - task, err := b.SearchDatastore(context.TODO(), path, &spec) - if err != nil { - return res, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return res, err - } - - res = info.Result.(types.HostDatastoreBrowserSearchResults) - return res, nil -} - -type listOutput struct { - rs []types.HostDatastoreBrowserSearchResults - cmd *ls -} - -func (o *listOutput) add(r types.HostDatastoreBrowserSearchResults) { - res := r - res.File = nil - - for _, f := range r.File { - if f.GetFileInfo().Path[0] == '.' && !o.cmd.all { - continue - } - - if o.cmd.slash { - if d, ok := f.(*types.FolderFileInfo); ok { - d.Path += "/" - } - } - - res.File = append(res.File, f) - } - - o.rs = append(o.rs, res) -} - -// hasMultiplePaths returns whether or not the slice of search results contains -// results from more than one folder path. -func (o *listOutput) hasMultiplePaths() bool { - if len(o.rs) == 0 { - return false - } - - p := o.rs[0].FolderPath - - // Multiple paths if any entry is not equal to the first one. - for _, e := range o.rs { - if e.FolderPath != p { - return true - } - } - - return false -} - -func (o *listOutput) MarshalJSON() ([]byte, error) { - return json.Marshal(o.rs) -} - -func (o *listOutput) Write(w io.Writer) error { - // Only include path header if we're dealing with more than one path. - includeHeader := false - if o.hasMultiplePaths() { - includeHeader = true - } - - tw := tabwriter.NewWriter(w, 3, 0, 2, ' ', 0) - for i, r := range o.rs { - if includeHeader { - if i > 0 { - fmt.Fprintf(tw, "\n") - } - fmt.Fprintf(tw, "%s:\n", r.FolderPath) - } - for _, file := range r.File { - info := file.GetFileInfo() - if o.cmd.long { - fmt.Fprintf(tw, "%s\t%s\t%s\n", units.ByteSize(info.FileSize), info.Modification.Format("Mon Jan 2 15:04:05 2006"), info.Path) - } else { - fmt.Fprintf(tw, "%s\n", info.Path) - } - } - } - tw.Flush() - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/mkdir.go b/vendor/github.com/vmware/govmomi/govc/datastore/mkdir.go deleted file mode 100644 index cfa7e3933..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/mkdir.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type mkdir struct { - *flags.DatastoreFlag - - createParents bool -} - -func init() { - cli.Register("datastore.mkdir", &mkdir{}) -} - -func (cmd *mkdir) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - - f.BoolVar(&cmd.createParents, "p", false, "Create intermediate directories as needed") -} - -func (cmd *mkdir) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *mkdir) Usage() string { - return "DIRECTORY" -} - -func (cmd *mkdir) Run(ctx context.Context, f *flag.FlagSet) error { - args := f.Args() - if len(args) == 0 { - return errors.New("missing operand") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO(PN): Accept multiple args - path, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - err = m.MakeDirectory(context.TODO(), path, dc, cmd.createParents) - - // ignore EEXIST if -p flag is given - if err != nil && cmd.createParents { - if soap.IsSoapFault(err) { - soapFault := soap.ToSoapFault(err) - if _, ok := soapFault.VimFault().(types.FileAlreadyExists); ok { - return nil - } - } - } - - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/mv.go b/vendor/github.com/vmware/govmomi/govc/datastore/mv.go deleted file mode 100644 index 023ef393e..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/mv.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type mv struct { - *flags.DatastoreFlag - - force bool -} - -func init() { - cli.Register("datastore.mv", &mv{}) -} - -func (cmd *mv) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - - f.BoolVar(&cmd.force, "f", false, "If true, overwrite any identically named file at the destination") -} - -func (cmd *mv) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *mv) Usage() string { - return "SRC DST" -} - -func (cmd *mv) Run(ctx context.Context, f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("SRC and DST arguments are required") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO: support cross-datacenter move - - src, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - dst, err := cmd.DatastorePath(args[1]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - task, err := m.MoveDatastoreFile(context.TODO(), src, dc, dst, dc, cmd.force) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/remove.go b/vendor/github.com/vmware/govmomi/govc/datastore/remove.go deleted file mode 100644 index 772803446..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/remove.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" -) - -type remove struct { - *flags.HostSystemFlag - *flags.DatastoreFlag -} - -func init() { - cli.Register("datastore.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "HOST..." -} - -func (cmd *remove) Description() string { - return `Remove datastore from HOST. -Example: -govc datastore.remove -ds nfsDatastore cluster1 -` -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - ds, err := cmd.Datastore() - if err != nil { - return err - } - - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - for _, host := range hosts { - hds, err := host.ConfigManager().DatastoreSystem(ctx) - if err != nil { - return err - } - - err = hds.Remove(ctx, ds) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/rm.go b/vendor/github.com/vmware/govmomi/govc/datastore/rm.go deleted file mode 100644 index 09ef57d2f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/rm.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type rm struct { - *flags.DatastoreFlag - - force bool -} - -func init() { - cli.Register("datastore.rm", &rm{}) - cli.Alias("datastore.rm", "datastore.delete") -} - -func (cmd *rm) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - - f.BoolVar(&cmd.force, "f", false, "Force; ignore nonexistent files and arguments") -} - -func (cmd *rm) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *rm) Usage() string { - return "FILE" -} - -func (cmd *rm) Run(ctx context.Context, f *flag.FlagSet) error { - args := f.Args() - if len(args) == 0 { - return errors.New("missing operand") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO(PN): Accept multiple args - path, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - task, err := m.DeleteDatastoreFile(context.TODO(), path, dc) - if err != nil { - return err - } - - err = task.Wait(context.TODO()) - if err != nil { - if types.IsFileNotFound(err) && cmd.force { - // Ignore error - return nil - } - } - - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/datastore/upload.go b/vendor/github.com/vmware/govmomi/govc/datastore/upload.go deleted file mode 100644 index 77d3d8dcd..000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/upload.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package datastore - -import ( - "errors" - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/soap" -) - -type upload struct { - *flags.OutputFlag - *flags.DatastoreFlag -} - -func init() { - cli.Register("datastore.upload", &upload{}) -} - -func (cmd *upload) Register(ctx context.Context, f *flag.FlagSet) { - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) -} - -func (cmd *upload) Process(ctx context.Context) error { - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *upload) Usage() string { - return "LOCAL REMOTE" -} - -func (cmd *upload) Run(ctx context.Context, f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("invalid arguments") - } - - ds, err := cmd.Datastore() - if err != nil { - return err - } - - p := soap.DefaultUpload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger("Uploading... ") - p.Progress = logger - defer logger.Wait() - } - - return ds.UploadFile(context.TODO(), args[0], args[1], &p) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/boot.go b/vendor/github.com/vmware/govmomi/govc/device/boot.go deleted file mode 100644 index 268acacbf..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/boot.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package device - -import ( - "flag" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type boot struct { - *flags.VirtualMachineFlag - - order string - types.VirtualMachineBootOptions -} - -func init() { - cli.Register("device.boot", &boot{}) -} - -func (cmd *boot) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.Int64Var(&cmd.BootDelay, "delay", 0, "Delay in ms before starting the boot sequence") - f.StringVar(&cmd.order, "order", "", "Boot device order") - f.Int64Var(&cmd.BootRetryDelay, "retry-delay", 0, "Delay in ms before a boot retry") - - cmd.BootRetryEnabled = types.NewBool(false) - f.BoolVar(cmd.BootRetryEnabled, "retry", false, "If true, retry boot after retry-delay") - - cmd.EnterBIOSSetup = types.NewBool(false) - f.BoolVar(cmd.EnterBIOSSetup, "setup", false, "If true, enter BIOS setup on next boot") -} - -func (cmd *boot) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *boot) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - if cmd.order != "" { - o := strings.Split(cmd.order, ",") - cmd.BootOrder = devices.BootOrder(o) - } - - return vm.SetBootOptions(context.TODO(), &cmd.VirtualMachineBootOptions) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/cdrom/add.go b/vendor/github.com/vmware/govmomi/govc/device/cdrom/add.go deleted file mode 100644 index 122789a93..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/cdrom/add.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cdrom - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag - - controller string -} - -func init() { - cli.Register("device.cdrom.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.controller, "controller", "", "IDE controller name") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindIDEController(cmd.controller) - if err != nil { - return err - } - - d, err := devices.CreateCdrom(c) - if err != nil { - return err - } - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/cdrom/eject.go b/vendor/github.com/vmware/govmomi/govc/device/cdrom/eject.go deleted file mode 100644 index ea8a161a8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/cdrom/eject.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cdrom - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type eject struct { - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.cdrom.eject", &eject{}) -} - -func (cmd *eject) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.device, "device", "", "CD-ROM device name") -} - -func (cmd *eject) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *eject) Description() string { - return `Eject media from CD-ROM device. - -If device is not specified, the first CD-ROM device is used.` -} - -func (cmd *eject) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindCdrom(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.EjectIso(c)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/cdrom/insert.go b/vendor/github.com/vmware/govmomi/govc/device/cdrom/insert.go deleted file mode 100644 index cd4532ddc..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/cdrom/insert.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cdrom - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type insert struct { - *flags.DatastoreFlag - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.cdrom.insert", &insert{}) -} - -func (cmd *insert) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.device, "device", "", "CD-ROM device name") -} - -func (cmd *insert) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *insert) Usage() string { - return "ISO" -} - -func (cmd *insert) Description() string { - return `Insert media on datastore into CD-ROM device. - -If device is not specified, the first CD-ROM device is used.` -} - -func (cmd *insert) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil || f.NArg() != 1 { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindCdrom(cmd.device) - if err != nil { - return err - } - - iso, err := cmd.DatastorePath(f.Arg(0)) - if err != nil { - return nil - } - - return vm.EditDevice(context.TODO(), devices.InsertIso(c, iso)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/connect.go b/vendor/github.com/vmware/govmomi/govc/device/connect.go deleted file mode 100644 index 65f93aa2b..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/connect.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package device - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type connect struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.connect", &connect{}) -} - -func (cmd *connect) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) -} - -func (cmd *connect) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *connect) Usage() string { - return "DEVICE..." -} - -func (cmd *connect) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - if err = devices.Connect(device); err != nil { - return err - } - - if err = vm.EditDevice(context.TODO(), device); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/disconnect.go b/vendor/github.com/vmware/govmomi/govc/device/disconnect.go deleted file mode 100644 index fc2308621..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/disconnect.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package device - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type disconnect struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.disconnect", &disconnect{}) -} - -func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) -} - -func (cmd *disconnect) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *disconnect) Usage() string { - return "DEVICE..." -} - -func (cmd *disconnect) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - if err = devices.Disconnect(device); err != nil { - return err - } - - if err = vm.EditDevice(context.TODO(), device); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/floppy/add.go b/vendor/github.com/vmware/govmomi/govc/device/floppy/add.go deleted file mode 100644 index 36b819616..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/floppy/add.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package floppy - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.floppy.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.CreateFloppy() - if err != nil { - return err - } - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/floppy/eject.go b/vendor/github.com/vmware/govmomi/govc/device/floppy/eject.go deleted file mode 100644 index a2271ea6d..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/floppy/eject.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package floppy - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type eject struct { - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.floppy.eject", &eject{}) -} - -func (cmd *eject) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.device, "device", "", "Floppy device name") -} - -func (cmd *eject) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *eject) Description() string { - return `Eject image from floppy device. - -If device is not specified, the first floppy device is used.` -} - -func (cmd *eject) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindFloppy(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.EjectImg(c)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/floppy/insert.go b/vendor/github.com/vmware/govmomi/govc/device/floppy/insert.go deleted file mode 100644 index 213db6920..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/floppy/insert.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package floppy - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type insert struct { - *flags.DatastoreFlag - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.floppy.insert", &insert{}) -} - -func (cmd *insert) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.device, "device", "", "Floppy device name") -} - -func (cmd *insert) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *insert) Usage() string { - return "IMG" -} - -func (cmd *insert) Description() string { - return `Insert image on datastore into floppy device. - -If device is not specified, the first floppy device is used.` -} - -func (cmd *insert) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil || f.NArg() != 1 { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindFloppy(cmd.device) - if err != nil { - return err - } - - img, err := cmd.DatastorePath(f.Arg(0)) - if err != nil { - return nil - } - - return vm.EditDevice(context.TODO(), devices.InsertImg(c, img)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/info.go b/vendor/github.com/vmware/govmomi/govc/device/info.go deleted file mode 100644 index e1707a910..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/info.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package device - -import ( - "flag" - "fmt" - "io" - "os" - "strings" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.VirtualMachineFlag - *flags.OutputFlag -} - -func init() { - cli.Register("device.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Usage() string { - return "[DEVICE]..." -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - res := infoResult{ - list: devices, - } - - if f.NArg() == 0 { - res.Devices = devices - } else { - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - res.Devices = append(res.Devices, device) - } - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - Devices object.VirtualDeviceList - // need the full list of devices to lookup attached devices and controllers - list object.VirtualDeviceList -} - -func (r *infoResult) Write(w io.Writer) error { - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, device := range r.Devices { - d := device.GetVirtualDevice() - info := d.DeviceInfo.GetDescription() - - fmt.Fprintf(tw, "Name:\t%s\n", r.Devices.Name(device)) - fmt.Fprintf(tw, " Type:\t%s\n", r.Devices.TypeName(device)) - fmt.Fprintf(tw, " Label:\t%s\n", info.Label) - fmt.Fprintf(tw, " Summary:\t%s\n", info.Summary) - fmt.Fprintf(tw, " Key:\t%d\n", d.Key) - - if c, ok := device.(types.BaseVirtualController); ok { - var attached []string - for _, key := range c.GetVirtualController().Device { - attached = append(attached, r.Devices.Name(r.list.FindByKey(key))) - } - fmt.Fprintf(tw, " Devices:\t%s\n", strings.Join(attached, ", ")) - } else { - if c := r.list.FindByKey(d.ControllerKey); c != nil { - fmt.Fprintf(tw, " Controller:\t%s\n", r.Devices.Name(c)) - fmt.Fprintf(tw, " Unit number:\t%d\n", d.UnitNumber) - } - } - - if ca := d.Connectable; ca != nil { - fmt.Fprintf(tw, " Connected:\t%t\n", ca.Connected) - fmt.Fprintf(tw, " Start connected:\t%t\n", ca.StartConnected) - fmt.Fprintf(tw, " Guest control:\t%t\n", ca.AllowGuestControl) - fmt.Fprintf(tw, " Status:\t%s\n", ca.Status) - } - - switch md := device.(type) { - case types.BaseVirtualEthernetCard: - fmt.Fprintf(tw, " MAC Address:\t%s\n", md.GetVirtualEthernetCard().MacAddress) - fmt.Fprintf(tw, " Address type:\t%s\n", md.GetVirtualEthernetCard().AddressType) - case *types.VirtualDisk: - if b, ok := md.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { - fmt.Fprintf(tw, " File:\t%s\n", b.GetVirtualDeviceFileBackingInfo().FileName) - } - if b, ok := md.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok && b.Parent != nil { - fmt.Fprintf(tw, " Parent:\t%s\n", b.Parent.GetVirtualDeviceFileBackingInfo().FileName) - } - case *types.VirtualSerialPort: - if b, ok := md.Backing.(*types.VirtualSerialPortURIBackingInfo); ok { - fmt.Fprintf(tw, " Direction:\t%s\n", b.Direction) - fmt.Fprintf(tw, " Service URI:\t%s\n", b.ServiceURI) - fmt.Fprintf(tw, " Proxy URI:\t%s\n", b.ProxyURI) - } - } - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/ls.go b/vendor/github.com/vmware/govmomi/govc/device/ls.go deleted file mode 100644 index c4eafa318..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/ls.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package device - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type ls struct { - *flags.VirtualMachineFlag - - boot bool -} - -func init() { - cli.Register("device.ls", &ls{}) -} - -func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.BoolVar(&cmd.boot, "boot", false, "List devices configured in the VM's boot options") -} - -func (cmd *ls) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - if cmd.boot { - options, err := vm.BootOptions(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectBootOrder(options.BootOrder) - } - - tw := tabwriter.NewWriter(os.Stdout, 3, 0, 2, ' ', 0) - - for _, device := range devices { - fmt.Fprintf(tw, "%s\t%s\t%s\n", devices.Name(device), devices.TypeName(device), - device.GetVirtualDevice().DeviceInfo.GetDescription().Summary) - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/remove.go b/vendor/github.com/vmware/govmomi/govc/device/remove.go deleted file mode 100644 index 0e03b7197..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/remove.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package device - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type remove struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "DEVICE..." -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - if err = vm.RemoveDevice(context.TODO(), device); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/scsi/add.go b/vendor/github.com/vmware/govmomi/govc/device/scsi/add.go deleted file mode 100644 index 276391da8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/scsi/add.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package scsi - -import ( - "flag" - "fmt" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag - - controller string - sharedBus string - hotAddRemove bool -} - -func init() { - cli.Register("device.scsi.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - var ctypes []string - ct := object.SCSIControllerTypes() - for _, t := range ct { - ctypes = append(ctypes, ct.Type(t)) - } - f.StringVar(&cmd.controller, "type", ct.Type(ct[0]), - fmt.Sprintf("SCSI controller type (%s)", strings.Join(ctypes, "|"))) - f.StringVar(&cmd.sharedBus, "sharing", string(types.VirtualSCSISharingNoSharing), "SCSI sharing") - f.BoolVar(&cmd.hotAddRemove, "hot", false, "Enable hot-add/remove") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.CreateSCSIController(cmd.controller) - if err != nil { - return err - } - - c := d.(types.BaseVirtualSCSIController).GetVirtualSCSIController() - c.HotAddRemove = &cmd.hotAddRemove - c.SharedBus = types.VirtualSCSISharing(cmd.sharedBus) - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/serial/add.go b/vendor/github.com/vmware/govmomi/govc/device/serial/add.go deleted file mode 100644 index 564ef27ab..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/serial/add.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package serial - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.serial.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.CreateSerialPort() - if err != nil { - return err - } - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/serial/connect.go b/vendor/github.com/vmware/govmomi/govc/device/serial/connect.go deleted file mode 100644 index ec9088387..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/serial/connect.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package serial - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type connect struct { - *flags.VirtualMachineFlag - - device string - client bool -} - -func init() { - cli.Register("device.serial.connect", &connect{}) -} - -func (cmd *connect) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.device, "device", "", "serial port device name") - f.BoolVar(&cmd.client, "client", false, "Use client direction") -} - -func (cmd *connect) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *connect) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.FindSerialPort(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.ConnectSerialPort(d, f.Arg(0), cmd.client)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/device/serial/disconnect.go b/vendor/github.com/vmware/govmomi/govc/device/serial/disconnect.go deleted file mode 100644 index 108006fc1..000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/serial/disconnect.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package serial - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type disconnect struct { - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.serial.disconnect", &disconnect{}) -} - -func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.device, "device", "", "serial port device name") -} - -func (cmd *disconnect) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *disconnect) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.FindSerialPort(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.DisconnectSerialPort(d)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/dvs/add.go b/vendor/github.com/vmware/govmomi/govc/dvs/add.go deleted file mode 100644 index 671b7e13b..000000000 --- a/vendor/github.com/vmware/govmomi/govc/dvs/add.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package dvs - -import ( - "flag" - "fmt" - "os" - "strings" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type add struct { - *flags.HostSystemFlag - - path string - pnic string -} - -func init() { - cli.Register("dvs.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.StringVar(&cmd.path, "dvs", "", "DVS path") - f.StringVar(&cmd.pnic, "pnic", "vmnic0", "Name of the host physical NIC") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Usage() string { - return "HOST..." -} - -func (cmd *add) Description() string { - return `Add hosts to DVS.` -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - net, err := finder.Network(ctx, cmd.path) - if err != nil { - return err - } - - dvs, ok := net.(*object.DistributedVirtualSwitch) - if !ok { - return fmt.Errorf("%s (%T) is not of type %T", cmd.path, net, dvs) - } - - var s mo.VmwareDistributedVirtualSwitch - err = dvs.Properties(ctx, dvs.Reference(), []string{"config"}, &s) - if err != nil { - return err - } - - backing := new(types.DistributedVirtualSwitchHostMemberPnicBacking) - - for _, vmnic := range strings.Split(cmd.pnic, ",") { - backing.PnicSpec = append(backing.PnicSpec, types.DistributedVirtualSwitchHostMemberPnicSpec{ - PnicDevice: strings.TrimSpace(vmnic), - }) - } - - config := &types.DVSConfigSpec{ - ConfigVersion: s.Config.GetDVSConfigInfo().ConfigVersion, - } - - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - existing := make(map[string]bool) - // TODO: host.pnic.info command - for _, member := range s.Config.GetDVSConfigInfo().Host { - existing[member.Config.Host.Value] = true - } - - for _, host := range hosts { - ref := host.Reference() - if existing[ref.Value] { - fmt.Fprintf(os.Stderr, "%s is already a member of %s\n", host.InventoryPath, dvs.InventoryPath) - continue - } - - config.Host = append(config.Host, types.DistributedVirtualSwitchHostMemberConfigSpec{ - Operation: "add", - Host: ref, - Backing: backing, - }) - } - - if len(config.Host) == 0 { - return nil - } - - task, err := dvs.Reconfigure(ctx, config) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("adding %d hosts to dvs %s... ", len(config.Host), dvs.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/dvs/create.go b/vendor/github.com/vmware/govmomi/govc/dvs/create.go deleted file mode 100644 index cab77f6bc..000000000 --- a/vendor/github.com/vmware/govmomi/govc/dvs/create.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package dvs - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type create struct { - *flags.DatacenterFlag - - types.DVSCreateSpec - - configSpec *types.VMwareDVSConfigSpec - - parent string -} - -func init() { - cli.Register("dvs.create", &create{}) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.configSpec = new(types.VMwareDVSConfigSpec) - - cmd.DVSCreateSpec.ConfigSpec = cmd.configSpec - - f.StringVar(&cmd.parent, "parent", "", "Path to parent folder for the new dvs") -} - -func (cmd *create) Usage() string { - return "DVS" -} - -func (cmd *create) Description() string { - return `Create DVS (DistributedVirtualSwitch) in datacenter. - -The dvs is added to the folder specified by the 'parent' flag. If not given, -this defaults to the network folder in the specified or default datacenter.` -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - var parent *object.Folder - - if f.NArg() != 1 { - return flag.ErrHelp - } - - name := f.Arg(0) - - if cmd.parent == "" { - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - folders, err := dc.Folders(ctx) - if err != nil { - return err - } - - parent = folders.NetworkFolder - } else { - finder, err := cmd.Finder() - if err != nil { - return err - } - - parent, err = finder.Folder(ctx, cmd.parent) - if err != nil { - return err - } - } - - cmd.configSpec.Name = name - - task, err := parent.CreateDVS(ctx, cmd.DVSCreateSpec) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("adding %s to folder %s... ", name, parent.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/dvs/portgroup/add.go b/vendor/github.com/vmware/govmomi/govc/dvs/portgroup/add.go deleted file mode 100644 index 01b7ceb8a..000000000 --- a/vendor/github.com/vmware/govmomi/govc/dvs/portgroup/add.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package portgroup - -import ( - "flag" - "fmt" - "strings" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type add struct { - *flags.DatacenterFlag - - types.DVPortgroupConfigSpec - - path string -} - -func init() { - cli.Register("dvs.portgroup.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.StringVar(&cmd.path, "dvs", "", "DVS path") - - ptypes := []string{ - string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), - string(types.DistributedVirtualPortgroupPortgroupTypeLateBinding), - string(types.DistributedVirtualPortgroupPortgroupTypeEphemeral), - } - - f.StringVar(&cmd.DVPortgroupConfigSpec.Type, "type", ptypes[0], - fmt.Sprintf("Portgroup type (%s)", strings.Join(ptypes, "|"))) - - f.IntVar(&cmd.DVPortgroupConfigSpec.NumPorts, "nports", 128, "Number of ports") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Usage() string { - return "NAME" -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - name := f.Arg(0) - - finder, err := cmd.Finder() - if err != nil { - return err - } - - net, err := finder.Network(ctx, cmd.path) - if err != nil { - return err - } - - dvs, ok := net.(*object.DistributedVirtualSwitch) - if !ok { - return fmt.Errorf("%s (%T) is not of type %T", cmd.path, net, dvs) - } - - cmd.DVPortgroupConfigSpec.Name = name - - task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{cmd.DVPortgroupConfigSpec}) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("adding %s portgroup to dvs %s... ", name, dvs.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/.gitignore b/vendor/github.com/vmware/govmomi/govc/emacs/.gitignore deleted file mode 100644 index 56179efce..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.cask -elpa -*.elc diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/Cask b/vendor/github.com/vmware/govmomi/govc/emacs/Cask deleted file mode 100644 index aa7cf639c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/Cask +++ /dev/null @@ -1,10 +0,0 @@ -(source gnu) -(source melpa) - -(package-file "govc.el") - -(development - (depends-on "dash") - (depends-on "json-mode") - (depends-on "magit") - (depends-on "s")) diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/Makefile b/vendor/github.com/vmware/govmomi/govc/emacs/Makefile deleted file mode 100644 index 0508993db..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -CASK = cask -EMACS_BIN ?= emacs -EMACS_FLAGS = -EMACS_EXEC = $(CASK) exec $(EMACS_BIN) --no-site-file --no-site-lisp --batch $(EMACS_FLAGS) - -OBJECTS = govc.elc - -elpa: - $(CASK) install - $(CASK) update - touch $@ - -.PHONY: build test docs clean - -build: elpa $(OBJECTS) - -test: build docs - $(EMACS_EXEC) -l test/make.el -f make-test - -docs: build - $(EMACS_EXEC) -l test/make.el -f make-docs -clean: - rm -f $(OBJECTS) elpa - rm -rf .cask - -%.elc: %.el - $(EMACS_EXEC) -f batch-byte-compile $< diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/README.md b/vendor/github.com/vmware/govmomi/govc/emacs/README.md deleted file mode 100644 index 861702f2b..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/README.md +++ /dev/null @@ -1,224 +0,0 @@ -# govc.el - -Emacs interface to govc for managing VMware ESXi and vCenter. - -The goal of this package is to provide a simple interface for commonly used -govc commands within Emacs. This includes table based inventory/state modes -for vms, hosts, datastores and pools. The keymap for each mode provides -shortcuts for easily feeding the data in view to other govc commands. - -Within the various govc modes, press `?` to see a popup menu of options. -A menu bar is enabled for certain modes, such as `govc-vm-mode` and `govc-host-mode`. -There is also a `govc` menu at all times under the `Tools` menu. - -The recommended way to install govc.el is via MELPA (http://melpa.org/). - -## govc-mode - -Running `govc-global-mode` creates key bindings to the various govc modes. -The default prefix is `C-c v` and can be changed by setting `govc-keymap-prefix`. - -### govc-command-map - -Keybinding | Description ----------------|------------------------------------------------------------ -H | Host info via govc -P | Pool info via govc -V | VM info via govc -S | Datastore info via govc - -### govc-urls - -List of URLs for use with `govc-session`. -The `govc-session-name` displayed by `govc-mode-line` uses `url-target` (anchor) -if set, otherwise `url-host` is used. - -Example: -``` - (setq govc-urls `("root:vagrant@localhost:18443#Vagrant-ESXi" - "root:password@192.168.1.192#Intel-NUC" - "Administrator@vsphere.local:password!@vcva-clovervm")) -``` -To enter a URL that is not in the list, prefix `universal-argument`, for example: - - `C-u M-x govc-vm` - -When in `govc-vm` or `govc-host` mode, a default URL is composed with the -current session credentials and the IP address of the current vm/host and -the vm/host name as the session name. This makes it easier to connect to -nested ESX/vCenter VMs or directly to an ESX host. - -### govc-session-url - -ESX or vCenter URL set by `govc-session` via `govc-urls` selection. - -### govc-session-insecure - -Skip verification of server certificate when true. -This variable is set to the value of the `GOVC_INSECURE` env var by default. -It can also be set per-url via the query string (insecure=true). For example: -``` - (setq govc-urls `("root:password@hostname?insecure=true")) -``` - -### govc-session-datacenter - -Datacenter to use for the current `govc-session`. -If the endpoint has a single Datacenter it will be used by default, otherwise -`govc-session` will prompt for selection. It can also be set per-url via the -query string. For example: -``` - (setq govc-urls `("root:password@hostname?datacenter=dc1")) -``` - -### govc-session-datastore - -Datastore to use for the current `govc-session`. -If the endpoint has a single Datastore it will be used by default, otherwise -`govc-session` will prompt for selection. It can also be set per-url via the -query string. For example: -``` - (setq govc-urls `("root:password@hostname?datastore=vsanDatastore")) -``` - -## govc-tabulated-list-mode - -Generic table bindings to mark/unmark rows. - -In addition to any hooks its parent mode `tabulated-list-mode` might have run, -this mode runs the hook `govc-tabulated-list-mode-hook`, as the final step -during initialization. - -### govc-tabulated-list-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -m | Mark and move to the next line -u | Unmark and move to the next line -t | Toggle mark -U | Unmark all -M-& | Shell CMD with current `govc-session` exported as GOVC_ env vars -M-w | Copy current selection or region to the kill ring -M-E | Export session to `process-environment` and `kill-ring` - -## govc-host-mode - -Major mode for handling a list of govc hosts. - -In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, -this mode runs the hook `govc-host-mode-hook`, as the final step -during initialization. - -### govc-host-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -E | Events via govc events -n `govc-max-events` -J | JSON via govc host -N | Netstat via `govc-esxcli-netstat-info` with current host id -c | Connect new session for the current govc mode -p | Pool-mode with current session -s | Datastore-mode with current session -v | VM-mode with current session - -## govc-pool-mode - -Major mode for handling a list of govc pools. - -In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, -this mode runs the hook `govc-pool-mode-hook`, as the final step -during initialization. - -### govc-pool-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -E | Events via govc events -n `govc-max-events` -J | JSON via govc pool -D | Destroy via `govc-pool-destroy` on the pool selection -c | Connect new session for the current govc mode -h | Host-mode with current session -s | Datastore-mode with current session -v | VM-mode with current session - -## govc-datastore-mode - -Major mode for govc datastore.info. - -In addition to any hooks its parent mode `tabulated-list-mode` might have run, -this mode runs the hook `govc-datastore-mode-hook`, as the final step -during initialization. - -### govc-datastore-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -J | JSON via govc datastore -RET | Browse datastore -c | Connect new session for the current govc mode -h | Host-mode with current session -p | Pool-mode with current session -v | VM-mode with current session - -## govc-datastore-ls-mode - -Major mode govc datastore.ls. - -In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, -this mode runs the hook `govc-datastore-ls-mode-hook`, as the final step -during initialization. - -### govc-datastore-ls-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -J | JSON via govc datastore -D | Delete selected datastore paths -+ | Mkdir via govc datastore -DEL | Up to parent folder -RET | Open datastore folder or file - -## govc-vm-mode - -Major mode for handling a list of govc vms. - -In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, -this mode runs the hook `govc-vm-mode-hook`, as the final step -during initialization. - -### govc-vm-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -E | Events via govc events -n `govc-max-events` -J | JSON via govc vm -X | ExtraConfig via `govc-vm-extra-config` on the current selection -RET | Devices via `govc-device` on the current selection -V | VNC via `govc-vm-vnc` on the current selection -D | Destroy via `govc-vm-destroy` on the current selection -^ | Start via `govc-vm-start` on the current selection -! | Shutdown via `govc-vm-shutdown` on the current selection -@ | Reboot via `govc-vm-reboot` on the current selection -& | Suspend via `govc-vm-suspend` on the current selection -H | Host info via `govc-host` with host(s) of current selection -S | Datastore via `govc-datastore-ls` with datastore of current selection -P | Ping VM -c | Connect new session for the current govc mode -h | Host-mode with current session -p | Pool-mode with current session -s | Datastore-mode with current session - -## govc-device-mode - -Major mode for handling a govc device. - -In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, -this mode runs the hook `govc-device-mode-hook`, as the final step -during initialization. - -### govc-device-mode-map - -Keybinding | Description ----------------|------------------------------------------------------------ -J | JSON via govc device -RET | Tabulated govc device diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/govc.el b/vendor/github.com/vmware/govmomi/govc/emacs/govc.el deleted file mode 100644 index 1042f0102..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/govc.el +++ /dev/null @@ -1,1260 +0,0 @@ -;;; govc.el --- Emacs interface to govc for managing VMware ESXi and vCenter - -;; Author: The govc developers -;; URL: https://github.com/vmware/govmomi -;; Keywords: convenience -;; Version: 0.1.0 -;; Package-Requires: ((dash "1.5.0") (s "1.9.0") (magit-popup "2.0.50") (json-mode "1.6.0")) - -;; This file is NOT part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Commentary: -;; The goal of this package is to provide a simple interface for commonly used -;; govc commands within Emacs. This includes table based inventory/state modes -;; for vms, hosts, datastores and pools. The keymap for each mode provides -;; shortcuts for easily feeding the data in view to other govc commands. -;; -;; Within the various govc modes, press `?' to see a popup menu of options. -;; A menu bar is enabled for certain modes, such as `govc-vm-mode' and `govc-host-mode'. -;; There is also a `govc' menu at all times under the `Tools' menu. -;; -;; The recommended way to install govc.el is via MELPA (http://melpa.org/). - -;;; Code: - -(eval-when-compile - (require 'cl)) -(require 'dash) -(require 'dired) -(require 'json-mode) -(require 'magit-popup) -(require 'url-parse) -(require 's) - -(defgroup govc nil - "Emacs customization group for govc." - :group 'convenience) - -(defcustom govc-keymap-prefix "C-c v" - "Prefix for `govc-mode'." - :group 'govc) - -(defvar govc-command-map - (let ((map (make-sparse-keymap))) - (define-key map "H" 'govc-host) - (define-key map "P" 'govc-pool) - (define-key map "V" 'govc-vm) - (define-key map "S" 'govc-datastore) - (define-key map "?" 'govc-popup) - map) - "Keymap for `govc-mode' after `govc-keymap-prefix' was pressed.") - -(defvar govc-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd govc-keymap-prefix) govc-command-map) - map) - "Keymap for `govc-mode'.") - -;;;###autoload -(define-minor-mode govc-mode - "Running `govc-global-mode' creates key bindings to the various govc modes. -The default prefix is `C-c v' and can be changed by setting `govc-keymap-prefix'. - -\\{govc-mode-map\}" - nil govc-mode-line govc-mode-map - :group 'govc) - -;;;###autoload -(define-globalized-minor-mode govc-global-mode govc-mode govc-mode) - -(defcustom govc-mode-line - '(:eval (format " govc[%s]" (or (govc-session-name) "-"))) - "Mode line lighter for govc." - :group 'govc - :type 'sexp - :risky t) - - -;;; Tabulated list mode extensions (derived from https://github.com/Silex/docker.el tabulated-list-ext.el) -(defun govc-tabulated-list-mark () - "Mark and move to the next line." - (interactive) - (tabulated-list-put-tag (char-to-string dired-marker-char) t)) - -(defun govc-tabulated-list-unmark () - "Unmark and move to the next line." - (interactive) - (tabulated-list-put-tag "" t)) - -(defun govc-tabulated-list-toggle-marks () - "Toggle mark." - (interactive) - (save-excursion - (goto-char (point-min)) - (let ((cmd)) - (while (not (eobp)) - (setq cmd (char-after)) - (tabulated-list-put-tag - (if (eq cmd dired-marker-char) - "" - (char-to-string dired-marker-char)) t))))) - -(defun govc-tabulated-list-unmark-all () - "Unmark all." - (interactive) - (save-excursion - (goto-char (point-min)) - (while (not (eobp)) - (tabulated-list-put-tag "" t)))) - -(defun govc-selection () - "Get the current selection as a list of names." - (let ((selection)) - (save-excursion - (goto-char (point-min)) - (while (not (eobp)) - (when (eq (char-after) ?*) - (add-to-list 'selection (tabulated-list-get-id))) - (forward-line))) - (or selection (let ((id (tabulated-list-get-id))) - (if id - (list id)))))) - -(defun govc-do-selection (fn action) - "Call FN with `govc-selection' confirming ACTION." - (let* ((selection (govc-selection)) - (count (length selection)) - (prompt (if (= count 1) - (car selection) - (format "* [%d] marked" count)))) - (if (yes-or-no-p (format "%s %s ?" action prompt)) - (funcall fn selection)))) - -(defun govc-copy-selection () - "Copy current selection or region to the kill ring." - (interactive) - (if (region-active-p) - (copy-region-as-kill (mark) (point) 'region) - (kill-new (message "%s" (s-join " " (--map (format "'%s'" it) (govc-selection))))))) - -(defvar govc-font-lock-keywords - (list - (list dired-re-mark '(0 dired-mark-face)))) - -(defvar govc-tabulated-list-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "m" 'govc-tabulated-list-mark) - (define-key map "u" 'govc-tabulated-list-unmark) - (define-key map "t" 'govc-tabulated-list-toggle-marks) - (define-key map "U" 'govc-tabulated-list-unmark-all) - (define-key map (kbd "M-&") 'govc-shell-command) - (define-key map (kbd "M-w") 'govc-copy-selection) - (define-key map (kbd "M-E") 'govc-copy-environment) - map) - "Keymap for `govc-tabulated-list-mode'.") - -(define-derived-mode govc-tabulated-list-mode tabulated-list-mode "Tabulated govc" - "Generic table bindings to mark/unmark rows." - (setq-local font-lock-defaults - '(govc-font-lock-keywords t nil nil beginning-of-line))) - - -;;; Keymap helpers for generating menus and popups -(defun govc-keymap-list (keymap) - "Return a list of (key name function) for govc bindings in the given KEYMAP. -The name returned is the first word of the function `documentation'." - (let ((map)) - (map-keymap - (lambda (k f) - (when (keymapp f) - (setq map (append map - (--map (and (setcar it (kbd (format "M-%s" (char-to-string (car it))))) it) - (govc-keymap-list f))))) - (when (and (symbolp f) - (s-starts-with? "govc-" (symbol-name f))) - (if (not (eq ?? k)) - (add-to-list 'map (list k (car (split-string (documentation f))) f))))) keymap) - map)) - -(defun govc-keymap-menu (keymap) - "Return a list of [key function t] for govc bindings in the given KEYMAP. -For use with `easy-menu-define'." - (-map (lambda (item) - (vector (nth 1 item) (nth 2 item) t)) - (govc-keymap-list keymap))) - -(defun govc-key-description (key) - "Call `key-description' ensuring KEY is a sequence." - (key-description (if (integerp key) (list key) key))) - -(defun govc-keymap-list-to-help (keymap) - "Convert KEYMAP to list of help text." - (--map (list (govc-key-description (car it)) - (car (split-string (documentation (nth 2 it)) "\\."))) - keymap)) - -(defun govc-keymap-popup-help () - "Default keymap help for `govc-keymap-popup'." - (append (govc-keymap-list-to-help (govc-keymap-list govc-tabulated-list-mode-map)) - '(("g" "Refresh current buffer") - ("C-h m" "Show all key bindings")))) - -(defun govc-keymap-popup (keymap) - "Convert a `govc-keymap-list' using KEYMAP for use with `magit-define-popup'. -Keys in the ASCII range of 32-97 are mapped to popup commands, all others are listed as help text." - (let* ((maps (--separate (and (integerp (car it)) - (>= (car it) 32) - (<= (car it) 97)) - (govc-keymap-list keymap))) - (help (govc-keymap-list-to-help (cadr maps)))) - (append - '("Commands") - (car maps) - (list (s-join "\n" (--map (format " %-6s %s" (car it) (cadr it)) - (append help (govc-keymap-popup-help)))) - nil)))) - - -;;; govc process helpers -(defvar govc-urls nil - "List of URLs for use with `govc-session'. -The `govc-session-name' displayed by `govc-mode-line' uses `url-target' (anchor) -if set, otherwise `url-host' is used. - -Example: -``` - (setq govc-urls '(\"root:vagrant@localhost:18443#Vagrant-ESXi\" - \"root:password@192.168.1.192#Intel-NUC\" - \"Administrator@vsphere.local:password!@vcva-clovervm\")) -``` -To enter a URL that is not in the list, prefix `universal-argument', for example: - - `\\[universal-argument] \\[govc-vm]' - -When in `govc-vm' or `govc-host' mode, a default URL is composed with the -current session credentials and the IP address of the current vm/host and -the vm/host name as the session name. This makes it easier to connect to -nested ESX/vCenter VMs or directly to an ESX host.") - -(defvar-local govc-session-url nil - "ESX or vCenter URL set by `govc-session' via `govc-urls' selection.") - -(defvar-local govc-session-insecure nil - "Skip verification of server certificate when true. -This variable is set to the value of the `GOVC_INSECURE' env var by default. -It can also be set per-url via the query string (insecure=true). For example: -``` - (setq govc-urls '(\"root:password@hostname?insecure=true\")) -```") - -(defvar-local govc-session-datacenter nil - "Datacenter to use for the current `govc-session'. -If the endpoint has a single Datacenter it will be used by default, otherwise -`govc-session' will prompt for selection. It can also be set per-url via the -query string. For example: -``` - (setq govc-urls '(\"root:password@hostname?datacenter=dc1\")) -```") - -(defvar-local govc-session-datastore nil - "Datastore to use for the current `govc-session'. -If the endpoint has a single Datastore it will be used by default, otherwise -`govc-session' will prompt for selection. It can also be set per-url via the -query string. For example: -``` - (setq govc-urls '(\"root:password@hostname?datastore=vsanDatastore\")) -```") - -(defvar-local govc-filter nil - "Resource path filter.") - -(defvar-local govc-args nil - "Additional govc arguments.") - -(defun govc-session-name () - "Return a name for the current session. -Derived from `govc-session-url' if set, otherwise from the 'GOVC_URL' env var. -Return value is the url anchor if set, otherwise the hostname is returned." - (let* ((u (or govc-session-url (getenv "GOVC_URL"))) - (url (if u (govc-url-parse u)))) - (if url - (or (url-target url) (url-host url))))) - -(defun govc-command (command &rest args) - "Format govc COMMAND ARGS." - (format "govc %s %s" command - (s-join " " (--map (format "'%s'" it) - (-flatten (-non-nil args)))))) - -(defconst govc-environment-map (--map (cons (concat "GOVC_" (upcase it)) - (intern (concat "govc-session-" it))) - '("url" "insecure" "datacenter" "datastore")) - - "Map of `GOVC_*' environment variable names to `govc-session-*' symbol names.") - -(defun govc-environment (&optional unset) - "Return `process-environment' for govc. -Optionally clear govc env if UNSET is non-nil." - (let ((process-environment (copy-sequence process-environment))) - (dolist (e govc-environment-map) - (setenv (car e) (unless unset (symbol-value (cdr e))))) - process-environment)) - -(defun govc-export-environment (arg) - "Set if ARG is \\[universal-argument], unset if ARG is \\[negative-argument]." - (if (equal arg '-) - (progn (setq process-environment (govc-environment t)) - (cons "unset" (--map (car it) - govc-environment-map))) - (progn (setq process-environment (govc-environment)) - (cons "export" (--map (format "%s='%s'" (car it) (or (symbol-value (cdr it)) "")) - govc-environment-map))))) - -(defun govc-copy-environment (&optional arg) - "Export session to `process-environment' and `kill-ring'. -Optionally set `GOVC_*' vars in `process-environment' using prefix -\\[universal-argument] ARG or unset with prefix \\[negative-argument] ARG." - (interactive "P") - (kill-new (message (if arg (s-join " " (govc-export-environment arg)) govc-session-url)))) - -(defun govc-process (command handler) - "Run COMMAND, calling HANDLER upon successful exit of the process." - (message command) - (let ((process-environment (govc-environment)) - (exit-code)) - (with-temp-buffer - (setq exit-code (call-process-shell-command command nil (current-buffer))) - (if (zerop exit-code) - (funcall handler) - (error (buffer-string)))))) - -(defun govc (command &rest args) - "Execute govc COMMAND with ARGS. -Return value is `buffer-string' split on newlines." - (govc-process (govc-command command args) - (lambda () - (split-string (buffer-string) "\n" t)))) - -(defun govc-json (command &rest args) - "Execute govc COMMAND passing arguments ARGS. -Return value is `json-read'." - (govc-process (govc-command command (cons "-json" args)) - (lambda () - (goto-char (point-min)) - (let ((json-object-type 'plist)) - (json-read))))) - -(defun govc-ls-datacenter () - "List datacenters." - (delete-dups (--map (nth 1 (split-string it "/")) - (govc "ls")))) - -(defun govc-object-prompt (prompt ls) - "PROMPT for object name via LS function. Return object without PROMPT if there is just one instance." - (let ((objs (funcall ls))) - (if (eq 1 (length objs)) - (car objs) - (completing-read prompt objs)))) - -(defun govc-url-parse (url) - "A `url-generic-parse-url' wrapper to handle URL with password, but no scheme. -Also fixes the case where user contains an '@'." - (let* ((full (s-contains? "://" url)) - (u (url-generic-parse-url (concat (unless full "https://") url)))) - (unless full - (setf (url-type u) nil) - (setf (url-fullness u) nil)) - (if (s-contains? "@" (url-host u)) - (let* ((h (split-string (url-host u) "@")) - (p (split-string (car h) ":"))) - (setf (url-host u) (cadr h)) - (setf (url-user u) (concat (url-user u) "@" (car p))) - (setf (url-password u) (cadr p)))) - u)) - -(defun govc-url-default () - "Default URL when creating a new session." - (if govc-session-url - (let ((url (govc-url-parse govc-session-url))) - (if (equal major-mode 'govc-host-mode) - (progn (setf (url-host url) (govc-table-column-value "Name")) - (setf (url-target url) nil)) - (progn (setf (url-host url) (govc-table-column-value "IP address")) - (setf (url-target url) (govc-table-column-value "Name")))) - (url-recreate-url url)))) - -(defun govc-urls-completing-read () - "A wrapper for `completing-read' to mask credentials in `govc-urls'." - (let ((alist)) - (dolist (ent govc-urls) - (let ((u (govc-url-parse ent))) - (setf (url-password u) nil) - (add-to-list 'alist `(,(url-recreate-url u) . ,ent) t))) - (let ((u (completing-read "govc url: " (-map 'car alist)))) - (cdr (assoc u alist))))) - -(defun govc-session-set-url (url) - "Set `govc-session-url' to URL and optionally set other govc-session-* variables via URL query." - (let ((q (cdr (url-path-and-query (govc-url-parse url))))) - (dolist (opt (if q (url-parse-query-string q))) - (let ((var (intern (concat "govc-session-" (car opt))))) - (if (boundp var) - (set var (cadr opt)))))) - (setq govc-session-url url)) - -(defun govc-session () - "Initialize a govc session." - (interactive) - (let ((url (if (or current-prefix-arg (eq 0 (length govc-urls))) - (read-string "govc url: " (govc-url-default)) - (if (eq 1 (length govc-urls)) - (car govc-urls) - (govc-urls-completing-read))))) - ;; Wait until this point to clear so current session is preserved in the - ;; event of `keyboard-quit' in `read-string'. - (setq govc-session-datacenter nil - govc-session-datastore nil - govc-filter nil) - (govc-session-set-url url)) - (unless govc-session-insecure - (setq govc-session-insecure (or (getenv "GOVC_INSECURE") - (completing-read "govc insecure: " '("true" "false"))))) - (unless govc-session-datacenter - (setq govc-session-datacenter (govc-object-prompt "govc datacenter: " 'govc-ls-datacenter))) - (add-to-list 'govc-urls govc-session-url)) - -(defalias 'govc-current-session 'buffer-local-variables) - -(defun govc-session-clone (session) - "Clone a session from SESSION buffer locals." - (dolist (v session) - (let ((s (car v))) - (when (s-starts-with? "govc-session-" (symbol-name s)) - (set s (assoc-default s session)))))) - -(defun govc-shell-command (&optional cmd) - "Shell CMD with current `govc-session' exported as GOVC_ env vars." - (interactive) - (let ((process-environment (govc-environment)) - (current-prefix-arg "*govc*") - (url govc-session-url)) - (if cmd - (async-shell-command cmd current-prefix-arg) - (call-interactively 'async-shell-command)) - (with-current-buffer (get-buffer current-prefix-arg) - (setq govc-session-url url)))) - -(defcustom govc-max-events 50 - "Limit events output to the last N events." - :type 'integer - :group 'govc) - -(defun govc-events () - "Events via govc events -n `govc-max-events'." - (interactive) - (govc-shell-command - (govc-command "events" - (list "-n" govc-max-events (govc-selection))))) - -(defun govc-parse-info (output) - "Parse govc info command OUTPUT." - (let* ((entries) - (entry) - (entry-key)) - (-each output - (lambda (line) - (let* ((ix (s-index-of ":" line)) - (key (s-trim (substring line 0 ix))) - (val (s-trim (substring line (+ ix 1))))) - (unless entry-key - (setq entry-key key)) - (when (s-equals? key entry-key) - (setq entry (make-hash-table :test 'equal)) - (add-to-list 'entries entry)) - (puthash key val entry)))) - entries)) - -(defun govc-table-column-names () - "Return a list of column names from `tabulated-list-format'." - (--map (car (aref tabulated-list-format it)) - (number-sequence 0 (- (length tabulated-list-format) 1)))) - -(defun govc-table-column-value (key) - "Return current column value for given KEY." - (let ((names (govc-table-column-names)) - (entry (tabulated-list-get-entry)) - (value)) - (dotimes (ix (- (length names) 1)) - (if (s-equals? key (nth ix names)) - (setq value (elt entry ix)))) - value)) - -(defun govc-table-info (command &optional args) - "Convert `govc-parse-info' COMMAND ARGS output to `tabulated-list-entries' format." - (let ((names (govc-table-column-names))) - (-map (lambda (info) - (let ((id (or (gethash "Path" info) - (gethash (car names) info)))) - (list id (vconcat - (--map (or (gethash it info) "-") - names))))) - (govc-parse-info (govc command args))))) - -(defun govc-map-info (command &optional args) - "Populate key=val map table with govc COMMAND ARGS output." - (-map (lambda (line) - (let* ((ix (s-index-of ":" line)) - (key (s-trim (substring line 0 ix))) - (val (s-trim (substring line (+ ix 1))))) - (list key (vector key val)))) - (govc command args))) - -(defun govc-map-info-table (entries) - "Tabulated `govc-map-info' data via ENTRIES." - (let ((session (govc-current-session)) - (args (append govc-args (govc-selection))) - (buffer (get-buffer-create "*govc-info*"))) - (pop-to-buffer buffer) - (tabulated-list-mode) - (setq govc-args args) - (govc-session-clone session) - (setq tabulated-list-format [("Name" 50) - ("Value" 50)] - tabulated-list-padding 2 - tabulated-list-entries entries) - (tabulated-list-print))) - -(defun govc-json-info (command &optional selection) - "Run govc COMMAND -json on SELECTION." - (interactive) - (govc-process (govc-command command (append (cons "-json" govc-args) - (or selection (govc-selection)))) - (lambda () - (let ((buffer (get-buffer-create "*govc-json*"))) - (with-current-buffer buffer - (erase-buffer)) - (copy-to-buffer buffer (point-min) (point-max)) - (pop-to-buffer buffer) - (json-mode) - ;; We use `json-mode-beautify' as `json-pretty-print-buffer' does not work for `govc-host-json-info' - (json-mode-beautify) - (goto-char (point-min)))))) - -(defun govc-mode-new-session () - "Connect new session for the current govc mode." - (interactive) - (call-interactively 'govc-session) - (revert-buffer)) - -(defun govc-host-with-session () - "Host-mode with current session." - (interactive) - (govc-host nil (govc-current-session))) - -(defun govc-vm-with-session () - "VM-mode with current session." - (interactive) - (govc-vm nil (govc-current-session))) - -(defun govc-datastore-with-session () - "Datastore-mode with current session." - (interactive) - (govc-datastore nil (govc-current-session))) - -(defun govc-pool-with-session () - "Pool-mode with current session." - (interactive) - (govc-pool nil (govc-current-session))) - - -;;; govc host mode -(defun govc-ls-host () - "List hosts." - (govc "ls" "-t" "HostSystem" "host/*")) - -(defun govc-esxcli-netstat-info () - "Wrapper for govc host.esxcli network ip connection list." - (govc-table-info "host.esxcli" - (append govc-args '("-hints=false" "--" "network" "ip" "connection" "list")))) - -(defun govc-esxcli-netstat (host) - "Tabulated `govc-esxcli-netstat-info' HOST." - (interactive (list (govc-object-prompt "Host: " 'govc-ls-host))) - (let ((session (govc-current-session)) - (buffer (get-buffer-create "*govc-esxcli*"))) - (pop-to-buffer buffer) - (tabulated-list-mode) - (setq govc-args (list "-host.ipath" host)) - (govc-session-clone session) - (setq tabulated-list-format [("CCAlgo" 10 t) - ("ForeignAddress" 20 t) - ("LocalAddress" 20 t) - ("Proto" 5 t) - ("RecvQ" 5 t) - ("SendQ" 5 t) - ("State" 15 t) - ("WorldID" 7 t) - ("WorldName" 10 t)] - tabulated-list-padding 2 - tabulated-list-entries #'govc-esxcli-netstat-info) - (tabulated-list-init-header) - (tabulated-list-print))) - -(defun govc-host-esxcli-netstat () - "Netstat via `govc-esxcli-netstat-info' with current host id." - (interactive) - (govc-esxcli-netstat (tabulated-list-get-id))) - -(defun govc-host-info () - "Wrapper for govc host.info." - (govc-table-info "host.info" (or govc-filter "*/*"))) - -(defun govc-host-json-info () - "JSON via govc host.info -json on current selection." - (interactive) - (govc-json-info "host.info" (govc-selection))) - -(defvar govc-host-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "E" 'govc-events) - (define-key map "J" 'govc-host-json-info) - (define-key map "N" 'govc-host-esxcli-netstat) - (define-key map "c" 'govc-mode-new-session) - (define-key map "p" 'govc-pool-with-session) - (define-key map "s" 'govc-datastore-with-session) - (define-key map "v" 'govc-vm-with-session) - (define-key map "?" 'govc-host-popup) - map) - "Keymap for `govc-host-mode'.") - -(defun govc-host (&optional filter session) - "Host info via govc. -Optionally filter by FILTER and inherit SESSION." - (interactive) - (let ((buffer (get-buffer-create "*govc-host*"))) - (pop-to-buffer buffer) - (govc-host-mode) - (if session - (govc-session-clone session) - (call-interactively 'govc-session)) - (setq govc-filter filter) - (tabulated-list-print))) - -(define-derived-mode govc-host-mode govc-tabulated-list-mode "Host" - "Major mode for handling a list of govc hosts." - (setq tabulated-list-format [("Name" 30 t) - ("Logical CPUs" 20 t) - ("CPU usage" 25 t) - ("Memory" 10 t) - ("Memory usage" 25 t) - ("Manufacturer" 13 t) - ("Boot time" 15 t)] - tabulated-list-sort-key (cons "Name" nil) - tabulated-list-padding 2 - tabulated-list-entries #'govc-host-info) - (tabulated-list-init-header)) - -(magit-define-popup govc-host-popup - "Host popup." - :actions (govc-keymap-popup govc-host-mode-map)) - -(easy-menu-define govc-host-mode-menu govc-host-mode-map - "Host menu." - (cons "Host" (govc-keymap-menu govc-host-mode-map))) - - -;;; govc pool mode -(defun govc-ls-pool (&optional pools) - "List resource POOLS recursively." - (let ((subpools (govc "ls" "-t" "ResourcePool" (--map (concat it "/*") (or pools '("host")))))) - (append pools - (if subpools - (govc-ls-pool subpools))))) - -(defun govc-ls-vapp () - "List virtual apps." - (govc "ls" "-t" "VirtualApp" "vm")) - -(defun govc-pool-destroy (name) - "Destroy pool with given NAME." - (interactive (list (completing-read "Destroy pool: " (govc-ls-pool)))) - (govc "pool.destroy" name)) - -(defun govc-pool-destroy-selection () - "Destroy via `govc-pool-destroy' on the pool selection." - (interactive) - (govc-do-selection 'govc-pool-destroy "Delete") - (tabulated-list-revert)) - -(defun govc-pool-info () - "Wrapper for govc pool.info." - (govc-table-info "pool.info" (or govc-filter (append (govc-ls-pool) (govc-ls-vapp))))) - -(defun govc-pool-json-info () - "JSON via govc pool.info -json on current selection." - (interactive) - (govc-json-info "pool.info" (govc-selection))) - -(defvar govc-pool-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "E" 'govc-events) - (define-key map "J" 'govc-pool-json-info) - (define-key map "D" 'govc-pool-destroy-selection) - (define-key map "c" 'govc-mode-new-session) - (define-key map "h" 'govc-host-with-session) - (define-key map "s" 'govc-datastore-with-session) - (define-key map "v" 'govc-vm-with-session) - (define-key map "?" 'govc-pool-popup) - map) - "Keymap for `govc-pool-mode'.") - -(defun govc-pool (&optional filter session) - "Pool info via govc. -Optionally filter by FILTER and inherit SESSION." - (interactive) - (let ((buffer (get-buffer-create "*govc-pool*"))) - (pop-to-buffer buffer) - (govc-pool-mode) - (if session - (govc-session-clone session) - (call-interactively 'govc-session)) - (setq govc-filter filter) - (tabulated-list-print))) - -(define-derived-mode govc-pool-mode govc-tabulated-list-mode "Pool" - "Major mode for handling a list of govc pools." - (setq tabulated-list-format [("Name" 30 t) - ("CPU Usage" 25 t) - ("CPU Shares" 25 t) - ("CPU Reservation" 25 t) - ("CPU Limit" 10 t) - ("Mem Usage" 25 t) - ("Mem Shares" 25 t) - ("Mem Reservation" 25 t) - ("Mem Limit" 10 t)] - tabulated-list-sort-key (cons "Name" nil) - tabulated-list-padding 2 - tabulated-list-entries #'govc-pool-info) - (tabulated-list-init-header)) - -(magit-define-popup govc-pool-popup - "Pool popup." - :actions (govc-keymap-popup govc-pool-mode-map)) - -(easy-menu-define govc-host-mode-menu govc-pool-mode-map - "Pool menu." - (cons "Pool" (govc-keymap-menu govc-pool-mode-map))) - - -;;; govc datastore mode -(defun govc-ls-datastore () - "List datastores." - (govc "ls" "datastore")) - -(defun govc-datastore-ls-entries () - "Wrapper for govc datastore.ls." - (let* ((data (govc-json "datastore.ls" "-l" "-p" govc-filter)) - (file (plist-get (elt data 0) :File))) - (-map (lambda (ent) - (let ((name (plist-get ent :Path)) - (size (plist-get ent :FileSize)) - (time (plist-get ent :Modification)) - (user (plist-get ent :Owner))) - (list (concat govc-filter name) - (vector (file-size-human-readable size) - (current-time-string (date-to-time time)) - name)))) file))) - -(defun govc-datastore-ls-parent () - "Up to parent folder." - (interactive) - (if (s-blank? govc-filter) - (let ((session (govc-current-session))) - (govc-datastore-mode) - (govc-session-clone session)) - (setq govc-filter (file-name-directory (directory-file-name govc-filter)))) - (tabulated-list-revert)) - -(defun govc-datastore-ls-child () - "Open datastore folder or file." - (interactive) - (let ((id (tabulated-list-get-id))) - (if (s-ends-with? "/" id) - (progn (setq govc-filter id) - (tabulated-list-revert)) - (govc-datastore-open)))) - -(defun govc-datastore-open () - "Open datastore file." - (lexical-let* ((srcfile (tabulated-list-get-id)) - (srcpath (format "[%s] %s" (file-name-nondirectory govc-session-datastore) (s-chop-prefix "/" srcfile))) - (suffix (file-name-extension srcfile t)) - (tmpfile (make-temp-file "govc-ds" nil suffix)) - (session (govc-current-session))) - (when (yes-or-no-p (concat "Open " srcpath "?")) - (govc "datastore.download" srcfile tmpfile) - (with-current-buffer (pop-to-buffer (find-file-noselect tmpfile)) - (govc-session-clone session) - (add-hook 'kill-buffer-hook (lambda () - (with-demoted-errors - (delete-file tmpfile))) t t) - (add-hook 'after-save-hook (lambda () - (if (yes-or-no-p (concat "Upload changes to " srcpath "?")) - (with-demoted-errors - (govc "datastore.upload" tmpfile srcfile)))) t t))))) - -(defun govc-datastore-ls-json () - "JSON via govc datastore.ls -json on current selection." - (interactive) - (let ((govc-args '("-l" "-p"))) - (govc-json-info "datastore.ls" (govc-selection)))) - -(defun govc-datastore-mkdir (name) - "Mkdir via govc datastore.mkdir with given NAME." - (interactive (list (read-from-minibuffer "Create directory: " govc-filter))) - (govc "datastore.mkdir" name) - (tabulated-list-revert)) - -(defun govc-datastore-rm (paths) - "Delete datastore PATHS." - (--each paths (govc "datastore.rm" it))) - -(defun govc-datastore-rm-selection () - "Delete selected datastore paths." - (interactive) - (govc-do-selection 'govc-datastore-rm "Delete") - (tabulated-list-revert)) - -(defvar govc-datastore-ls-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "J" 'govc-datastore-ls-json) - (define-key map "D" 'govc-datastore-rm-selection) - (define-key map "+" 'govc-datastore-mkdir) - (define-key map (kbd "DEL") 'govc-datastore-ls-parent) - (define-key map (kbd "RET") 'govc-datastore-ls-child) - (define-key map "?" 'govc-datastore-ls-popup) - map) - "Keymap for `govc-datastore-ls-mode'.") - -(defun govc-datastore-ls (&optional datastore session) - "List govc datastore. Optionally specify DATASTORE and SESSION." - (interactive) - (let ((buffer (get-buffer-create "*govc-datastore*"))) - (pop-to-buffer buffer) - (govc-datastore-ls-mode) - (if session - (govc-session-clone session) - (call-interactively 'govc-session)) - (setq govc-session-datastore (or datastore (govc-object-prompt "govc datastore: " 'govc-ls-datastore))) - (tabulated-list-print))) - -(define-derived-mode govc-datastore-ls-mode govc-tabulated-list-mode "Datastore" - "Major mode govc datastore.ls." - (setq tabulated-list-format [("Size" 10 t) - ("Modification time" 25 t) - ("Name" 40 t)] - tabulated-list-sort-key (cons "Name" nil) - tabulated-list-padding 2 - tabulated-list-entries #'govc-datastore-ls-entries) - (tabulated-list-init-header)) - -(magit-define-popup govc-datastore-ls-popup - "Datastore ls popup." - :actions (govc-keymap-popup govc-datastore-ls-mode-map)) - -(easy-menu-define govc-datastore-ls-mode-menu govc-datastore-ls-mode-map - "Datastore ls menu." - (cons "Datastore" (govc-keymap-menu govc-datastore-ls-mode-map))) - -(defvar govc-datastore-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "J" 'govc-datastore-json-info) - (define-key map (kbd "RET") 'govc-datastore-ls-selection) - (define-key map "c" 'govc-mode-new-session) - (define-key map "h" 'govc-host-with-session) - (define-key map "p" 'govc-pool-with-session) - (define-key map "v" 'govc-vm-with-session) - (define-key map "?" 'govc-datastore-popup) - map) - "Keymap for `govc-datastore-mode'.") - -(defun govc-datastore-json-info () - "JSON via govc datastore.info -json on current selection." - (interactive) - (govc-json-info "datastore.info")) - -(defun govc-datastore-info () - "Wrapper for govc datastore.info." - (govc-table-info "datastore.info" (or govc-filter "*"))) - -(defun govc-datastore-ls-selection () - "Browse datastore." - (interactive) - (govc-datastore-ls (tabulated-list-get-id) (govc-current-session))) - -(defun govc-datastore (&optional filter session) - "Datastore info via govc. -Optionally filter by FILTER and inherit SESSION." - (interactive) - (let ((buffer (get-buffer-create "*govc-datastore*"))) - (pop-to-buffer buffer) - (govc-datastore-mode) - (if session - (govc-session-clone session) - (call-interactively 'govc-session)) - (setq govc-filter filter) - (tabulated-list-print))) - -(define-derived-mode govc-datastore-mode tabulated-list-mode "Datastore" - "Major mode for govc datastore.info." - (setq tabulated-list-format [("Name" 15 t) - ("Type" 10 t) - ("Capacity" 10 t) - ("Free" 10 t) - ("Remote" 30 t)] - tabulated-list-sort-key (cons "Name" nil) - tabulated-list-padding 2 - tabulated-list-entries #'govc-datastore-info) - (tabulated-list-init-header)) - -(magit-define-popup govc-datastore-popup - "Datastore popup." - :actions (govc-keymap-popup govc-datastore-mode-map)) - -(easy-menu-define govc-datastore-mode-menu govc-datastore-mode-map - "Datastore menu." - (cons "Datastore" (govc-keymap-menu govc-datastore-mode-map))) - - -;;; govc vm mode -(defun govc-vm-prompt (prompt) - "PROMPT for a vm name." - (completing-read prompt (govc "ls" "vm"))) - -(defun govc-vm-start (name) - "Start vm with given NAME." - (interactive (list (govc-vm-prompt "Start vm: "))) - (govc "vm.power" "-on" name)) - -(defun govc-vm-shutdown (name) - "Shutdown vm with given NAME." - (interactive (list (govc-vm-prompt "Shutdown vm: "))) - (govc "vm.power" "-s" "-force" name)) - -(defun govc-vm-reboot (name) - "Reboot vm with given NAME." - (interactive (list (govc-vm-prompt "Reboot vm: "))) - (govc "vm.power" "-r" "-force" name)) - -(defun govc-vm-suspend (name) - "Suspend vm with given NAME." - (interactive (list (govc-vm-prompt "Suspend vm: "))) - (govc "vm.power" "-suspend" name)) - -(defun govc-vm-destroy (name) - "Destroy vm with given NAME." - (interactive (list (govc-vm-prompt "Destroy vm: "))) - (govc "vm.destroy" name)) - -(defun govc-vm-vnc-enable (name) - "Enable vnc on vm with given NAME." - (--map (last (split-string it)) - (govc "vm.vnc" "-enable" - "-port" "-1" - "-password" (format "%08x" (random (expt 16 8))) name))) - -(defun govc-vm-vnc (name &optional arg) - "VNC for vm with given NAME. -By default, enable and open VNC for the given vm NAME. -With prefix \\[negative-argument] ARG, VNC will be disabled. -With prefix \\[universal-argument] ARG, VNC will be enabled but not opened." - (interactive (list (govc-vm-prompt "VNC vm: ") - current-prefix-arg)) - (if (equal arg '-) - (govc "vm.vnc" "-disable" name) - (let ((urls (govc-vm-vnc-enable name))) - (unless arg - (-each (-flatten urls) 'browse-url))))) - -(defun govc-vm-screen (name &optional arg) - "Console screenshot of vm NAME console. -Open via `eww' by default, via `browse-url' if ARG is non-nil." - (interactive (list (govc-vm-prompt "Console screenshot vm: ") - current-prefix-arg)) - (let* ((data (govc-json "vm.info" name)) - (vms (plist-get data :VirtualMachines)) - (url (govc-url-parse govc-session-url))) - (mapc - (lambda (vm) - (let* ((moid (plist-get (plist-get vm :Self) :Value)) - (on (string= "poweredOn" (plist-get (plist-get vm :Runtime) :PowerState))) - (host (format "%s:%d" (url-host url) (or (url-port url) 443))) - (path (concat "/screen?id=" moid)) - (auth (concat (url-user url) ":" (url-password url)))) - (if current-prefix-arg - (browse-url (concat "https://" auth "@" host path)) - (let ((creds `((,host ("VMware HTTP server" . ,(base64-encode-string auth))))) - (url-basic-auth-storage 'creds) - (u (concat "https://" host path))) - (require 'eww) - (if on - (url-retrieve u 'eww-render (list u)) - (kill-new (message u))))))) - vms))) - -(defun govc-vm-start-selection () - "Start via `govc-vm-start' on the current selection." - (interactive) - (govc-vm-start (govc-selection)) - (tabulated-list-revert)) - -(defun govc-vm-shutdown-selection () - "Shutdown via `govc-vm-shutdown' on the current selection." - (interactive) - (govc-vm-shutdown (govc-selection)) - (tabulated-list-revert)) - -(defun govc-vm-reboot-selection () - "Reboot via `govc-vm-reboot' on the current selection." - (interactive) - (govc-vm-reboot (govc-selection)) - (tabulated-list-revert)) - -(defun govc-vm-suspend-selection () - "Suspend via `govc-vm-suspend' on the current selection." - (interactive) - (govc-vm-suspend (govc-selection)) - (tabulated-list-revert)) - -(defun govc-vm-destroy-selection () - "Destroy via `govc-vm-destroy' on the current selection." - (interactive) - (govc-do-selection 'govc-vm-destroy "Destroy") - (tabulated-list-revert)) - -(defun govc-vm-vnc-selection () - "VNC via `govc-vm-vnc' on the current selection." - (interactive) - (govc-vm-vnc (govc-selection) current-prefix-arg)) - -(defun govc-vm-screen-selection () - "Console screenshot via `govc-vm-screen' on the current selection." - (interactive) - (govc-vm-screen (govc-selection) current-prefix-arg)) - -(defun govc-vm-info () - "Wrapper for govc vm.info." - (govc-table-info "vm.info" (list "-r" (or govc-filter (setq govc-filter (govc-vm-filter)))))) - -(defun govc-vm-host () - "Host info via `govc-host' with host(s) of current selection." - (interactive) - (govc-host (concat "*/" (govc-table-column-value "Host")) - (govc-current-session))) - -(defun govc-vm-datastore () - "Datastore via `govc-datastore-ls' with datastore of current selection." - (interactive) - (govc-datastore (s-split ", " (govc-table-column-value "Storage") t) - (govc-current-session))) - -(defun govc-vm-ping () - "Ping VM." - (interactive) - (let ((ping-program-options '("-c" "20"))) - (ping (govc-table-column-value "IP address")))) - -(defun govc-vm-device-ls () - "Devices via `govc-device' on the current selection." - (interactive) - (govc-device (tabulated-list-get-id) - (govc-current-session))) - -(defun govc-vm-extra-config () - "Populate table with govc vm.info -e output." - (let* ((data (govc-json "vm.info" govc-args)) - (vms (plist-get data :VirtualMachines)) - (info)) - (mapc - (lambda (vm) - (let* ((config (plist-get vm :Config)) - (name (plist-get config :Name))) - (mapc (lambda (x) - (let ((key (plist-get x :Key)) - (val (plist-get x :Value))) - (push (list key (vector key val)) info))) - (plist-get config :ExtraConfig)) - (if (> (length vms) 1) - (push (list name (vector "vm.name" name)) info)))) - vms) - info)) - -(defun govc-vm-extra-config-table () - "ExtraConfig via `govc-vm-extra-config' on the current selection." - (interactive) - (govc-map-info-table #'govc-vm-extra-config)) - -(defun govc-vm-json-info () - "JSON via govc vm.info -json on current selection." - (interactive) - (govc-json-info "vm.info")) - -(defvar govc-vm-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "E" 'govc-events) - (define-key map "J" 'govc-vm-json-info) - (define-key map "X" 'govc-vm-extra-config-table) - (define-key map (kbd "RET") 'govc-vm-device-ls) - (define-key map "C" 'govc-vm-screen-selection) - (define-key map "V" 'govc-vm-vnc-selection) - (define-key map "D" 'govc-vm-destroy-selection) - (define-key map "^" 'govc-vm-start-selection) - (define-key map "!" 'govc-vm-shutdown-selection) - (define-key map "@" 'govc-vm-reboot-selection) - (define-key map "&" 'govc-vm-suspend-selection) - (define-key map "H" 'govc-vm-host) - (define-key map "S" 'govc-vm-datastore) - (define-key map "P" 'govc-vm-ping) - (define-key map "c" 'govc-mode-new-session) - (define-key map "h" 'govc-host-with-session) - (define-key map "p" 'govc-pool-with-session) - (define-key map "s" 'govc-datastore-with-session) - (define-key map "?" 'govc-vm-popup) - map) - "Keymap for `govc-vm-mode'.") - -(defun govc-vm-filter () - "Default `govc-filter' for `vm-info'." - (--map (concat it "/*") - (append (govc-ls-folder (list (concat "/" govc-session-datacenter "/vm"))) - (govc "ls" "-t" "VirtualApp" "vm")))) - -(defun govc-ls-folder (folders) - "List FOLDERS recursively." - (let ((subfolders (govc "ls" "-t" "Folder" folders))) - (append folders - (if subfolders - (govc-ls-folder subfolders))))) - -(defun govc-vm (&optional filter session) - "VM info via govc. -Optionally filter by FILTER and inherit SESSION." - (interactive) - (let ((buffer (get-buffer-create "*govc-vm*"))) - (pop-to-buffer buffer) - (govc-vm-mode) - (if session - (govc-session-clone session) - (call-interactively 'govc-session)) - (setq govc-filter filter) - (tabulated-list-print))) - -(define-derived-mode govc-vm-mode govc-tabulated-list-mode "VM" - "Major mode for handling a list of govc vms." - (setq tabulated-list-format [("Name" 40 t) - ("Power state" 12 t) - ("Boot time" 13 t) - ("IP address" 15 t) - ("Guest name" 20 t) - ("Host" 20 t) - ("CPU usage" 15 t) - ("Host memory usage" 18 t) - ("Guest memory usage" 19 t) - ("Storage committed" 18 t) - ("Storage" 10 t) - ("Network" 10 t)] - tabulated-list-sort-key (cons "Name" nil) - tabulated-list-padding 2 - tabulated-list-entries #'govc-vm-info) - (tabulated-list-init-header)) - -(magit-define-popup govc-vm-popup - "VM popup." - :actions (govc-keymap-popup govc-vm-mode-map)) - -(easy-menu-define govc-vm-mode-menu govc-vm-mode-map - "VM menu." - (cons "VM" (govc-keymap-menu govc-vm-mode-map))) - - -;;; govc device mode -(defun govc-device-ls () - "Wrapper for govc device.ls -vm VM." - (-map (lambda (line) - (let* ((entry (s-split-up-to " " (s-collapse-whitespace line) 2)) - (name (car entry)) - (type (nth 1 entry)) - (summary (car (last entry)))) - (list name (vector name type summary)))) - (govc "device.ls" govc-args))) - -(defun govc-device-info () - "Populate table with govc device.info output." - (govc-map-info "device.info" govc-args)) - -(defun govc-device-info-table () - "Tabulated govc device.info." - (interactive) - (govc-map-info-table #'govc-device-info)) - -(defun govc-device-json-info () - "JSON via govc device.info -json on current selection." - (interactive) - (govc-json-info "device.info")) - -(defvar govc-device-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "J") 'govc-device-json-info) - (define-key map (kbd "RET") 'govc-device-info-table) - map) - "Keymap for `govc-device-mode'.") - -(defun govc-device (&optional vm session) - "List govc devices for VM. Optionally inherit SESSION." - (interactive) - (let ((buffer (get-buffer-create "*govc-device*"))) - (pop-to-buffer buffer) - (govc-device-mode) - (if session - (govc-session-clone session) - (call-interactively 'govc-session)) - (setq govc-args (list "-vm" (or vm (govc-vm-prompt "vm: ")))) - (tabulated-list-print))) - -(define-derived-mode govc-device-mode govc-tabulated-list-mode "Device" - "Major mode for handling a govc device." - (setq tabulated-list-format [("Name" 15 t) - ("Type" 30 t) - ("Summary" 40 t)] - tabulated-list-sort-key (cons "Name" nil) - tabulated-list-padding 2 - tabulated-list-entries #'govc-device-ls) - (tabulated-list-init-header)) - -(magit-define-popup govc-popup - "govc popup." - :actions (govc-keymap-list govc-command-map)) - -(easy-menu-change - '("Tools") "govc" - (govc-keymap-menu govc-command-map) - "Search Files (Grep)...") - -(provide 'govc) - -;;; govc.el ends here diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/test/govc-test.el b/vendor/github.com/vmware/govmomi/govc/emacs/test/govc-test.el deleted file mode 100644 index b693b4f21..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/test/govc-test.el +++ /dev/null @@ -1,137 +0,0 @@ -(defconst testsuite-dir - (if load-file-name - (file-name-directory load-file-name) - ;; Fall back to default directory (in case of M-x eval-buffer) - default-directory) - "Directory of the test suite.") - -(defconst govc-test-helper-path - (concat (expand-file-name (concat testsuite-dir "/../../test/test_helper.bash")))) - -(load (expand-file-name "../govc" testsuite-dir) nil :no-message) - -(ert-deftest test-govc-url-parse () - (dolist (u '("root:vagrant@localhost:18443" - "Administrator@vsphere.local:vagrant@localhost" - "https://root:vagrant@localhost:18443/sdk" - "https://Administrator@vsphere.local:vagrant@localhost/sdk")) - (should (equal u (url-recreate-url (govc-url-parse u)))))) - -(ert-deftest test-govc-session-set-url () - (should (equal govc-session-insecure nil)) - (should (equal govc-session-datacenter nil)) - (with-temp-buffer - (govc-session-set-url "vc.example.com?insecure=true&datacenter=foo&ignored=true") - (should (equal govc-session-insecure "true")) - (should (equal govc-session-datacenter "foo")) - (should (equal govc-session-datastore nil)))) - -(ert-deftest test-govc-copy-environment () - (let ((process-environment) - (govc-session-url "vc.example.com") - (govc-session-insecure "false") - (govc-session-datacenter "dc1") - (govc-session-datastore "ds1")) - (govc-export-environment '-) - (dolist (e govc-environment-map) - (should (equal nil (getenv (car e))))) - (govc-export-environment (universal-argument)) - (dolist (e govc-environment-map) - (should (not (equal nil (getenv (car e)))))))) - -(defun govc-test-env () - (let ((url (getenv "GOVC_TEST_URL"))) - (unless url - (ert-skip "env GOVC_TEST_URL not set")) - (setq govc-session-url url - govc-session-insecure "true"))) - -(defun govc-test-helper (arg) - (shell-command-to-string (format "bash -c \"source %s; %s\"" govc-test-helper-path arg))) - -(defun govc-test-new-vm () - (s-trim-right (govc-test-helper "new_empty_vm"))) - -(defun govc-test-new-id () - (s-trim-right (govc-test-helper "new_id"))) - -(defun govc-test-teardown () - (ignore-errors - (govc-test-helper "teardown"))) - -(ert-deftest test-govc-vm-info () - (govc-test-env) - (unwind-protect - (let ((id (govc-test-new-vm))) - (govc-json-info "vm.info" (list id)) - (with-current-buffer "*govc-json*" - (goto-char (point-min)) - (let ((data (json-read))) - (should (= (length data) 1)) - (should (cdr (assq 'VirtualMachines data))))) - - (govc-json-info "vm.info" (list "ENOENT")) - (with-current-buffer "*govc-json*" - (goto-char (point-min)) - (let ((data (json-read))) - (should (= (length data) 1)) - (should (not (cdr (assq 'VirtualMachines data)))))) - - (let ((govc-args (list id)) - (len1) - (len2)) - (setq len1 (length (govc-vm-extra-config))) - (should (>= len1 1)) - (govc "vm.change" "-vm" id - "-e" "govc-test-one=1" - "-e" "govc-test-two:2.2=2" - ;; test that we don't choke on \n - "-e" "foo=bar -baz") - (setq len2 (length (govc-vm-extra-config))) - - (should (= (- len2 len1) 3))) - - (let ((govc-filter "*")) - (should (>= (length (govc-vm-info)) 1))) - - (let ((govc-filter "ENOENT")) - (should (= (length (govc-vm-info)) 0))) - - (govc-vm-screen id)) - (govc-test-teardown))) - -(ert-deftest test-govc-datastore-ls-entries () - (govc-test-env) - (unwind-protect - (let ((id (govc-test-new-id))) - (should (>= (length (govc-datastore-ls-entries)) 1)) - - (let ((govc-filter (concat id "/"))) - (should-error (govc-datastore-ls-entries)) - (govc "datastore.mkdir" id) - (should (= (length (govc-datastore-ls-entries)) 0)) - (dotimes (i 3) - (govc "datastore.mkdir" (format "%s/dir %d" id i))) - (let ((entries (govc-datastore-ls-entries))) - (should (= (length entries) 3)) - (should (s-starts-with? (concat id "/dir ") (caar entries)))))) - (govc-test-teardown))) - -(ert-deftest test-govc-pool-ls () - (govc-test-env) - (unwind-protect - (let* ((pools (govc-ls-pool)) - (num (length pools)) - (path (concat (car pools) "/" (govc-test-new-id)))) - (should (>= num 1)) - (message "%d existing pools [%S]" num pools) - (govc "pool.create" path) - (setq pools (govc-ls-pool)) - (govc-pool-destroy path) - (should (= (- (length pools) num) 1))) - (govc-test-teardown))) - -(ert-deftest test-govc-about () - (govc-test-env) - (govc "about")) diff --git a/vendor/github.com/vmware/govmomi/govc/emacs/test/make.el b/vendor/github.com/vmware/govmomi/govc/emacs/test/make.el deleted file mode 100644 index add62185e..000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/test/make.el +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env emacs --script - -(let ((current-directory (file-name-directory load-file-name))) - (setq project-test-path (expand-file-name "." current-directory)) - (setq project-root-path (expand-file-name ".." current-directory))) - -(add-to-list 'load-path project-root-path) -(add-to-list 'load-path project-test-path) - -(require 'lisp-mnt) -(require 'govc) -(require 's) - -(defun make-test () - (dolist (test-file (or argv (directory-files project-test-path t "-test.el$"))) - (load test-file nil t)) - (ert-run-tests-batch-and-exit t)) - -(defun govc-help () - "Summary of govc modes in markdown format." - (interactive) - (with-help-window (help-buffer) ; TODO: this turned into a mess, but does the job of generating README.md from govc.el - (dolist (kind '(govc-mode govc-urls govc-session-url govc-session-insecure govc-session-datacenter govc-session-datastore - tabulated-list host pool datastore datastore-ls vm device)) - (let* ((name (if (boundp kind) (symbol-name kind) (format "govc-%s-mode" kind))) - (map (if (equal 'govc-mode kind) 'govc-command-map (intern (concat name "-map")))) - (doc (lambda (f &optional all) - (let* ((txt (if (functionp f) (documentation f t) (documentation-property f 'variable-documentation))) - (ix (if all (length txt) (s-index-of "." txt)))) - (s-replace (format "\n\n\\\{%s\}" (concat name "-map")) "" - (s-replace "'" "`" (substring txt 0 ix))))))) - (princ (concat (s-repeat (if (and (boundp kind) (not (fboundp kind))) 3 2) "#") " " name "\n")) - (princ (concat "\n" (funcall doc (intern name) t) "\n\n")) - (when (boundp map) - (princ (concat "### " (symbol-name map) "\n\n")) - (princ "Keybinding | Description\n") - (princ "---------------|------------------------------------------------------------\n") - (dolist (kl (govc-keymap-list (symbol-value map))) - (let ((key (govc-key-description (car kl)))) - (princ (format "%s%s| %s\n" key (s-repeat (- 4 (length key)) " ") (funcall doc (nth 2 kl)))))) - (princ "\n")))))) - -(defun make-docs () - (let ((commentary) - (summary)) - (with-current-buffer (find-file-noselect (concat project-root-path "/govc.el")) - (setq commentary (s-replace ";;; Commentary:" "" (lm-commentary)) - summary (lm-summary))) - (let ((readme (find-file-noselect (concat project-root-path "/README.md")))) - (with-current-buffer readme - (erase-buffer) - (govc-help) - (with-current-buffer (help-buffer) - (copy-to-buffer readme (point-min) (point-max))) - (goto-char (point-min)) - (insert (concat "# govc.el\n\n" summary ".\n")) - (insert (s-replace "'" "`" (replace-regexp-in-string ";; ?" "" commentary t t))) - (save-buffer 0))))) diff --git a/vendor/github.com/vmware/govmomi/govc/events/command.go b/vendor/github.com/vmware/govmomi/govc/events/command.go deleted file mode 100644 index c3a11e4ad..000000000 --- a/vendor/github.com/vmware/govmomi/govc/events/command.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package events - -import ( - "flag" - "fmt" - "os" - "strings" - "time" - - "github.com/vmware/govmomi/event" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type events struct { - *flags.DatacenterFlag - - Max int -} - -func init() { - cli.Register("events", &events{}) -} - -func (cmd *events) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.IntVar(&cmd.Max, "n", 25, "Output the last N events") -} - -func (cmd *events) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *events) Usage() string { - return "[PATH]..." -} - -func (cmd *events) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - m := event.NewManager(c) - - objs, err := cmd.ManagedObjects(ctx, f.Args()) - if err != nil { - return err - } - - var events []types.BaseEvent - - for _, o := range objs { - filter := types.EventFilterSpec{ - Entity: &types.EventFilterSpecByEntity{ - Entity: o, - Recursion: types.EventFilterSpecRecursionOptionAll, - }, - } - - collector, err := m.CreateCollectorForEvents(ctx, filter) - if err != nil { - return fmt.Errorf("[%#v] %s", o, err) - } - defer collector.Destroy(ctx) - - err = collector.SetPageSize(ctx, cmd.Max) - if err != nil { - return err - } - - page, err := collector.LatestPage(ctx) - if err != nil { - return err - } - - events = append(events, page...) - } - - event.Sort(events) - - for _, e := range events { - cat, err := m.EventCategory(ctx, e) - if err != nil { - return err - } - - event := e.GetEvent() - msg := strings.TrimSpace(event.FullFormattedMessage) - - if t, ok := e.(*types.TaskEvent); ok { - msg = fmt.Sprintf("%s (target=%s %s)", msg, t.Info.Entity.Type, t.Info.EntityName) - } - - fmt.Fprintf(os.Stdout, "[%s] [%s] %s\n", - event.CreatedTime.Local().Format(time.ANSIC), - cat, msg) - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/examples/lib/ssh.sh b/vendor/github.com/vmware/govmomi/govc/examples/lib/ssh.sh deleted file mode 100644 index 60910e9fb..000000000 --- a/vendor/github.com/vmware/govmomi/govc/examples/lib/ssh.sh +++ /dev/null @@ -1,44 +0,0 @@ -function public-key { - local dir=${HOME}/.ssh - - for f in $HOME/.ssh/{id_{rsa,dsa},*}.pub; do - if [ -r $f ]; then - echo $f - return - fi - done - - echo "Can't find public key file..." - exit 1 -} - -PUBLIC_KEY_FILE=${PUBLIC_KEY_FILE-$(public-key)} -SSH_OPTS="-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=quiet" - -function upload-public-key { - local vm_name=$1 - local dir=$2 - - if [ -z "$dir" ] - then - uid=$(echo $GOVC_GUEST_LOGIN | awk -F: '{print $1}') - dir=$(govc guest.getenv -vm ${vm_name} HOME | awk -F= '{print $2}') - - if [ -z "$dir" ] - then - echo "Can't find ${uid}'s HOME dir..." - exit 1 - fi - fi - - govc guest.mkdir \ - -vm ${vm_name} \ - -p \ - ${dir}/.ssh - - govc guest.upload \ - -vm ${vm_name} \ - -f \ - ${PUBLIC_KEY_FILE} \ - ${dir}/.ssh/authorized_keys -} diff --git a/vendor/github.com/vmware/govmomi/govc/examples/vcsa.sh b/vendor/github.com/vmware/govmomi/govc/examples/vcsa.sh deleted file mode 100644 index 19e4d6b21..000000000 --- a/vendor/github.com/vmware/govmomi/govc/examples/vcsa.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -e - -lib=$(readlink -nf $(dirname $0))/lib -. $lib/ssh.sh - -ova=$1 - -if [ -z "$ova" ] -then - ova=./VMware-vCenter-Server-Appliance-5.5.0.10300-2000350_OVF10.ova -fi - -# default to local Vagrant esxbox for testing -export GOVC_URL=${GOVC_URL-"https://root:vagrant@localhost:8443/sdk"} - -# default VCSA credentials -export GOVC_GUEST_LOGIN=root:vmware - -# VM name as defined in the VCSA .ovf -vm_name=VMware_vCenter_Server_Appliance - -echo "Importing $ova..." -govc import.ova $ova - -echo "Powering on $vm_name..." -govc vm.power -on $vm_name - -echo "Waiting for $vm_name's IP address..." -vc=$(govc vm.ip $vm_name) - -govc vm.info $vm_name - -echo "Uploading ssh public key to $vm_name..." -upload-public-key $vm_name - -echo "Configuring vCenter Server Appliance..." - -# http://www.virtuallyghetto.com/2012/02/automating-vcenter-server-appliance.html -ssh ${SSH_OPTS} root@$vc < 1 - return nil, flag.err - } - - return flag.dc, err -} - -func (flag *DatacenterFlag) ManagedObjects(ctx context.Context, args []string) ([]types.ManagedObjectReference, error) { - var refs []types.ManagedObjectReference - - c, err := flag.Client() - if err != nil { - return nil, err - } - - if len(args) == 0 { - refs = append(refs, c.ServiceContent.RootFolder) - return refs, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - for _, arg := range args { - elements, err := finder.ManagedObjectList(ctx, arg) - if err != nil { - return nil, err - } - - for _, e := range elements { - refs = append(refs, e.Object.Reference()) - } - } - - return refs, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/datastore.go b/vendor/github.com/vmware/govmomi/govc/flags/datastore.go deleted file mode 100644 index d339f7d1f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/datastore.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "net/url" - "os" - - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type DatastoreFlag struct { - common - - *DatacenterFlag - - name string - ds *object.Datastore -} - -var datastoreFlagKey = flagKey("datastore") - -func NewDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context) { - if v := ctx.Value(datastoreFlagKey); v != nil { - return v.(*DatastoreFlag), ctx - } - - v := &DatastoreFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - ctx = context.WithValue(ctx, datastoreFlagKey, v) - return v, ctx -} - -func (flag *DatastoreFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.DatacenterFlag.Register(ctx, f) - - env := "GOVC_DATASTORE" - value := os.Getenv(env) - usage := fmt.Sprintf("Datastore [%s]", env) - f.StringVar(&flag.name, "ds", value, usage) - }) -} - -func (flag *DatastoreFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *DatastoreFlag) Datastore() (*object.Datastore, error) { - if flag.ds != nil { - return flag.ds, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.ds, err = finder.DatastoreOrDefault(context.TODO(), flag.name); err != nil { - return nil, err - } - - return flag.ds, nil -} - -func (flag *DatastoreFlag) DatastorePath(name string) (string, error) { - ds, err := flag.Datastore() - if err != nil { - return "", err - } - - return ds.Path(name), nil -} - -func (flag *DatastoreFlag) DatastoreURL(path string) (*url.URL, error) { - dc, err := flag.Datacenter() - if err != nil { - return nil, err - } - - ds, err := flag.Datastore() - if err != nil { - return nil, err - } - - u, err := ds.URL(context.TODO(), dc, path) - if err != nil { - return nil, err - } - - return u, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/debug.go b/vendor/github.com/vmware/govmomi/govc/flags/debug.go deleted file mode 100644 index d8e910ea0..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/debug.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - "path/filepath" - "strings" - "time" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/vim25/debug" -) - -type DebugFlag struct { - common - - enable bool -} - -var debugFlagKey = flagKey("debug") - -func NewDebugFlag(ctx context.Context) (*DebugFlag, context.Context) { - if v := ctx.Value(debugFlagKey); v != nil { - return v.(*DebugFlag), ctx - } - - v := &DebugFlag{} - ctx = context.WithValue(ctx, debugFlagKey, v) - return v, ctx -} - -func (flag *DebugFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - env := "GOVC_DEBUG" - enable := false - switch env := strings.ToLower(os.Getenv(env)); env { - case "1", "true": - enable = true - } - - usage := fmt.Sprintf("Store debug logs [%s]", env) - f.BoolVar(&flag.enable, "debug", enable, usage) - }) -} - -func (flag *DebugFlag) Process(ctx context.Context) error { - if !flag.enable { - return nil - } - - return flag.ProcessOnce(func() error { - // Base path for storing debug logs. - r := os.Getenv("GOVC_DEBUG_PATH") - if r == "" { - r = filepath.Join(os.Getenv("HOME"), ".govmomi") - } - r = filepath.Join(r, "debug") - - // Path for this particular run. - now := time.Now().Format("2006-01-02T15-04-05.999999999") - r = filepath.Join(r, now) - - err := os.MkdirAll(r, 0700) - if err != nil { - return err - } - - p := debug.FileProvider{ - Path: r, - } - - debug.SetProvider(&p) - return nil - }) -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/empty.go b/vendor/github.com/vmware/govmomi/govc/flags/empty.go deleted file mode 100644 index 0a1a438ca..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/empty.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - - "golang.org/x/net/context" -) - -type EmptyFlag struct{} - -func (flag *EmptyFlag) Register(ctx context.Context, f *flag.FlagSet) { -} - -func (flag *EmptyFlag) Process(ctx context.Context) error { - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/host_connect.go b/vendor/github.com/vmware/govmomi/govc/flags/host_connect.go deleted file mode 100644 index be39dbd0a..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/host_connect.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/vim25/types" -) - -type HostConnectFlag struct { - common - - types.HostConnectSpec - - noverify bool -} - -var hostConnectFlagKey = flagKey("hostConnect") - -func NewHostConnectFlag(ctx context.Context) (*HostConnectFlag, context.Context) { - if v := ctx.Value(hostConnectFlagKey); v != nil { - return v.(*HostConnectFlag), ctx - } - - v := &HostConnectFlag{} - ctx = context.WithValue(ctx, hostConnectFlagKey, v) - return v, ctx -} - -func (flag *HostConnectFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - f.StringVar(&flag.HostName, "hostname", "", "Hostname or IP address of the host") - f.StringVar(&flag.UserName, "username", "", "Username of administration account on the host") - f.StringVar(&flag.Password, "password", "", "Password of administration account on the host") - f.StringVar(&flag.SslThumbprint, "fingerprint", "", "Fingerprint of the host's SSL certificate") - f.BoolVar(&flag.Force, "force", false, "Force when host is managed by another VC") - - f.BoolVar(&flag.noverify, "noverify", false, "When true, ignore host SSL certificate verification error") - }) -} - -func (flag *HostConnectFlag) Process(ctx context.Context) error { - return nil -} - -// AcceptThumbprint returns nil if the given error is an SSLVerifyFault and -noverify is true. -// In which case, flag.SslThumbprint is set to fault.Thumbprint and the caller should retry the task. -func (flag *HostConnectFlag) AcceptThumbprint(err error) error { - if f, ok := err.(types.HasFault); ok { - switch fault := f.Fault().(type) { - case *types.SSLVerifyFault: - if flag.noverify { - flag.SslThumbprint = fault.Thumbprint - return nil - } - return fmt.Errorf("%s Fingerprint is %s", err, fault.Thumbprint) - } - } - - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/host_system.go b/vendor/github.com/vmware/govmomi/govc/flags/host_system.go deleted file mode 100644 index a0d847239..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/host_system.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type HostSystemFlag struct { - common - - *ClientFlag - *DatacenterFlag - *SearchFlag - - name string - host *object.HostSystem - pool *object.ResourcePool -} - -var hostSystemFlagKey = flagKey("hostSystem") - -func NewHostSystemFlag(ctx context.Context) (*HostSystemFlag, context.Context) { - if v := ctx.Value(hostSystemFlagKey); v != nil { - return v.(*HostSystemFlag), ctx - } - - v := &HostSystemFlag{} - v.ClientFlag, ctx = NewClientFlag(ctx) - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - v.SearchFlag, ctx = NewSearchFlag(ctx, SearchHosts) - ctx = context.WithValue(ctx, hostSystemFlagKey, v) - return v, ctx -} - -func (flag *HostSystemFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.ClientFlag.Register(ctx, f) - flag.DatacenterFlag.Register(ctx, f) - flag.SearchFlag.Register(ctx, f) - - env := "GOVC_HOST" - value := os.Getenv(env) - usage := fmt.Sprintf("Host system [%s]", env) - f.StringVar(&flag.name, "host", value, usage) - }) -} - -func (flag *HostSystemFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.ClientFlag.Process(ctx); err != nil { - return err - } - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := flag.SearchFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *HostSystemFlag) HostSystemIfSpecified() (*object.HostSystem, error) { - if flag.host != nil { - return flag.host, nil - } - - // Use search flags if specified. - if flag.SearchFlag.IsSet() { - host, err := flag.SearchFlag.HostSystem() - if err != nil { - return nil, err - } - - flag.host = host - return flag.host, nil - } - - // Never look for a default host system. - // A host system parameter is optional for vm creation. It uses a mandatory - // resource pool parameter to determine where the vm should be placed. - if flag.name == "" { - return nil, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.host, err = finder.HostSystem(context.TODO(), flag.name) - return flag.host, err -} - -func (flag *HostSystemFlag) HostSystem() (*object.HostSystem, error) { - host, err := flag.HostSystemIfSpecified() - if err != nil { - return nil, err - } - - if host != nil { - return host, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.host, err = finder.DefaultHostSystem(context.TODO()) - return flag.host, err -} - -func (flag *HostSystemFlag) HostNetworkSystem() (*object.HostNetworkSystem, error) { - host, err := flag.HostSystem() - if err != nil { - return nil, err - } - - return host.ConfigManager().NetworkSystem(context.TODO()) -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/network.go b/vendor/github.com/vmware/govmomi/govc/flags/network.go deleted file mode 100644 index 602dd0f61..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/network.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type NetworkFlag struct { - common - - *DatacenterFlag - - name string - net object.NetworkReference - adapter string - address string -} - -var networkFlagKey = flagKey("network") - -func NewNetworkFlag(ctx context.Context) (*NetworkFlag, context.Context) { - if v := ctx.Value(networkFlagKey); v != nil { - return v.(*NetworkFlag), ctx - } - - v := &NetworkFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - ctx = context.WithValue(ctx, networkFlagKey, v) - return v, ctx -} - -func (flag *NetworkFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.DatacenterFlag.Register(ctx, f) - - env := "GOVC_NETWORK" - value := os.Getenv(env) - flag.Set(value) - usage := fmt.Sprintf("Network [%s]", env) - f.Var(flag, "net", usage) - f.StringVar(&flag.adapter, "net.adapter", "e1000", "Network adapter type") - f.StringVar(&flag.address, "net.address", "", "Network hardware address") - }) -} - -func (flag *NetworkFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *NetworkFlag) String() string { - return flag.name -} - -func (flag *NetworkFlag) Set(name string) error { - flag.name = name - return nil -} - -func (flag *NetworkFlag) Network() (object.NetworkReference, error) { - if flag.net != nil { - return flag.net, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.net, err = finder.NetworkOrDefault(context.TODO(), flag.name); err != nil { - return nil, err - } - - return flag.net, nil -} - -func (flag *NetworkFlag) Device() (types.BaseVirtualDevice, error) { - net, err := flag.Network() - if err != nil { - return nil, err - } - - backing, err := net.EthernetCardBackingInfo(context.TODO()) - if err != nil { - return nil, err - } - - device, err := object.EthernetCardTypes().CreateEthernetCard(flag.adapter, backing) - if err != nil { - return nil, err - } - - if flag.address != "" { - card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - card.AddressType = string(types.VirtualEthernetCardMacTypeManual) - card.MacAddress = flag.address - } - - return device, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/optional_bool.go b/vendor/github.com/vmware/govmomi/govc/flags/optional_bool.go deleted file mode 100644 index 6adef5181..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/optional_bool.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "strconv" -) - -type optionalBool struct { - val **bool -} - -func (b *optionalBool) Set(s string) error { - v, err := strconv.ParseBool(s) - *b.val = &v - return err -} - -func (b *optionalBool) Get() interface{} { - if *b.val == nil { - return nil - } - return **b.val -} - -func (b *optionalBool) String() string { - if *b.val == nil { - return "" - } - return fmt.Sprintf("%v", **b.val) -} - -func (b *optionalBool) IsBoolFlag() bool { return true } - -// NewOptionalBool returns a flag.Value implementation where there is no default value. -// This avoids sending a default value over the wire as using flag.BoolVar() would. -func NewOptionalBool(v **bool) flag.Value { - return &optionalBool{v} -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/output.go b/vendor/github.com/vmware/govmomi/govc/flags/output.go deleted file mode 100644 index d6446f206..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/output.go +++ /dev/null @@ -1,210 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "os" - "sync" - "time" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/vim25/progress" -) - -type OutputWriter interface { - Write(io.Writer) error -} - -type OutputFlag struct { - common - - JSON bool - TTY bool -} - -var outputFlagKey = flagKey("output") - -func NewOutputFlag(ctx context.Context) (*OutputFlag, context.Context) { - if v := ctx.Value(outputFlagKey); v != nil { - return v.(*OutputFlag), ctx - } - - v := &OutputFlag{} - ctx = context.WithValue(ctx, outputFlagKey, v) - return v, ctx -} - -func (flag *OutputFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - f.BoolVar(&flag.JSON, "json", false, "Enable JSON output") - }) -} - -func (flag *OutputFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if !flag.JSON { - // Assume we have a tty if not outputting JSON - flag.TTY = true - } - - return nil - }) -} - -// Log outputs the specified string, prefixed with the current time. -// A newline is not automatically added. If the specified string -// starts with a '\r', the current line is cleared first. -func (flag *OutputFlag) Log(s string) (int, error) { - if len(s) > 0 && s[0] == '\r' { - flag.Write([]byte{'\r', 033, '[', 'K'}) - s = s[1:] - } - - return flag.WriteString(time.Now().Format("[02-01-06 15:04:05] ") + s) -} - -func (flag *OutputFlag) Write(b []byte) (int, error) { - if !flag.TTY { - return 0, nil - } - - n, err := os.Stdout.Write(b) - os.Stdout.Sync() - return n, err -} - -func (flag *OutputFlag) WriteString(s string) (int, error) { - return flag.Write([]byte(s)) -} - -func (flag *OutputFlag) WriteResult(result OutputWriter) error { - var err error - var out = os.Stdout - - if flag.JSON { - err = json.NewEncoder(out).Encode(result) - } else { - err = result.Write(out) - } - - return err -} - -type progressLogger struct { - flag *OutputFlag - prefix string - - wg sync.WaitGroup - - sink chan chan progress.Report - done chan struct{} -} - -func newProgressLogger(flag *OutputFlag, prefix string) *progressLogger { - p := &progressLogger{ - flag: flag, - prefix: prefix, - - sink: make(chan chan progress.Report), - done: make(chan struct{}), - } - - p.wg.Add(1) - - go p.loopA() - - return p -} - -// loopA runs before Sink() has been called. -func (p *progressLogger) loopA() { - var err error - - defer p.wg.Done() - - tick := time.NewTicker(100 * time.Millisecond) - defer tick.Stop() - - for stop := false; !stop; { - select { - case ch := <-p.sink: - err = p.loopB(tick, ch) - stop = true - case <-p.done: - stop = true - case <-tick.C: - line := fmt.Sprintf("\r%s", p.prefix) - p.flag.Log(line) - } - } - - if err != nil && err != io.EOF { - p.flag.Log(fmt.Sprintf("\r%sError: %s\n", p.prefix, err)) - } else { - p.flag.Log(fmt.Sprintf("\r%sOK\n", p.prefix)) - } -} - -// loopA runs after Sink() has been called. -func (p *progressLogger) loopB(tick *time.Ticker, ch <-chan progress.Report) error { - var r progress.Report - var ok bool - var err error - - for ok = true; ok; { - select { - case r, ok = <-ch: - if !ok { - break - } - err = r.Error() - case <-tick.C: - line := fmt.Sprintf("\r%s", p.prefix) - if r != nil { - line += fmt.Sprintf("(%.0f%%", r.Percentage()) - detail := r.Detail() - if detail != "" { - line += fmt.Sprintf(", %s", detail) - } - line += ")" - } - p.flag.Log(line) - } - } - - return err -} - -func (p *progressLogger) Sink() chan<- progress.Report { - ch := make(chan progress.Report) - p.sink <- ch - return ch -} - -func (p *progressLogger) Wait() { - close(p.done) - p.wg.Wait() -} - -func (flag *OutputFlag) ProgressLogger(prefix string) *progressLogger { - return newProgressLogger(flag, prefix) -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go b/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go deleted file mode 100644 index c7459c978..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type ResourcePoolFlag struct { - common - - *DatacenterFlag - - name string - pool *object.ResourcePool -} - -var resourcePoolFlagKey = flagKey("resourcePool") - -func NewResourcePoolFlag(ctx context.Context) (*ResourcePoolFlag, context.Context) { - if v := ctx.Value(resourcePoolFlagKey); v != nil { - return v.(*ResourcePoolFlag), ctx - } - - v := &ResourcePoolFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - ctx = context.WithValue(ctx, resourcePoolFlagKey, v) - return v, ctx -} - -func (flag *ResourcePoolFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.DatacenterFlag.Register(ctx, f) - - env := "GOVC_RESOURCE_POOL" - value := os.Getenv(env) - usage := fmt.Sprintf("Resource pool [%s]", env) - f.StringVar(&flag.name, "pool", value, usage) - }) -} - -func (flag *ResourcePoolFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *ResourcePoolFlag) ResourcePool() (*object.ResourcePool, error) { - if flag.pool != nil { - return flag.pool, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.pool, err = finder.ResourcePoolOrDefault(context.TODO(), flag.name); err != nil { - return nil, err - } - - return flag.pool, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/search.go b/vendor/github.com/vmware/govmomi/govc/flags/search.go deleted file mode 100644 index c43912ffe..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/search.go +++ /dev/null @@ -1,392 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "errors" - "flag" - "fmt" - "strings" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "golang.org/x/net/context" -) - -const ( - SearchVirtualMachines = iota + 1 - SearchHosts - SearchVirtualApps -) - -type SearchFlag struct { - common - - *ClientFlag - *DatacenterFlag - - t int - entity string - - byDatastorePath string - byDNSName string - byInventoryPath string - byIP string - byUUID string - - isset bool -} - -var searchFlagKey = flagKey("search") - -func NewSearchFlag(ctx context.Context, t int) (*SearchFlag, context.Context) { - if v := ctx.Value(searchFlagKey); v != nil { - return v.(*SearchFlag), ctx - } - - v := &SearchFlag{ - t: t, - } - - v.ClientFlag, ctx = NewClientFlag(ctx) - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - - switch t { - case SearchVirtualMachines: - v.entity = "VM" - case SearchHosts: - v.entity = "host" - case SearchVirtualApps: - v.entity = "vapp" - default: - panic("invalid search type") - } - - ctx = context.WithValue(ctx, searchFlagKey, v) - return v, ctx -} - -func (flag *SearchFlag) Register(ctx context.Context, fs *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.ClientFlag.Register(ctx, fs) - flag.DatacenterFlag.Register(ctx, fs) - - register := func(v *string, f string, d string) { - f = fmt.Sprintf("%s.%s", strings.ToLower(flag.entity), f) - d = fmt.Sprintf(d, flag.entity) - fs.StringVar(v, f, "", d) - } - - switch flag.t { - case SearchVirtualMachines: - register(&flag.byDatastorePath, "path", "Find %s by path to .vmx file") - } - - switch flag.t { - case SearchVirtualMachines, SearchHosts: - register(&flag.byDNSName, "dns", "Find %s by FQDN") - register(&flag.byIP, "ip", "Find %s by IP address") - register(&flag.byUUID, "uuid", "Find %s by instance UUID") - } - - register(&flag.byInventoryPath, "ipath", "Find %s by inventory path") - }) -} - -func (flag *SearchFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.ClientFlag.Process(ctx); err != nil { - return err - } - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - - flags := []string{ - flag.byDatastorePath, - flag.byDNSName, - flag.byInventoryPath, - flag.byIP, - flag.byUUID, - } - - flag.isset = false - for _, f := range flags { - if f != "" { - if flag.isset { - return errors.New("cannot use more than one search flag") - } - flag.isset = true - } - } - - return nil - }) -} - -func (flag *SearchFlag) IsSet() bool { - return flag.isset -} - -func (flag *SearchFlag) searchIndex(c *vim25.Client) *object.SearchIndex { - return object.NewSearchIndex(c) -} - -func (flag *SearchFlag) searchByDatastorePath(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByDatastorePath(context.TODO(), dc, flag.byDatastorePath) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) searchByDNSName(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByDnsName(context.TODO(), dc, flag.byDNSName, true) - case SearchHosts: - return flag.searchIndex(c).FindByDnsName(context.TODO(), dc, flag.byDNSName, false) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) searchByInventoryPath(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - // TODO(PN): The datacenter flag should not be set because it is ignored. - return flag.searchIndex(c).FindByInventoryPath(context.TODO(), flag.byInventoryPath) -} - -func (flag *SearchFlag) searchByIP(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByIp(context.TODO(), dc, flag.byIP, true) - case SearchHosts: - return flag.searchIndex(c).FindByIp(context.TODO(), dc, flag.byIP, false) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) searchByUUID(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByUuid(context.TODO(), dc, flag.byUUID, true, nil) - case SearchHosts: - return flag.searchIndex(c).FindByUuid(context.TODO(), dc, flag.byUUID, false, nil) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) search() (object.Reference, error) { - var ref object.Reference - var err error - - c, err := flag.Client() - if err != nil { - return nil, err - } - - dc, err := flag.Datacenter() - if err != nil { - return nil, err - } - - switch { - case flag.byDatastorePath != "": - ref, err = flag.searchByDatastorePath(c, dc) - case flag.byDNSName != "": - ref, err = flag.searchByDNSName(c, dc) - case flag.byInventoryPath != "": - ref, err = flag.searchByInventoryPath(c, dc) - case flag.byIP != "": - ref, err = flag.searchByIP(c, dc) - case flag.byUUID != "": - ref, err = flag.searchByUUID(c, dc) - default: - err = errors.New("no search flag specified") - } - - if err != nil { - return nil, err - } - - if ref == nil { - return nil, fmt.Errorf("no such %s", flag.entity) - } - - return ref, nil -} - -func (flag *SearchFlag) VirtualMachine() (*object.VirtualMachine, error) { - ref, err := flag.search() - if err != nil { - return nil, err - } - - vm, ok := ref.(*object.VirtualMachine) - if !ok { - return nil, fmt.Errorf("expected VirtualMachine entity, got %s", ref.Reference().Type) - } - - return vm, nil -} - -func (flag *SearchFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error) { - var out []*object.VirtualMachine - - if flag.IsSet() { - vm, err := flag.VirtualMachine() - if err != nil { - return nil, err - } - - out = append(out, vm) - return out, nil - } - - // List virtual machines - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - var nfe error - - // List virtual machines for every argument - for _, arg := range args { - vms, err := finder.VirtualMachineList(context.TODO(), arg) - if err != nil { - if _, ok := err.(*find.NotFoundError); ok { - // Let caller decide how to handle NotFoundError - nfe = err - continue - } - return nil, err - } - - out = append(out, vms...) - } - - return out, nfe -} - -func (flag *SearchFlag) VirtualApp() (*object.VirtualApp, error) { - ref, err := flag.search() - if err != nil { - return nil, err - } - - app, ok := ref.(*object.VirtualApp) - if !ok { - return nil, fmt.Errorf("expected VirtualApp entity, got %s", ref.Reference().Type) - } - - return app, nil -} - -func (flag *SearchFlag) VirtualApps(args []string) ([]*object.VirtualApp, error) { - var out []*object.VirtualApp - - if flag.IsSet() { - app, err := flag.VirtualApp() - if err != nil { - return nil, err - } - - out = append(out, app) - return out, nil - } - - // List virtual apps - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - // List virtual apps for every argument - for _, arg := range args { - apps, err := finder.VirtualAppList(context.TODO(), arg) - if err != nil { - return nil, err - } - - out = append(out, apps...) - } - - return out, nil -} - -func (flag *SearchFlag) HostSystem() (*object.HostSystem, error) { - ref, err := flag.search() - if err != nil { - return nil, err - } - - host, ok := ref.(*object.HostSystem) - if !ok { - return nil, fmt.Errorf("expected HostSystem entity, got %s", ref.Reference().Type) - } - - return host, nil -} - -func (flag *SearchFlag) HostSystems(args []string) ([]*object.HostSystem, error) { - var out []*object.HostSystem - - if flag.IsSet() { - host, err := flag.HostSystem() - if err != nil { - return nil, err - } - - out = append(out, host) - return out, nil - } - - // List host system - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - // List host systems for every argument - for _, arg := range args { - vms, err := finder.HostSystemList(context.TODO(), arg) - if err != nil { - return nil, err - } - - out = append(out, vms...) - } - - return out, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/version.go b/vendor/github.com/vmware/govmomi/govc/flags/version.go deleted file mode 100644 index d0b5f0ac7..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/version.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "strconv" - "strings" -) - -type version []int - -func ParseVersion(s string) (version, error) { - v := make(version, 0) - ps := strings.Split(s, ".") - for _, p := range ps { - i, err := strconv.Atoi(p) - if err != nil { - return nil, err - } - - v = append(v, i) - } - - return v, nil -} - -func (v version) Lte(u version) bool { - lv := len(v) - lu := len(u) - - for i := 0; i < lv; i++ { - // Everything up to here has been equal and v has more elements than u. - if i >= lu { - return false - } - - // Move to next digit if equal. - if v[i] == u[i] { - continue - } - - return v[i] < u[i] - } - - // Equal. - return true -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/virtual_app.go b/vendor/github.com/vmware/govmomi/govc/flags/virtual_app.go deleted file mode 100644 index e85819fa0..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/virtual_app.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type VirtualAppFlag struct { - common - - *DatacenterFlag - *SearchFlag - - name string - app *object.VirtualApp -} - -var virtualAppFlagKey = flagKey("virtualApp") - -func NewVirtualAppFlag(ctx context.Context) (*VirtualAppFlag, context.Context) { - if v := ctx.Value(virtualAppFlagKey); v != nil { - return v.(*VirtualAppFlag), ctx - } - - v := &VirtualAppFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - v.SearchFlag, ctx = NewSearchFlag(ctx, SearchVirtualApps) - ctx = context.WithValue(ctx, virtualAppFlagKey, v) - return v, ctx -} - -func (flag *VirtualAppFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.DatacenterFlag.Register(ctx, f) - flag.SearchFlag.Register(ctx, f) - - env := "GOVC_VAPP" - value := os.Getenv(env) - usage := fmt.Sprintf("Virtual App [%s]", env) - f.StringVar(&flag.name, "vapp", value, usage) - }) -} - -func (flag *VirtualAppFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := flag.SearchFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *VirtualAppFlag) VirtualApp() (*object.VirtualApp, error) { - if flag.app != nil { - return flag.app, nil - } - - // Use search flags if specified. - if flag.SearchFlag.IsSet() { - app, err := flag.SearchFlag.VirtualApp() - if err != nil { - return nil, err - } - - flag.app = app - return flag.app, nil - } - - // Never look for a default virtual app. - if flag.name == "" { - return nil, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.app, err = finder.VirtualApp(context.TODO(), flag.name) - return flag.app, err -} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/virtual_machine.go b/vendor/github.com/vmware/govmomi/govc/flags/virtual_machine.go deleted file mode 100644 index 0d3cc9a11..000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/virtual_machine.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type VirtualMachineFlag struct { - common - - *ClientFlag - *DatacenterFlag - *SearchFlag - - name string - vm *object.VirtualMachine -} - -var virtualMachineFlagKey = flagKey("virtualMachine") - -func NewVirtualMachineFlag(ctx context.Context) (*VirtualMachineFlag, context.Context) { - if v := ctx.Value(virtualMachineFlagKey); v != nil { - return v.(*VirtualMachineFlag), ctx - } - - v := &VirtualMachineFlag{} - v.ClientFlag, ctx = NewClientFlag(ctx) - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - v.SearchFlag, ctx = NewSearchFlag(ctx, SearchVirtualMachines) - ctx = context.WithValue(ctx, virtualMachineFlagKey, v) - return v, ctx -} - -func (flag *VirtualMachineFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.ClientFlag.Register(ctx, f) - flag.DatacenterFlag.Register(ctx, f) - flag.SearchFlag.Register(ctx, f) - - env := "GOVC_VM" - value := os.Getenv(env) - usage := fmt.Sprintf("Virtual machine [%s]", env) - f.StringVar(&flag.name, "vm", value, usage) - }) -} - -func (flag *VirtualMachineFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.ClientFlag.Process(ctx); err != nil { - return err - } - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := flag.SearchFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *VirtualMachineFlag) VirtualMachine() (*object.VirtualMachine, error) { - if flag.vm != nil { - return flag.vm, nil - } - - // Use search flags if specified. - if flag.SearchFlag.IsSet() { - vm, err := flag.SearchFlag.VirtualMachine() - if err != nil { - return nil, err - } - - flag.vm = vm - return flag.vm, nil - } - - // Never look for a default virtual machine. - if flag.name == "" { - return nil, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.vm, err = finder.VirtualMachine(context.TODO(), flag.name) - return flag.vm, err -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/add.go b/vendor/github.com/vmware/govmomi/govc/host/add.go deleted file mode 100644 index 583f64cf7..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/add.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - - -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. -*/ - -package host - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.ClientFlag - *flags.DatacenterFlag - *flags.HostConnectFlag - - parent string - connect bool -} - -func init() { - cli.Register("host.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) - cmd.HostConnectFlag.Register(ctx, f) - - f.StringVar(&cmd.parent, "parent", "", "Path to folder to add the host to") - f.BoolVar(&cmd.connect, "connect", true, "Immediately connect to host") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostConnectFlag.Process(ctx); err != nil { - return err - } - if cmd.HostName == "" { - return flag.ErrHelp - } - if cmd.UserName == "" { - return flag.ErrHelp - } - if cmd.Password == "" { - return flag.ErrHelp - } - return nil -} - -func (cmd *add) Description() string { - return `Add host to datacenter. - -The host is added to the folder specified by the 'parent' flag. If not given, -this defaults to the hosts folder in the specified or default datacenter.` -} - -func (cmd *add) Add(ctx context.Context, parent *object.Folder) error { - spec := cmd.HostConnectSpec - - req := types.AddStandaloneHost_Task{ - This: parent.Reference(), - Spec: spec, - AddConnected: cmd.connect, - } - - res, err := methods.AddStandaloneHost_Task(ctx, parent.Client(), &req) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("adding %s to folder %s... ", spec.HostName, parent.InventoryPath)) - defer logger.Wait() - - task := object.NewTask(parent.Client(), res.Returnval) - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - var parent *object.Folder - - if f.NArg() != 0 { - return flag.ErrHelp - } - - if cmd.parent == "" { - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - folders, err := dc.Folders(ctx) - if err != nil { - return err - } - - parent = folders.HostFolder - } else { - finder, err := cmd.Finder() - if err != nil { - return err - } - - parent, err = finder.Folder(ctx, cmd.parent) - if err != nil { - return err - } - } - - err := cmd.Add(ctx, parent) - if err == nil { - return nil - } - - // Check if we failed due to SSLVerifyFault and -noverify is set - if err := cmd.AcceptThumbprint(err); err != nil { - return err - } - - // Accepted unverified thumbprint, try again - return cmd.Add(ctx, parent) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/autostart/add.go b/vendor/github.com/vmware/govmomi/govc/host/autostart/add.go deleted file mode 100644 index ec1fe3459..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/autostart/add.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package autostart - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/vim25/types" -) - -type add struct { - *AutostartFlag -} - -func init() { - cli.Register("host.autostart.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.AutostartFlag, ctx = newAutostartFlag(ctx) - cmd.AutostartFlag.Register(ctx, f) -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.AutostartFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Usage() string { - return "VM..." -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - var powerInfo = types.AutoStartPowerInfo{ - StartAction: "powerOn", - StartDelay: -1, - StartOrder: -1, - StopAction: "systemDefault", - StopDelay: -1, - WaitForHeartbeat: types.AutoStartWaitHeartbeatSettingSystemDefault, - } - - return cmd.ReconfigureVMs(f.Args(), powerInfo) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/autostart/autostart.go b/vendor/github.com/vmware/govmomi/govc/host/autostart/autostart.go deleted file mode 100644 index 4e260db32..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/autostart/autostart.go +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package autostart - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type AutostartFlag struct { - *flags.ClientFlag - *flags.DatacenterFlag - *flags.HostSystemFlag -} - -func newAutostartFlag(ctx context.Context) (*AutostartFlag, context.Context) { - f := &AutostartFlag{} - f.ClientFlag, ctx = flags.NewClientFlag(ctx) - f.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - f.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - return f, ctx -} - -func (f *AutostartFlag) Register(ctx context.Context, fs *flag.FlagSet) { - f.ClientFlag.Register(ctx, fs) - f.DatacenterFlag.Register(ctx, fs) - f.HostSystemFlag.Register(ctx, fs) -} - -func (f *AutostartFlag) Process(ctx context.Context) error { - if err := f.ClientFlag.Process(ctx); err != nil { - return err - } - if err := f.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := f.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -// VirtualMachines returns list of virtual machine objects based on the -// arguments specified on the command line. This helper is defined in -// flags.SearchFlag as well, but that pulls in other virtual machine flags that -// are not relevant here. -func (f *AutostartFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error) { - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := f.Finder() - if err != nil { - return nil, err - } - - var out []*object.VirtualMachine - for _, arg := range args { - vms, err := finder.VirtualMachineList(context.TODO(), arg) - if err != nil { - return nil, err - } - - out = append(out, vms...) - } - - return out, nil -} - -func (f *AutostartFlag) HostAutoStartManager() (*mo.HostAutoStartManager, error) { - h, err := f.HostSystem() - if err != nil { - return nil, err - } - - var mhs mo.HostSystem - err = h.Properties(context.TODO(), h.Reference(), []string{"configManager.autoStartManager"}, &mhs) - if err != nil { - return nil, err - } - - var mhas mo.HostAutoStartManager - err = h.Properties(context.TODO(), *mhs.ConfigManager.AutoStartManager, nil, &mhas) - if err != nil { - return nil, err - } - - return &mhas, nil -} - -func (f *AutostartFlag) ReconfigureDefaults(template types.AutoStartDefaults) error { - c, err := f.Client() - if err != nil { - return err - } - - mhas, err := f.HostAutoStartManager() - if err != nil { - return err - } - - req := types.ReconfigureAutostart{ - This: mhas.Reference(), - Spec: types.HostAutoStartManagerConfig{ - Defaults: &template, - }, - } - - _, err = methods.ReconfigureAutostart(context.TODO(), c, &req) - if err != nil { - return err - } - - return nil -} - -func (f *AutostartFlag) ReconfigureVMs(args []string, template types.AutoStartPowerInfo) error { - c, err := f.Client() - if err != nil { - return err - } - - mhas, err := f.HostAutoStartManager() - if err != nil { - return err - } - - req := types.ReconfigureAutostart{ - This: mhas.Reference(), - Spec: types.HostAutoStartManagerConfig{ - PowerInfo: make([]types.AutoStartPowerInfo, 0), - }, - } - - vms, err := f.VirtualMachines(args) - if err != nil { - return err - } - - for _, vm := range vms { - pi := template - pi.Key = vm.Reference() - req.Spec.PowerInfo = append(req.Spec.PowerInfo, pi) - } - - _, err = methods.ReconfigureAutostart(context.TODO(), c, &req) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/autostart/configure.go b/vendor/github.com/vmware/govmomi/govc/host/autostart/configure.go deleted file mode 100644 index 405a26ce8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/autostart/configure.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package autostart - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" -) - -type configure struct { - *AutostartFlag - - types.AutoStartDefaults -} - -func init() { - cli.Register("host.autostart.configure", &configure{}) -} - -func (cmd *configure) Register(ctx context.Context, f *flag.FlagSet) { - cmd.AutostartFlag, ctx = newAutostartFlag(ctx) - cmd.AutostartFlag.Register(ctx, f) - - f.Var(flags.NewOptionalBool(&cmd.Enabled), "enabled", "") - f.IntVar(&cmd.StartDelay, "start-delay", 0, "") - f.StringVar(&cmd.StopAction, "stop-action", "", "") - f.IntVar(&cmd.StopDelay, "stop-delay", 0, "") - f.Var(flags.NewOptionalBool(&cmd.WaitForHeartbeat), "wait-for-heartbeat", "") -} - -func (cmd *configure) Process(ctx context.Context) error { - if err := cmd.AutostartFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *configure) Usage() string { - return "" -} - -func (cmd *configure) Run(ctx context.Context, f *flag.FlagSet) error { - return cmd.ReconfigureDefaults(cmd.AutoStartDefaults) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/autostart/info.go b/vendor/github.com/vmware/govmomi/govc/host/autostart/info.go deleted file mode 100644 index 33bd9ec89..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/autostart/info.go +++ /dev/null @@ -1,143 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package autostart - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type info struct { - cli.Command - - *AutostartFlag - *flags.OutputFlag -} - -func init() { - cli.Register("host.autostart.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.AutostartFlag, ctx = newAutostartFlag(ctx) - cmd.AutostartFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.AutostartFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Usage() string { - return "" -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - mhas, err := cmd.HostAutoStartManager() - if err != nil { - return err - } - - return cmd.WriteResult(&infoResult{client, mhas}) -} - -type infoResult struct { - client *vim25.Client - mhas *mo.HostAutoStartManager -} - -func (r *infoResult) MarshalJSON() ([]byte, error) { - return json.Marshal(r.mhas) -} - -// vmPaths resolves the paths for the VMs in the result. -func (r *infoResult) vmPaths() (map[string]string, error) { - paths := make(map[string]string) - for _, info := range r.mhas.Config.PowerInfo { - mes, err := mo.Ancestors(context.TODO(), r.client, r.client.ServiceContent.PropertyCollector, info.Key) - if err != nil { - return nil, err - } - - path := "" - for _, me := range mes { - // Skip root entity in building inventory path. - if me.Parent == nil { - continue - } - path += "/" + me.Name - } - - paths[info.Key.Value] = path - } - - return paths, nil -} - -func (r *infoResult) Write(w io.Writer) error { - paths, err := r.vmPaths() - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "VM") - fmt.Fprintf(tw, "\tStartAction") - fmt.Fprintf(tw, "\tStartDelay") - fmt.Fprintf(tw, "\tStartOrder") - fmt.Fprintf(tw, "\tStopAction") - fmt.Fprintf(tw, "\tStopDelay") - fmt.Fprintf(tw, "\tWaitForHeartbeat") - fmt.Fprintf(tw, "\n") - - for _, info := range r.mhas.Config.PowerInfo { - fmt.Fprintf(tw, "%s", paths[info.Key.Value]) - fmt.Fprintf(tw, "\t%s", info.StartAction) - fmt.Fprintf(tw, "\t%d", info.StartDelay) - fmt.Fprintf(tw, "\t%d", info.StartOrder) - fmt.Fprintf(tw, "\t%s", info.StopAction) - fmt.Fprintf(tw, "\t%d", info.StopDelay) - fmt.Fprintf(tw, "\t%s", info.WaitForHeartbeat) - fmt.Fprintf(tw, "\n") - } - - _ = tw.Flush() - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/autostart/remove.go b/vendor/github.com/vmware/govmomi/govc/host/autostart/remove.go deleted file mode 100644 index b41d5ec11..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/autostart/remove.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package autostart - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/vim25/types" -) - -type remove struct { - *AutostartFlag -} - -func init() { - cli.Register("host.autostart.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.AutostartFlag, ctx = newAutostartFlag(ctx) - cmd.AutostartFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.AutostartFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "VM..." -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - var powerInfo = types.AutoStartPowerInfo{ - StartAction: "none", - StartDelay: -1, - StartOrder: -1, - StopAction: "none", - StopDelay: -1, - WaitForHeartbeat: types.AutoStartWaitHeartbeatSettingSystemDefault, - } - - return cmd.ReconfigureVMs(f.Args(), powerInfo) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/disconnect.go b/vendor/github.com/vmware/govmomi/govc/host/disconnect.go deleted file mode 100644 index 6c8ed9b80..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/disconnect.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package host - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" -) - -type disconnect struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.disconnect", &disconnect{}) -} - -func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *disconnect) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *disconnect) Description() string { - return `Disconnect host from vCenter and instruct the host to stop sending heartbeats.` -} - -func (cmd *disconnect) Disconnect(ctx context.Context, host *object.HostSystem) error { - task, err := host.Disconnect(ctx) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("%s disconnecting... ", host.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *disconnect) Run(ctx context.Context, f *flag.FlagSet) error { - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - for _, host := range hosts { - err = cmd.Disconnect(ctx, host) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go deleted file mode 100644 index c36e89a40..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package esxcli - -import ( - "flag" - "fmt" - "strings" - - "github.com/vmware/govmomi/vim25/types" -) - -type Command struct { - name []string - args []string -} - -type CommandInfoItem struct { - Name string `xml:"name"` - DisplayName string `xml:"displayName"` - Help string `xml:"help"` -} - -type CommandInfoParam struct { - CommandInfoItem - Aliases []string `xml:"aliases"` - Flag bool `xml:"flag"` -} - -type CommandInfoHint struct { - Key string `xml:"key"` - Value string `xml:"value"` -} - -type CommandInfoHints []CommandInfoHint - -type CommandInfoMethod struct { - CommandInfoItem - Param []CommandInfoParam `xml:"param"` - Hints CommandInfoHints `xml:"hints"` -} - -type CommandInfo struct { - CommandInfoItem - Method []*CommandInfoMethod `xml:"method"` -} - -func NewCommand(args []string) *Command { - c := &Command{} - - for i, arg := range args { - if strings.HasPrefix(arg, "-") { - c.args = args[i:] - break - } else { - c.name = append(c.name, arg) - } - } - - return c -} - -func (c *Command) Namespace() string { - return strings.Join(c.name[:len(c.name)-1], ".") -} - -func (c *Command) Name() string { - return c.name[len(c.name)-1] -} - -func (c *Command) Method() string { - return "vim.EsxCLI." + strings.Join(c.name, ".") -} - -func (c *Command) Moid() string { - return "ha-cli-handler-" + strings.Join(c.name[:len(c.name)-1], "-") -} - -// Parse generates a flag.FlagSet based on the given []CommandInfoParam and -// returns arguments for use with methods.ExecuteSoap -func (c *Command) Parse(params []CommandInfoParam) ([]types.ReflectManagedMethodExecuterSoapArgument, error) { - flags := flag.NewFlagSet(strings.Join(c.name, " "), flag.ExitOnError) - vals := make([]string, len(params)) - - for i, p := range params { - v := &vals[i] - for _, a := range p.Aliases { - a = strings.TrimPrefix(a[1:], "-") - flags.StringVar(v, a, "", p.Help) - } - } - - err := flags.Parse(c.args) - if err != nil { - return nil, err - } - - args := []types.ReflectManagedMethodExecuterSoapArgument{} - - for i, p := range params { - if vals[i] == "" { - continue - } - args = append(args, c.Argument(p.Name, vals[i])) - } - - return args, nil -} - -func (c *Command) Argument(name string, val string) types.ReflectManagedMethodExecuterSoapArgument { - return types.ReflectManagedMethodExecuterSoapArgument{ - Name: name, - Val: fmt.Sprintf("<%s>%s", name, val, name), - } -} - -func (h CommandInfoHints) Formatter() string { - for _, hint := range h { - if hint.Key == "formatter" { - return hint.Value - } - } - - return "simple" -} - -func (h CommandInfoHints) Fields() []string { - for _, hint := range h { - if strings.HasPrefix(hint.Key, "fields:") { - return strings.Split(hint.Value, ",") - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go deleted file mode 100644 index 010d3b885..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package esxcli - -import ( - "flag" - "fmt" - "os" - "sort" - "strings" - "text/tabwriter" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" -) - -type esxcli struct { - *flags.HostSystemFlag - - hints bool -} - -func init() { - cli.Register("host.esxcli", &esxcli{}) -} - -func (cmd *esxcli) Usage() string { - return "COMMAND [ARG]..." -} - -func (cmd *esxcli) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.BoolVar(&cmd.hints, "hints", true, "Use command info hints when formatting output") -} - -func (cmd *esxcli) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *esxcli) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return nil - } - - host, err := cmd.HostSystem() - if err != nil { - return err - } - - e, err := NewExecutor(c, host) - if err != nil { - return err - } - - res, err := e.Run(f.Args()) - if err != nil { - return err - } - - if len(res.Values) == 0 { - return nil - } - - var formatType string - if cmd.hints { - formatType = res.Info.Hints.Formatter() - } - - // TODO: OutputFlag / format options - switch formatType { - case "table": - cmd.formatTable(res) - default: - cmd.formatSimple(res) - } - - return nil -} - -func (cmd *esxcli) formatSimple(res *Response) { - var keys []string - for key := range res.Values[0] { - keys = append(keys, key) - } - sort.Strings(keys) - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for i, rv := range res.Values { - if i > 0 { - fmt.Fprintln(tw) - _ = tw.Flush() - } - for _, key := range keys { - fmt.Fprintf(tw, "%s:\t%s\n", key, strings.Join(rv[key], ", ")) - } - } - - _ = tw.Flush() -} - -func (cmd *esxcli) formatTable(res *Response) { - fields := res.Info.Hints.Fields() - - tw := tabwriter.NewWriter(os.Stdout, len(fields), 0, 2, ' ', 0) - - var hr []string - for _, name := range fields { - hr = append(hr, strings.Repeat("-", len(name))) - } - - fmt.Fprintln(tw, strings.Join(fields, "\t")) - fmt.Fprintln(tw, strings.Join(hr, "\t")) - - for _, vals := range res.Values { - var row []string - - for _, name := range fields { - key := strings.Replace(name, " ", "", -1) - if val, ok := vals[key]; ok { - row = append(row, strings.Join(val, ", ")) - } else { - row = append(row, "") - } - } - - fmt.Fprintln(tw, strings.Join(row, "\t")) - } - - _ = tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/executor.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/executor.go deleted file mode 100644 index 055791056..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/executor.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package esxcli - -import ( - "errors" - "fmt" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "github.com/vmware/govmomi/vim25/xml" - "golang.org/x/net/context" -) - -type Executor struct { - c *vim25.Client - host *object.HostSystem - mme *types.ReflectManagedMethodExecuter - dtm *types.InternalDynamicTypeManager - info map[string]*CommandInfo -} - -func NewExecutor(c *vim25.Client, host *object.HostSystem) (*Executor, error) { - e := &Executor{ - c: c, - host: host, - info: make(map[string]*CommandInfo), - } - - { - req := types.RetrieveManagedMethodExecuter{ - This: host.Reference(), - } - - res, err := methods.RetrieveManagedMethodExecuter(context.TODO(), c, &req) - if err != nil { - return nil, err - } - - e.mme = res.Returnval - } - - { - req := types.RetrieveDynamicTypeManager{ - This: host.Reference(), - } - - res, err := methods.RetrieveDynamicTypeManager(context.TODO(), c, &req) - if err != nil { - return nil, err - } - - e.dtm = res.Returnval - } - - return e, nil -} - -func (e *Executor) CommandInfo(c *Command) (*CommandInfoMethod, error) { - ns := c.Namespace() - var info *CommandInfo - var ok bool - - if info, ok = e.info[ns]; !ok { - req := types.ExecuteSoap{ - Moid: "ha-dynamic-type-manager-local-cli-cliinfo", - Method: "vim.CLIInfo.FetchCLIInfo", - Argument: []types.ReflectManagedMethodExecuterSoapArgument{ - c.Argument("typeName", "vim.EsxCLI."+ns), - }, - } - - info = new(CommandInfo) - if err := e.Execute(&req, info); err != nil { - return nil, err - } - - e.info[ns] = info - } - - name := c.Name() - for _, method := range info.Method { - if method.Name == name { - return method, nil - } - } - - return nil, fmt.Errorf("method '%s' not found in name space '%s'", name, c.Namespace()) -} - -func (e *Executor) NewRequest(args []string) (*types.ExecuteSoap, *CommandInfoMethod, error) { - c := NewCommand(args) - - info, err := e.CommandInfo(c) - if err != nil { - return nil, nil, err - } - - sargs, err := c.Parse(info.Param) - if err != nil { - return nil, nil, err - } - - sreq := types.ExecuteSoap{ - Moid: c.Moid(), - Method: c.Method(), - Argument: sargs, - } - - return &sreq, info, nil -} - -func (e *Executor) Execute(req *types.ExecuteSoap, res interface{}) error { - req.This = e.mme.ManagedObjectReference - req.Version = "urn:vim25/5.0" - - x, err := methods.ExecuteSoap(context.TODO(), e.c, req) - if err != nil { - return err - } - - if x.Returnval != nil { - if x.Returnval.Fault != nil { - return errors.New(x.Returnval.Fault.FaultMsg) - } - - if err := xml.Unmarshal([]byte(x.Returnval.Response), res); err != nil { - return err - } - } - - return nil -} - -func (e *Executor) Run(args []string) (*Response, error) { - req, info, err := e.NewRequest(args) - if err != nil { - return nil, err - } - - res := &Response{ - Info: info, - } - - if err := e.Execute(req, res); err != nil { - return nil, err - } - - return res, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go deleted file mode 100644 index ee4477a2f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package esxcli - -import "github.com/vmware/govmomi/object" - -type FirewallInfo struct { - Loaded bool - Enabled bool - DefaultAction string -} - -// GetFirewallInfo via 'esxcli network firewall get' -// The HostFirewallSystem type does not expose this data. -// This helper can be useful in particular to determine if the firewall is enabled or disabled. -func GetFirewallInfo(s *object.HostSystem) (*FirewallInfo, error) { - x, err := NewExecutor(s.Client(), s) - - res, err := x.Run([]string{"network", "firewall", "get"}) - if err != nil { - return nil, err - } - - info := &FirewallInfo{ - Loaded: res.Values[0]["Loaded"][0] == "true", - Enabled: res.Values[0]["Enabled"][0] == "true", - DefaultAction: res.Values[0]["DefaultAction"][0], - } - - return info, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml b/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml deleted file mode 100644 index 087144974..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - foo - VM Network - dougm - 2 - 98842 - - - bar - VM Network - 1 - 236235 - - diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml b/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml deleted file mode 100644 index b9e3474a7..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - 192.168.247.149 - 00:0c:29:12:b2:cf - 33554438 - VM Network - vmnic0 - 33554434 - vSwitch0 - - diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml b/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml deleted file mode 100644 index 9c1e9462f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml +++ /dev/null @@ -1,5 +0,0 @@ - - localdomain - esxbox.localdomain - esxbox - diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go deleted file mode 100644 index 566979338..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package esxcli - -import ( - "strings" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type hostInfo struct { - *Executor - wids map[string]string -} - -type GuestInfo struct { - c *vim25.Client - hosts map[string]*hostInfo -} - -func NewGuestInfo(c *vim25.Client) *GuestInfo { - return &GuestInfo{ - c: c, - hosts: make(map[string]*hostInfo), - } -} - -func (g *GuestInfo) hostInfo(ref *types.ManagedObjectReference) (*hostInfo, error) { - // cache exectuor and uuid -> worldid map - if h, ok := g.hosts[ref.Value]; ok { - return h, nil - } - - host := object.NewHostSystem(g.c, *ref) - - e, err := NewExecutor(g.c, host) - if err != nil { - return nil, err - } - - res, err := e.Run([]string{"vm", "process", "list"}) - if err != nil { - return nil, err - } - - ids := make(map[string]string, len(res.Values)) - - for _, process := range res.Values { - // Normalize uuid, esxcli and mo.VirtualMachine have different formats - uuid := strings.Replace(process["UUID"][0], " ", "", -1) - uuid = strings.Replace(uuid, "-", "", -1) - - ids[uuid] = process["WorldID"][0] - } - - h := &hostInfo{e, ids} - g.hosts[ref.Value] = h - - return h, nil -} - -// IpAddress attempts to find the guest IP address using esxcli. -// ESX hosts must be configured with the /Net/GuestIPHack enabled. -// For example: -// $ govc host.esxcli -- system settings advanced set -o /Net/GuestIPHack -i 1 -func (g *GuestInfo) IpAddress(vm *object.VirtualMachine) (string, error) { - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(g.c) - err := pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"runtime.host", "config.uuid"}, &mvm) - if err != nil { - return "", err - } - - h, err := g.hostInfo(mvm.Runtime.Host) - if err != nil { - return "", err - } - - // Normalize uuid, esxcli and mo.VirtualMachine have different formats - uuid := strings.Replace(mvm.Config.Uuid, "-", "", -1) - - if wid, ok := h.wids[uuid]; ok { - res, err := h.Run([]string{"network", "vm", "port", "list", "--world-id", wid}) - if err != nil { - return "", err - } - - if len(res.Values) == 1 { - if ip, ok := res.Values[0]["IPAddress"]; ok { - return ip[0], nil - } - } - } - - return "", nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/response.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/response.go deleted file mode 100644 index 2957748c6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/response.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ -package esxcli - -import ( - "io" - - "github.com/vmware/govmomi/vim25/xml" -) - -type Values map[string][]string - -type Response struct { - Info *CommandInfoMethod - Values []Values -} - -func (v Values) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - for { - t, err := d.Token() - if err != nil { - if err == io.EOF { - return nil - } - return err - } - - if s, ok := t.(xml.StartElement); ok { - t, err = d.Token() - if err != nil { - return err - } - - key := s.Name.Local - var val string - if c, ok := t.(xml.CharData); ok { - val = string(c) - } - v[key] = append(v[key], val) - } - } -} - -func (r *Response) Type(start xml.StartElement) string { - for _, a := range start.Attr { - if a.Name.Local == "type" { - return a.Value - } - } - return "" -} - -func (r *Response) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - stype := r.Type(start) - - if stype != "ArrayOfDataObject" { - v := Values{} - if err := d.DecodeElement(&v, &start); err != nil { - return err - } - r.Values = append(r.Values, v) - return nil - } - - for { - t, err := d.Token() - if err != nil { - if err == io.EOF { - return nil - } - return err - } - - if s, ok := t.(xml.StartElement); ok { - if s.Name.Local == "DataObject" { - v := Values{} - if err := d.DecodeElement(&v, &s); err != nil { - return err - } - r.Values = append(r.Values, v) - } - } - } -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/firewall/find.go b/vendor/github.com/vmware/govmomi/govc/host/firewall/find.go deleted file mode 100644 index fd649fbd2..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/firewall/find.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package firewall - -import ( - "flag" - "fmt" - "os" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/govc/host/esxcli" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type find struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.HostSystemFlag - - enabled bool - check bool - - types.HostFirewallRule -} - -func init() { - cli.Register("firewall.ruleset.find", &find{}) -} - -func (cmd *find) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.BoolVar(&cmd.check, "c", true, "Check if esx firewall is enabled") - f.BoolVar(&cmd.enabled, "enabled", true, "Find enabled rule sets if true, disabled if false") - f.StringVar((*string)(&cmd.Direction), "direction", string(types.HostFirewallRuleDirectionOutbound), "Direction") - f.StringVar((*string)(&cmd.PortType), "type", string(types.HostFirewallRulePortTypeDst), "Port type") - f.StringVar((*string)(&cmd.Protocol), "proto", string(types.HostFirewallRuleProtocolTcp), "Protocol") - f.IntVar(&cmd.Port, "port", 0, "Port") -} - -func (cmd *find) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *find) Description() string { - return `Find firewall rulesets matching the given rule. - -For a complete list of rulesets: govc host.esxcli network firewall ruleset list -For a complete list of rules: govc host.esxcli network firewall ruleset rule list` -} - -func (cmd *find) Run(ctx context.Context, f *flag.FlagSet) error { - host, err := cmd.HostSystem() - if err != nil { - return err - } - - fs, err := host.ConfigManager().FirewallSystem(ctx) - if err != nil { - return err - } - - if cmd.check { - esxfw, err := esxcli.GetFirewallInfo(host) - if err != nil { - return err - } - - if !esxfw.Enabled { - fmt.Fprintln(os.Stderr, "host firewall is disabled") - } - } - - info, err := fs.Info(ctx) - if err != nil { - return err - } - - if f.NArg() != 0 { - // TODO: f.Args() -> types.HostFirewallRulesetIpList - return flag.ErrHelp - } - - rs := object.HostFirewallRulesetList(info.Ruleset) - matched, err := rs.EnabledByRule(cmd.HostFirewallRule, cmd.enabled) - - if err != nil { - return err - } - - for _, r := range matched { - fmt.Println(r.Key) - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/info.go b/vendor/github.com/vmware/govmomi/govc/host/info.go deleted file mode 100644 index 956791f3e..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/info.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package host - -import ( - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - var res infoResult - var props []string - - if cmd.OutputFlag.JSON { - props = nil // Load everything - } else { - props = []string{"summary"} // Load summary - } - - // We could do without the -host flag, leaving it for compat - host, err := cmd.HostSystemIfSpecified() - if err != nil { - return err - } - - // Default only if there is a single host - if host == nil && f.NArg() == 0 { - host, err = cmd.HostSystem() - if err != nil { - return err - } - } - - if host != nil { - res.objects = append(res.objects, host) - } else { - res.objects, err = cmd.HostSystems(f.Args()) - if err != nil { - return err - } - } - - if len(res.objects) != 0 { - refs := make([]types.ManagedObjectReference, 0, len(res.objects)) - for _, o := range res.objects { - refs = append(refs, o.Reference()) - } - - pc := property.DefaultCollector(c) - err = pc.Retrieve(ctx, refs, props, &res.HostSystems) - if err != nil { - return err - } - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - HostSystems []mo.HostSystem - objects []*object.HostSystem -} - -func (r *infoResult) Write(w io.Writer) error { - // Maintain order via r.objects as Property collector does not always return results in order. - objects := make(map[types.ManagedObjectReference]mo.HostSystem, len(r.HostSystems)) - for _, o := range r.HostSystems { - objects[o.Reference()] = o - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, o := range r.objects { - host := objects[o.Reference()] - s := host.Summary - h := s.Hardware - z := s.QuickStats - ncpu := int(h.NumCpuPkgs * h.NumCpuCores) - cpuUsage := 100 * float64(z.OverallCpuUsage) / float64(ncpu*h.CpuMhz) - memUsage := 100 * float64(z.OverallMemoryUsage<<20) / float64(h.MemorySize) - - fmt.Fprintf(tw, "Name:\t%s\n", s.Config.Name) - fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) - fmt.Fprintf(tw, " Manufacturer:\t%s\n", h.Vendor) - fmt.Fprintf(tw, " Logical CPUs:\t%d CPUs @ %dMHz\n", ncpu, h.CpuMhz) - fmt.Fprintf(tw, " Processor type:\t%s\n", h.CpuModel) - fmt.Fprintf(tw, " CPU usage:\t%d MHz (%.1f%%)\n", z.OverallCpuUsage, cpuUsage) - fmt.Fprintf(tw, " Memory:\t%dMB\n", h.MemorySize/(1024*1024)) - fmt.Fprintf(tw, " Memory usage:\t%d MB (%.1f%%)\n", z.OverallMemoryUsage, memUsage) - fmt.Fprintf(tw, " Boot time:\t%s\n", s.Runtime.BootTime) - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/maintenance/enter.go b/vendor/github.com/vmware/govmomi/govc/host/maintenance/enter.go deleted file mode 100644 index 16405fdf6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/maintenance/enter.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package maintenancec - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" -) - -type enter struct { - *flags.HostSystemFlag - - timeout int - evacuate bool -} - -func init() { - cli.Register("host.maintenance.enter", &enter{}) -} - -func (cmd *enter) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.IntVar(&cmd.timeout, "timeout", 0, "Timeout") - f.BoolVar(&cmd.evacuate, "evacuate", false, "Evacuate powered off VMs") -} - -func (cmd *enter) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *enter) Usage() string { - return "HOST..." -} - -func (cmd *enter) Description() string { - return `Put the hosts in maintenance mode. - -While this task is running and when the host is in maintenance mode, -no virtual machines can be powered on and no provisioning operations can be performed on the host.` -} - -func (cmd *enter) EnterMaintenanceMode(ctx context.Context, host *object.HostSystem) error { - task, err := host.EnterMaintenanceMode(ctx, cmd.timeout, cmd.evacuate, nil) // TODO: spec param - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("%s entering maintenance mode... ", host.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *enter) Run(ctx context.Context, f *flag.FlagSet) error { - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - for _, host := range hosts { - err = cmd.EnterMaintenanceMode(ctx, host) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/maintenance/exit.go b/vendor/github.com/vmware/govmomi/govc/host/maintenance/exit.go deleted file mode 100644 index ff51cb6f2..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/maintenance/exit.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package maintenancec - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" -) - -type exit struct { - *flags.HostSystemFlag - - timeout int -} - -func init() { - cli.Register("host.maintenance.exit", &exit{}) -} - -func (cmd *exit) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.IntVar(&cmd.timeout, "timeout", 0, "Timeout") -} - -func (cmd *exit) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *exit) Usage() string { - return "HOST..." -} - -func (cmd *exit) Description() string { - return `Take hosts out of maintenance mode. - -This blocks if any concurrent running maintenance-only host configurations operations are being performed. -For example, if VMFS volumes are being upgraded. - -The 'timeout' flag is the number of seconds to wait for the exit maintenance mode to succeed. -If the timeout is less than or equal to zero, there is no timeout.` -} - -func (cmd *exit) ExitMaintenanceMode(ctx context.Context, host *object.HostSystem) error { - task, err := host.ExitMaintenanceMode(ctx, cmd.timeout) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("%s exiting maintenance mode... ", host.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *exit) Run(ctx context.Context, f *flag.FlagSet) error { - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - for _, host := range hosts { - err = cmd.ExitMaintenanceMode(ctx, host) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/portgroup/add.go b/vendor/github.com/vmware/govmomi/govc/host/portgroup/add.go deleted file mode 100644 index f1cb86378..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/portgroup/add.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package portgroup - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.HostSystemFlag - - spec types.HostPortGroupSpec -} - -func init() { - cli.Register("host.portgroup.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.StringVar(&cmd.spec.VswitchName, "vswitch", "", "vSwitch Name") - f.IntVar(&cmd.spec.VlanId, "vlan", 0, "VLAN ID") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Usage() string { - return "NAME" -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - cmd.spec.Name = f.Arg(0) - - return ns.AddPortGroup(context.TODO(), cmd.spec) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/portgroup/remove.go b/vendor/github.com/vmware/govmomi/govc/host/portgroup/remove.go deleted file mode 100644 index 174455ae5..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/portgroup/remove.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package portgroup - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type remove struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.portgroup.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "NAME" -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - return ns.RemovePortGroup(context.TODO(), f.Arg(0)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/reconnect.go b/vendor/github.com/vmware/govmomi/govc/host/reconnect.go deleted file mode 100644 index 26f0c3225..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/reconnect.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package host - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type reconnect struct { - *flags.HostSystemFlag - *flags.HostConnectFlag - - types.HostSystemReconnectSpec -} - -func init() { - cli.Register("host.reconnect", &reconnect{}) -} - -func (cmd *reconnect) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - cmd.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) - cmd.HostConnectFlag.Register(ctx, f) - - cmd.HostSystemReconnectSpec.SyncState = types.NewBool(false) - f.BoolVar(cmd.HostSystemReconnectSpec.SyncState, "sync-state", false, "Sync state") -} - -func (cmd *reconnect) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostConnectFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *reconnect) Description() string { - return `Reconnect host to vCenter. - -This command can also be used to change connection properties (hostname, fingerprint, username, password), -without disconnecting the host.` -} - -func (cmd *reconnect) Reconnect(ctx context.Context, host *object.HostSystem) error { - task, err := host.Reconnect(ctx, &cmd.HostConnectSpec, &cmd.HostSystemReconnectSpec) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("%s reconnecting... ", host.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *reconnect) Run(ctx context.Context, f *flag.FlagSet) error { - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - for _, host := range hosts { - err = cmd.Reconnect(ctx, host) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/remove.go b/vendor/github.com/vmware/govmomi/govc/host/remove.go deleted file mode 100644 index c9235e0fb..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/remove.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package host - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" -) - -type remove struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "HOST..." -} - -func (cmd *remove) Description() string { - return `Remove hosts from vCenter.` -} - -func (cmd *remove) Remove(ctx context.Context, host *object.HostSystem) error { - var h mo.HostSystem - err := host.Properties(ctx, host.Reference(), []string{"parent"}, &h) - if err != nil { - return err - } - - remove := host.Destroy - - if h.Parent.Type == "ComputeResource" { - // Standalone host. From the docs: - // "Invoking remove on a HostSystem of standalone type throws a NotSupported fault. - // A standalone HostSystem can be removeed only by invoking remove on its parent ComputeResource." - remove = object.NewComputeResource(host.Client(), *h.Parent).Destroy - } - - task, err := remove(ctx) - if err != nil { - return err - } - - logger := cmd.ProgressLogger(fmt.Sprintf("%s removing... ", host.InventoryPath)) - defer logger.Wait() - - _, err = task.WaitForResult(ctx, logger) - return err -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - hosts, err := cmd.HostSystems(f.Args()) - if err != nil { - return err - } - - for _, host := range hosts { - err = cmd.Remove(ctx, host) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/storage/info.go b/vendor/github.com/vmware/govmomi/govc/host/storage/info.go deleted file mode 100644 index 9d132399d..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/storage/info.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package storage - -import ( - "flag" - "fmt" - "io" - "strings" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -var infoTypes = []string{"hba", "lun"} - -type infoType string - -func (t *infoType) Set(s string) error { - s = strings.ToLower(s) - - for _, e := range infoTypes { - if s == e { - *t = infoType(s) - return nil - } - } - - return fmt.Errorf("invalid type") -} - -func (t *infoType) String() string { - return string(*t) -} - -func (t *infoType) Result(hss mo.HostStorageSystem) flags.OutputWriter { - switch string(*t) { - case "hba": - return hbaResult(hss) - case "lun": - return lunResult(hss) - default: - panic("unsupported") - } -} - -type info struct { - *flags.HostSystemFlag - *flags.OutputFlag - - typ infoType -} - -func init() { - cli.Register("host.storage.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - err := cmd.typ.Set("lun") - if err != nil { - panic(err) - } - - f.Var(&cmd.typ, "t", fmt.Sprintf("Type (%s)", strings.Join(infoTypes, ","))) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Usage() string { - return "[-t TYPE]" -} - -func (cmd *info) Description() string { - return `Show information about a host's storage system.` -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - host, err := cmd.HostSystem() - if err != nil { - return err - } - - ss, err := host.ConfigManager().StorageSystem(ctx) - if err != nil { - return err - } - - var hss mo.HostStorageSystem - err = ss.Properties(ctx, ss.Reference(), nil, &hss) - if err != nil { - return nil - } - - return cmd.WriteResult(cmd.typ.Result(hss)) -} - -type hbaResult mo.HostStorageSystem - -func (r hbaResult) Write(w io.Writer) error { - tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "Device\t") - fmt.Fprintf(tw, "PCI\t") - fmt.Fprintf(tw, "Driver\t") - fmt.Fprintf(tw, "Status\t") - fmt.Fprintf(tw, "Model\t") - fmt.Fprintf(tw, "\n") - - for _, e := range r.StorageDeviceInfo.HostBusAdapter { - hba := e.GetHostHostBusAdapter() - - fmt.Fprintf(tw, "%s\t", hba.Device) - fmt.Fprintf(tw, "%s\t", hba.Pci) - fmt.Fprintf(tw, "%s\t", hba.Driver) - fmt.Fprintf(tw, "%s\t", hba.Status) - fmt.Fprintf(tw, "%s\t", hba.Model) - fmt.Fprintf(tw, "\n") - } - - return tw.Flush() -} - -type lunResult mo.HostStorageSystem - -func (r lunResult) Write(w io.Writer) error { - tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "Name\t") - fmt.Fprintf(tw, "Type\t") - fmt.Fprintf(tw, "Capacity\t") - fmt.Fprintf(tw, "Model\t") - fmt.Fprintf(tw, "\n") - - for _, e := range r.StorageDeviceInfo.ScsiLun { - var capacity int64 - - lun := e.GetScsiLun() - if disk, ok := e.(*types.HostScsiDisk); ok { - capacity = int64(disk.Capacity.Block) * int64(disk.Capacity.BlockSize) - } - - fmt.Fprintf(tw, "%s\t", lun.DeviceName) - fmt.Fprintf(tw, "%s\t", lun.DeviceType) - - if capacity == 0 { - fmt.Fprintf(tw, "-\t") - } else { - fmt.Fprintf(tw, "%s\t", units.ByteSize(capacity)) - } - - fmt.Fprintf(tw, "%s\t", lun.Model) - fmt.Fprintf(tw, "\n") - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/storage/partition.go b/vendor/github.com/vmware/govmomi/govc/host/storage/partition.go deleted file mode 100644 index 5e3d4d5d7..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/storage/partition.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package storage - -import ( - "flag" - "fmt" - "io" - "text/tabwriter" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" -) - -type partition struct { - *flags.HostSystemFlag - *flags.OutputFlag -} - -func init() { - cli.Register("host.storage.partition", &partition{}) -} - -func (cmd *partition) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) -} - -func (cmd *partition) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *partition) Usage() string { - return "DEVICE_PATH" -} - -func (cmd *partition) Description() string { - return `Show partition table for device at DEVICE_PATH.` -} - -func (cmd *partition) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() != 1 { - return fmt.Errorf("specify device path") - } - - path := f.Args()[0] - - host, err := cmd.HostSystem() - if err != nil { - return err - } - - ss, err := host.ConfigManager().StorageSystem(ctx) - if err != nil { - return err - } - - var hss mo.HostStorageSystem - err = ss.Properties(ctx, ss.Reference(), nil, &hss) - if err != nil { - return nil - } - - info, err := ss.RetrieveDiskPartitionInfo(ctx, path) - if err != nil { - return err - } - - return cmd.WriteResult(partitionInfo(*info)) -} - -type partitionInfo types.HostDiskPartitionInfo - -func (p partitionInfo) Write(w io.Writer) error { - tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "Table format: %s\n", p.Spec.PartitionFormat) - fmt.Fprintf(tw, "Number of sectors: %d\n", p.Spec.TotalSectors) - fmt.Fprintf(tw, "\n") - - fmt.Fprintf(tw, "Number\t") - fmt.Fprintf(tw, "Start\t") - fmt.Fprintf(tw, "End\t") - fmt.Fprintf(tw, "Size\t") - fmt.Fprintf(tw, "Type\t") - fmt.Fprintf(tw, "\n") - - for _, e := range p.Spec.Partition { - sectors := e.EndSector - e.StartSector - - fmt.Fprintf(tw, "%d\t", e.Partition) - fmt.Fprintf(tw, "%d\t", e.StartSector) - fmt.Fprintf(tw, "%d\t", e.EndSector) - fmt.Fprintf(tw, "%s\t", units.ByteSize(sectors*512)) - fmt.Fprintf(tw, "%s\t", e.Type) - fmt.Fprintf(tw, "\n") - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/vnic/info.go b/vendor/github.com/vmware/govmomi/govc/host/vnic/info.go deleted file mode 100644 index 7631b64ee..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/vnic/info.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vnic - -import ( - "flag" - "fmt" - "os" - "strings" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.vnic.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - host, err := cmd.HostSystem() - if err != nil { - return err - } - - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - var mns mo.HostNetworkSystem - - m, err := host.ConfigManager().VirtualNicManager(ctx) - if err != nil { - return err - } - - info, err := m.Info(ctx) - if err != nil { - return err - } - - err = ns.Properties(ctx, ns.Reference(), []string{"networkInfo"}, &mns) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - type dnet struct { - dvp mo.DistributedVirtualPortgroup - dvs mo.VmwareDistributedVirtualSwitch - } - - dnets := make(map[string]*dnet) - - for _, nic := range mns.NetworkInfo.Vnic { - fmt.Fprintf(tw, "Device:\t%s\n", nic.Device) - - if dvp := nic.Spec.DistributedVirtualPort; dvp != nil { - dn, ok := dnets[dvp.PortgroupKey] - - if !ok { - dn = new(dnet) - o := object.NewDistributedVirtualPortgroup(host.Client(), types.ManagedObjectReference{ - Type: "DistributedVirtualPortgroup", - Value: dvp.PortgroupKey, - }) - - err = o.Properties(ctx, o.Reference(), []string{"name", "config.distributedVirtualSwitch"}, &dn.dvp) - if err != nil { - return err - } - - err = o.Properties(ctx, *dn.dvp.Config.DistributedVirtualSwitch, []string{"name"}, &dn.dvs) - if err != nil { - return err - } - - dnets[dvp.PortgroupKey] = dn - } - - fmt.Fprintf(tw, "Network label:\t%s\n", dn.dvp.Name) - fmt.Fprintf(tw, "Switch:\t%s\n", dn.dvs.Name) - } else { - fmt.Fprintf(tw, "Network label:\t%s\n", nic.Portgroup) - for _, pg := range mns.NetworkInfo.Portgroup { - if pg.Spec.Name == nic.Portgroup { - fmt.Fprintf(tw, "Switch:\t%s\n", pg.Spec.VswitchName) - break - } - } - } - - fmt.Fprintf(tw, "IP address:\t%s\n", nic.Spec.Ip.IpAddress) - fmt.Fprintf(tw, "TCP/IP stack:\t%s\n", nic.Spec.NetStackInstanceKey) - - var services []string - for _, nc := range info.NetConfig { - for _, dev := range nc.SelectedVnic { - key := nc.NicType + "." + nic.Key - if dev == key { - services = append(services, nc.NicType) - } - } - - } - fmt.Fprintf(tw, "Enabled services:\t%s\n", strings.Join(services, ", ")) - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/vnic/service.go b/vendor/github.com/vmware/govmomi/govc/host/vnic/service.go deleted file mode 100644 index 3198974c3..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/vnic/service.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vnic - -import ( - "flag" - "fmt" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type service struct { - *flags.HostSystemFlag - - Enable bool - Disable bool -} - -func init() { - cli.Register("host.vnic.service", &service{}) -} - -func (cmd *service) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.BoolVar(&cmd.Enable, "enable", false, "Enable service") - f.BoolVar(&cmd.Disable, "disable", false, "Disable service") -} - -func (cmd *service) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - // Either may be true or none may be true. - if cmd.Enable && cmd.Disable { - return flag.ErrHelp - } - - return nil -} - -func (cmd *service) Usage() string { - return "SERVICE DEVICE" -} - -func (cmd *service) Description() string { - nicTypes := []string{ - string(types.HostVirtualNicManagerNicTypeVmotion), - string(types.HostVirtualNicManagerNicTypeFaultToleranceLogging), - string(types.HostVirtualNicManagerNicTypeVSphereReplication), - string(types.HostVirtualNicManagerNicTypeVSphereReplicationNFC), - string(types.HostVirtualNicManagerNicTypeManagement), - string(types.HostVirtualNicManagerNicTypeVsan), - string(types.HostVirtualNicManagerNicTypeVSphereProvisioning), - } - - return fmt.Sprintf(` -Enable or disable service on a virtual nic device. Example: -SERVICE [%s] DEVICE [%s]`, strings.Join(nicTypes, "|"), strings.Join([]string{"vmk0", "vmk1", "..."}, "|")) -} - -func (cmd *service) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() != 2 { - return flag.ErrHelp - } - - service := f.Arg(0) - device := f.Arg(1) - - host, err := cmd.HostSystem() - if err != nil { - return err - } - - m, err := host.ConfigManager().VirtualNicManager(ctx) - if err != nil { - return err - } - - var method func(context.Context, string, string) error - - if cmd.Enable { - method = m.SelectVnic - } else if cmd.Disable { - method = m.DeselectVnic - } - - if method == nil { - return flag.ErrHelp - } - - return method(ctx, service, device) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/vswitch/add.go b/vendor/github.com/vmware/govmomi/govc/host/vswitch/add.go deleted file mode 100644 index 0f1edd340..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/vswitch/add.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vswitch - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.HostSystemFlag - - nic string - spec types.HostVirtualSwitchSpec -} - -func init() { - cli.Register("host.vswitch.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.IntVar(&cmd.spec.NumPorts, "ports", 128, "Number of ports") - f.IntVar(&cmd.spec.Mtu, "mtu", 0, "MTU") - f.StringVar(&cmd.nic, "nic", "", "Bridge nic device") -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Usage() string { - return "NAME" -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - if cmd.nic != "" { - cmd.spec.Bridge = &types.HostVirtualSwitchBondBridge{ - NicDevice: []string{cmd.nic}, - } - } - - return ns.AddVirtualSwitch(context.TODO(), f.Arg(0), &cmd.spec) -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/vswitch/info.go b/vendor/github.com/vmware/govmomi/govc/host/vswitch/info.go deleted file mode 100644 index 589be1302..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/vswitch/info.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vswitch - -import ( - "flag" - "fmt" - "os" - "strings" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.vswitch.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - var mns mo.HostNetworkSystem - - pc := property.DefaultCollector(client) - err = pc.RetrieveOne(context.TODO(), ns.Reference(), []string{"networkInfo.vswitch"}, &mns) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for i, s := range mns.NetworkInfo.Vswitch { - if i > 0 { - fmt.Fprintln(tw) - } - fmt.Fprintf(tw, "Name:\t%s\n", s.Name) - fmt.Fprintf(tw, "Portgroup:\t%s\n", cmd.keys("key-vim.host.PortGroup-", s.Portgroup)) - fmt.Fprintf(tw, "Pnic:\t%s\n", cmd.keys("key-vim.host.PhysicalNic-", s.Pnic)) - fmt.Fprintf(tw, "MTU:\t%d\n", s.Mtu) - fmt.Fprintf(tw, "Ports:\t%d\n", s.NumPorts) - fmt.Fprintf(tw, "Ports Available:\t%d\n", s.NumPortsAvailable) - } - - return tw.Flush() -} - -func (cmd *info) keys(key string, vals []string) string { - for i, val := range vals { - vals[i] = strings.TrimPrefix(val, key) - } - return strings.Join(vals, ", ") -} diff --git a/vendor/github.com/vmware/govmomi/govc/host/vswitch/remove.go b/vendor/github.com/vmware/govmomi/govc/host/vswitch/remove.go deleted file mode 100644 index c5660d322..000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/vswitch/remove.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vswitch - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type remove struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.vswitch.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "NAME" -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - return ns.RemoveVirtualSwitch(context.TODO(), f.Arg(0)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/archive.go b/vendor/github.com/vmware/govmomi/govc/importx/archive.go deleted file mode 100644 index 92722549c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/archive.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "archive/tar" - "flag" - "fmt" - "io" - "io/ioutil" - "os" - "path" - "path/filepath" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/ovf" -) - -// ArchiveFlag doesn't register any flags; -// only encapsulates some common archive related functionality. -type ArchiveFlag struct { - Archive -} - -func newArchiveFlag(ctx context.Context) (*ArchiveFlag, context.Context) { - return &ArchiveFlag{}, ctx -} - -func (f *ArchiveFlag) Register(ctx context.Context, fs *flag.FlagSet) { -} - -func (f *ArchiveFlag) Process(ctx context.Context) error { - return nil -} - -func (f *ArchiveFlag) ReadOvf(fpath string) ([]byte, error) { - r, _, err := f.Archive.Open(fpath) - if err != nil { - return nil, err - } - defer r.Close() - - return ioutil.ReadAll(r) -} - -func (f *ArchiveFlag) ReadEnvelope(fpath string) (*ovf.Envelope, error) { - if fpath == "" { - return nil, nil - } - - r, _, err := f.Open(fpath) - if err != nil { - return nil, err - } - defer r.Close() - - e, err := ovf.Unmarshal(r) - if err != nil { - return nil, fmt.Errorf("failed to parse ovf: %s", err.Error()) - } - - return e, nil -} - -type Archive interface { - Open(string) (io.ReadCloser, int64, error) -} - -type TapeArchive struct { - path string -} - -type TapeArchiveEntry struct { - io.Reader - f *os.File -} - -func (t *TapeArchiveEntry) Close() error { - return t.f.Close() -} - -func (t *TapeArchive) Open(name string) (io.ReadCloser, int64, error) { - f, err := os.Open(t.path) - if err != nil { - return nil, 0, err - } - - r := tar.NewReader(f) - - for { - h, err := r.Next() - if err == io.EOF { - break - } - if err != nil { - return nil, 0, err - } - - matched, err := filepath.Match(name, path.Base(h.Name)) - if err != nil { - return nil, 0, err - } - - if matched { - return &TapeArchiveEntry{r, f}, h.Size, nil - } - } - - _ = f.Close() - - return nil, 0, os.ErrNotExist -} - -type FileArchive struct { - path string -} - -func (t *FileArchive) Open(name string) (io.ReadCloser, int64, error) { - fpath := name - if name != t.path { - fpath = filepath.Join(filepath.Dir(t.path), name) - } - - s, err := os.Stat(fpath) - if err != nil { - return nil, 0, err - } - - f, err := os.Open(fpath) - if err != nil { - return nil, 0, err - } - - return f, s.Size(), nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/folder.go b/vendor/github.com/vmware/govmomi/govc/importx/folder.go deleted file mode 100644 index 924e75f2c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/folder.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "errors" - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" -) - -type FolderFlag struct { - *flags.DatacenterFlag - - folder string -} - -func newFolderFlag(ctx context.Context) (*FolderFlag, context.Context) { - f := &FolderFlag{} - f.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - return f, ctx -} - -func (flag *FolderFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.DatacenterFlag.Register(ctx, f) - - f.StringVar(&flag.folder, "folder", "", "Path to folder to add the VM to") -} - -func (flag *FolderFlag) Process(ctx context.Context) error { - return flag.DatacenterFlag.Process(ctx) -} - -func (flag *FolderFlag) Folder() (*object.Folder, error) { - if len(flag.folder) == 0 { - dc, err := flag.Datacenter() - if err != nil { - return nil, err - } - folders, err := dc.Folders(context.TODO()) - if err != nil { - return nil, err - } - return folders.VmFolder, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - mo, err := finder.ManagedObjectList(context.TODO(), flag.folder) - if err != nil { - return nil, err - } - if len(mo) == 0 { - return nil, errors.New("folder argument does not resolve to object") - } - if len(mo) > 1 { - return nil, errors.New("folder argument resolves to more than one object") - } - - ref := mo[0].Object.Reference() - if ref.Type != "Folder" { - return nil, errors.New("folder argument does not resolve to folder") - } - - c, err := flag.Client() - if err != nil { - return nil, err - } - - return object.NewFolder(c, ref), nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/importable.go b/vendor/github.com/vmware/govmomi/govc/importx/importable.go deleted file mode 100644 index 14e31670b..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/importable.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "fmt" - "path" -) - -type importable struct { - localPath string - remotePath string -} - -func (i importable) Ext() string { - return path.Ext(i.localPath) -} - -func (i importable) Base() string { - return path.Base(i.localPath) -} - -func (i importable) BaseClean() string { - b := i.Base() - e := i.Ext() - return b[:len(b)-len(e)] -} - -func (i importable) RemoteSrcVMDK() string { - file := fmt.Sprintf("%s-src.vmdk", i.BaseClean()) - return i.toRemotePath(file) -} - -func (i importable) RemoteDstVMDK() string { - file := fmt.Sprintf("%s.vmdk", i.BaseClean()) - return i.toRemotePath(file) -} - -func (i importable) toRemotePath(p string) string { - if i.remotePath == "" { - return p - } - - return path.Join(i.remotePath, p) -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/lease_updater.go b/vendor/github.com/vmware/govmomi/govc/importx/lease_updater.go deleted file mode 100644 index 6f1f1d150..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/lease_updater.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "fmt" - "net/url" - "sync" - "sync/atomic" - "time" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/progress" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ovfFileItem struct { - url *url.URL - item types.OvfFileItem - ch chan progress.Report -} - -func (o ovfFileItem) Sink() chan<- progress.Report { - return o.ch -} - -type leaseUpdater struct { - client *vim25.Client - lease *object.HttpNfcLease - - pos int64 // Number of bytes - total int64 // Total number of bytes - - done chan struct{} // When lease updater should stop - - wg sync.WaitGroup // Track when update loop is done -} - -func newLeaseUpdater(client *vim25.Client, lease *object.HttpNfcLease, items []ovfFileItem) *leaseUpdater { - l := leaseUpdater{ - client: client, - lease: lease, - - done: make(chan struct{}), - } - - for _, item := range items { - l.total += item.item.Size - go l.waitForProgress(item) - } - - // Kickstart update loop - l.wg.Add(1) - go l.run() - - return &l -} - -func (l *leaseUpdater) waitForProgress(item ovfFileItem) { - var pos, total int64 - - total = item.item.Size - - for { - select { - case <-l.done: - return - case p, ok := <-item.ch: - // Return in case of error - if ok && p.Error() != nil { - return - } - - if !ok { - // Last element on the channel, add to total - atomic.AddInt64(&l.pos, total-pos) - return - } - - // Approximate progress in number of bytes - x := int64(float32(total) * (p.Percentage() / 100.0)) - atomic.AddInt64(&l.pos, x-pos) - pos = x - } - } -} - -func (l *leaseUpdater) run() { - defer l.wg.Done() - - tick := time.NewTicker(2 * time.Second) - defer tick.Stop() - - for { - select { - case <-l.done: - return - case <-tick.C: - // From the vim api HttpNfcLeaseProgress(percent) doc, percent == - // "Completion status represented as an integer in the 0-100 range." - // Always report the current value of percent, as it will renew the - // lease even if the value hasn't changed or is 0. - percent := int(float32(100*atomic.LoadInt64(&l.pos)) / float32(l.total)) - err := l.lease.HttpNfcLeaseProgress(context.TODO(), percent) - if err != nil { - fmt.Printf("from lease updater: %s\n", err) - } - } - } -} - -func (l *leaseUpdater) Done() { - close(l.done) - l.wg.Wait() -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/options.go b/vendor/github.com/vmware/govmomi/govc/importx/options.go deleted file mode 100644 index 76c61786a..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/options.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "encoding/json" - "flag" - "os" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/ovf" - "github.com/vmware/govmomi/vim25/types" -) - -type Property struct { - types.KeyValue - Spec *ovf.Property `json:",omitempty"` -} - -type Options struct { - AllDeploymentOptions []string `json:",omitempty"` - Deployment string - - AllDiskProvisioningOptions []string `json:",omitempty"` - DiskProvisioning string - - AllIPAllocationPolicyOptions []string `json:",omitempty"` - IPAllocationPolicy string - - AllIPProtocolOptions []string `json:",omitempty"` - IPProtocol string - - PropertyMapping []Property `json:",omitempty"` - - PowerOn bool - InjectOvfEnv bool - WaitForIP bool - Name *string -} - -type OptionsFlag struct { - Options Options - - path string -} - -func newOptionsFlag(ctx context.Context) (*OptionsFlag, context.Context) { - return &OptionsFlag{}, ctx -} - -func (flag *OptionsFlag) Register(ctx context.Context, f *flag.FlagSet) { - f.StringVar(&flag.path, "options", "", "Options spec file path for VM deployment") -} - -func (flag *OptionsFlag) Process(ctx context.Context) error { - if len(flag.path) > 0 { - f, err := os.Open(flag.path) - if err != nil { - return err - } - defer f.Close() - - if err := json.NewDecoder(f).Decode(&flag.Options); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/ova.go b/vendor/github.com/vmware/govmomi/govc/importx/ova.go deleted file mode 100644 index ce33484f6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/ova.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" -) - -type ova struct { - *ovfx -} - -func init() { - cli.Register("import.ova", &ova{&ovfx{}}) -} - -func (cmd *ova) Usage() string { - return "PATH_TO_OVA" -} - -func (cmd *ova) Run(ctx context.Context, f *flag.FlagSet) error { - fpath, err := cmd.Prepare(f) - if err != nil { - return err - } - - cmd.Archive = &TapeArchive{fpath} - - moref, err := cmd.Import(fpath) - if err != nil { - return err - } - - vm := object.NewVirtualMachine(cmd.Client, *moref) - return cmd.Deploy(vm) -} - -func (cmd *ova) Import(fpath string) (*types.ManagedObjectReference, error) { - ovf := "*.ovf" - return cmd.ovfx.Import(ovf) -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/ovf.go b/vendor/github.com/vmware/govmomi/govc/importx/ovf.go deleted file mode 100644 index 9f1aafcda..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/ovf.go +++ /dev/null @@ -1,415 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "errors" - "flag" - "fmt" - "path" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/ovf" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/progress" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ovfx struct { - *flags.DatastoreFlag - *flags.HostSystemFlag - *flags.OutputFlag - *flags.ResourcePoolFlag - - *ArchiveFlag - *OptionsFlag - *FolderFlag - - Name string - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - ResourcePool *object.ResourcePool -} - -func init() { - cli.Register("import.ovf", &ovfx{}) -} - -func (cmd *ovfx) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) - cmd.ResourcePoolFlag.Register(ctx, f) - - cmd.ArchiveFlag, ctx = newArchiveFlag(ctx) - cmd.ArchiveFlag.Register(ctx, f) - cmd.OptionsFlag, ctx = newOptionsFlag(ctx) - cmd.OptionsFlag.Register(ctx, f) - cmd.FolderFlag, ctx = newFolderFlag(ctx) - cmd.FolderFlag.Register(ctx, f) - - f.StringVar(&cmd.Name, "name", "", "Name to use for new entity") -} - -func (cmd *ovfx) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { - return err - } - if err := cmd.ArchiveFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OptionsFlag.Process(ctx); err != nil { - return err - } - if err := cmd.FolderFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ovfx) Usage() string { - return "PATH_TO_OVF" -} - -func (cmd *ovfx) Run(ctx context.Context, f *flag.FlagSet) error { - fpath, err := cmd.Prepare(f) - if err != nil { - return err - } - - cmd.Archive = &FileArchive{fpath} - - moref, err := cmd.Import(fpath) - if err != nil { - return err - } - - vm := object.NewVirtualMachine(cmd.Client, *moref) - return cmd.Deploy(vm) -} - -func (cmd *ovfx) Prepare(f *flag.FlagSet) (string, error) { - var err error - - args := f.Args() - if len(args) != 1 { - return "", errors.New("no file specified") - } - - cmd.Client, err = cmd.DatastoreFlag.Client() - if err != nil { - return "", err - } - - cmd.Datacenter, err = cmd.DatastoreFlag.Datacenter() - if err != nil { - return "", err - } - - cmd.Datastore, err = cmd.DatastoreFlag.Datastore() - if err != nil { - return "", err - } - - cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() - if err != nil { - return "", err - } - - return f.Arg(0), nil -} - -func (cmd *ovfx) Deploy(vm *object.VirtualMachine) error { - if err := cmd.PowerOn(vm); err != nil { - return err - } - - if err := cmd.InjectOvfEnv(vm); err != nil { - return err - } - - if err := cmd.WaitForIP(vm); err != nil { - return err - } - - return nil -} - -func (cmd *ovfx) Map(op []Property) (p []types.KeyValue) { - for _, v := range op { - p = append(p, v.KeyValue) - } - - return -} - -func (cmd *ovfx) Import(fpath string) (*types.ManagedObjectReference, error) { - o, err := cmd.ReadOvf(fpath) - if err != nil { - return nil, err - } - - e, err := cmd.ReadEnvelope(fpath) - if err != nil { - return nil, fmt.Errorf("failed to parse ovf: %s", err.Error()) - } - - name := "Govc Virtual Appliance" - if e.VirtualSystem != nil { - name = e.VirtualSystem.ID - if e.VirtualSystem.Name != nil { - name = *e.VirtualSystem.Name - } - } - - // Override name from options if specified - if cmd.Options.Name != nil { - name = *cmd.Options.Name - } - - // Override name from arguments if specified - if cmd.Name != "" { - name = cmd.Name - } - - cisp := types.OvfCreateImportSpecParams{ - DiskProvisioning: cmd.Options.DiskProvisioning, - EntityName: name, - IpAllocationPolicy: cmd.Options.IPAllocationPolicy, - IpProtocol: cmd.Options.IPProtocol, - OvfManagerCommonParams: types.OvfManagerCommonParams{ - DeploymentOption: cmd.Options.Deployment, - Locale: "US"}, - PropertyMapping: cmd.Map(cmd.Options.PropertyMapping), - } - - m := object.NewOvfManager(cmd.Client) - spec, err := m.CreateImportSpec(context.TODO(), string(o), cmd.ResourcePool, cmd.Datastore, cisp) - if err != nil { - return nil, err - } - if spec.Error != nil { - return nil, errors.New(spec.Error[0].LocalizedMessage) - } - if spec.Warning != nil { - for _, w := range spec.Warning { - _, _ = cmd.Log(fmt.Sprintf("Warning: %s\n", w.LocalizedMessage)) - } - } - - // TODO: ImportSpec may have unitNumber==0, but this field is optional in the wsdl - // and hence omitempty in the struct tag; but unitNumber is required for certain devices. - s := &spec.ImportSpec.(*types.VirtualMachineImportSpec).ConfigSpec - for _, d := range s.DeviceChange { - n := &d.GetVirtualDeviceConfigSpec().Device.GetVirtualDevice().UnitNumber - if *n == 0 { - *n = -1 - } - } - - var host *object.HostSystem - if cmd.SearchFlag.IsSet() { - if host, err = cmd.HostSystem(); err != nil { - return nil, err - } - } - - folder, err := cmd.Folder() - if err != nil { - return nil, err - } - - lease, err := cmd.ResourcePool.ImportVApp(context.TODO(), spec.ImportSpec, folder, host) - if err != nil { - return nil, err - } - - info, err := lease.Wait(context.TODO()) - if err != nil { - return nil, err - } - - // Build slice of items and URLs first, so that the lease updater can know - // about every item that needs to be uploaded, and thereby infer progress. - var items []ovfFileItem - - for _, device := range info.DeviceUrl { - for _, item := range spec.FileItem { - if device.ImportKey != item.DeviceId { - continue - } - - u, err := cmd.Client.ParseURL(device.Url) - if err != nil { - return nil, err - } - - i := ovfFileItem{ - url: u, - item: item, - ch: make(chan progress.Report), - } - - items = append(items, i) - } - } - - u := newLeaseUpdater(cmd.Client, lease, items) - defer u.Done() - - for _, i := range items { - err = cmd.Upload(lease, i) - if err != nil { - return nil, err - } - } - - return &info.Entity, lease.HttpNfcLeaseComplete(context.TODO()) -} - -func (cmd *ovfx) Upload(lease *object.HttpNfcLease, ofi ovfFileItem) error { - item := ofi.item - file := item.Path - - f, size, err := cmd.Open(file) - if err != nil { - return err - } - defer f.Close() - - logger := cmd.ProgressLogger(fmt.Sprintf("Uploading %s... ", path.Base(file))) - defer logger.Wait() - - opts := soap.Upload{ - ContentLength: size, - Progress: progress.Tee(ofi, logger), - } - - // Non-disk files (such as .iso) use the PUT method. - // Overwrite: t header is also required in this case (ovftool does the same) - if item.Create { - opts.Method = "PUT" - opts.Headers = map[string]string{ - "Overwrite": "t", - } - } else { - opts.Method = "POST" - opts.Type = "application/x-vnd.vmware-streamVmdk" - } - - return cmd.Client.Client.Upload(f, ofi.url, &opts) -} - -func (cmd *ovfx) PowerOn(vm *object.VirtualMachine) error { - if !cmd.Options.PowerOn { - return nil - } - - cmd.Log("Powering on VM...\n") - - task, err := vm.PowerOn(context.TODO()) - if err != nil { - return err - } - - if _, err = task.WaitForResult(context.TODO(), nil); err != nil { - return err - } - - return nil -} - -func (cmd *ovfx) InjectOvfEnv(vm *object.VirtualMachine) error { - if !cmd.Options.PowerOn || !cmd.Options.InjectOvfEnv { - return nil - } - - a := cmd.Client.ServiceContent.About - if strings.EqualFold(a.ProductLineId, "esx") || strings.EqualFold(a.ProductLineId, "embeddedEsx") { - cmd.Log("Injecting OVF environment...\n") - - // build up Environment in order to marshal to xml - var epa []ovf.EnvProperty - for _, p := range cmd.Options.PropertyMapping { - epa = append(epa, ovf.EnvProperty{ - Key: p.Key, - Value: p.Value}) - } - env := ovf.Env{ - EsxID: vm.Reference().Value, - Platform: &ovf.PlatformSection{ - Kind: a.Name, - Version: a.Version, - Vendor: a.Vendor, - Locale: "US", - }, - Property: &ovf.PropertySection{ - Properties: epa}, - } - - xenv := env.MarshalManual() - vmConfigSpec := types.VirtualMachineConfigSpec{ - ExtraConfig: []types.BaseOptionValue{&types.OptionValue{ - Key: "guestinfo.ovfEnv", - Value: xenv}}} - - task, err := vm.Reconfigure(context.TODO(), vmConfigSpec) - if err != nil { - return err - } - if err := task.Wait(context.TODO()); err != nil { - return err - } - } - - return nil -} - -func (cmd *ovfx) WaitForIP(vm *object.VirtualMachine) error { - if !cmd.Options.PowerOn || !cmd.Options.WaitForIP { - return nil - } - - cmd.Log("Waiting for IP address...\n") - ip, err := vm.WaitForIP(context.TODO()) - if err != nil { - return err - } - - cmd.Log(fmt.Sprintf("Received IP address: %s\n", ip)) - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/spec.go b/vendor/github.com/vmware/govmomi/govc/importx/spec.go deleted file mode 100644 index cc7776442..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/spec.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "encoding/json" - "flag" - "fmt" - "path" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/ovf" - "github.com/vmware/govmomi/vim25/types" -) - -var ( - // all possible ovf property values - // the first element being the default value - allDeploymentOptions = []string{"small", "medium", "large"} - allDiskProvisioningOptions = []string{"thin", "monolithicSparse", "monolithicFlat", "twoGbMaxExtentSparse", "twoGbMaxExtentFlat", "seSparse", "eagerZeroedThick", "thick", "sparse", "flat"} - allIPAllocationPolicyOptions = []string{"dhcpPolicy", "transientPolicy", "fixedPolicy", "fixedAllocatedPolicy"} - allIPProtocolOptions = []string{"IPv4", "IPv6"} -) - -type spec struct { - *ArchiveFlag - - verbose bool -} - -func init() { - cli.Register("import.spec", &spec{}) -} - -func (cmd *spec) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ArchiveFlag, ctx = newArchiveFlag(ctx) - cmd.ArchiveFlag.Register(ctx, f) - - f.BoolVar(&cmd.verbose, "verbose", false, "Verbose spec output") -} - -func (cmd *spec) Process(ctx context.Context) error { - if err := cmd.ArchiveFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *spec) Usage() string { - return "PATH_TO_OVF_OR_OVA" -} - -func (cmd *spec) Run(ctx context.Context, f *flag.FlagSet) error { - fpath := "" - args := f.Args() - if len(args) == 1 { - fpath = f.Arg(0) - } - - if len(fpath) > 0 { - switch path.Ext(fpath) { - case ".ovf": - cmd.Archive = &FileArchive{fpath} - case "", ".ova": - cmd.Archive = &TapeArchive{fpath} - fpath = "*.ovf" - default: - return fmt.Errorf("invalid file extension %s", path.Ext(fpath)) - } - } - - return cmd.Spec(fpath) -} - -func (cmd *spec) Map(e *ovf.Envelope) (res []Property) { - if e == nil { - return nil - } - - for _, p := range e.VirtualSystem.Product { - for i, v := range p.Property { - d := "" - if v.Default != nil { - d = *v.Default - } - - // From OVF spec, section 9.5.1: - // key-value-env = [class-value "."] key-value-prod ["." instance-value] - k := v.Key - if p.Class != nil { - k = fmt.Sprintf("%s.%s", *p.Class, k) - } - if p.Instance != nil { - k = fmt.Sprintf("%s.%s", k, *p.Instance) - } - - np := Property{KeyValue: types.KeyValue{Key: k, Value: d}} - if cmd.verbose { - np.Spec = &p.Property[i] - } - - res = append(res, np) - } - } - - return -} - -func (cmd *spec) Spec(fpath string) error { - e, err := cmd.ReadEnvelope(fpath) - if err != nil { - return err - } - - var deploymentOptions = allDeploymentOptions - if e != nil && e.DeploymentOption != nil && e.DeploymentOption.Configuration != nil { - deploymentOptions = nil - - // add default first - for _, c := range e.DeploymentOption.Configuration { - if c.Default != nil && *c.Default { - deploymentOptions = append(deploymentOptions, c.ID) - } - } - - for _, c := range e.DeploymentOption.Configuration { - if c.Default == nil || !*c.Default { - deploymentOptions = append(deploymentOptions, c.ID) - } - } - } - - o := Options{ - Deployment: deploymentOptions[0], - DiskProvisioning: allDiskProvisioningOptions[0], - IPAllocationPolicy: allIPAllocationPolicyOptions[0], - IPProtocol: allIPProtocolOptions[0], - PowerOn: false, - WaitForIP: false, - InjectOvfEnv: false, - PropertyMapping: cmd.Map(e)} - if cmd.verbose { - o.AllDeploymentOptions = deploymentOptions - o.AllDiskProvisioningOptions = allDiskProvisioningOptions - o.AllIPAllocationPolicyOptions = allIPAllocationPolicyOptions - o.AllIPProtocolOptions = allIPProtocolOptions - } - - j, err := json.Marshal(&o) - if err != nil { - return err - } - - fmt.Println(string(j)) - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/importx/vmdk.go b/vendor/github.com/vmware/govmomi/govc/importx/vmdk.go deleted file mode 100644 index 6952532cc..000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/vmdk.go +++ /dev/null @@ -1,518 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package importx - -import ( - "errors" - "flag" - "fmt" - "path" - "reflect" - "regexp" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/progress" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type vmdk struct { - *flags.DatastoreFlag - *flags.ResourcePoolFlag - *flags.OutputFlag - - upload bool - force bool - keep bool - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - ResourcePool *object.ResourcePool -} - -func init() { - cli.Register("import.vmdk", &vmdk{}) - cli.Alias("import.vmdk", "datastore.import") -} - -func (cmd *vmdk) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) - cmd.ResourcePoolFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - f.BoolVar(&cmd.upload, "upload", true, "Upload specified disk") - f.BoolVar(&cmd.force, "force", false, "Overwrite existing disk") - f.BoolVar(&cmd.keep, "keep", false, "Keep uploaded disk after import") -} - -func (cmd *vmdk) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *vmdk) Usage() string { - return "PATH_TO_VMDK [REMOTE_DIRECTORY]" -} - -func (cmd *vmdk) Run(ctx context.Context, f *flag.FlagSet) error { - var err error - - args := f.Args() - if len(args) < 1 { - return errors.New("no file to import") - } - - file := importable{ - localPath: f.Arg(0), - } - - // Include remote path if specified - if len(args) >= 2 { - file.remotePath = f.Arg(1) - } - - cmd.Client, err = cmd.DatastoreFlag.Client() - if err != nil { - return err - } - - cmd.Datacenter, err = cmd.DatastoreFlag.Datacenter() - if err != nil { - return err - } - - cmd.Datastore, err = cmd.DatastoreFlag.Datastore() - if err != nil { - return err - } - - cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() - if err != nil { - return err - } - - err = cmd.PrepareDestination(file) - if err != nil { - return err - } - - if cmd.upload { - err = cmd.Upload(file) - if err != nil { - return err - } - } - - return cmd.Import(file) -} - -// PrepareDestination makes sure that the destination VMDK does not yet exist. -// If the force flag is passed, it removes the existing VMDK. This functions -// exists to give a meaningful error if the remote VMDK already exists. -// -// CopyVirtualDisk can return a " file does not exist" error while in fact -// the source file *does* exist and the *destination* file also exist. -// -func (cmd *vmdk) PrepareDestination(i importable) error { - vmdkPath := i.RemoteDstVMDK() - res, err := cmd.Datastore.Stat(context.TODO(), vmdkPath) - if err != nil { - switch err.(type) { - case object.DatastoreNoSuchDirectoryError: - // The base path doesn't exist. Create it. - dsPath := cmd.Datastore.Path(path.Dir(vmdkPath)) - m := object.NewFileManager(cmd.Client) - return m.MakeDirectory(context.TODO(), dsPath, cmd.Datacenter, true) - case object.DatastoreNoSuchFileError: - // Destination path doesn't exist; all good to continue with import. - return nil - } - - return err - } - - // Check that the returned entry has the right type. - switch res.(type) { - case *types.VmDiskFileInfo: - default: - expected := "VmDiskFileInfo" - actual := reflect.TypeOf(res) - panic(fmt.Sprintf("Expected: %s, actual: %s", expected, actual)) - } - - if !cmd.force { - dsPath := cmd.Datastore.Path(vmdkPath) - err = fmt.Errorf("File %s already exists", dsPath) - return err - } - - // Delete existing disk. - err = cmd.DeleteDisk(vmdkPath) - if err != nil { - return err - } - - return nil -} - -func (cmd *vmdk) Upload(i importable) error { - p := soap.DefaultUpload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger("Uploading... ") - p.Progress = logger - defer logger.Wait() - } - - return cmd.Datastore.UploadFile(context.TODO(), i.localPath, i.RemoteSrcVMDK(), &p) -} - -func (cmd *vmdk) Import(i importable) error { - err := cmd.Copy(i) - if err != nil { - return err - } - - if !cmd.keep { - err = cmd.DeleteDisk(i.RemoteSrcVMDK()) - if err != nil { - return err - } - } - - return nil -} - -func (cmd *vmdk) Copy(i importable) error { - var err error - - logger := cmd.ProgressLogger("Importing... ") - defer logger.Wait() - - agg := progress.NewAggregator(logger) - defer agg.Done() - - switch p := cmd.Client.ServiceContent.About.ApiType; p { - case "HostAgent": - err = cmd.CopyHostAgent(i, agg) - case "VirtualCenter": - err = cmd.CopyVirtualCenter(i, agg) - default: - return fmt.Errorf("unsupported ApiType: %s", p) - } - - return err -} - -func (cmd *vmdk) CopyHostAgent(i importable, s progress.Sinker) error { - spec := &types.VirtualDiskSpec{ - AdapterType: "lsiLogic", - DiskType: "thin", - } - - dc := cmd.Datacenter - src := cmd.Datastore.Path(i.RemoteSrcVMDK()) - dst := cmd.Datastore.Path(i.RemoteDstVMDK()) - vdm := object.NewVirtualDiskManager(cmd.Client) - task, err := vdm.CopyVirtualDisk(context.TODO(), src, dc, dst, dc, spec, false) - if err != nil { - return err - } - - ps := progress.Prefix(s, "copying disk") - _, err = task.WaitForResult(context.TODO(), ps) - if err != nil { - return err - } - - return nil -} - -func (cmd *vmdk) CopyVirtualCenter(i importable, s progress.Sinker) error { - var err error - - srcName := i.BaseClean() + "-srcvm" - dstName := i.BaseClean() + "-dstvm" - - spec := &configSpec{ - Name: srcName, - GuestId: "otherGuest", - Files: &types.VirtualMachineFileInfo{ - VmPathName: fmt.Sprintf("[%s]", cmd.Datastore.Name()), - }, - } - - spec.AddDisk(cmd.Datastore, i.RemoteSrcVMDK()) - - src, err := cmd.CreateVM(spec) - if err != nil { - return err - } - - dst, err := cmd.CloneVM(src, dstName) - if err != nil { - return err - } - - err = cmd.DestroyVM(src) - if err != nil { - return err - } - - vmdk, err := cmd.DetachDisk(dst) - if err != nil { - return err - } - - err = cmd.MoveDisk(vmdk, i.RemoteDstVMDK()) - if err != nil { - return err - } - - err = cmd.DestroyVM(dst) - if err != nil { - return err - } - - return nil -} - -func (cmd *vmdk) MoveDisk(src, dst string) error { - dsSrc := cmd.Datastore.Path(src) - dsDst := cmd.Datastore.Path(dst) - vdm := object.NewVirtualDiskManager(cmd.Client) - task, err := vdm.MoveVirtualDisk(context.TODO(), dsSrc, cmd.Datacenter, dsDst, cmd.Datacenter, true) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} - -func (cmd *vmdk) DeleteDisk(path string) error { - vdm := object.NewVirtualDiskManager(cmd.Client) - task, err := vdm.DeleteVirtualDisk(context.TODO(), cmd.Datastore.Path(path), cmd.Datacenter) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} - -func (cmd *vmdk) DetachDisk(vm *object.VirtualMachine) (string, error) { - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(cmd.Client) - err := pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"config.hardware"}, &mvm) - if err != nil { - return "", err - } - - spec := new(configSpec) - dsFile := spec.RemoveDisk(&mvm) - - task, err := vm.Reconfigure(context.TODO(), spec.ToSpec()) - if err != nil { - return "", err - } - - err = task.Wait(context.TODO()) - if err != nil { - return "", err - } - - return dsFile, nil -} - -func (cmd *vmdk) CreateVM(spec *configSpec) (*object.VirtualMachine, error) { - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return nil, err - } - - task, err := folders.VmFolder.CreateVM(context.TODO(), spec.ToSpec(), cmd.ResourcePool, nil) - if err != nil { - return nil, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return nil, err - } - - return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil -} - -func (cmd *vmdk) CloneVM(vm *object.VirtualMachine, name string) (*object.VirtualMachine, error) { - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return nil, err - } - - spec := types.VirtualMachineCloneSpec{ - Config: &types.VirtualMachineConfigSpec{}, - Location: types.VirtualMachineRelocateSpec{}, - } - - task, err := vm.Clone(context.TODO(), folders.VmFolder, name, spec) - if err != nil { - return nil, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return nil, err - } - - return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil -} - -func (cmd *vmdk) DestroyVM(vm *object.VirtualMachine) error { - _, err := cmd.DetachDisk(vm) - if err != nil { - return err - } - - task, err := vm.Destroy(context.TODO()) - if err != nil { - return err - } - - err = task.Wait(context.TODO()) - if err != nil { - return err - } - - return nil -} - -type configSpec types.VirtualMachineConfigSpec - -func (c *configSpec) ToSpec() types.VirtualMachineConfigSpec { - return types.VirtualMachineConfigSpec(*c) -} - -func (c *configSpec) AddChange(d types.BaseVirtualDeviceConfigSpec) { - c.DeviceChange = append(c.DeviceChange, d) -} - -func (c *configSpec) AddDisk(ds *object.Datastore, path string) { - controller := &types.VirtualLsiLogicController{ - VirtualSCSIController: types.VirtualSCSIController{ - SharedBus: types.VirtualSCSISharingNoSharing, - VirtualController: types.VirtualController{ - BusNumber: 0, - VirtualDevice: types.VirtualDevice{ - Key: -1, - }, - }, - }, - } - - controllerSpec := &types.VirtualDeviceConfigSpec{ - Device: controller, - Operation: types.VirtualDeviceConfigSpecOperationAdd, - } - - c.AddChange(controllerSpec) - - disk := &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - Key: -1, - ControllerKey: -1, - UnitNumber: -1, - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: ds.Path(path), - }, - DiskMode: string(types.VirtualDiskModePersistent), - ThinProvisioned: types.NewBool(true), - }, - }, - } - - diskSpec := &types.VirtualDeviceConfigSpec{ - Device: disk, - Operation: types.VirtualDeviceConfigSpecOperationAdd, - } - - c.AddChange(diskSpec) -} - -var dsPathRegexp = regexp.MustCompile(`^\[.*\] (.*)$`) - -func (c *configSpec) RemoveDisk(vm *mo.VirtualMachine) string { - var file string - - for _, d := range vm.Config.Hardware.Device { - switch device := d.(type) { - case *types.VirtualDisk: - if file != "" { - panic("expected VM to have only one disk") - } - - switch backing := device.Backing.(type) { - case *types.VirtualDiskFlatVer1BackingInfo: - file = backing.FileName - case *types.VirtualDiskFlatVer2BackingInfo: - file = backing.FileName - case *types.VirtualDiskSeSparseBackingInfo: - file = backing.FileName - case *types.VirtualDiskSparseVer1BackingInfo: - file = backing.FileName - case *types.VirtualDiskSparseVer2BackingInfo: - file = backing.FileName - default: - name := reflect.TypeOf(device.Backing).String() - panic(fmt.Sprintf("unexpected backing type: %s", name)) - } - - // Remove [datastore] prefix - m := dsPathRegexp.FindStringSubmatch(file) - if len(m) != 2 { - panic(fmt.Sprintf("expected regexp match for %#v", file)) - } - file = m[1] - - removeOp := &types.VirtualDeviceConfigSpec{ - Operation: types.VirtualDeviceConfigSpecOperationRemove, - Device: device, - } - - c.AddChange(removeOp) - } - } - - return file -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/add.go b/vendor/github.com/vmware/govmomi/govc/license/add.go deleted file mode 100644 index a161c3d87..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/add.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/license" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.ClientFlag - *flags.OutputFlag -} - -func init() { - cli.Register("license.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Usage() string { - return "KEY..." -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m := license.NewManager(client) - - // From the vSphere 5.5 documentation: - // - // To specify the edition type and any optional functions, use - // updateLicense for ESX Server and addLicense follow by - // LicenseAssingmentManager.updateAssignedLicense for VirtualCenter. - // - var addFunc func(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) - switch t := client.ServiceContent.About.ApiType; t { - case "HostAgent": - addFunc = m.Update - case "VirtualCenter": - addFunc = m.Add - default: - return fmt.Errorf("unsupported ApiType: %s", t) - } - - result := make(licenseOutput, 0) - for _, v := range f.Args() { - license, err := addFunc(context.TODO(), v, nil) - if err != nil { - return err - } - - result = append(result, license) - } - - return cmd.WriteResult(licenseOutput(result)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/assign.go b/vendor/github.com/vmware/govmomi/govc/license/assign.go deleted file mode 100644 index aedf239bc..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/assign.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/license" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type assign struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.HostSystemFlag - - name string - remove bool -} - -func init() { - cli.Register("license.assign", &assign{}) -} - -func (cmd *assign) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.StringVar(&cmd.name, "name", "", "Display name") - f.BoolVar(&cmd.remove, "remove", false, "Remove assignment") -} - -func (cmd *assign) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *assign) Usage() string { - return "KEY" -} - -func (cmd *assign) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() != 1 { - return flag.ErrHelp - } - - key := f.Arg(0) - - client, err := cmd.Client() - if err != nil { - return err - } - - m, err := license.NewManager(client).AssignmentManager(ctx) - if err != nil { - return err - } - - host, err := cmd.HostSystemIfSpecified() - if err != nil { - return err - } - - var id string - - if host == nil { - // Default to vCenter UUID - id = client.ServiceContent.About.InstanceUuid - } else { - id = host.Reference().Value - } - - if cmd.remove { - return m.Remove(ctx, id) - } - - info, err := m.Update(ctx, id, key, cmd.name) - if err != nil { - return err - } - - return cmd.WriteResult(licenseOutput([]types.LicenseManagerLicenseInfo{*info})) -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/assigned.go b/vendor/github.com/vmware/govmomi/govc/license/assigned.go deleted file mode 100644 index 682e831a7..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/assigned.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/license" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type assigned struct { - *flags.ClientFlag - *flags.OutputFlag - - id string -} - -func init() { - cli.Register("license.assigned.list", &assigned{}) -} - -func (cmd *assigned) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - f.StringVar(&cmd.id, "id", "", "Entity ID") -} - -func (cmd *assigned) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *assigned) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m, err := license.NewManager(client).AssignmentManager(context.TODO()) - if err != nil { - return err - } - - assigned, err := m.QueryAssigned(context.TODO(), cmd.id) - if err != nil { - return err - } - - return cmd.WriteResult(assignedOutput(assigned)) -} - -type assignedOutput []types.LicenseAssignmentManagerLicenseAssignment - -func (res assignedOutput) Write(w io.Writer) error { - tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) - fmt.Fprintf(tw, "Id:\tScope:\tName:\tLicense:\n") - for _, v := range res { - fmt.Fprintf(tw, "%s\t", v.EntityId) - fmt.Fprintf(tw, "%s\t", v.Scope) - fmt.Fprintf(tw, "%s\t", v.EntityDisplayName) - fmt.Fprintf(tw, "%s\t", v.AssignedLicense.LicenseKey) - fmt.Fprintf(tw, "\n") - } - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/decode.go b/vendor/github.com/vmware/govmomi/govc/license/decode.go deleted file mode 100644 index aadbed319..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/decode.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/license" - "golang.org/x/net/context" -) - -type decode struct { - *flags.ClientFlag - *flags.OutputFlag - - feature string -} - -func init() { - cli.Register("license.decode", &decode{}) -} - -func (cmd *decode) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - f.StringVar(&cmd.feature, "feature", "", featureUsage) -} - -func (cmd *decode) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *decode) Usage() string { - return "KEY..." -} - -func (cmd *decode) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - var result license.InfoList - m := license.NewManager(client) - for _, v := range f.Args() { - license, err := m.Decode(context.TODO(), v) - if err != nil { - return err - } - - result = append(result, license) - } - - if cmd.feature != "" { - result = result.WithFeature(cmd.feature) - } - - return cmd.WriteResult(licenseOutput(result)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/list.go b/vendor/github.com/vmware/govmomi/govc/license/list.go deleted file mode 100644 index 382d75441..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/list.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/license" - "golang.org/x/net/context" -) - -var featureUsage = "List licenses with given feature" - -type list struct { - *flags.ClientFlag - *flags.OutputFlag - - feature string -} - -func init() { - cli.Register("license.list", &list{}) -} - -func (cmd *list) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - f.StringVar(&cmd.feature, "feature", "", featureUsage) -} - -func (cmd *list) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *list) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m := license.NewManager(client) - result, err := m.List(context.TODO()) - if err != nil { - return err - } - - if cmd.feature != "" { - result = result.WithFeature(cmd.feature) - } - - return cmd.WriteResult(licenseOutput(result)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/output.go b/vendor/github.com/vmware/govmomi/govc/license/output.go deleted file mode 100644 index e4cfe42a5..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/output.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/vim25/types" -) - -type licenseOutput []types.LicenseManagerLicenseInfo - -func (res licenseOutput) Write(w io.Writer) error { - tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) - fmt.Fprintf(tw, "Key:\tEdition:\tUsed:\tTotal:\n") - for _, v := range res { - fmt.Fprintf(tw, "%s\t", v.LicenseKey) - fmt.Fprintf(tw, "%s\t", v.EditionKey) - fmt.Fprintf(tw, "%d\t", v.Used) - fmt.Fprintf(tw, "%d\t", v.Total) - fmt.Fprintf(tw, "\n") - } - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/license/remove.go b/vendor/github.com/vmware/govmomi/govc/license/remove.go deleted file mode 100644 index 886a2bbb9..000000000 --- a/vendor/github.com/vmware/govmomi/govc/license/remove.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/license" - "golang.org/x/net/context" -) - -type remove struct { - *flags.ClientFlag - *flags.OutputFlag -} - -func init() { - cli.Register("license.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "KEY..." -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m := license.NewManager(client) - for _, v := range f.Args() { - err = m.Remove(context.TODO(), v) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/logs/command.go b/vendor/github.com/vmware/govmomi/govc/logs/command.go deleted file mode 100644 index df01c9d4a..000000000 --- a/vendor/github.com/vmware/govmomi/govc/logs/command.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package logs - -import ( - "flag" - "fmt" - "math" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" -) - -type logs struct { - *flags.HostSystemFlag - - Max int - Key string -} - -func init() { - cli.Register("logs", &logs{}) -} - -func (cmd *logs) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - f.IntVar(&cmd.Max, "n", 25, "Output the last N logs") - f.StringVar(&cmd.Key, "log", "", "Log file key") -} - -func (cmd *logs) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *logs) Description() string { - return ` -The '-log' option defaults to "hostd" when connected directly to a host or -when connected to VirtualCenter and a '-host' option is given. Otherwise, -the '-log' option defaults to "vpxd:vpxd.log". The '-host' option is ignored -when connected directly to host. -See 'govc logs.ls' for other '-log' options.` -} - -func (cmd *logs) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - defaultKey := "hostd" - var host *object.HostSystem - - if c.IsVC() { - host, err = cmd.HostSystemIfSpecified() - if err != nil { - return err - } - - if host == nil { - defaultKey = "vpxd:vpxd.log" - } - } - - m := object.NewDiagnosticManager(c) - - key := cmd.Key - if key == "" { - key = defaultKey - } - - // get LineEnd without any LineText - h, err := m.BrowseLog(ctx, host, key, math.MaxInt32, 0) - if err != nil { - return err - } - - start := h.LineEnd - cmd.Max - h, err = m.BrowseLog(ctx, host, key, start, 0) - if err != nil { - return err - } - - for _, line := range h.LineText { - fmt.Println(line) - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/logs/download.go b/vendor/github.com/vmware/govmomi/govc/logs/download.go deleted file mode 100644 index 5fa709c0c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/logs/download.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package logs - -import ( - "flag" - "fmt" - "path" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" -) - -type download struct { - *flags.DatacenterFlag - - IncludeDefault bool -} - -func init() { - cli.Register("logs.download", &download{}) -} - -func (cmd *download) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.BoolVar(&cmd.IncludeDefault, "default", true, "Specifies if the bundle should include the default server") -} - -func (cmd *download) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *download) Usage() string { - return "[PATH]..." -} - -func (cmd *download) DownloadFile(c *vim25.Client, b string) error { - u, err := c.Client.ParseURL(b) - if err != nil { - return err - } - - dst := path.Base(u.Path) - p := soap.DefaultDownload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger(fmt.Sprintf("Downloading %s... ", dst)) - defer logger.Wait() - p.Progress = logger - } - - return c.Client.DownloadFile(dst, u, &p) -} - -func (cmd *download) GenerateLogBundles(m *object.DiagnosticManager, host []*object.HostSystem) ([]types.DiagnosticManagerBundleInfo, error) { - logger := cmd.ProgressLogger("Generating log bundles... ") - defer logger.Wait() - - task, err := m.GenerateLogBundles(context.TODO(), cmd.IncludeDefault, host) - if err != nil { - return nil, err - } - - r, err := task.WaitForResult(context.TODO(), logger) - if err != nil { - return nil, err - } - - return r.Result.(types.ArrayOfDiagnosticManagerBundleInfo).DiagnosticManagerBundleInfo, nil -} - -func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { - finder, err := cmd.Finder() - if err != nil { - return err - } - - var host []*object.HostSystem - - for _, arg := range f.Args() { - hs, err := finder.HostSystemList(context.TODO(), arg) - if err != nil { - return err - } - - host = append(host, hs...) - } - - c, err := cmd.Client() - if err != nil { - return err - } - - m := object.NewDiagnosticManager(c) - - bundles, err := cmd.GenerateLogBundles(m, host) - if err != nil { - return err - } - - for _, bundle := range bundles { - err := cmd.DownloadFile(c, bundle.Url) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/logs/ls.go b/vendor/github.com/vmware/govmomi/govc/logs/ls.go deleted file mode 100644 index 0437bc9c1..000000000 --- a/vendor/github.com/vmware/govmomi/govc/logs/ls.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package logs - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" -) - -type ls struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("logs.ls", &ls{}) -} - -func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) -} - -func (cmd *ls) Process(ctx context.Context) error { - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - var host *object.HostSystem - - if c.IsVC() { - host, err = cmd.HostSystemIfSpecified() - if err != nil { - return err - } - } - - m := object.NewDiagnosticManager(c) - - desc, err := m.QueryDescriptions(ctx, host) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, d := range desc { - fmt.Fprintf(tw, "%s\t%s\n", d.Key, d.FileName) - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/ls/command.go b/vendor/github.com/vmware/govmomi/govc/ls/command.go deleted file mode 100644 index 91b95ca3e..000000000 --- a/vendor/github.com/vmware/govmomi/govc/ls/command.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package ls - -import ( - "flag" - "fmt" - "io" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/list" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ls struct { - *flags.DatacenterFlag - - Long bool - Type string -} - -func init() { - cli.Register("ls", &ls{}) -} - -func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.BoolVar(&cmd.Long, "l", false, "Long listing format") - f.StringVar(&cmd.Type, "t", "", "Object type") -} - -func (cmd *ls) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ls) Usage() string { - return "[PATH]..." -} - -func (cmd *ls) typeMatch(ref types.ManagedObjectReference) bool { - if cmd.Type == "" { - return true - } - - return strings.ToLower(cmd.Type) == strings.ToLower(ref.Type) -} - -func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { - finder, err := cmd.Finder() - if err != nil { - return err - } - - lr := listResult{ - Elements: nil, - Long: cmd.Long, - } - - args := f.Args() - if len(args) == 0 { - args = []string{"."} - } - - for _, arg := range args { - es, err := finder.ManagedObjectListChildren(context.TODO(), arg) - if err != nil { - return err - } - - for _, e := range es { - if cmd.typeMatch(e.Object.Reference()) { - lr.Elements = append(lr.Elements, e) - } - } - } - - return cmd.WriteResult(lr) -} - -type listResult struct { - Elements []list.Element `json:"elements"` - - Long bool `json:"-"` -} - -func (l listResult) Write(w io.Writer) error { - var err error - - for _, e := range l.Elements { - if !l.Long { - fmt.Fprintf(w, "%s\n", e.Path) - continue - } - - switch e.Object.(type) { - case mo.Folder: - if _, err = fmt.Fprintf(w, "%s/\n", e.Path); err != nil { - return err - } - default: - if _, err = fmt.Fprintf(w, "%s (%s)\n", e.Path, e.Object.Reference().Type); err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/main.go b/vendor/github.com/vmware/govmomi/govc/main.go deleted file mode 100644 index 3212d8634..000000000 --- a/vendor/github.com/vmware/govmomi/govc/main.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package main - -import ( - "os" - - "github.com/vmware/govmomi/govc/cli" - - _ "github.com/vmware/govmomi/govc/about" - _ "github.com/vmware/govmomi/govc/cluster" - _ "github.com/vmware/govmomi/govc/datacenter" - _ "github.com/vmware/govmomi/govc/datastore" - _ "github.com/vmware/govmomi/govc/device" - _ "github.com/vmware/govmomi/govc/device/cdrom" - _ "github.com/vmware/govmomi/govc/device/floppy" - _ "github.com/vmware/govmomi/govc/device/scsi" - _ "github.com/vmware/govmomi/govc/device/serial" - _ "github.com/vmware/govmomi/govc/dvs" - _ "github.com/vmware/govmomi/govc/dvs/portgroup" - _ "github.com/vmware/govmomi/govc/events" - _ "github.com/vmware/govmomi/govc/extension" - _ "github.com/vmware/govmomi/govc/fields" - _ "github.com/vmware/govmomi/govc/host" - _ "github.com/vmware/govmomi/govc/host/autostart" - _ "github.com/vmware/govmomi/govc/host/esxcli" - _ "github.com/vmware/govmomi/govc/host/firewall" - _ "github.com/vmware/govmomi/govc/host/maintenance" - _ "github.com/vmware/govmomi/govc/host/portgroup" - _ "github.com/vmware/govmomi/govc/host/storage" - _ "github.com/vmware/govmomi/govc/host/vnic" - _ "github.com/vmware/govmomi/govc/host/vswitch" - _ "github.com/vmware/govmomi/govc/importx" - _ "github.com/vmware/govmomi/govc/license" - _ "github.com/vmware/govmomi/govc/logs" - _ "github.com/vmware/govmomi/govc/ls" - _ "github.com/vmware/govmomi/govc/permissions" - _ "github.com/vmware/govmomi/govc/pool" - _ "github.com/vmware/govmomi/govc/vapp" - _ "github.com/vmware/govmomi/govc/version" - _ "github.com/vmware/govmomi/govc/vm" - _ "github.com/vmware/govmomi/govc/vm/disk" - _ "github.com/vmware/govmomi/govc/vm/guest" - _ "github.com/vmware/govmomi/govc/vm/network" -) - -func main() { - os.Exit(cli.Run(os.Args[1:])) -} diff --git a/vendor/github.com/vmware/govmomi/govc/permissions/ls.go b/vendor/github.com/vmware/govmomi/govc/permissions/ls.go deleted file mode 100644 index 665809366..000000000 --- a/vendor/github.com/vmware/govmomi/govc/permissions/ls.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cluster - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type ls struct { - *flags.DatacenterFlag - *flags.OutputFlag -} - -func init() { - cli.Register("permissions.ls", &ls{}) -} - -func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) -} - -func (cmd *ls) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ls) Usage() string { - return "[PATH]..." -} - -func (cmd *ls) Description() string { - return `List the permissions defined on or effective on managed entities.` -} - -func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - refs, err := cmd.ManagedObjects(ctx, f.Args()) - if err != nil { - return err - } - - m := object.NewAuthorizationManager(c) - rl, err := m.RoleList(ctx) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, ref := range refs { - perms, err := m.RetrieveEntityPermissions(ctx, ref, true) - if err != nil { - return err - } - - for _, perm := range perms { - fmt.Fprintf(tw, "%s\t%s\n", perm.Principal, rl.ById(perm.RoleId).Name) - } - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/permissions/remove.go b/vendor/github.com/vmware/govmomi/govc/permissions/remove.go deleted file mode 100644 index becec4893..000000000 --- a/vendor/github.com/vmware/govmomi/govc/permissions/remove.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cluster - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type remove struct { - *flags.DatacenterFlag - - types.Permission - - role string -} - -func init() { - cli.Register("permissions.remove", &remove{}) -} - -func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.StringVar(&cmd.Principal, "principal", "", "User or group for which the permission is defined") - f.BoolVar(&cmd.Group, "group", false, "True, if principal refers to a group name; false, for a user name") -} - -func (cmd *remove) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *remove) Usage() string { - return "[PATH]..." -} - -func (cmd *remove) Description() string { - return `Removes a permission rule from managed entities.` -} - -func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - refs, err := cmd.ManagedObjects(ctx, f.Args()) - if err != nil { - return err - } - - m := object.NewAuthorizationManager(c) - - for _, ref := range refs { - err = m.RemoveEntityPermission(ctx, ref, cmd.Principal, cmd.Group) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/permissions/set.go b/vendor/github.com/vmware/govmomi/govc/permissions/set.go deleted file mode 100644 index 6b58e7e47..000000000 --- a/vendor/github.com/vmware/govmomi/govc/permissions/set.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package cluster - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type set struct { - *flags.DatacenterFlag - - types.Permission - - role string -} - -func init() { - cli.Register("permissions.set", &set{}) -} - -func (cmd *set) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.StringVar(&cmd.Principal, "principal", "", "User or group for which the permission is defined") - f.BoolVar(&cmd.Group, "group", false, "True, if principal refers to a group name; false, for a user name") - f.BoolVar(&cmd.Propagate, "propagate", true, "Whether or not this permission propagates down the hierarchy to sub-entities") - f.StringVar(&cmd.role, "role", "Admin", "Permission role name") -} - -func (cmd *set) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *set) Usage() string { - return "[PATH]..." -} - -func (cmd *set) Description() string { - return `Set the permissions managed entities. -Example: -govc permissions.set -principal root -role Admin -` -} - -func (cmd *set) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - refs, err := cmd.ManagedObjects(ctx, f.Args()) - if err != nil { - return err - } - - m := object.NewAuthorizationManager(c) - rl, err := m.RoleList(ctx) - if err != nil { - return err - } - - role := rl.ByName(cmd.role) - if role == nil { - return fmt.Errorf("role '%s' not found", cmd.role) - } - cmd.Permission.RoleId = role.RoleId - - perms := []types.Permission{cmd.Permission} - - for _, ref := range refs { - err = m.SetEntityPermissions(ctx, ref, perms) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/pool/change.go b/vendor/github.com/vmware/govmomi/govc/pool/change.go deleted file mode 100644 index 126733aea..000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/change.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package pool - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type change struct { - *flags.DatacenterFlag - *ResourceConfigSpecFlag - - name string -} - -func init() { - cli.Register("pool.change", &change{}) -} - -func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - cmd.ResourceConfigSpecFlag = NewResourceConfigSpecFlag() - cmd.ResourceConfigSpecFlag.Register(ctx, f) - - f.StringVar(&cmd.name, "name", "", "Resource pool name") -} - -func (cmd *change) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.ResourceConfigSpecFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *change) Usage() string { - return "POOL..." -} - -func (cmd *change) Description() string { - return "Change the configuration of one or more resource POOLs.\n" + poolNameHelp -} - -func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - cmd.SetAllocation(func(a types.BaseResourceAllocationInfo) { - ra := a.GetResourceAllocationInfo() - if ra.Shares.Level == "" { - ra.Shares = nil - } - }) - - for _, arg := range f.Args() { - pools, err := finder.ResourcePoolList(context.TODO(), arg) - if err != nil { - return err - } - - for _, pool := range pools { - err := pool.UpdateConfig(context.TODO(), cmd.name, &cmd.ResourceConfigSpec) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/pool/create.go b/vendor/github.com/vmware/govmomi/govc/pool/create.go deleted file mode 100644 index affad7420..000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/create.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package pool - -import ( - "flag" - "fmt" - "path" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.DatacenterFlag - *ResourceConfigSpecFlag -} - -func init() { - cli.Register("pool.create", &create{}) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.ResourceConfigSpecFlag = NewResourceConfigSpecFlag() - cmd.ResourceConfigSpecFlag.SetAllocation(func(a types.BaseResourceAllocationInfo) { - ra := a.GetResourceAllocationInfo() - ra.Shares.Level = types.SharesLevelNormal - ra.ExpandableReservation = types.NewBool(true) - }) - cmd.ResourceConfigSpecFlag.Register(ctx, f) -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.ResourceConfigSpecFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Usage() string { - return "POOL..." -} - -func (cmd *create) Description() string { - return "Create one or more resource POOLs.\n" + poolCreateHelp -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - for _, arg := range f.Args() { - dir := path.Dir(arg) - base := path.Base(arg) - parents, err := finder.ResourcePoolList(context.TODO(), dir) - if err != nil { - if _, ok := err.(*find.NotFoundError); ok { - return fmt.Errorf("cannot create resource pool '%s': parent not found", base) - } - return err - } - - for _, parent := range parents { - _, err = parent.Create(context.TODO(), base, cmd.ResourceConfigSpec) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/pool/destroy.go b/vendor/github.com/vmware/govmomi/govc/pool/destroy.go deleted file mode 100644 index 6e1fe2668..000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/destroy.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package pool - -import ( - "flag" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.DatacenterFlag - - recursive bool -} - -func init() { - cli.Register("pool.destroy", &destroy{}) -} - -func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.BoolVar(&cmd.recursive, "r", false, "Remove all child resource pools recursively") -} - -func (cmd *destroy) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *destroy) Usage() string { - return "POOL..." -} - -func (cmd *destroy) Description() string { - return "Destroy one or more resource POOLs.\n" + poolNameHelp -} - -func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - for _, arg := range f.Args() { - pools, err := finder.ResourcePoolList(context.TODO(), arg) - if err != nil { - if _, ok := err.(*find.NotFoundError); ok { - // Ignore if pool cannot be found - continue - } - - return err - } - - for _, pool := range pools { - if cmd.recursive { - err = pool.DestroyChildren(context.TODO()) - if err != nil { - return err - } - } - - task, err := pool.Destroy(context.TODO()) - if err != nil { - return err - } - err = task.Wait(context.TODO()) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/pool/help.go b/vendor/github.com/vmware/govmomi/govc/pool/help.go deleted file mode 100644 index dbd8ca23b..000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/help.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package pool - -var poolNameHelp = ` -POOL may be an absolute or relative path to a resource pool or a (clustered) -compute host. If it resolves to a compute host, the associated root resource -pool is returned. If a relative path is specified, it is resolved with respect -to the current datacenter's "host" folder (i.e. /ha-datacenter/host). - -Paths to nested resource pools must traverse through the root resource pool of -the selected compute host, i.e. "compute-host/Resources/nested-pool". - -The same globbing rules that apply to the "ls" command apply here. For example, -POOL may be specified as "*/Resources/*" to expand to all resource pools that -are nested one level under the root resource pool, on all (clustered) compute -hosts in the current datacenter.` - -var poolCreateHelp = ` -POOL may be an absolute or relative path to a resource pool. The parent of the -specified POOL must be an existing resource pool. If a relative path is -specified, it is resolved with respect to the current datacenter's "host" -folder (i.e. /ha-datacenter/host). The basename of the specified POOL is used -as the name for the new resource pool. - -The same globbing rules that apply to the "ls" command apply here. For example, -the path to the parent resource pool in POOL may be specified as "*/Resources" -to expand to the root resource pools on all (clustered) compute hosts in the -current datacenter. - -For example: - */Resources/test Create resource pool "test" on all (clustered) - compute hosts in the current datacenter. - somehost/Resources/*/nested Create resource pool "nested" in every - resource pool that is a direct descendant of - the root resource pool on "somehost".` diff --git a/vendor/github.com/vmware/govmomi/govc/pool/info.go b/vendor/github.com/vmware/govmomi/govc/pool/info.go deleted file mode 100644 index 7fcd28185..000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/info.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package pool - -import ( - "flag" - "fmt" - "io" - "text/tabwriter" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.DatacenterFlag - *flags.OutputFlag - - pools bool - apps bool -} - -func init() { - cli.Register("pool.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - f.BoolVar(&cmd.pools, "p", true, "List resource pools") - f.BoolVar(&cmd.apps, "a", false, "List virtual app resource pools") -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Usage() string { - return "POOL..." -} - -func (cmd *info) Description() string { - return "Retrieve information about one or more resource POOLs.\n" + poolNameHelp -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - c, err := cmd.Client() - if err != nil { - return err - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - var res infoResult - var props []string - - if cmd.OutputFlag.JSON { - props = nil - } else { - props = []string{ - "name", - "config.cpuAllocation", - "config.memoryAllocation", - "runtime.cpu", - "runtime.memory", - } - } - - var vapps []*object.VirtualApp - - for _, arg := range f.Args() { - if cmd.pools { - objects, err := finder.ResourcePoolList(ctx, arg) - if err != nil { - if _, ok := err.(*find.NotFoundError); !ok { - return err - } - } - res.objects = append(res.objects, objects...) - } - - if cmd.apps { - apps, err := finder.VirtualAppList(ctx, arg) - if err != nil { - if _, ok := err.(*find.NotFoundError); !ok { - return err - } - } - vapps = append(vapps, apps...) - } - } - - if len(res.objects) != 0 { - refs := make([]types.ManagedObjectReference, 0, len(res.objects)) - for _, o := range res.objects { - refs = append(refs, o.Reference()) - } - - pc := property.DefaultCollector(c) - err = pc.Retrieve(ctx, refs, props, &res.ResourcePools) - if err != nil { - return err - } - } - - if len(vapps) != 0 { - var apps []mo.VirtualApp - refs := make([]types.ManagedObjectReference, 0, len(vapps)) - for _, o := range vapps { - refs = append(refs, o.Reference()) - p := object.NewResourcePool(c, o.Reference()) - p.InventoryPath = o.InventoryPath - res.objects = append(res.objects, p) - } - - pc := property.DefaultCollector(c) - err = pc.Retrieve(ctx, refs, props, &apps) - if err != nil { - return err - } - - for _, app := range apps { - res.ResourcePools = append(res.ResourcePools, app.ResourcePool) - } - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - ResourcePools []mo.ResourcePool - objects []*object.ResourcePool -} - -func (r *infoResult) Write(w io.Writer) error { - // Maintain order via r.objects as Property collector does not always return results in order. - objects := make(map[types.ManagedObjectReference]mo.ResourcePool, len(r.ResourcePools)) - for _, o := range r.ResourcePools { - objects[o.Reference()] = o - } - - tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) - - for _, o := range r.objects { - pool := objects[o.Reference()] - fmt.Fprintf(tw, "Name:\t%s\n", pool.Name) - fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) - - writeInfo(tw, "CPU", "MHz", &pool.Runtime.Cpu, pool.Config.CpuAllocation) - pool.Runtime.Memory.MaxUsage >>= 20 - pool.Runtime.Memory.OverallUsage >>= 20 - writeInfo(tw, "Mem", "MB", &pool.Runtime.Memory, pool.Config.MemoryAllocation) - } - - return tw.Flush() -} - -func writeInfo(w io.Writer, name string, units string, ru *types.ResourcePoolResourceUsage, b types.BaseResourceAllocationInfo) { - ra := b.GetResourceAllocationInfo() - usage := 100.0 * float64(ru.OverallUsage) / float64(ru.MaxUsage) - shares := "" - limit := "unlimited" - - if ra.Shares.Level == types.SharesLevelCustom { - shares = fmt.Sprintf(" (%d)", ra.Shares.Shares) - } - - if ra.Limit != -1 { - limit = fmt.Sprintf("%d%s", ra.Limit, units) - } - - fmt.Fprintf(w, " %s Usage:\t%d%s (%0.1f%%)\n", name, ru.OverallUsage, units, usage) - fmt.Fprintf(w, " %s Shares:\t%s%s\n", name, ra.Shares.Level, shares) - fmt.Fprintf(w, " %s Reservation:\t%d%s (expandable=%v)\n", name, ra.Reservation, units, *ra.ExpandableReservation) - fmt.Fprintf(w, " %s Limit:\t%s\n", name, limit) -} diff --git a/vendor/github.com/vmware/govmomi/govc/pool/resource_config_spec.go b/vendor/github.com/vmware/govmomi/govc/pool/resource_config_spec.go deleted file mode 100644 index 5fd61fd96..000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/resource_config_spec.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package pool - -import ( - "flag" - "strconv" - "strings" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" -) - -type sharesInfo types.SharesInfo - -func (s *sharesInfo) String() string { - return string(s.Level) -} - -func (s *sharesInfo) Set(val string) error { - switch val { - case string(types.SharesLevelNormal), string(types.SharesLevelLow), string(types.SharesLevelHigh): - s.Level = types.SharesLevel(val) - default: - n, err := strconv.Atoi(val) - if err != nil { - return err - } - - s.Level = types.SharesLevelCustom - s.Shares = n - } - - return nil -} - -func NewResourceConfigSpecFlag() *ResourceConfigSpecFlag { - f := new(ResourceConfigSpecFlag) - f.MemoryAllocation = new(types.ResourceAllocationInfo) - f.CpuAllocation = new(types.ResourceAllocationInfo) - - f.SetAllocation(func(a types.BaseResourceAllocationInfo) { - a.GetResourceAllocationInfo().Shares = new(types.SharesInfo) - }) - return f -} - -type ResourceConfigSpecFlag struct { - types.ResourceConfigSpec -} - -func (s *ResourceConfigSpecFlag) Register(ctx context.Context, f *flag.FlagSet) { - opts := []struct { - name string - units string - types.BaseResourceAllocationInfo - }{ - {"CPU", "MHz", s.CpuAllocation}, - {"Memory", "MB", s.MemoryAllocation}, - } - - for _, opt := range opts { - prefix := strings.ToLower(opt.name)[:3] - ra := opt.GetResourceAllocationInfo() - shares := (*sharesInfo)(ra.Shares) - - f.Int64Var(&ra.Limit, prefix+".limit", 0, opt.name+" limit in "+opt.units) - f.Int64Var(&ra.Reservation, prefix+".reservation", 0, opt.name+" reservation in "+opt.units) - f.Var(flags.NewOptionalBool(&ra.ExpandableReservation), prefix+".expandable", opt.name+" expandable reservation") - f.Var(shares, prefix+".shares", opt.name+" shares level or number") - } -} - -func (s *ResourceConfigSpecFlag) Process(ctx context.Context) error { - return nil -} - -func (s *ResourceConfigSpecFlag) SetAllocation(f func(types.BaseResourceAllocationInfo)) { - for _, a := range []types.BaseResourceAllocationInfo{s.CpuAllocation, s.MemoryAllocation} { - f(a) - } -} diff --git a/vendor/github.com/vmware/govmomi/govc/release.sh b/vendor/github.com/vmware/govmomi/govc/release.sh deleted file mode 100644 index f934ad342..000000000 --- a/vendor/github.com/vmware/govmomi/govc/release.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -e - -if ! which github-release > /dev/null; then - echo 'Please install github-release...' - echo '' - echo ' $ go get github.com/aktau/github-release' - echo '' - exit 1 -fi - -if [ -z "${GITHUB_TOKEN}" ]; then - echo 'Please set GITHUB_TOKEN...' - exit 1 -fi - -export GITHUB_USER="${GITHUB_USER:-vmware}" -export GITHUB_REPO="${GITHUB_REPO:-govmomi}" - -name="$(git describe)" - -case "$1" in - release) - tag="${name}" - ;; - prerelease) - tag="prerelease-${name}" - ;; - *) - echo "Usage: $0 [release|prerelease]" - exit 1 - ;; -esac - -echo "Building govc..." -rm -f govc_* -./build.sh -gzip -f govc_* - -echo "Pushing tag ${tag}..." -git tag -f "${tag}" -git push origin "refs/tags/${tag}" - -# Generate description -description=$( -if [[ "${tag}" == "prerelease-"* ]]; then - echo '**This is a PRERELEASE version.**' -fi - -echo ' -The binaries below are provided without warranty, following the [Apache license](LICENSE). -' - -echo ' -Instructions: -* Download the file relevant to your operating system -* Decompress (i.e. `gzip -d govc_linux_amd64.gz`) -* Set the executable bit (i.e. `chmod +x govc_linux_amd64`) -* Move the file to a directory in your `$PATH` (i.e. `mv govc_linux_amd64 /usr/local/bin`) -' - -echo '```' -echo '$ sha1sum govc_*.gz' -sha1sum govc_*.gz -echo '```' -) - -echo "Creating release..." -github-release release --tag "${tag}" --name "${name}" --description "${description}" --draft --pre-release - -# Upload build artifacts -for f in govc_*.gz; do - echo "Uploading $f..." - github-release upload --tag "${tag}" --name "${f}" --file "${f}" -done - -echo "Remember to publish the draft release!" diff --git a/vendor/github.com/vmware/govmomi/govc/test/.gitignore b/vendor/github.com/vmware/govmomi/govc/test/.gitignore deleted file mode 100644 index 8000dd9db..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.vagrant diff --git a/vendor/github.com/vmware/govmomi/govc/test/README.md b/vendor/github.com/vmware/govmomi/govc/test/README.md deleted file mode 100644 index d48e8fc86..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Functional tests for govc - -## Bats - -Install [Bats](https://github.com/sstephenson/bats/) - -## coreutils - -Install gxargs, greadlink and gmktemp on Darwin - -``` -brew install coreutils -brew install findutils -``` - -## Download test images - -Some tests depend on [ttylinux](http://ttylinux.net) images, these can be downloaded by running: - -``` -./images/update.sh -``` - -These images are uploaded to the esxbox as needed by tests and can be -removed with the following command: - -``` -./clean.sh -``` - -## GOVC_TEST_URL - -The govc tests need an ESX instance to run against. The default -`GOVC_TEST_URL` is that of the vagrant box in the *esxbox* directory: - -``` -(cd esxbox && vagrant up) -``` - -Any other ESX box can be used by exporting the following variable: - -``` -export GOVC_TEST_URL=user:pass@hostname -``` - -## vCenter Simulator - -Some tests require vCenter and depend on the Vagrant box in the -*vcsim* directory. These tests are skipped if the vcsim box is not -running. To enable these tests: - -``` -(cd vcsim && vagrant up) -``` - -## Running tests - -The test helper prepends ../govc to `PATH`. - -The tests can be run from any directory, as *govc* is found related to -`PATH` and *images* are found relative to `$BATS_TEST_DIRNAME`. - -The entire suite can be run with the following command: - -``` -bats . -``` - -Or individually, for example: - -``` -./cli.bats -``` diff --git a/vendor/github.com/vmware/govmomi/govc/test/boot_order_test.sh b/vendor/github.com/vmware/govmomi/govc/test/boot_order_test.sh deleted file mode 100644 index e52d16be9..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/boot_order_test.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -e - -# This test is not run via bats. -# A VNC session will be opened to observe the VM boot order: -# 1) from floppy (followed by: eject floppy, reboot) -# 2) from cdrom (followed by: eject cdrom, reboot) -# 3) from network (will timeout) -# 4) from disk - -. $(dirname $0)/test_helper.bash - -upload_img -upload_iso - -id=$(new_ttylinux_vm) - -function cleanup() { - quit_vnc $vnc - govc vm.destroy $id - pkill -TERM -g $$ ^nc -} - -trap cleanup EXIT - -govc device.cdrom.add -vm $id > /dev/null -govc device.cdrom.insert -vm $id $GOVC_TEST_ISO - -govc device.floppy.add -vm $id > /dev/null -govc device.floppy.insert -vm $id $GOVC_TEST_IMG - -govc device.boot -vm $id -delay 1000 -order floppy,cdrom,ethernet,disk - -vnc=$(govc vm.vnc -port 21122 -password govmomi -enable "${id}" | awk '{print $2}') - -echo "booting from floppy..." -govc vm.power -on $id - -open_vnc $vnc - -sleep 10 - -govc vm.power -off $id - -govc device.floppy.eject -vm $id - -# this is ttylinux-live, notice the 'boot:' prompt vs 'login:' prompt when booted from disk -echo "booting from cdrom..." -govc vm.power -on $id - -sleep 10 - -govc vm.power -off $id - -govc device.cdrom.eject -vm $id - -host_ip=$(echo $vnc | awk -F@ '{print $2}' | awk -F: '{print $1}') -serial_port=33233 -govc device.serial.add -vm $id > /dev/null -govc device.serial.connect -vm $id $uri telnet://:$serial_port - -echo "booting from network, will timeout then boot from disk..." -govc vm.power -on $id - -# capture serial console -echo | nc $host_ip $serial_port 2>/dev/null & - -ip=$(govc vm.ip $id) - -echo "VM booted from disk (ip=$ip)" - -sleep 5 - -govc vm.power -s $id - -sleep 5 diff --git a/vendor/github.com/vmware/govmomi/govc/test/clean.sh b/vendor/github.com/vmware/govmomi/govc/test/clean.sh deleted file mode 100644 index c7700852c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/clean.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Cleanup any artifacts created by govc -# - -. $(dirname $0)/test_helper.bash - -teardown - -datastore_rm() { - name=$1 - govc datastore.rm $name 2> /dev/null -} - -datastore_rm $GOVC_TEST_IMG -datastore_rm $GOVC_TEST_ISO -datastore_rm $GOVC_TEST_VMDK -datastore_rm $(echo $GOVC_TEST_VMDK | sed 's/.vmdk/-flat.vmdk/') - -# Recursively destroy all resource pools created by the test suite -govc ls host/*/Resources/govc-test-* | \ - xargs -rt govc pool.destroy -r - -govc datastore.ls diff --git a/vendor/github.com/vmware/govmomi/govc/test/cli.bats b/vendor/github.com/vmware/govmomi/govc/test/cli.bats deleted file mode 100644 index 72ea52406..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/cli.bats +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "about" { - run govc about - assert_success - assert_line "Vendor: VMware, Inc." -} - -@test "login attempt without credentials" { - run govc about -u $(echo $GOVC_URL | awk -F@ '{print $2}') - assert_failure "govc: ServerFaultCode: Cannot complete login due to an incorrect user name or password." -} - -@test "login attempt with GOVC_URL, GOVC_USERNAME, and GOVC_PASSWORD" { - govc_url_to_vars - run govc about - assert_success -} - -@test "connect to an endpoint with a non-supported API version" { - run env GOVC_MIN_API_VERSION=24.4 govc about - assert grep -q "^govc: Require API version 24.4," <<<${output} -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/datacenter.bats b/vendor/github.com/vmware/govmomi/govc/test/datacenter.bats deleted file mode 100644 index 9a1a94a01..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/datacenter.bats +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "create and destroy datacenters" { - vcsim_env - dcs=(`uuidgen` `uuidgen`) - run govc datacenter.create ${dcs[0]} ${dcs[1]} - assert_success - - for dc in ${dcs[*]}; do - run govc ls /$dc - assert_success - # //{vm,network,host,datastore} - [ ${#lines[@]} -eq 4 ] - done - - run govc datacenter.destroy ${dcs[0]} ${dcs[1]} - assert_success - - for dc in ${dcs[*]}; do - run govc ls /$dc - assert_success - [ ${#lines[@]} -eq 0 ] - done -} - -@test "destroy datacenter using glob" { - vcsim_env - prefix=test-dc - dcs=(${prefix}-`uuidgen` ${prefix}-`uuidgen`) - run govc datacenter.create ${dcs[0]} ${dcs[1]} - assert_success - - run govc datacenter.destroy ${prefix}-* - assert_success - - for dc in ${dcs[*]}; do - run govc ls /$dc - assert_success - [ ${#lines[@]} -eq 0 ] - done -} - -@test "destroy datacenter that doesn't exist" { - vcsim_env - dc=$(uuidgen) - - run govc datacenter.destroy $dc - assert_success -} - -@test "create datacenter that already exists" { - vcsim_env - dc=$(uuidgen) - - run govc datacenter.create $dc - assert_success - - run govc datacenter.create $dc - assert_success - - run govc datacenter.destroy $dc - assert_success -} - -@test "fails when datacenter name not specified" { - run govc datacenter.create - assert_failure - - run govc datacenter.destroy - assert_failure -} - -@test "fails when operation attempted on standalone ESX host" { - run govc datacenter.create something - assert_failure - assert_output "govc: ServerFaultCode: The operation is not supported on the object." -} - -@test "fails when attempting to destroy ha-datacenter" { - run govc datacenter.destroy ha-datacenter - assert_failure - assert_output "govc: The operation is not supported on the object." -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/datastore.bats b/vendor/github.com/vmware/govmomi/govc/test/datastore.bats deleted file mode 100644 index c1d4acac6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/datastore.bats +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -upload_file() { - file=$($mktemp --tmpdir govc-test-XXXXX) - name=$(basename ${file}) - echo "Hello world!" > ${file} - - run govc datastore.upload "${file}" "${name}" - assert_success - - rm -f "${file}" - echo "${name}" -} - -@test "datastore.ls" { - name=$(upload_file) - - # Single argument - run govc datastore.ls "${name}" - assert_success - [ ${#lines[@]} -eq 1 ] - - # Multiple arguments - run govc datastore.ls "${name}" "${name}" - assert_success - [ ${#lines[@]} -eq 2 ] - - # Pattern argument - run govc datastore.ls "./govc-test-*" - assert_success - [ ${#lines[@]} -ge 1 ] - - # Long listing - run govc datastore.ls -l "./govc-test-*" - assert_success - assert_equal "13B" $(awk '{ print $1 }' <<<${output}) -} - -@test "datastore.rm" { - name=$(upload_file) - - # Not found is a failure - run govc datastore.rm "${name}.notfound" - assert_failure - assert_matches "govc: File .* was not found" "${output}" - - # Not found is NOT a failure with the force flag - run govc datastore.rm -f "${name}.notfound" - assert_success - assert_empty "${output}" - - # Verify the file is present - run govc datastore.ls "${name}" - assert_success - - # Delete the file - run govc datastore.rm "${name}" - assert_success - assert_empty "${output}" - - # Verify the file is gone - run govc datastore.ls "${name}" - assert_failure -} - -@test "datastore.info" { - run govc datastore.info enoent - assert_failure - - run govc datastore.info - assert_success - [ ${#lines[@]} -gt 1 ] -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/device.bats b/vendor/github.com/vmware/govmomi/govc/test/device.bats deleted file mode 100644 index b764830a6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/device.bats +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "device.ls" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep ethernet-0 | wc -l) - [ $result -eq 1 ] -} - -@test "device.info" { - vm=$(new_empty_vm) - - run govc device.info -vm $vm ide-200 - assert_success - - run govc device.info -vm $vm ide-20000 - assert_failure -} - -@test "device.boot" { - vm=$(new_ttylinux_vm) - - result=$(govc device.ls -vm $vm -boot | wc -l) - [ $result -eq 0 ] - - run govc device.boot -vm $vm -order floppy,cdrom,ethernet,disk - assert_success - - result=$(govc device.ls -vm $vm -boot | wc -l) - [ $result -eq 2 ] - - run govc device.cdrom.add -vm $vm - assert_success - - run govc device.floppy.add -vm $vm - assert_success - - run govc device.boot -vm $vm -order floppy,cdrom,ethernet,disk - assert_success - - result=$(govc device.ls -vm $vm -boot | wc -l) - [ $result -eq 4 ] -} - -@test "device.cdrom" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep cdrom- | wc -l) - [ $result -eq 0 ] - - run govc device.cdrom.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - run govc device.info -vm $vm $id - assert_success - - run govc device.cdrom.insert -vm $vm -device $id x.iso - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: ISO [${GOVC_DATASTORE}] x.iso" - - run govc device.disconnect -vm $vm $id - assert_success - - run govc device.connect -vm $vm $id - assert_success - - run govc device.remove -vm $vm $id - assert_success - - run govc device.disconnect -vm $vm $id - assert_failure "govc: device '$id' not found" - - run govc device.cdrom.insert -vm $vm -device $id x.iso - assert_failure "govc: device '$id' not found" - - run govc device.remove -vm $vm $id - assert_failure "govc: device '$id' not found" -} - -@test "device.floppy" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep floppy- | wc -l) - [ $result -eq 0 ] - - run govc device.floppy.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - run govc device.info -vm $vm $id - assert_success - - run govc device.floppy.insert -vm $vm -device $id x.img - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: Image [${GOVC_DATASTORE}] x.img" - - run govc device.disconnect -vm $vm $id - assert_success - - run govc device.connect -vm $vm $id - assert_success - - run govc device.remove -vm $vm $id - assert_success - - run govc device.disconnect -vm $vm $id - assert_failure "govc: device '$id' not found" - - run govc device.floppy.insert -vm $vm -device $id x.img - assert_failure "govc: device '$id' not found" - - run govc device.remove -vm $vm $id - assert_failure "govc: device '$id' not found" -} - -@test "device.serial" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep serial- | wc -l) - [ $result -eq 0 ] - - run govc device.serial.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - run govc device.info -vm $vm $id - assert_success - - uri=telnet://:33233 - run govc device.serial.connect -vm $vm -device $id $uri - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: Remote $uri" - - run govc device.serial.disconnect -vm $vm -device $id - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: Remote localhost:0" - - run govc device.disconnect -vm $vm $id - assert_success - - run govc device.connect -vm $vm $id - assert_success - - run govc device.remove -vm $vm $id - assert_success - - run govc device.disconnect -vm $vm $id - assert_failure "govc: device '$id' not found" - - run govc device.serial.connect -vm $vm -device $id $uri - assert_failure "govc: device '$id' not found" - - run govc device.remove -vm $vm $id - assert_failure "govc: device '$id' not found" -} - -@test "device.scsi" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) - [ $result -eq 1 ] - - run govc device.scsi.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) - [ $result -eq 2 ] - - run govc device.scsi.add -vm $vm -type pvscsi - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile b/vendor/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile deleted file mode 100644 index df9a01576..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile +++ /dev/null @@ -1,27 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.ssh.insert_key = false - config.ssh.default.username = "root" - config.ssh.shell = "sh" - config.vm.hostname = "esxbox" - - config.vm.box = "esxi55" - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.network "forwarded_port", guest: 443, host: 18443 - - [:vmware_fusion, :vmware_workstation].each do |name| - config.vm.provider name do |v,override| - v.vmx["memsize"] = "4096" - end - end - - config.vm.provision "shell", privileged: false, :inline => </dev/null - run govc import.ovf ./images/${TTYLINUX_NAME}.ovf - assert_success - popd >/dev/null - - run govc vm.destroy ${TTYLINUX_NAME} - assert_success -} - -@test "import.ovf with name in options" { - name=$(new_id) - file=$($mktemp --tmpdir govc-test-XXXXX) - echo "{ \"Name\": \"${name}\"}" > ${file} - - run govc import.ovf -options="${file}" $GOVC_IMAGES/${TTYLINUX_NAME}.ovf - assert_success - - run govc vm.destroy "${name}" - assert_success - - rm -f ${file} -} - -@test "import.ovf with name as argument" { - name=$(new_id) - - run govc import.ova -name="${name}" $GOVC_IMAGES/${TTYLINUX_NAME}.ova - assert_success - - run govc vm.destroy "${name}" - assert_success -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/license.bats b/vendor/github.com/vmware/govmomi/govc/test/license.bats deleted file mode 100644 index 6132eb11d..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/license.bats +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -# These tests should only run against a server running an evaluation license. -verify_evaluation() { - if [ "$(govc license.list -json | jq -r .[0].EditionKey)" != "eval" ]; then - skip "requires evaluation license" - fi -} - -get_key() { - jq ".[] | select(.LicenseKey == \"$1\")" -} - -get_property() { - jq -r ".Properties[] | select(.Key == \"$1\") | .Value" -} - -@test "license.add" { - verify_evaluation - - run govc license.add -json 00000-00000-00000-00000-00001 00000-00000-00000-00000-00002 - assert_success - - # Expect to see an entry for both the first and the second key - assert_equal "License is not valid for this product" $(get_key 00000-00000-00000-00000-00001 <<<${output} | get_property diagnostic) - assert_equal "License is not valid for this product" $(get_key 00000-00000-00000-00000-00002 <<<${output} | get_property diagnostic) -} - -@test "license.remove" { - verify_evaluation - - run govc license.remove -json 00000-00000-00000-00000-00001 - assert_success -} - -@test "license.list" { - verify_evaluation - - run govc license.list -json - assert_success - - # Expect the test instance to run in evaluation mode - assert_equal "Evaluation Mode" $(get_key 00000-00000-00000-00000-00000 <<<$output | jq -r ".Name") -} - -@test "license.decode" { - verify_evaluation - - key=00000-00000-00000-00000-00000 - assert_equal "eval" $(govc license.decode $key | grep $key | awk '{print $2}') -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/logs.bats b/vendor/github.com/vmware/govmomi/govc/test/logs.bats deleted file mode 100644 index 733cd8f9c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/logs.bats +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "logs" { - run govc logs - assert_success - nlogs=${#lines[@]} - # there should be plenty more than 1 line of hostd logs - [ $nlogs -ge 1 ] - - # test -n flag - run govc logs -n $((nlogs - 1)) - assert_success - [ ${#lines[@]} -le $nlogs ] - - run govc logs -log vmkernel - assert_success - nlogs=${#lines[@]} - # there should be plenty more than 1 line of vmkernel logs - [ $nlogs -ge 1 ] - - # -host ignored against ESX - run govc logs -host enoent - assert_success - - run govc logs -log enoent - assert_failure -} - -@test "logs.ls" { - run govc logs.ls - assert_success - - # -host ignored against ESX - run govc logs.ls -host enoent - assert_success -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/ls.bats b/vendor/github.com/vmware/govmomi/govc/test/ls.bats deleted file mode 100644 index 9c290c97a..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/ls.bats +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "ls" { - run govc ls - assert_success - # /dc/{vm,network,host,datastore} - [ ${#lines[@]} -ge 4 ] - - run govc ls host - assert_success - [ ${#lines[@]} -ge 1 ] - - run govc ls enoent - assert_success - [ ${#lines[@]} -eq 0 ] -} - -@test "ls vm" { - vm=$(new_empty_vm) - - run govc ls vm - assert_success - [ ${#lines[@]} -ge 1 ] - - run govc ls vm/$vm - assert_success - [ ${#lines[@]} -eq 1 ] - - run govc ls /*/vm/$vm - assert_success - [ ${#lines[@]} -eq 1 ] -} - -@test "ls network" { - run govc ls network - assert_success - [ ${#lines[@]} -ge 1 ] - - local path=${lines[0]} - run govc ls $path - assert_success - [ ${#lines[@]} -eq 1 ] - - run govc ls network/$(basename $path) - assert_success - [ ${#lines[@]} -eq 1 ] - - run govc ls /*/network/$(basename $path) - assert_success - [ ${#lines[@]} -eq 1 ] -} - -@test "ls multi ds" { - vcsim_env - - run govc ls - assert_success - # /DC0/{vm,network,host,datastore} - [ ${#lines[@]} -eq 4 ] - - run govc ls /DC* - assert_success - # /DC[0,1]/{vm,network,host,datastore} - [ ${#lines[@]} -eq 8 ] - - # here 'vm' is relative to /DC0 - run govc ls vm - assert_success - [ ${#lines[@]} -gt 0 ] - - unset GOVC_DATACENTER - - run govc ls - assert_success - # /DC[0,1] - [ ${#lines[@]} -eq 2 ] - - run govc ls -dc enoent - assert_failure - [ ${#lines[@]} -gt 0 ] - - # here 'vm' is relative to '/' - so there are no matches - run govc ls vm - assert_success - [ ${#lines[@]} -eq 0 ] - - # ls all vms in all datacenters - run govc ls */vm - assert_success - [ ${#lines[@]} -gt 0 ] -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/network.bats b/vendor/github.com/vmware/govmomi/govc/test/network.bats deleted file mode 100644 index 242e013c8..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/network.bats +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "network dvs backing" { - vcsim_env - - # DVS backed network by default (from vcsim_env) - vm=$(new_empty_vm) - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - run govc device.info -vm $vm $eth0 - assert_success - - summary=$(govc device.info -vm $vm $eth0 | grep Summary: | awk '{print $2}') - assert_equal "DVSwitch:" $summary - - run govc device.remove -vm $vm $eth0 - assert_success - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - [ -z "$eth0" ] - - # Standard network backing - run govc vm.network.add -vm $vm -net "VM Network" - assert_success - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - - run govc device.info -vm $vm $eth0 - assert_success - - summary=$(govc device.info -vm $vm $eth0 | grep Summary: | awk -F: '{print $2}') - assert_equal "VM Network" $(collapse_ws $summary) - - run govc device.remove -vm $vm $eth0 - assert_success - - run govc device.remove -vm $vm $eth0 - assert_failure "govc: device '$eth0' not found" -} - -@test "network change backing" { - vcsim_env - - vm=$(new_empty_vm) - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - run govc vm.network.change -vm $vm $eth0 enoent - assert_failure "govc: network 'enoent' not found" - - run govc vm.network.change -vm $vm enoent "VM Network" - assert_failure "govc: device 'enoent' not found" - - run govc vm.network.change -vm $vm $eth0 "VM Network" - assert_success - - run govc vm.network.change -vm $vm $eth0 - assert_success - - unset GOVC_NETWORK - run govc vm.network.change -vm $vm $eth0 - assert_failure "govc: default network resolves to multiple instances, please specify" - - run govc vm.power -on $vm - assert_success - run govc vm.power -off $vm - - mac=$(vm_mac $vm) - run govc vm.network.change -vm $vm -net "VM Network" $eth0 - assert_success - - # verify we didn't change the mac address - run govc vm.power -on $vm - assert_success - assert_equal $mac $(vm_mac $vm) -} - -@test "network standard backing" { - vm=$(new_empty_vm) - - run govc device.info -vm $vm ethernet-0 - assert_success - - run govc device.remove -vm $vm ethernet-0 - assert_success - - run govc device.info -vm $vm ethernet-0 - assert_failure - - run govc vm.network.add -vm $vm enoent - assert_failure "govc: network 'enoent' not found" - - run govc vm.network.add -vm $vm "VM Network" - assert_success - - run govc device.info -vm $vm ethernet-0 - assert_success -} - -@test "network adapter" { - vm=$(new_id) - run govc vm.create -on=false -net.adapter=enoent $vm - assert_failure "govc: unknown ethernet card type 'enoent'" - - vm=$(new_id) - run govc vm.create -on=false -net.adapter=vmxnet3 $vm - assert_success - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - type=$(govc device.info -vm $vm $eth0 | grep Type: | awk -F: '{print $2}') - assert_equal "VirtualVmxnet3" $(collapse_ws $type) - - run govc vm.network.add -vm $vm -net.adapter e1000e "VM Network" - assert_success - - eth1=$(govc device.ls -vm $vm | grep ethernet- | grep -v $eth0 | awk '{print $1}') - type=$(govc device.info -vm $vm $eth1 | grep Type: | awk -F: '{print $2}') - assert_equal "VirtualE1000e" $(collapse_ws $type) -} - -@test "network flag required" { - vcsim_env - - # -net flag is required when there are multiple networks - unset GOVC_NETWORK - run govc vm.create -on=false $(new_id) - assert_failure "govc: default network resolves to multiple instances, please specify" -} - -@test "network change hardware address" { - mac="00:00:0f$(dd bs=1 count=3 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02x"')" - vm=$(new_id) - run govc vm.create -on=false $vm - assert_success - - run govc vm.network.change -vm $vm -net.address $mac ethernet-0 - assert_success - - run govc vm.power -on $vm - assert_success - - assert_equal $mac $(vm_mac $vm) -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/pool.bats b/vendor/github.com/vmware/govmomi/govc/test/pool.bats deleted file mode 100644 index d2b551c1b..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/pool.bats +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "pool.create" { - path="*/Resources/$(new_id)/$(new_id)" - run govc pool.create $path - assert_failure - assert_line "govc: cannot create resource pool '$(basename ${path})': parent not found" - - id=$(new_id) - path="*/Resources/$id" - run govc pool.create -cpu.shares low -mem.reservation 500 $path - assert_success - - run govc pool.info $path - assert_success - - assert_line "Name: $id" - assert_line "CPU Shares: low" - assert_line "Mem Reservation: 500MB (expandable=true)" - - run govc pool.destroy $path - assert_success -} - -@test "pool.create multiple" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - # Create multiple parent pools with multiple arguments (without globbing) - run govc pool.create $path/a $path/b - assert_success - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # Create multiple child pools with one argument (with globbing) - run govc pool.create $path/*/{a,b} - assert_success - result=$(govc ls "host/$path/*/*" | wc -l) - [ $result -eq 4 ] - - # Clean up - run govc pool.destroy $path/*/* $path/* $path - assert_success -} - -@test "pool.change" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - run govc pool.change -mem.shares high $path - assert_success - run govc pool.info $path - assert_success - assert_line "Mem Shares: high" - assert_line "CPU Shares: normal" - - nid=$(new_id) - run govc pool.change -name $nid $path - assert_success - path="*/Resources/$nid" - - run govc pool.info $path - assert_success - assert_line "Name: $nid" - - run govc pool.destroy $path - assert_success -} - -@test "pool.change multiple" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - # Create some nested pools so that we can test changing multiple in one call - govc pool.create $path/{a,b} $path/{a,b}/test - - # Test precondition - run govc pool.info $path/a/test - assert_success - assert_line "Name: test" - run govc pool.info $path/b/test - assert_success - assert_line "Name: test" - - # Change name of both test pools - run govc pool.change -name hello $path/*/test - assert_success - - # Test postcondition - run govc pool.info $path/a/hello - assert_success - assert_line "Name: hello" - run govc pool.info $path/b/hello - assert_success - assert_line "Name: hello" - - # Clean up - govc pool.destroy $path/a/hello - govc pool.destroy $path/a - govc pool.destroy $path/b/hello - govc pool.destroy $path/b - govc pool.destroy $path -} - -@test "pool.destroy" { - id=$(new_id) - - # should not be any existing test pools - result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) - [ $result -eq 0 ] - - # parent pool - path="*/Resources/$id" - run govc pool.create $path - assert_success - - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 0 ] - - # child pools - run govc pool.create $path/$(new_id) - assert_success - - run govc pool.create $path/$(new_id) - assert_success - - # 2 child pools - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # 1 parent pool - result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) - [ $result -eq 1 ] - - run govc pool.destroy -r $path - assert_success - - # if we didn't -r, the child pools would end up here - result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) - [ $result -eq 0 ] -} - -@test "pool.destroy multiple" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - # Create some nested pools so that we can test destroying multiple in one call - govc pool.create $path/{a,b} - - # Test precondition - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # Destroy both pools - run govc pool.destroy $path/{a,b} - assert_success - - # Test postcondition - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 0 ] - - # Clean up - govc pool.destroy $path -} - -@test "vm.create -pool" { - # test with full inventory path to pools - parent_path=$(govc ls 'host/*/Resources') - parent_name=$(basename $parent_path) - [ "$parent_name" = "Resources" ] - - child_name=$(new_id) - child_path="$parent_path/$child_name" - - grand_child_name=$(new_id) - grand_child_path="$child_path/$grand_child_name" - - run govc pool.create $parent_path/$child_name{,/$grand_child_name} - assert_success - - for path in $parent_path $child_path $grand_child_path - do - run govc vm.create -pool $path $(new_id) - assert_success - done - - run govc pool.change -debug -mem.limit 100 -mem.expandable=false $child_path - assert_failure - - run govc pool.change -debug -mem.limit 100 $child_path - assert_success - - run govc pool.change -debug -mem.limit 120 -mem.expandable $child_path - assert_success - - # test with glob inventory path to pools - parent_path="*/$parent_name" - child_path="$parent_path/$child_name" - grand_child_path="$child_path/$grand_child_name" - - for path in $grand_child_path $child_path - do - run govc pool.destroy $path - assert_success - done -} - -@test "vm.create -pool host" { - id=$(new_id) - - path=$(govc ls host) - - run govc vm.create -on=false -pool enoent $id - assert_failure "govc: resource pool 'enoent' not found" - - run govc vm.create -on=false -pool $path $id - assert_success -} - -@test "vm.create -pool cluster" { - vcsim_env - - id=$(new_id) - - path=$(dirname $GOVC_HOST) - - unset GOVC_HOST - unset GOVC_RESOURCE_POOL - - run govc vm.create -on=false -pool enoent $id - assert_failure "govc: resource pool 'enoent' not found" - - run govc vm.create -on=false -pool $path $id - assert_success -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/test_helper.bash b/vendor/github.com/vmware/govmomi/govc/test/test_helper.bash deleted file mode 100644 index 233aaae1c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/test_helper.bash +++ /dev/null @@ -1,248 +0,0 @@ -GOVC_TEST_URL=${GOVC_TEST_URL-"https://root:vagrant@localhost:18443/sdk"} -export GOVC_URL=$GOVC_TEST_URL -export GOVC_DATASTORE=datastore1 -export GOVC_NETWORK="VM Network" -export GOVC_INSECURE=true -unset GOVC_DATACENTER -unset GOVC_USERNAME -unset GOVC_PASSWORD - -if [ -z "$BATS_TEST_DIRNAME" ]; then - BATS_TEST_DIRNAME=$(dirname ${BASH_SOURCE}) -fi - -# gnu core utils -readlink=$(type -p greadlink readlink | head -1) -xargs=$(type -p gxargs xargs | head -1) -mktemp=$(type -p gmktemp mktemp | head -1) - -BATS_TEST_DIRNAME=$($readlink -nf $BATS_TEST_DIRNAME) - -GOVC_IMAGES=$BATS_TEST_DIRNAME/images -TTYLINUX_NAME=ttylinux-pc_i486-16.1 - -GOVC_TEST_VMDK_SRC=$GOVC_IMAGES/${TTYLINUX_NAME}-disk1.vmdk -GOVC_TEST_VMDK=$(basename $GOVC_TEST_VMDK_SRC) - -GOVC_TEST_ISO_SRC=$GOVC_IMAGES/${TTYLINUX_NAME}.iso -GOVC_TEST_ISO=$(basename $GOVC_TEST_ISO_SRC) - -GOVC_TEST_IMG_SRC=$GOVC_IMAGES/floppybird.img -GOVC_TEST_IMG=$(basename $GOVC_TEST_IMG_SRC) - -PATH="$(dirname $BATS_TEST_DIRNAME):$PATH" - -teardown() { - govc ls vm | grep govc-test- | $xargs -r govc vm.destroy - govc datastore.ls | grep govc-test- | awk '{print ($NF)}' | $xargs -n1 -r govc datastore.rm -} - -new_id() { - echo "govc-test-$(uuidgen)" -} - -import_ttylinux_vmdk() { - # TODO: fix datastore.ls do we don't need grep - govc datastore.ls | grep -q $GOVC_TEST_VMDK || \ - govc import.vmdk $GOVC_TEST_VMDK_SRC > /dev/null -} - -datastore_upload() { - src=$1 - dst=$(basename $src) - # TODO: fix datastore.ls do we don't need grep - govc datastore.ls | grep -q $dst || \ - govc datastore.upload $src $dst > /dev/null -} - -upload_img() { - datastore_upload $GOVC_TEST_IMG_SRC -} - -upload_iso() { - datastore_upload $GOVC_TEST_ISO_SRC -} - -new_ttylinux_vm() { - import_ttylinux_vmdk # TODO: make this part of vagrant provision - id=$(new_id) - govc vm.create -m 32 -disk $GOVC_TEST_VMDK -disk.controller ide -on=false $id - echo $id -} - -new_empty_vm() { - id=$(new_id) - govc vm.create -on=false $id - echo $id -} - -vm_power_state() { - govc vm.info "$1" | grep "Power state:" | awk -F: '{print $2}' | collapse_ws -} - -vm_mac() { - govc device.info -vm "$1" ethernet-0 | grep "MAC Address" | awk '{print $NF}' -} - -# exports an enviroment for using vcsim if running, otherwise skips the calling test. -vcsim_env() { - if [ "$(uname)" == "Darwin" ]; then - PATH="/Applications/VMware Fusion.app/Contents/Library:$PATH" - fi - - if [ "$(vmrun list | grep $BATS_TEST_DIRNAME/vcsim | wc -l)" -eq 1 ]; then - export GOVC_URL=https://root:vmware@localhost:16443/sdk \ - GOVC_DATACENTER=DC0 \ - GOVC_DATASTORE=GlobalDS_0 \ - GOVC_HOST=/DC0/host/DC0_C0/DC0_C0_H0 \ - GOVC_RESOURCE_POOL=/DC0/host/DC0_C0/Resources \ - GOVC_NETWORK=/DC0/network/DC0_DVPG0 - else - skip "requires vcsim" - fi -} - -# remove username/password from $GOVC_URL and set $GOVC_{USERNAME,PASSWORD} -govc_url_to_vars() { - local url=$(awk -F@ '{print $2}' <<<"$GOVC_URL") - local userpass=$(awk -F// '{print $2}' <<<"$GOVC_URL" | awk -F@ '{print $1}') - local username=$(awk -F: '{print $1}' <<<"$userpass") - local password=$(awk -F: '{print $2}' <<<"$userpass") - - export GOVC_URL="$url" GOVC_USERNAME="$username" GOVC_PASSWORD="$password" - - # double check that we removed user/pass - grep -q -v @ <<<"$GOVC_URL" -} - -quit_vnc() { - if [ "$(uname)" = "Darwin" ]; then - osascript <&2 - return 1 -} - -assert_success() { - if [ "$status" -ne 0 ]; then - flunk "command failed with exit status $status: $output" - elif [ "$#" -gt 0 ]; then - assert_output "$1" - fi -} - -assert_failure() { - if [ "$status" -ne 1 ]; then - flunk $(printf "expected failed exit status=1, got status=%d" $status) - elif [ "$#" -gt 0 ]; then - assert_output "$1" - fi -} - -assert_equal() { - if [ "$1" != "$2" ]; then - { echo "expected: $1" - echo "actual: $2" - } | flunk - fi -} - -assert_output() { - local expected - if [ $# -eq 0 ]; then expected="$(cat -)" - else expected="$1" - fi - assert_equal "$expected" "$output" -} - -assert_matches() { - local pattern="${1}" - local actual="${2}" - - if [ $# -eq 1 ]; then - actual="$(cat -)" - fi - - if ! grep -q "${pattern}" <<<"${actual}"; then - { echo "pattern: ${pattern}" - echo "actual: ${actual}" - } | flunk - fi -} - -assert_empty() { - local actual="${1}" - - if [ $# -eq 0 ]; then - actual="$(cat -)" - fi - - if [ -n "${actual}" ]; then - { echo "actual: ${actual}" - } | flunk - fi -} - -assert_line() { - if [ "$1" -ge 0 ] 2>/dev/null; then - assert_equal "$2" "$(collapse_ws ${lines[$1]})" - else - local line - for line in "${lines[@]}"; do - if [ "$(collapse_ws $line)" = "$1" ]; then return 0; fi - done - flunk "expected line \`$1'" - fi -} - -refute_line() { - if [ "$1" -ge 0 ] 2>/dev/null; then - local num_lines="${#lines[@]}" - if [ "$1" -lt "$num_lines" ]; then - flunk "output has $num_lines lines" - fi - else - local line - for line in "${lines[@]}"; do - if [ "$line" = "$1" ]; then - flunk "expected to not find line \`$line'" - fi - done - fi -} - -assert() { - if ! "$@"; then - flunk "failed: $@" - fi -} diff --git a/vendor/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile b/vendor/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile deleted file mode 100644 index 76a3b6d3f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# VCSA with VC simulator enabled. -# 'vagrant provision' will erase any existing inventory and -# populate with the config in ./provision.sh - -Vagrant.configure("2") do |config| - config.vm.hostname = "vcsim" - - config.vm.box = "vcsa" - config.vm.synced_folder ".", "/vagrant", disabled: true - - config.vm.provision "shell", path: "provision.sh" - - config.vm.network "forwarded_port", guest: 443, host: 16443 - config.vm.network "forwarded_port", guest: 80, host: 16080 - - [:vmware_fusion, :vmware_workstation].each do |name| - config.vm.provider name do |v,override| - v.vmx["memsize"] = "4096" - end - end -end diff --git a/vendor/github.com/vmware/govmomi/govc/test/vcsim/provision.sh b/vendor/github.com/vmware/govmomi/govc/test/vcsim/provision.sh deleted file mode 100644 index 9732c277c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/vcsim/provision.sh +++ /dev/null @@ -1,30 +0,0 @@ -PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin - -echo "Creating vcsim model..." -cat > /etc/vmware-vpx/vcsim/model/initInventory-govc.cfg < - - 2 - 3 - 3 - 2 - 2 - 3 - 3 - 4 - 3 - 2 - - -EOF - -cat > /etc/vmware-vpx/vcsim/model/vcsim-default.cfg < -true -vcsim/model/initInventory-govc.cfg - -EOF - -echo "Starting VC simulator..." -vmware-vcsim-stop -vmware-vcsim-start default diff --git a/vendor/github.com/vmware/govmomi/govc/test/vm.bats b/vendor/github.com/vmware/govmomi/govc/test/vm.bats deleted file mode 100644 index 751cbedc6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/vm.bats +++ /dev/null @@ -1,339 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "vm.ip" { - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - run govc vm.ip $id - assert_success -} - -@test "vm.ip -esxcli" { - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - run govc vm.ip -esxcli $id - assert_success - - ip_esxcli=$output - - run govc vm.ip $id - assert_success - ip_tools=$output - - assert_equal $ip_esxcli $ip_tools -} - -@test "vm.create" { - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 0 ] - - result=$(govc device.ls -vm $vm | grep cdrom- | wc -l) - [ $result -eq 0 ] -} - -@test "vm.change" { - id=$(new_ttylinux_vm) - - run govc vm.change -g ubuntu64Guest -m 1024 -c 2 -vm $id - assert_success - - run govc vm.info $id - assert_success - assert_line "Guest name: Ubuntu Linux (64-bit)" - assert_line "Memory: 1024MB" - assert_line "CPU: 2 vCPU(s)" - - run govc vm.change -e "guestinfo.a=1" -e "guestinfo.b=2" -vm $id - assert_success - - run govc vm.info -e $id - assert_success - assert_line "guestinfo.a: 1" - assert_line "guestinfo.b: 2" - - nid=$(new_id) - run govc vm.change -name $nid -vm $id - assert_success - - run govc vm.info $id - [ ${#lines[@]} -eq 0 ] - - run govc vm.info $nid - [ ${#lines[@]} -gt 0 ] -} - -@test "vm.power" { - vm=$(new_ttylinux_vm) - - run vm_power_state $vm - assert_success "poweredOff" - - run govc vm.power $vm - assert_failure - - run govc vm.power -on -off $vm - assert_failure - - run govc vm.power -on $vm - assert_success - run vm_power_state $vm - assert_success "poweredOn" - - run govc vm.power -suspend $vm - assert_success - run vm_power_state $vm - assert_success "suspended" - - run govc vm.power -on $vm - assert_success - run vm_power_state $vm - assert_success "poweredOn" -} - -@test "vm.power -force" { - vm=$(new_id) - govc vm.create $vm - - run govc vm.power -r $vm - assert_failure - - run govc vm.power -r -force $vm - assert_success - - run govc vm.power -s $vm - assert_failure - - run govc vm.power -s -force $vm - assert_success - - run govc vm.power -off $vm - assert_failure - - run govc vm.power -off -force $vm - assert_success - - run govc vm.destroy $vm - assert_success - - run govc vm.power -off $vm - assert_failure - - run govc vm.power -off -force $vm - assert_failure -} - -@test "vm.create pvscsi" { - vm=$(new_id) - govc vm.create -on=false -disk.controller pvscsi $vm - - result=$(govc device.ls -vm $vm | grep pvscsi- | wc -l) - [ $result -eq 1 ] - - result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) - [ $result -eq 0 ] -} - -@test "vm.create in cluster" { - vcsim_env - - # using GOVC_HOST and its resource pool - run govc vm.create -on=false $(new_id) - assert_success - - # using no -host and the default resource pool for DC0 - unset GOVC_HOST - run govc vm.create -on=false $(new_id) - assert_success -} - -@test "vm.info" { - local num=3 - - local prefix=$(new_id) - - for x in $(seq $num) - do - local id="${prefix}-${x}" - - # If VM is not found: No output, exit code==0 - run govc vm.info $id - assert_success - [ ${#lines[@]} -eq 0 ] - - # If VM is not found (using -json flag): Valid json output, exit code==0 - run govc vm.info -json $id - assert_success - assert_line "{\"VirtualMachines\":null}" - - run govc vm.create -on=false $id - assert_success - - local info=$(govc vm.info -r $id) - local found=$(grep Name: <<<"$info" | wc -l) - [ "$found" -eq 1 ] - - # test that mo names are printed - found=$(grep Host: <<<"$info" | awk '{print $2}') - [ -n "$found" ] - found=$(grep Storage: <<<"$info" | awk '{print $2}') - [ -n "$found" ] - found=$(grep Network: <<<"$info" | awk '{print $2}') - [ -n "$found" ] - done - - # test find slice - local slice=$(govc vm.info ${prefix}-*) - local found=$(grep Name: <<<"$slice" | wc -l) - [ "$found" -eq $num ] - - # test -r - found=$(grep Storage: <<<"$slice" | wc -l) - [ "$found" -eq 0 ] - found=$(grep Network: <<<"$slice" | wc -l) - [ "$found" -eq 0 ] - slice=$(govc vm.info -r ${prefix}-*) - found=$(grep Storage: <<<"$slice" | wc -l) - [ "$found" -eq $num ] - found=$(grep Network: <<<"$slice" | wc -l) - [ "$found" -eq $num ] - - # test extraConfig - run govc vm.change -e "guestinfo.a=2" -vm $id - assert_success - run govc vm.info -e $id - assert_success - assert_line "guestinfo.a: 2" -} - -@test "vm.create linked ide disk" { - vm=$(new_id) - run govc vm.create -disk $GOVC_TEST_VMDK -disk.controller ide -on=false $vm - assert_success - - run govc device.info -vm $vm disk-200-0 - assert_success - assert_line "Controller: ide-200" -} - -@test "vm.create linked scsi disk" { - vm=$(new_id) - - run govc vm.create -disk enoent -on=false $vm - assert_failure "govc: cannot stat '[${GOVC_DATASTORE}] enoent': No such file" - - run govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success - assert_line "Controller: lsilogic-1000" - assert_line "Parent: [${GOVC_DATASTORE}] $GOVC_TEST_VMDK" - assert_line "File: [${GOVC_DATASTORE}] $vm/${vm}.vmdk" -} - -@test "vm.create scsi disk" { - vm=$(new_id) - - run govc vm.create -disk enoent -on=false $vm - assert_failure "govc: cannot stat '[${GOVC_DATASTORE}] enoent': No such file" - - run govc vm.create -disk $GOVC_TEST_VMDK -on=false -link=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success - assert_line "Controller: lsilogic-1000" - refute_line "Parent: [${GOVC_DATASTORE}] $GOVC_TEST_VMDK" - assert_line "File: [${GOVC_DATASTORE}] $GOVC_TEST_VMDK" -} - -@test "vm.create iso" { - upload_iso - - vm=$(new_id) - - run govc vm.create -iso enoent -on=false $vm - assert_failure "govc: cannot stat '[${GOVC_DATASTORE}] enoent': No such file" - - run govc vm.create -iso $GOVC_TEST_ISO -on=false $vm - assert_success - - run govc device.info -vm $vm cdrom-3000 - assert_success - assert_line "Controller: ide-200" - assert_line "Summary: ISO [${GOVC_DATASTORE}] $GOVC_TEST_ISO" -} - -@test "vm.disk.create empty vm" { - vm=$(new_empty_vm) - - local name=$(new_id) - - run govc vm.disk.create -vm $vm -name $name -size 1G - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 1 ] - - name=$(new_id) - - run govc vm.disk.create -vm $vm -name $name -controller lsilogic-1000 -size 2G - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] -} - -@test "vm.disk.create" { - import_ttylinux_vmdk - vm=$(new_id) - - govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 1 ] - - local name=$(new_id) - - run govc vm.disk.create -vm $vm -name $name -size 1G - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] - - run govc vm.disk.create -vm $vm -name $name -size 1G - assert_success # TODO: should fail? - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] -} - -@test "vm.disk.attach" { - import_ttylinux_vmdk - vm=$(new_id) - - govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 1 ] - - run govc import.vmdk $GOVC_TEST_VMDK_SRC $vm - assert_success - - run govc vm.disk.attach -vm $vm -link=false -disk enoent.vmdk - assert_failure "govc: File [${GOVC_DATASTORE}] enoent.vmdk was not found" - - run govc vm.disk.attach -vm $vm -disk enoent.vmdk - assert_failure "govc: Invalid configuration for device '0'." - - run govc vm.disk.attach -vm $vm -disk $vm/$GOVC_TEST_VMDK -controller lsilogic-1000 - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] -} diff --git a/vendor/github.com/vmware/govmomi/govc/vapp/destroy.go b/vendor/github.com/vmware/govmomi/govc/vapp/destroy.go deleted file mode 100644 index 8f66428e4..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vapp/destroy.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vapp - -import ( - "flag" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.DatacenterFlag -} - -func init() { - cli.Register("vapp.destroy", &destroy{}) -} - -func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) -} - -func (cmd *destroy) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *destroy) Usage() string { - return "VAPP..." -} - -func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - for _, arg := range f.Args() { - vapps, err := finder.VirtualAppList(context.TODO(), arg) - if err != nil { - if _, ok := err.(*find.NotFoundError); ok { - // Ignore if vapp cannot be found - continue - } - - return err - } - - for _, vapp := range vapps { - task, err := vapp.PowerOffVApp_Task(context.TODO(), false) - if err != nil { - return err - } - err = task.Wait(context.TODO()) - if err != nil { - return err - } - - task, err = vapp.Destroy(context.TODO()) - if err != nil { - return err - } - err = task.Wait(context.TODO()) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vapp/power.go b/vendor/github.com/vmware/govmomi/govc/vapp/power.go deleted file mode 100644 index a03dc958f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vapp/power.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vapp - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type power struct { - *flags.SearchFlag - - On bool - Off bool - Suspend bool - Force bool -} - -func init() { - cli.Register("vapp.power", &power{}) -} - -func (cmd *power) Register(ctx context.Context, f *flag.FlagSet) { - cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualApps) - cmd.SearchFlag.Register(ctx, f) - - f.BoolVar(&cmd.On, "on", false, "Power on") - f.BoolVar(&cmd.Off, "off", false, "Power off") - f.BoolVar(&cmd.Suspend, "suspend", false, "Power suspend") - f.BoolVar(&cmd.Force, "force", false, "Force (If force is false, the shutdown order in the vApp is executed. If force is true, all virtual machines are powered-off (regardless of shutdown order))") -} - -func (cmd *power) Process(ctx context.Context) error { - if err := cmd.SearchFlag.Process(ctx); err != nil { - return err - } - opts := []bool{cmd.On, cmd.Off, cmd.Suspend} - selected := false - - for _, opt := range opts { - if opt { - if selected { - return flag.ErrHelp - } - selected = opt - } - } - - if !selected { - return flag.ErrHelp - } - - return nil -} - -func (cmd *power) Run(ctx context.Context, f *flag.FlagSet) error { - vapps, err := cmd.VirtualApps(f.Args()) - if err != nil { - return err - } - - for _, vapp := range vapps { - var task *object.Task - - switch { - case cmd.On: - fmt.Fprintf(cmd, "Powering on %s... ", vapp.Reference()) - task, err = vapp.PowerOnVApp_Task(context.TODO()) - case cmd.Off: - fmt.Fprintf(cmd, "Powering off %s... ", vapp.Reference()) - task, err = vapp.PowerOffVApp_Task(context.TODO(), cmd.Force) - case cmd.Suspend: - fmt.Fprintf(cmd, "Suspend %s... ", vapp.Reference()) - task, err = vapp.SuspendVApp_Task(context.TODO()) - } - - if err != nil { - return err - } - - if task != nil { - err = task.Wait(context.TODO()) - } - if err == nil { - fmt.Fprintf(cmd, "OK\n") - continue - } - - return err - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/version/command.go b/vendor/github.com/vmware/govmomi/govc/version/command.go deleted file mode 100644 index 68ef342f6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/version/command.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package version - -import ( - "flag" - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" -) - -var gitVersion string - -type version struct { - *flags.EmptyFlag -} - -func init() { - if gitVersion == "" { - gitVersion = "unknown" - } - - cli.Register("version", &version{}) -} - -func (c *version) Run(ctx context.Context, f *flag.FlagSet) error { - fmt.Printf("govc %s\n", gitVersion) - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/change.go b/vendor/github.com/vmware/govmomi/govc/vm/change.go deleted file mode 100644 index c359569c1..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/change.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "flag" - "fmt" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type extraConfig []types.BaseOptionValue - -func (e *extraConfig) String() string { - return fmt.Sprintf("%v", *e) -} - -func (e *extraConfig) Set(v string) error { - r := strings.Split(v, "=") - if len(r) < 2 { - return fmt.Errorf("failed to parse extraConfig: %s", v) - } else if r[1] == "" { - return fmt.Errorf("empty value: %s", v) - } - *e = append(*e, &types.OptionValue{Key: r[0], Value: r[1]}) - return nil -} - -type change struct { - *flags.VirtualMachineFlag - - types.VirtualMachineConfigSpec - extraConfig extraConfig -} - -func init() { - cli.Register("vm.change", &change{}) -} - -func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.Int64Var(&cmd.MemoryMB, "m", 0, "Size in MB of memory") - f.IntVar(&cmd.NumCPUs, "c", 0, "Number of CPUs") - f.StringVar(&cmd.GuestId, "g", "", "Guest OS") - f.StringVar(&cmd.Name, "name", "", "Display name") - f.Var(&cmd.extraConfig, "e", "ExtraConfig. =") - - f.Var(flags.NewOptionalBool(&cmd.NestedHVEnabled), "nested-hv-enabled", "Enable nested hardware-assisted virtualization") -} - -func (cmd *change) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - if len(cmd.extraConfig) > 0 { - cmd.VirtualMachineConfigSpec.ExtraConfig = cmd.extraConfig - } - - task, err := vm.Reconfigure(context.TODO(), cmd.VirtualMachineConfigSpec) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/create.go b/vendor/github.com/vmware/govmomi/govc/vm/create.go deleted file mode 100644 index fdb49eb95..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/create.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.ClientFlag - *flags.DatacenterFlag - *flags.DatastoreFlag - *flags.ResourcePoolFlag - *flags.HostSystemFlag - *flags.NetworkFlag - - memory int - cpus int - guestID string - link bool - on bool - force bool - iso string - disk string - controller string - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - ResourcePool *object.ResourcePool - HostSystem *object.HostSystem -} - -func init() { - cli.Register("vm.create", &create{}) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - - cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) - cmd.ResourcePoolFlag.Register(ctx, f) - - cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) - cmd.HostSystemFlag.Register(ctx, f) - - cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) - cmd.NetworkFlag.Register(ctx, f) - - f.IntVar(&cmd.memory, "m", 1024, "Size in MB of memory") - f.IntVar(&cmd.cpus, "c", 1, "Number of CPUs") - f.StringVar(&cmd.guestID, "g", "otherGuest", "Guest OS") - f.BoolVar(&cmd.link, "link", true, "Link specified disk") - f.BoolVar(&cmd.on, "on", true, "Power on VM. Default is true if -disk argument is given.") - f.BoolVar(&cmd.force, "force", false, "Create VM if vmx already exists") - f.StringVar(&cmd.iso, "iso", "", "Path to ISO") - f.StringVar(&cmd.controller, "disk.controller", "scsi", "Disk controller type") - f.StringVar(&cmd.disk, "disk", "", "Disk path name") -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { - return err - } - if err := cmd.HostSystemFlag.Process(ctx); err != nil { - return err - } - if err := cmd.NetworkFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - var err error - - if len(f.Args()) != 1 { - return flag.ErrHelp - } - - cmd.Client, err = cmd.ClientFlag.Client() - if err != nil { - return err - } - - cmd.Datacenter, err = cmd.DatacenterFlag.Datacenter() - if err != nil { - return err - } - - cmd.Datastore, err = cmd.DatastoreFlag.Datastore() - if err != nil { - return err - } - - cmd.HostSystem, err = cmd.HostSystemFlag.HostSystemIfSpecified() - if err != nil { - return err - } - - if cmd.HostSystem != nil { - if cmd.ResourcePool, err = cmd.HostSystem.ResourcePool(context.TODO()); err != nil { - return err - } - } else { - // -host is optional - if cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool(); err != nil { - return err - } - } - - for _, file := range []*string{&cmd.iso, &cmd.disk} { - if *file != "" { - _, err = cmd.Datastore.Stat(context.TODO(), *file) - if err != nil { - return err - } - } - } - - task, err := cmd.createVM(f.Arg(0)) - if err != nil { - return err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return err - } - - vm := object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)) - - if err := cmd.addDevices(vm); err != nil { - return err - } - - if cmd.on { - task, err := vm.PowerOn(context.TODO()) - if err != nil { - return err - } - - _, err = task.WaitForResult(context.TODO(), nil) - if err != nil { - return err - } - } - - return nil -} - -func (cmd *create) addDevices(vm *object.VirtualMachine) error { - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - var add []types.BaseVirtualDevice - - if cmd.disk != "" { - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return err - } - - disk := devices.CreateDisk(controller, cmd.Datastore.Path(cmd.disk)) - - if cmd.link { - disk = devices.ChildDisk(disk) - } - - add = append(add, disk) - } - - if cmd.iso != "" { - ide, err := devices.FindIDEController("") - if err != nil { - return err - } - - cdrom, err := devices.CreateCdrom(ide) - if err != nil { - return err - } - - add = append(add, devices.InsertIso(cdrom, cmd.Datastore.Path(cmd.iso))) - } - - netdev, err := cmd.NetworkFlag.Device() - if err != nil { - return err - } - - add = append(add, netdev) - - return vm.AddDevice(context.TODO(), add...) -} - -func (cmd *create) createVM(name string) (*object.Task, error) { - spec := types.VirtualMachineConfigSpec{ - Name: name, - GuestId: cmd.guestID, - Files: &types.VirtualMachineFileInfo{VmPathName: fmt.Sprintf("[%s]", cmd.Datastore.Name())}, - NumCPUs: cmd.cpus, - MemoryMB: int64(cmd.memory), - } - - if !cmd.force { - vmxPath := fmt.Sprintf("%s/%s.vmx", name, name) - - _, err := cmd.Datastore.Stat(context.TODO(), vmxPath) - if err == nil { - dsPath := cmd.Datastore.Path(vmxPath) - return nil, fmt.Errorf("File %s already exists", dsPath) - } - } - - if cmd.controller != "ide" { - scsi, err := object.SCSIControllerTypes().CreateSCSIController(cmd.controller) - if err != nil { - return nil, err - } - - spec.DeviceChange = append(spec.DeviceChange, &types.VirtualDeviceConfigSpec{ - Operation: types.VirtualDeviceConfigSpecOperationAdd, - Device: scsi, - }) - } - - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return nil, err - } - - return folders.VmFolder.CreateVM(context.TODO(), spec, cmd.ResourcePool, cmd.HostSystem) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/destroy.go b/vendor/github.com/vmware/govmomi/govc/vm/destroy.go deleted file mode 100644 index 9796a87ed..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/destroy.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.ClientFlag - *flags.SearchFlag -} - -func init() { - cli.Register("vm.destroy", &destroy{}) -} - -func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) - cmd.SearchFlag.Register(ctx, f) -} - -func (cmd *destroy) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.SearchFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - for _, vm := range vms { - task, err := vm.PowerOff(context.TODO()) - if err != nil { - return err - } - - // Ignore error since the VM may already been in powered off state. - // vm.Destroy will fail if the VM is still powered on. - _ = task.Wait(context.TODO()) - - task, err = vm.Destroy(context.TODO()) - if err != nil { - return err - } - - err = task.Wait(context.TODO()) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/disk/attach.go b/vendor/github.com/vmware/govmomi/govc/vm/disk/attach.go deleted file mode 100644 index c00126022..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/disk/attach.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package disk - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type attach struct { - *flags.DatastoreFlag - *flags.VirtualMachineFlag - - persist bool - link bool - disk string - controller string -} - -func init() { - cli.Register("vm.disk.attach", &attach{}) -} - -func (cmd *attach) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.BoolVar(&cmd.persist, "persist", true, "Persist attached disk") - f.BoolVar(&cmd.link, "link", true, "Link specified disk") - f.StringVar(&cmd.controller, "controller", "", "Disk controller") - f.StringVar(&cmd.disk, "disk", "", "Disk path name") -} - -func (cmd *attach) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *attach) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - ds, err := cmd.Datastore() - if err != nil { - return err - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return err - } - - disk := devices.CreateDisk(controller, ds.Path(cmd.disk)) - backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) - - if cmd.link { - if cmd.persist { - backing.DiskMode = string(types.VirtualDiskModeIndependent_persistent) - } else { - backing.DiskMode = string(types.VirtualDiskModeIndependent_persistent) - } - - disk = devices.ChildDisk(disk) - return vm.AddDevice(context.TODO(), disk) - } - - if cmd.persist { - backing.DiskMode = string(types.VirtualDiskModePersistent) - } else { - backing.DiskMode = string(types.VirtualDiskModeNonpersistent) - } - - return vm.AddDevice(context.TODO(), disk) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/disk/create.go b/vendor/github.com/vmware/govmomi/govc/vm/disk/create.go deleted file mode 100644 index 7a97577f4..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/disk/create.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package disk - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/units" - "golang.org/x/net/context" -) - -type create struct { - *flags.DatastoreFlag - *flags.OutputFlag - *flags.VirtualMachineFlag - - controller string - Name string - Bytes units.ByteSize -} - -func init() { - cli.Register("vm.disk.create", &create{}) -} - -func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) - cmd.DatastoreFlag.Register(ctx, f) - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - err := (&cmd.Bytes).Set("10G") - if err != nil { - panic(err) - } - - f.StringVar(&cmd.controller, "controller", "", "Disk controller") - f.StringVar(&cmd.Name, "name", "", "Name for new disk") - f.Var(&cmd.Bytes, "size", "Size of new disk") -} - -func (cmd *create) Process(ctx context.Context) error { - if err := cmd.DatastoreFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { - if len(cmd.Name) == 0 { - return errors.New("please specify a disk name") - } - - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - if vm == nil { - return errors.New("please specify a vm") - } - - ds, err := cmd.Datastore() - if err != nil { - return err - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return err - } - - disk := devices.CreateDisk(controller, ds.Path(cmd.Name)) - - existing := devices.SelectByBackingInfo(disk.Backing) - - if len(existing) > 0 { - cmd.Log("Disk already present\n") - return nil - } - - cmd.Log("Creating disk\n") - disk.CapacityInKB = int64(cmd.Bytes) / 1024 - return vm.AddDevice(context.TODO(), disk) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/auth.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/auth.go deleted file mode 100644 index beab7f1c9..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/auth.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "fmt" - "os" - "strings" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/vim25/types" -) - -type AuthFlag struct { - auth types.NamePasswordAuthentication -} - -func newAuthFlag(ctx context.Context) (*AuthFlag, context.Context) { - return &AuthFlag{}, ctx -} - -func (flag *AuthFlag) String() string { - return fmt.Sprintf("%s:%s", flag.auth.Username, strings.Repeat("x", len(flag.auth.Password))) -} - -func (flag *AuthFlag) Set(s string) error { - c := strings.Split(s, ":") - if len(c) > 0 { - flag.auth.Username = c[0] - if len(c) > 1 { - flag.auth.Password = c[1] - } - } - - return nil -} - -func (flag *AuthFlag) Register(ctx context.Context, f *flag.FlagSet) { - env := "GOVC_GUEST_LOGIN" - value := os.Getenv(env) - flag.Set(value) - usage := fmt.Sprintf("Guest VM credentials [%s]", env) - f.Var(flag, "l", usage) -} - -func (flag *AuthFlag) Process(ctx context.Context) error { - return nil -} - -func (flag *AuthFlag) Auth() types.BaseGuestAuthentication { - return &flag.auth -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/chmod.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/chmod.go deleted file mode 100644 index 4243af51f..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/chmod.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type chmod struct { - *GuestFlag - *FileAttrFlag -} - -func init() { - cli.Register("guest.chmod", &chmod{}) -} - -func (cmd *chmod) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - cmd.FileAttrFlag, ctx = newFileAttrFlag(ctx) - cmd.FileAttrFlag.Register(ctx, f) -} - -func (cmd *chmod) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - if err := cmd.FileAttrFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *chmod) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - return m.ChangeFileAttributes(context.TODO(), cmd.Auth(), f.Arg(0), cmd.Attr()) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go deleted file mode 100644 index 336c9fd13..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "os" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type download struct { - *GuestFlag - - overwrite bool -} - -func init() { - cli.Register("guest.download", &download{}) -} - -func (cmd *download) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - f.BoolVar(&cmd.overwrite, "f", false, "If set, the local destination file is clobbered") -} - -func (cmd *download) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - src := f.Arg(0) - dst := f.Arg(1) - - _, err = os.Stat(dst) - if err == nil && !cmd.overwrite { - return os.ErrExist - } - - info, err := m.InitiateFileTransferFromGuest(context.TODO(), cmd.Auth(), src) - if err != nil { - return err - } - - u, err := cmd.ParseURL(info.Url) - if err != nil { - return err - } - - c, err := cmd.Client() - if err != nil { - return nil - } - - return c.Client.DownloadFile(dst, u, nil) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/file_attr.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/file_attr.go deleted file mode 100644 index 3c943c02d..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/file_attr.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/vim25/types" -) - -type FileAttrFlag struct { - types.GuestPosixFileAttributes -} - -func newFileAttrFlag(ctx context.Context) (*FileAttrFlag, context.Context) { - return &FileAttrFlag{}, ctx -} - -func (flag *FileAttrFlag) Register(ctx context.Context, f *flag.FlagSet) { - f.IntVar(&flag.OwnerId, "uid", 0, "User ID") - f.IntVar(&flag.GroupId, "gid", 0, "Group ID") - f.Int64Var(&flag.Permissions, "perm", 0, "File permissions") -} - -func (flag *FileAttrFlag) Process(ctx context.Context) error { - return nil -} - -func (flag *FileAttrFlag) Attr() types.BaseGuestFileAttributes { - return &flag.GuestPosixFileAttributes -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/getenv.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/getenv.go deleted file mode 100644 index 193b03f6e..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/getenv.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type getenv struct { - *GuestFlag -} - -func init() { - cli.Register("guest.getenv", &getenv{}) -} - -func (cmd *getenv) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) -} - -func (cmd *getenv) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *getenv) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - vars, err := m.ReadEnvironmentVariable(context.TODO(), cmd.Auth(), f.Args()) - if err != nil { - return err - } - - for _, v := range vars { - fmt.Printf("%s\n", v) - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go deleted file mode 100644 index f9f6a0172..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "errors" - "flag" - - "net/url" - - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/guest" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type GuestFlag struct { - *flags.ClientFlag - *flags.VirtualMachineFlag - - *AuthFlag -} - -func newGuestFlag(ctx context.Context) (*GuestFlag, context.Context) { - f := &GuestFlag{} - f.ClientFlag, ctx = flags.NewClientFlag(ctx) - f.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - f.AuthFlag, ctx = newAuthFlag(ctx) - return f, ctx -} - -func (flag *GuestFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.ClientFlag.Register(ctx, f) - flag.VirtualMachineFlag.Register(ctx, f) - flag.AuthFlag.Register(ctx, f) -} - -func (flag *GuestFlag) Process(ctx context.Context) error { - if err := flag.ClientFlag.Process(ctx); err != nil { - return err - } - if err := flag.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - if err := flag.AuthFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (flag *GuestFlag) FileManager() (*guest.FileManager, error) { - c, err := flag.Client() - if err != nil { - return nil, err - } - - vm, err := flag.VirtualMachine() - if err != nil { - return nil, err - } - - o := guest.NewOperationsManager(c, vm.Reference()) - return o.FileManager(context.TODO()) -} - -func (flag *GuestFlag) ProcessManager() (*guest.ProcessManager, error) { - c, err := flag.Client() - if err != nil { - return nil, err - } - - vm, err := flag.VirtualMachine() - if err != nil { - return nil, err - } - - o := guest.NewOperationsManager(c, vm.Reference()) - return o.ProcessManager(context.TODO()) -} - -func (flag *GuestFlag) ParseURL(urlStr string) (*url.URL, error) { - c, err := flag.Client() - if err != nil { - return nil, err - } - - return c.Client.ParseURL(urlStr) -} - -func (flag *GuestFlag) VirtualMachine() (*object.VirtualMachine, error) { - vm, err := flag.VirtualMachineFlag.VirtualMachine() - if err != nil { - return nil, err - } - if vm == nil { - return nil, errors.New("no vm specified") - } - return vm, nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/kill.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/kill.go deleted file mode 100644 index bb7f66723..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/kill.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type kill struct { - *GuestFlag - - pids pidSelector -} - -func init() { - cli.Register("guest.kill", &kill{}) -} - -func (cmd *kill) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - f.Var(&cmd.pids, "p", "Process ID") -} - -func (cmd *kill) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *kill) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - for _, pid := range cmd.pids { - if err := m.TerminateProcess(context.TODO(), cmd.Auth(), pid); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/ls.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/ls.go deleted file mode 100644 index 1e39f7d9d..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/ls.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type ls struct { - *GuestFlag -} - -func init() { - cli.Register("guest.ls", &ls{}) -} - -func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) -} - -func (cmd *ls) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - offset := 0 - tw := tabwriter.NewWriter(os.Stdout, 3, 0, 2, ' ', 0) - - for { - info, err := m.ListFiles(context.TODO(), cmd.Auth(), f.Arg(0), offset, 0, f.Arg(1)) - if err != nil { - return err - } - - for _, f := range info.Files { - attr := f.Attributes.GetGuestFileAttributes() // TODO: GuestPosixFileAttributes - fmt.Fprintf(tw, "%d\t%s\t%s\n", f.Size, attr.ModificationTime.Format("Mon Jan 2 15:04:05 2006"), f.Path) - } - - _ = tw.Flush() - - if info.Remaining == 0 { - break - } - offset += len(info.Files) - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/mkdir.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/mkdir.go deleted file mode 100644 index 28859b040..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/mkdir.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type mkdir struct { - *GuestFlag - - createParents bool -} - -func init() { - cli.Register("guest.mkdir", &mkdir{}) -} - -func (cmd *mkdir) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - f.BoolVar(&cmd.createParents, "p", false, "Create intermediate directories as needed") -} - -func (cmd *mkdir) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *mkdir) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - err = m.MakeDirectory(context.TODO(), cmd.Auth(), f.Arg(0), cmd.createParents) - - // ignore EEXIST if -p flag is given - if err != nil && cmd.createParents { - if soap.IsSoapFault(err) { - soapFault := soap.ToSoapFault(err) - if _, ok := soapFault.VimFault().(types.FileAlreadyExists); ok { - return nil - } - } - } - - return err -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/mktemp.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/mktemp.go deleted file mode 100644 index ed0af945d..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/mktemp.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type mktemp struct { - *GuestFlag - - dir bool - prefix string - suffix string -} - -func init() { - cli.Register("guest.mktemp", &mktemp{}) -} - -func (cmd *mktemp) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - f.BoolVar(&cmd.dir, "d", false, "Make a directory instead of a file") - f.StringVar(&cmd.prefix, "t", "", "Prefix") - f.StringVar(&cmd.suffix, "s", "", "Suffix") -} - -func (cmd *mktemp) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *mktemp) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - mk := m.CreateTemporaryFile - if cmd.dir { - mk = m.CreateTemporaryDirectory - } - - name, err := mk(context.TODO(), cmd.Auth(), cmd.prefix, cmd.suffix) - if err != nil { - return err - } - - fmt.Println(name) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/ps.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/ps.go deleted file mode 100644 index c443b3bf1..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/ps.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "fmt" - "os" - "strconv" - "text/tabwriter" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type ps struct { - *GuestFlag - - every bool - - pids pidSelector - uids uidSelector -} - -type pidSelector []int64 - -func (s *pidSelector) String() string { - return fmt.Sprint(*s) -} - -func (s *pidSelector) Set(value string) error { - v, err := strconv.ParseInt(value, 0, 64) - if err != nil { - return err - } - *s = append(*s, v) - return nil -} - -type uidSelector map[string]bool - -func (s uidSelector) String() string { - return "" -} - -func (s uidSelector) Set(value string) error { - s[value] = true - return nil -} - -func init() { - cli.Register("guest.ps", &ps{}) -} - -func (cmd *ps) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - cmd.uids = make(map[string]bool) - f.BoolVar(&cmd.every, "e", false, "Select all processes") - f.Var(&cmd.pids, "p", "Select by process ID") - f.Var(&cmd.uids, "U", "Select by process UID") -} - -func (cmd *ps) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ps) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - if !cmd.every && len(cmd.uids) == 0 { - cmd.uids[cmd.auth.Username] = true - } - - procs, err := m.ListProcesses(context.TODO(), cmd.Auth(), cmd.pids) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n", "UID", "PID", "STIME", "CMD") - - for _, p := range procs { - if cmd.every || cmd.uids[p.Owner] { - fmt.Fprintf(tw, "%s\t%d\t%s\t%s\n", p.Owner, p.Pid, p.StartTime.Format("15:04"), p.CmdLine) - } - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/rm.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/rm.go deleted file mode 100644 index 4c7c85f74..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/rm.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type rm struct { - *GuestFlag -} - -func init() { - cli.Register("guest.rm", &rm{}) -} - -func (cmd *rm) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) -} - -func (cmd *rm) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *rm) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - return m.DeleteFile(context.TODO(), cmd.Auth(), f.Arg(0)) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/rmdir.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/rmdir.go deleted file mode 100644 index 723fe8932..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/rmdir.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type rmdir struct { - *GuestFlag - - recursive bool -} - -func init() { - cli.Register("guest.rmdir", &rmdir{}) -} - -func (cmd *rmdir) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - f.BoolVar(&cmd.recursive, "p", false, "Recursive removal") -} - -func (cmd *rmdir) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *rmdir) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - return m.DeleteDirectory(context.TODO(), cmd.Auth(), f.Arg(0), cmd.recursive) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/start.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/start.go deleted file mode 100644 index 49818d098..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/start.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "fmt" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type start struct { - *GuestFlag - - dir string - vars env -} - -type env []string - -func (e *env) String() string { - return fmt.Sprint(*e) -} - -func (e *env) Set(value string) error { - *e = append(*e, value) - return nil -} - -func init() { - cli.Register("guest.start", &start{}) -} - -func (cmd *start) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - - f.StringVar(&cmd.dir, "C", "", "The absolute path of the working directory for the program to start") - f.Var(&cmd.vars, "e", "Set environment variable (key=val)") -} - -func (cmd *start) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *start) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - spec := types.GuestProgramSpec{ - ProgramPath: f.Arg(0), - Arguments: strings.Join(f.Args()[1:], " "), - WorkingDirectory: cmd.dir, - EnvVariables: cmd.vars, - } - - pid, err := m.StartProgram(context.TODO(), cmd.Auth(), &spec) - if err != nil { - return err - } - - fmt.Printf("%d\n", pid) - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go deleted file mode 100644 index fb19a9a5c..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "flag" - "os" - - "github.com/vmware/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type upload struct { - *GuestFlag - *FileAttrFlag - - overwrite bool -} - -func init() { - cli.Register("guest.upload", &upload{}) -} - -func (cmd *upload) Register(ctx context.Context, f *flag.FlagSet) { - cmd.GuestFlag, ctx = newGuestFlag(ctx) - cmd.GuestFlag.Register(ctx, f) - cmd.FileAttrFlag, ctx = newFileAttrFlag(ctx) - cmd.FileAttrFlag.Register(ctx, f) - - f.BoolVar(&cmd.overwrite, "f", false, "If set, the guest destination file is clobbered") -} - -func (cmd *upload) Process(ctx context.Context) error { - if err := cmd.GuestFlag.Process(ctx); err != nil { - return err - } - if err := cmd.FileAttrFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *upload) Run(ctx context.Context, f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - src := f.Arg(0) - dst := f.Arg(1) - - s, err := os.Stat(src) - if err != nil { - return err - } - - url, err := m.InitiateFileTransferToGuest(context.TODO(), cmd.Auth(), dst, cmd.Attr(), s.Size(), cmd.overwrite) - if err != nil { - return err - } - - u, err := cmd.ParseURL(url) - if err != nil { - return err - } - - c, err := cmd.Client() - if err != nil { - return nil - } - - return c.Client.UploadFile(src, u, nil) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/info.go b/vendor/github.com/vmware/govmomi/govc/vm/info.go deleted file mode 100644 index 494bb8a26..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/info.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "flag" - "fmt" - "io" - "os" - "strings" - "text/tabwriter" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.SearchFlag - - WaitForIP bool - General bool - ExtraConfig bool - Resources bool -} - -func init() { - cli.Register("vm.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) - cmd.SearchFlag.Register(ctx, f) - - f.BoolVar(&cmd.WaitForIP, "waitip", false, "Wait for VM to acquire IP address") - f.BoolVar(&cmd.General, "g", true, "Show general summary") - f.BoolVar(&cmd.ExtraConfig, "e", false, "Show ExtraConfig") - f.BoolVar(&cmd.Resources, "r", false, "Show resource summary") -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.SearchFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - if _, ok := err.(*find.NotFoundError); ok { - // Continue with empty VM slice - } else { - return err - } - } - - refs := make([]types.ManagedObjectReference, 0, len(vms)) - for _, vm := range vms { - refs = append(refs, vm.Reference()) - } - - var res infoResult - var props []string - - if cmd.OutputFlag.JSON { - props = nil // Load everything - } else { - props = []string{"summary"} // Load summary - if cmd.General { - props = append(props, "guest.ipAddress") - } - if cmd.ExtraConfig { - props = append(props, "config.extraConfig") - } - if cmd.Resources { - props = append(props, "datastore", "network") - } - } - - pc := property.DefaultCollector(c) - if len(refs) != 0 { - err = pc.Retrieve(ctx, refs, props, &res.VirtualMachines) - if err != nil { - return err - } - } - - if cmd.WaitForIP { - for i, vm := range res.VirtualMachines { - if vm.Guest == nil || vm.Guest.IpAddress == "" { - _, err = vms[i].WaitForIP(ctx) - if err != nil { - return err - } - // Reload virtual machine object - err = pc.RetrieveOne(ctx, vms[i].Reference(), props, &res.VirtualMachines[i]) - if err != nil { - return err - } - } - } - } - - if !cmd.OutputFlag.JSON { - res.objects = vms - res.cmd = cmd - if err = res.collectReferences(pc, ctx); err != nil { - return err - } - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - VirtualMachines []mo.VirtualMachine - objects []*object.VirtualMachine - entities map[types.ManagedObjectReference]string - cmd *info -} - -// collectReferences builds a unique set of MORs to the set of VirtualMachines, -// so we can collect properties in a single call for each reference type {host,datastore,network}. -func (r *infoResult) collectReferences(pc *property.Collector, ctx context.Context) error { - r.entities = make(map[types.ManagedObjectReference]string) // MOR -> Name map - - var host []mo.HostSystem - var network []mo.Network - var dvp []mo.DistributedVirtualPortgroup - var datastore []mo.Datastore - // Table to drive inflating refs to their mo.* counterparts (dest) - // and save() the Name to r.entities w/o using reflection here. - // Note that we cannot use a []mo.ManagedEntity here, since mo.Network has its own 'Name' field, - // the mo.Network.ManagedEntity.Name field will not be set. - vrefs := map[string]*struct { - dest interface{} - refs []types.ManagedObjectReference - save func() - }{ - "HostSystem": { - &host, nil, func() { - for _, e := range host { - r.entities[e.Reference()] = e.Name - } - }, - }, - "Network": { - &network, nil, func() { - for _, e := range network { - r.entities[e.Reference()] = e.Name - } - }, - }, - "DistributedVirtualPortgroup": { - &dvp, nil, func() { - for _, e := range dvp { - r.entities[e.Reference()] = e.Name - } - }, - }, - "Datastore": { - &datastore, nil, func() { - for _, e := range datastore { - r.entities[e.Reference()] = e.Name - } - }, - }, - } - - xrefs := make(map[types.ManagedObjectReference]bool) - // Add MOR to vrefs[kind].refs avoiding any duplicates. - addRef := func(refs ...types.ManagedObjectReference) { - for _, ref := range refs { - if _, exists := xrefs[ref]; exists { - return - } - xrefs[ref] = true - vref := vrefs[ref.Type] - vref.refs = append(vref.refs, ref) - } - } - - for _, vm := range r.VirtualMachines { - if r.cmd.General { - if ref := vm.Summary.Runtime.Host; ref != nil { - addRef(*ref) - } - } - - if r.cmd.Resources { - addRef(vm.Datastore...) - addRef(vm.Network...) - } - } - - for _, vref := range vrefs { - if vref.refs == nil { - continue - } - err := pc.Retrieve(ctx, vref.refs, []string{"name"}, vref.dest) - if err != nil { - return err - } - vref.save() - } - - return nil -} - -func (r *infoResult) entityNames(refs []types.ManagedObjectReference) string { - var names []string - for _, ref := range refs { - names = append(names, r.entities[ref]) - } - return strings.Join(names, ", ") -} - -func (r *infoResult) Write(w io.Writer) error { - // Maintain order via r.objects as Property collector does not always return results in order. - objects := make(map[types.ManagedObjectReference]mo.VirtualMachine, len(r.VirtualMachines)) - for _, o := range r.VirtualMachines { - objects[o.Reference()] = o - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, o := range r.objects { - vm := objects[o.Reference()] - s := vm.Summary - - fmt.Fprintf(tw, "Name:\t%s\n", s.Config.Name) - - if r.cmd.General { - hostName := "" - - if href := vm.Summary.Runtime.Host; href != nil { - if name, ok := r.entities[*href]; ok { - hostName = name - } - } - - fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) - fmt.Fprintf(tw, " UUID:\t%s\n", s.Config.Uuid) - fmt.Fprintf(tw, " Guest name:\t%s\n", s.Config.GuestFullName) - fmt.Fprintf(tw, " Memory:\t%dMB\n", s.Config.MemorySizeMB) - fmt.Fprintf(tw, " CPU:\t%d vCPU(s)\n", s.Config.NumCpu) - fmt.Fprintf(tw, " Power state:\t%s\n", s.Runtime.PowerState) - fmt.Fprintf(tw, " Boot time:\t%s\n", s.Runtime.BootTime) - fmt.Fprintf(tw, " IP address:\t%s\n", s.Guest.IpAddress) - fmt.Fprintf(tw, " Host:\t%s\n", hostName) - } - - if r.cmd.Resources { - fmt.Fprintf(tw, " CPU usage:\t%dMHz\n", s.QuickStats.OverallCpuUsage) - fmt.Fprintf(tw, " Host memory usage:\t%dMB\n", s.QuickStats.HostMemoryUsage) - fmt.Fprintf(tw, " Guest memory usage:\t%dMB\n", s.QuickStats.GuestMemoryUsage) - fmt.Fprintf(tw, " Storage uncommitted:\t%s\n", units.ByteSize(s.Storage.Uncommitted)) - fmt.Fprintf(tw, " Storage committed:\t%s\n", units.ByteSize(s.Storage.Committed)) - fmt.Fprintf(tw, " Storage unshared:\t%s\n", units.ByteSize(s.Storage.Unshared)) - fmt.Fprintf(tw, " Storage:\t%s\n", r.entityNames(vm.Datastore)) - fmt.Fprintf(tw, " Network:\t%s\n", r.entityNames(vm.Network)) - } - - if r.cmd.ExtraConfig { - fmt.Fprintf(tw, " ExtraConfig:\n") - for _, v := range vm.Config.ExtraConfig { - fmt.Fprintf(tw, " %s:\t%s\n", v.GetOptionValue().Key, v.GetOptionValue().Value) - } - } - } - - return tw.Flush() -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/ip.go b/vendor/github.com/vmware/govmomi/govc/vm/ip.go deleted file mode 100644 index 6c0992cc2..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/ip.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "flag" - "fmt" - "time" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/govc/host/esxcli" - "github.com/vmware/govmomi/object" - "golang.org/x/net/context" -) - -type ip struct { - *flags.OutputFlag - *flags.SearchFlag - - esx bool -} - -func init() { - cli.Register("vm.ip", &ip{}) -} - -func (cmd *ip) Register(ctx context.Context, f *flag.FlagSet) { - cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) - cmd.OutputFlag.Register(ctx, f) - - cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) - cmd.SearchFlag.Register(ctx, f) - - f.BoolVar(&cmd.esx, "esxcli", false, "Use esxcli instead of guest tools") -} - -func (cmd *ip) Process(ctx context.Context) error { - if err := cmd.OutputFlag.Process(ctx); err != nil { - return err - } - if err := cmd.SearchFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *ip) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - var get func(*object.VirtualMachine) (string, error) - - if cmd.esx { - get = func(vm *object.VirtualMachine) (string, error) { - guest := esxcli.NewGuestInfo(c) - - ticker := time.NewTicker(time.Millisecond * 500) - defer ticker.Stop() - - for { - select { - case <-ticker.C: - ip, err := guest.IpAddress(vm) - if err != nil { - return "", err - } - - if ip != "0.0.0.0" { - return ip, nil - } - } - } - } - } else { - get = func(vm *object.VirtualMachine) (string, error) { - return vm.WaitForIP(context.TODO()) - } - } - - for _, vm := range vms { - ip, err := get(vm) - if err != nil { - return err - } - - // TODO(PN): Display inventory path to VM - fmt.Fprintf(cmd, "%s\n", ip) - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/network/add.go b/vendor/github.com/vmware/govmomi/govc/vm/network/add.go deleted file mode 100644 index 8f6006ebc..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/network/add.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package network - -import ( - "errors" - "flag" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag - *flags.NetworkFlag -} - -func init() { - cli.Register("vm.network.add", &add{}) -} - -func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) - cmd.NetworkFlag.Register(ctx, f) -} - -func (cmd *add) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - if err := cmd.NetworkFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachineFlag.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("please specify a vm") - } - - // Set network if specified as extra argument. - if f.NArg() > 0 { - _ = cmd.NetworkFlag.Set(f.Arg(0)) - } - - net, err := cmd.NetworkFlag.Device() - if err != nil { - return err - } - - return vm.AddDevice(context.TODO(), net) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/network/change.go b/vendor/github.com/vmware/govmomi/govc/vm/network/change.go deleted file mode 100644 index f7b403506..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/network/change.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package network - -import ( - "errors" - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type change struct { - *flags.VirtualMachineFlag - *flags.NetworkFlag -} - -func init() { - cli.Register("vm.network.change", &change{}) -} - -func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) - cmd.NetworkFlag.Register(ctx, f) -} - -func (cmd *change) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - if err := cmd.NetworkFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { - vm, err := cmd.VirtualMachineFlag.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("please specify a vm") - } - - name := f.Arg(0) - - if name == "" { - return errors.New("please specify a device name") - } - - // Set network if specified as extra argument. - if f.NArg() > 1 { - _ = cmd.NetworkFlag.Set(f.Arg(1)) - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - net := devices.Find(name) - - if net == nil { - return fmt.Errorf("device '%s' not found", name) - } - - dev, err := cmd.NetworkFlag.Device() - if err != nil { - return err - } - - current := net.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - changed := dev.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - - current.Backing = changed.Backing - - if changed.MacAddress != "" { - current.MacAddress = changed.MacAddress - } - - if changed.AddressType != "" { - current.AddressType = changed.AddressType - } - - return vm.EditDevice(context.TODO(), net) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/power.go b/vendor/github.com/vmware/govmomi/govc/vm/power.go deleted file mode 100644 index dbbeed8f4..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/power.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type power struct { - *flags.ClientFlag - *flags.SearchFlag - - On bool - Off bool - Reset bool - Reboot bool - Shutdown bool - Suspend bool - Force bool -} - -func init() { - cli.Register("vm.power", &power{}) -} - -func (cmd *power) Register(ctx context.Context, f *flag.FlagSet) { - cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) - cmd.ClientFlag.Register(ctx, f) - - cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) - cmd.SearchFlag.Register(ctx, f) - - f.BoolVar(&cmd.On, "on", false, "Power on") - f.BoolVar(&cmd.Off, "off", false, "Power off") - f.BoolVar(&cmd.Reset, "reset", false, "Power reset") - f.BoolVar(&cmd.Suspend, "suspend", false, "Power suspend") - f.BoolVar(&cmd.Reboot, "r", false, "Reboot guest") - f.BoolVar(&cmd.Shutdown, "s", false, "Shutdown guest") - f.BoolVar(&cmd.Force, "force", false, "Force (ignore state error and hard shutdown/reboot if tools unavailable)") -} - -func (cmd *power) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - if err := cmd.SearchFlag.Process(ctx); err != nil { - return err - } - opts := []bool{cmd.On, cmd.Off, cmd.Reset, cmd.Suspend, cmd.Reboot, cmd.Shutdown} - selected := false - - for _, opt := range opts { - if opt { - if selected { - return flag.ErrHelp - } - selected = opt - } - } - - if !selected { - return flag.ErrHelp - } - - return nil -} - -func isToolsUnavailable(err error) bool { - if soap.IsSoapFault(err) { - soapFault := soap.ToSoapFault(err) - if _, ok := soapFault.VimFault().(types.ToolsUnavailable); ok { - return ok - } - } - - return false -} - -func (cmd *power) Run(ctx context.Context, f *flag.FlagSet) error { - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - for _, vm := range vms { - var task *object.Task - - switch { - case cmd.On: - fmt.Fprintf(cmd, "Powering on %s... ", vm.Reference()) - task, err = vm.PowerOn(context.TODO()) - case cmd.Off: - fmt.Fprintf(cmd, "Powering off %s... ", vm.Reference()) - task, err = vm.PowerOff(context.TODO()) - case cmd.Reset: - fmt.Fprintf(cmd, "Reset %s... ", vm.Reference()) - task, err = vm.Reset(context.TODO()) - case cmd.Suspend: - fmt.Fprintf(cmd, "Suspend %s... ", vm.Reference()) - task, err = vm.Suspend(context.TODO()) - case cmd.Reboot: - fmt.Fprintf(cmd, "Reboot guest %s... ", vm.Reference()) - err = vm.RebootGuest(context.TODO()) - - if err != nil && cmd.Force && isToolsUnavailable(err) { - task, err = vm.Reset(context.TODO()) - } - case cmd.Shutdown: - fmt.Fprintf(cmd, "Shutdown guest %s... ", vm.Reference()) - err = vm.ShutdownGuest(context.TODO()) - - if err != nil && cmd.Force && isToolsUnavailable(err) { - task, err = vm.PowerOff(context.TODO()) - } - } - - if err != nil { - return err - } - - if task != nil { - err = task.Wait(context.TODO()) - } - if err == nil { - fmt.Fprintf(cmd, "OK\n") - continue - } - - if cmd.Force { - fmt.Fprintf(cmd, "Error: %s\n", err) - continue - } - - return err - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/question.go b/vendor/github.com/vmware/govmomi/govc/vm/question.go deleted file mode 100644 index 1ea6dc5a6..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/question.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "errors" - "flag" - "fmt" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type question struct { - *flags.VirtualMachineFlag - - answer string -} - -func init() { - cli.Register("vm.question", &question{}) -} - -func (cmd *question) Register(ctx context.Context, f *flag.FlagSet) { - cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) - cmd.VirtualMachineFlag.Register(ctx, f) - - f.StringVar(&cmd.answer, "answer", "", "Answer to question") -} - -func (cmd *question) Process(ctx context.Context) error { - if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *question) Run(ctx context.Context, f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("No VM specified") - } - - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(c) - err = pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"runtime.question"}, &mvm) - if err != nil { - return err - } - - q := mvm.Runtime.Question - if q == nil { - fmt.Printf("No pending question\n") - return nil - } - - // Print question if no answer is specified - if cmd.answer == "" { - fmt.Printf("Question:\n%s\n\n", q.Text) - fmt.Printf("Possible answers:\n") - for _, e := range q.Choice.ChoiceInfo { - ed := e.(*types.ElementDescription) - fmt.Printf("%s) %s\n", ed.Key, ed.Description.Label) - } - return nil - } - - // Answer question - return vm.Answer(context.TODO(), q.Id, cmd.answer) -} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/vnc.go b/vendor/github.com/vmware/govmomi/govc/vm/vnc.go deleted file mode 100644 index 55fe71975..000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/vnc.go +++ /dev/null @@ -1,480 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package vm - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "reflect" - "regexp" - "strconv" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type intRange struct { - low, high int -} - -var intRangeRegexp = regexp.MustCompile("^([0-9]+)-([0-9]+)$") - -func (i *intRange) Set(s string) error { - m := intRangeRegexp.FindStringSubmatch(s) - if m == nil { - return fmt.Errorf("invalid range: %s", s) - } - - low, _ := strconv.Atoi(m[1]) - high, _ := strconv.Atoi(m[2]) - if low > high { - return fmt.Errorf("invalid range: low > high") - } - - i.low = low - i.high = high - return nil -} - -func (i *intRange) String() string { - return fmt.Sprintf("%d-%d", i.low, i.high) -} - -type vnc struct { - *flags.SearchFlag - - Enable bool - Disable bool - Port int - PortRange intRange - Password string -} - -func init() { - cmd := &vnc{} - cmd.PortRange.Set("5900-5999") - cli.Register("vm.vnc", cmd) -} - -func (cmd *vnc) Register(ctx context.Context, f *flag.FlagSet) { - cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) - cmd.SearchFlag.Register(ctx, f) - - f.BoolVar(&cmd.Enable, "enable", false, "Enable VNC") - f.BoolVar(&cmd.Disable, "disable", false, "Disable VNC") - f.IntVar(&cmd.Port, "port", -1, "VNC port (-1 for auto-select)") - f.Var(&cmd.PortRange, "port-range", "VNC port auto-select range") - f.StringVar(&cmd.Password, "password", "", "VNC password") -} - -func (cmd *vnc) Process(ctx context.Context) error { - if err := cmd.SearchFlag.Process(ctx); err != nil { - return err - } - // Either may be true or none may be true. - if cmd.Enable && cmd.Disable { - return flag.ErrHelp - } - - return nil -} - -func (cmd *vnc) Usage() string { - return "VM..." -} - -func (cmd *vnc) Description() string { - return `VNC controls for VM(s). - -Port numbers are automatically chosen from a range if not specified. - -If neither -enable or -disable is specified, the current state is returned.` -} - -func (cmd *vnc) Run(ctx context.Context, f *flag.FlagSet) error { - vms, err := cmd.loadVMs(f.Args()) - if err != nil { - return err - } - - // Actuate settings in VMs - for _, vm := range vms { - switch { - case cmd.Enable: - vm.enable(cmd.Port, cmd.Password) - case cmd.Disable: - vm.disable() - } - } - - // Reconfigure VMs to reflect updates - for _, vm := range vms { - err = vm.reconfigure() - if err != nil { - return err - } - } - - return cmd.WriteResult(vncResult(vms)) -} - -func (cmd *vnc) loadVMs(args []string) ([]*vncVM, error) { - c, err := cmd.Client() - if err != nil { - return nil, err - } - - vms, err := cmd.VirtualMachines(args) - if err != nil { - return nil, err - } - - var vncVMs []*vncVM - for _, vm := range vms { - v, err := newVNCVM(c, vm) - if err != nil { - return nil, err - } - vncVMs = append(vncVMs, v) - } - - // Assign vncHosts to vncVMs - hosts := make(map[string]*vncHost) - for _, vm := range vncVMs { - if h, ok := hosts[vm.hostReference().Value]; ok { - vm.host = h - continue - } - - hs := object.NewHostSystem(c, vm.hostReference()) - h, err := newVNCHost(c, hs, cmd.PortRange.low, cmd.PortRange.high) - if err != nil { - return nil, err - } - - hosts[vm.hostReference().Value] = h - vm.host = h - } - - return vncVMs, nil -} - -type vncVM struct { - c *vim25.Client - vm *object.VirtualMachine - mvm mo.VirtualMachine - host *vncHost - - curOptions vncOptions - newOptions vncOptions -} - -func newVNCVM(c *vim25.Client, vm *object.VirtualMachine) (*vncVM, error) { - v := &vncVM{ - c: c, - vm: vm, - } - - virtualMachineProperties := []string{ - "name", - "config.extraConfig", - "runtime.host", - } - - pc := property.DefaultCollector(c) - err := pc.RetrieveOne(context.TODO(), vm.Reference(), virtualMachineProperties, &v.mvm) - if err != nil { - return nil, err - } - - v.curOptions = vncOptionsFromExtraConfig(v.mvm.Config.ExtraConfig) - v.newOptions = vncOptionsFromExtraConfig(v.mvm.Config.ExtraConfig) - - return v, nil -} - -func (v *vncVM) hostReference() types.ManagedObjectReference { - return *v.mvm.Runtime.Host -} - -func (v *vncVM) enable(port int, password string) error { - v.newOptions["enabled"] = "true" - v.newOptions["port"] = fmt.Sprintf("%d", port) - v.newOptions["password"] = password - - // Find port if auto-select - if port == -1 { - // Reuse port if If VM already has a port, reuse it. - // Otherwise, find unused VNC port on host. - if p, ok := v.curOptions["port"]; ok && p != "" { - v.newOptions["port"] = p - } else { - port, err := v.host.popUnusedPort() - if err != nil { - return err - } - v.newOptions["port"] = fmt.Sprintf("%d", port) - } - } - return nil -} - -func (v *vncVM) disable() error { - v.newOptions["enabled"] = "false" - v.newOptions["port"] = "" - v.newOptions["password"] = "" - return nil -} - -func (v *vncVM) reconfigure() error { - if reflect.DeepEqual(v.curOptions, v.newOptions) { - // No changes to settings - return nil - } - - spec := types.VirtualMachineConfigSpec{ - ExtraConfig: v.newOptions.ToExtraConfig(), - } - - task, err := v.vm.Reconfigure(context.TODO(), spec) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} - -func (v *vncVM) uri() (string, error) { - ip, err := v.host.managementIP() - if err != nil { - return "", err - } - - uri := fmt.Sprintf("vnc://:%s@%s:%s", - v.newOptions["password"], - ip, - v.newOptions["port"]) - - return uri, nil -} - -func (v *vncVM) write(w io.Writer) error { - if v.newOptions["enabled"] == "true" { - uri, err := v.uri() - if err != nil { - return err - } - fmt.Printf("%s: %s\n", v.mvm.Name, uri) - } else { - fmt.Printf("%s: disabled\n", v.mvm.Name) - } - return nil -} - -type vncHost struct { - c *vim25.Client - host *object.HostSystem - ports map[int]struct{} - ip string // This field is populated by `managementIP` -} - -func newVNCHost(c *vim25.Client, host *object.HostSystem, low, high int) (*vncHost, error) { - ports := make(map[int]struct{}) - for i := low; i <= high; i++ { - ports[i] = struct{}{} - } - - used, err := loadUsedPorts(c, host.Reference()) - if err != nil { - return nil, err - } - - // Remove used ports from range - for _, u := range used { - delete(ports, u) - } - - h := &vncHost{ - c: c, - host: host, - ports: ports, - } - - return h, nil -} - -func loadUsedPorts(c *vim25.Client, host types.ManagedObjectReference) ([]int, error) { - ospec := types.ObjectSpec{ - Obj: host, - SelectSet: []types.BaseSelectionSpec{ - &types.TraversalSpec{ - Type: "HostSystem", - Path: "vm", - Skip: types.NewBool(false), - }, - }, - Skip: types.NewBool(false), - } - - pspec := types.PropertySpec{ - Type: "VirtualMachine", - PathSet: []string{"config.extraConfig"}, - } - - req := types.RetrieveProperties{ - This: c.ServiceContent.PropertyCollector, - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ospec}, - PropSet: []types.PropertySpec{pspec}, - }, - }, - } - - var vms []mo.VirtualMachine - err := mo.RetrievePropertiesForRequest(context.TODO(), c, req, &vms) - if err != nil { - return nil, err - } - - var ports []int - for _, vm := range vms { - if vm.Config == nil || vm.Config.ExtraConfig == nil { - continue - } - - options := vncOptionsFromExtraConfig(vm.Config.ExtraConfig) - if ps, ok := options["port"]; ok && ps != "" { - pi, err := strconv.Atoi(ps) - if err == nil { - ports = append(ports, pi) - } - } - } - - return ports, nil -} - -func (h *vncHost) popUnusedPort() (int, error) { - if len(h.ports) == 0 { - return 0, fmt.Errorf("no unused ports in range") - } - - // Return first port we get when iterating - var port int - for port, _ = range h.ports { - break - } - delete(h.ports, port) - return port, nil -} - -func (h *vncHost) managementIP() (string, error) { - if h.ip != "" { - return h.ip, nil - } - - ips, err := h.host.ManagementIPs(context.TODO()) - if err != nil { - return "", err - } - - if len(ips) > 0 { - h.ip = ips[0].String() - } else { - h.ip = "" - } - - return h.ip, nil -} - -type vncResult []*vncVM - -func (vms vncResult) MarshalJSON() ([]byte, error) { - out := make(map[string]string) - for _, vm := range vms { - uri, err := vm.uri() - if err != nil { - return nil, err - } - out[vm.mvm.Name] = uri - } - return json.Marshal(out) -} - -func (vms vncResult) Write(w io.Writer) error { - for _, vm := range vms { - err := vm.write(w) - if err != nil { - return err - } - } - - return nil -} - -type vncOptions map[string]string - -var vncPrefix = "RemoteDisplay.vnc." - -func vncOptionsFromExtraConfig(ov []types.BaseOptionValue) vncOptions { - vo := make(vncOptions) - for _, b := range ov { - o := b.GetOptionValue() - if strings.HasPrefix(o.Key, vncPrefix) { - key := o.Key[len(vncPrefix):] - if key != "key" { - vo[key] = o.Value.(string) - } - } - } - return vo -} - -func (vo vncOptions) ToExtraConfig() []types.BaseOptionValue { - ov := make([]types.BaseOptionValue, 0, 0) - for k, v := range vo { - key := vncPrefix + k - value := v - - o := types.OptionValue{ - Key: key, - Value: &value, // Pass pointer to avoid omitempty - } - - ov = append(ov, &o) - } - - // Don't know how to deal with the key option, set it to be empty... - o := types.OptionValue{ - Key: vncPrefix + "key", - Value: new(string), // Pass pointer to avoid omitempty - } - - ov = append(ov, &o) - - return ov -} diff --git a/vendor/github.com/vmware/govmomi/guest/auth_manager.go b/vendor/github.com/vmware/govmomi/guest/auth_manager.go deleted file mode 100644 index c62f012ce..000000000 --- a/vendor/github.com/vmware/govmomi/guest/auth_manager.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type AuthManager struct { - types.ManagedObjectReference - - vm types.ManagedObjectReference - - c *vim25.Client -} - -func (m AuthManager) Reference() types.ManagedObjectReference { - return m.ManagedObjectReference -} - -func (m AuthManager) AcquireCredentials(ctx context.Context, requestedAuth types.BaseGuestAuthentication, sessionID int64) (types.BaseGuestAuthentication, error) { - req := types.AcquireCredentialsInGuest{ - This: m.Reference(), - Vm: m.vm, - RequestedAuth: requestedAuth, - SessionID: sessionID, - } - - res, err := methods.AcquireCredentialsInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (m AuthManager) ReleaseCredentials(ctx context.Context, auth types.BaseGuestAuthentication) error { - req := types.ReleaseCredentialsInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - } - - _, err := methods.ReleaseCredentialsInGuest(ctx, m.c, &req) - - return err -} - -func (m AuthManager) ValidateCredentials(ctx context.Context, auth types.BaseGuestAuthentication) error { - req := types.ValidateCredentialsInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - } - - _, err := methods.ValidateCredentialsInGuest(ctx, m.c, &req) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/guest/file_manager.go b/vendor/github.com/vmware/govmomi/guest/file_manager.go deleted file mode 100644 index 43931e662..000000000 --- a/vendor/github.com/vmware/govmomi/guest/file_manager.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type FileManager struct { - types.ManagedObjectReference - - vm types.ManagedObjectReference - - c *vim25.Client -} - -func (m FileManager) Reference() types.ManagedObjectReference { - return m.ManagedObjectReference -} - -func (m FileManager) ChangeFileAttributes(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string, fileAttributes types.BaseGuestFileAttributes) error { - req := types.ChangeFileAttributesInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - GuestFilePath: guestFilePath, - FileAttributes: fileAttributes, - } - - _, err := methods.ChangeFileAttributesInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) CreateTemporaryDirectory(ctx context.Context, auth types.BaseGuestAuthentication, prefix, suffix string) (string, error) { - req := types.CreateTemporaryDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Prefix: prefix, - Suffix: suffix, - } - - res, err := methods.CreateTemporaryDirectoryInGuest(ctx, m.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (m FileManager) CreateTemporaryFile(ctx context.Context, auth types.BaseGuestAuthentication, prefix, suffix string) (string, error) { - req := types.CreateTemporaryFileInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Prefix: prefix, - Suffix: suffix, - } - - res, err := methods.CreateTemporaryFileInGuest(ctx, m.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (m FileManager) DeleteDirectory(ctx context.Context, auth types.BaseGuestAuthentication, directoryPath string, recursive bool) error { - req := types.DeleteDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - DirectoryPath: directoryPath, - Recursive: recursive, - } - - _, err := methods.DeleteDirectoryInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) DeleteFile(ctx context.Context, auth types.BaseGuestAuthentication, filePath string) error { - req := types.DeleteFileInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - FilePath: filePath, - } - - _, err := methods.DeleteFileInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) InitiateFileTransferFromGuest(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string) (*types.FileTransferInformation, error) { - req := types.InitiateFileTransferFromGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - GuestFilePath: guestFilePath, - } - - res, err := methods.InitiateFileTransferFromGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (m FileManager) InitiateFileTransferToGuest(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string, fileAttributes types.BaseGuestFileAttributes, fileSize int64, overwrite bool) (string, error) { - req := types.InitiateFileTransferToGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - GuestFilePath: guestFilePath, - FileAttributes: fileAttributes, - FileSize: fileSize, - Overwrite: overwrite, - } - - res, err := methods.InitiateFileTransferToGuest(ctx, m.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (m FileManager) ListFiles(ctx context.Context, auth types.BaseGuestAuthentication, filePath string, index int, maxResults int, matchPattern string) (*types.GuestListFileInfo, error) { - req := types.ListFilesInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - FilePath: filePath, - Index: index, - MaxResults: maxResults, - MatchPattern: matchPattern, - } - - res, err := methods.ListFilesInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (m FileManager) MakeDirectory(ctx context.Context, auth types.BaseGuestAuthentication, directoryPath string, createParentDirectories bool) error { - req := types.MakeDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - DirectoryPath: directoryPath, - CreateParentDirectories: createParentDirectories, - } - - _, err := methods.MakeDirectoryInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) MoveDirectory(ctx context.Context, auth types.BaseGuestAuthentication, srcDirectoryPath string, dstDirectoryPath string) error { - req := types.MoveDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - SrcDirectoryPath: srcDirectoryPath, - DstDirectoryPath: dstDirectoryPath, - } - - _, err := methods.MoveDirectoryInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) MoveFile(ctx context.Context, auth types.BaseGuestAuthentication, srcFilePath string, dstFilePath string, overwrite bool) error { - req := types.MoveFileInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - SrcFilePath: srcFilePath, - DstFilePath: dstFilePath, - Overwrite: overwrite, - } - - _, err := methods.MoveFileInGuest(ctx, m.c, &req) - return err -} diff --git a/vendor/github.com/vmware/govmomi/guest/operations_manager.go b/vendor/github.com/vmware/govmomi/guest/operations_manager.go deleted file mode 100644 index 3c5394d9d..000000000 --- a/vendor/github.com/vmware/govmomi/guest/operations_manager.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type OperationsManager struct { - c *vim25.Client - vm types.ManagedObjectReference -} - -func NewOperationsManager(c *vim25.Client, vm types.ManagedObjectReference) *OperationsManager { - return &OperationsManager{c, vm} -} - -func (m OperationsManager) retrieveOne(ctx context.Context, p string, dst *mo.GuestOperationsManager) error { - pc := property.DefaultCollector(m.c) - return pc.RetrieveOne(ctx, *m.c.ServiceContent.GuestOperationsManager, []string{p}, dst) -} - -func (m OperationsManager) AuthManager(ctx context.Context) (*AuthManager, error) { - var g mo.GuestOperationsManager - - err := m.retrieveOne(ctx, "authManager", &g) - if err != nil { - return nil, err - } - - return &AuthManager{*g.AuthManager, m.vm, m.c}, nil -} - -func (m OperationsManager) FileManager(ctx context.Context) (*FileManager, error) { - var g mo.GuestOperationsManager - - err := m.retrieveOne(ctx, "fileManager", &g) - if err != nil { - return nil, err - } - - return &FileManager{*g.FileManager, m.vm, m.c}, nil -} - -func (m OperationsManager) ProcessManager(ctx context.Context) (*ProcessManager, error) { - var g mo.GuestOperationsManager - - err := m.retrieveOne(ctx, "processManager", &g) - if err != nil { - return nil, err - } - - return &ProcessManager{*g.ProcessManager, m.vm, m.c}, nil -} diff --git a/vendor/github.com/vmware/govmomi/guest/process_manager.go b/vendor/github.com/vmware/govmomi/guest/process_manager.go deleted file mode 100644 index 159a571d7..000000000 --- a/vendor/github.com/vmware/govmomi/guest/process_manager.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package guest - -import ( - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ProcessManager struct { - types.ManagedObjectReference - - vm types.ManagedObjectReference - - c *vim25.Client -} - -func (m ProcessManager) Reference() types.ManagedObjectReference { - return m.ManagedObjectReference -} - -func (m ProcessManager) ListProcesses(ctx context.Context, auth types.BaseGuestAuthentication, pids []int64) ([]types.GuestProcessInfo, error) { - req := types.ListProcessesInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Pids: pids, - } - - res, err := methods.ListProcessesInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, err -} - -func (m ProcessManager) ReadEnvironmentVariable(ctx context.Context, auth types.BaseGuestAuthentication, names []string) ([]string, error) { - req := types.ReadEnvironmentVariableInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Names: names, - } - - res, err := methods.ReadEnvironmentVariableInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, err -} - -func (m ProcessManager) StartProgram(ctx context.Context, auth types.BaseGuestAuthentication, spec types.BaseGuestProgramSpec) (int64, error) { - req := types.StartProgramInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Spec: spec, - } - - res, err := methods.StartProgramInGuest(ctx, m.c, &req) - if err != nil { - return 0, err - } - - return res.Returnval, err -} - -func (m ProcessManager) TerminateProcess(ctx context.Context, auth types.BaseGuestAuthentication, pid int64) error { - req := types.TerminateProcessInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Pid: pid, - } - - _, err := methods.TerminateProcessInGuest(ctx, m.c, &req) - return err -} diff --git a/vendor/github.com/vmware/govmomi/license/assignment_manager.go b/vendor/github.com/vmware/govmomi/license/assignment_manager.go deleted file mode 100644 index 509c94f99..000000000 --- a/vendor/github.com/vmware/govmomi/license/assignment_manager.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type AssignmentManager struct { - object.Common -} - -func (m AssignmentManager) QueryAssigned(ctx context.Context, id string) ([]types.LicenseAssignmentManagerLicenseAssignment, error) { - req := types.QueryAssignedLicenses{ - This: m.Reference(), - EntityId: id, - } - - res, err := methods.QueryAssignedLicenses(ctx, m.Client(), &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (m AssignmentManager) Remove(ctx context.Context, id string) error { - req := types.RemoveAssignedLicense{ - This: m.Reference(), - EntityId: id, - } - - _, err := methods.RemoveAssignedLicense(ctx, m.Client(), &req) - - return err -} - -func (m AssignmentManager) Update(ctx context.Context, id string, key string, name string) (*types.LicenseManagerLicenseInfo, error) { - req := types.UpdateAssignedLicense{ - This: m.Reference(), - Entity: id, - LicenseKey: key, - EntityDisplayName: name, - } - - res, err := methods.UpdateAssignedLicense(ctx, m.Client(), &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} diff --git a/vendor/github.com/vmware/govmomi/license/manager.go b/vendor/github.com/vmware/govmomi/license/manager.go deleted file mode 100644 index 1e268f29d..000000000 --- a/vendor/github.com/vmware/govmomi/license/manager.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package license - -import ( - "strconv" - "strings" - - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Manager struct { - object.Common -} - -func NewManager(c *vim25.Client) *Manager { - m := Manager{ - object.NewCommon(c, *c.ServiceContent.LicenseManager), - } - - return &m -} - -func mapToKeyValueSlice(m map[string]string) []types.KeyValue { - r := make([]types.KeyValue, len(m)) - for k, v := range m { - r = append(r, types.KeyValue{Key: k, Value: v}) - } - return r -} - -func (m Manager) Add(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) { - req := types.AddLicense{ - This: m.Reference(), - LicenseKey: key, - Labels: mapToKeyValueSlice(labels), - } - - res, err := methods.AddLicense(ctx, m.Client(), &req) - if err != nil { - return types.LicenseManagerLicenseInfo{}, err - } - - return res.Returnval, nil -} - -func (m Manager) Decode(ctx context.Context, key string) (types.LicenseManagerLicenseInfo, error) { - req := types.DecodeLicense{ - This: m.Reference(), - LicenseKey: key, - } - - res, err := methods.DecodeLicense(ctx, m.Client(), &req) - if err != nil { - return types.LicenseManagerLicenseInfo{}, err - } - - return res.Returnval, nil -} - -func (m Manager) Remove(ctx context.Context, key string) error { - req := types.RemoveLicense{ - This: m.Reference(), - LicenseKey: key, - } - - _, err := methods.RemoveLicense(ctx, m.Client(), &req) - return err -} - -func (m Manager) Update(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) { - req := types.UpdateLicense{ - This: m.Reference(), - LicenseKey: key, - Labels: mapToKeyValueSlice(labels), - } - - res, err := methods.UpdateLicense(ctx, m.Client(), &req) - if err != nil { - return types.LicenseManagerLicenseInfo{}, err - } - - return res.Returnval, nil -} - -func (m Manager) List(ctx context.Context) (InfoList, error) { - var mlm mo.LicenseManager - - err := m.Properties(ctx, m.Reference(), []string{"licenses"}, &mlm) - if err != nil { - return nil, err - } - - return InfoList(mlm.Licenses), nil -} - -func (m Manager) AssignmentManager(ctx context.Context) (*AssignmentManager, error) { - var mlm mo.LicenseManager - - err := m.Properties(ctx, m.Reference(), []string{"licenseAssignmentManager"}, &mlm) - if err != nil { - return nil, err - } - - if mlm.LicenseAssignmentManager == nil { - return nil, object.ErrNotSupported - } - - am := AssignmentManager{ - object.NewCommon(m.Client(), *mlm.LicenseAssignmentManager), - } - - return &am, nil -} - -type licenseFeature struct { - name string - level int -} - -func parseLicenseFeature(feature string) *licenseFeature { - lf := new(licenseFeature) - - f := strings.Split(feature, ":") - - lf.name = f[0] - - if len(f) > 1 { - var err error - lf.level, err = strconv.Atoi(f[1]) - if err != nil { - lf.name = feature - } - } - - return lf -} - -func HasFeature(license types.LicenseManagerLicenseInfo, key string) bool { - feature := parseLicenseFeature(key) - - for _, p := range license.Properties { - if p.Key != "feature" { - continue - } - - kv, ok := p.Value.(types.KeyValue) - - if !ok { - continue - } - - lf := parseLicenseFeature(kv.Key) - - if lf.name == feature.name && lf.level >= feature.level { - return true - } - } - - return false -} - -// InfoList provides helper methods for []types.LicenseManagerLicenseInfo -type InfoList []types.LicenseManagerLicenseInfo - -func (l InfoList) WithFeature(key string) InfoList { - var result InfoList - - for _, license := range l { - if HasFeature(license, key) { - result = append(result, license) - } - } - - return result -} diff --git a/vendor/github.com/vmware/govmomi/ovf/cim.go b/vendor/github.com/vmware/govmomi/ovf/cim.go deleted file mode 100644 index ce20bde19..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/cim.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package ovf - -/* -Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_VirtualSystemSettingData.xsd -*/ - -type CIMVirtualSystemSettingData struct { - ElementName string `xml:"ElementName"` - InstanceID string `xml:"InstanceID"` - - AutomaticRecoveryAction *uint8 `xml:"AutomaticRecoveryAction"` - AutomaticShutdownAction *uint8 `xml:"AutomaticShutdownAction"` - AutomaticStartupAction *uint8 `xml:"AutomaticStartupAction"` - AutomaticStartupActionDelay *string `xml:"AutomaticStartupActionDelay>Interval"` - AutomaticStartupActionSequenceNumber *uint16 `xml:"AutomaticStartupActionSequenceNumber"` - Caption *string `xml:"Caption"` - ConfigurationDataRoot *string `xml:"ConfigurationDataRoot"` - ConfigurationFile *string `xml:"ConfigurationFile"` - ConfigurationID *string `xml:"ConfigurationID"` - CreationTime *string `xml:"CreationTime"` - Description *string `xml:"Description"` - LogDataRoot *string `xml:"LogDataRoot"` - Notes []string `xml:"Notes"` - RecoveryFile *string `xml:"RecoveryFile"` - SnapshotDataRoot *string `xml:"SnapshotDataRoot"` - SuspendDataRoot *string `xml:"SuspendDataRoot"` - SwapFileDataRoot *string `xml:"SwapFileDataRoot"` - VirtualSystemIdentifier *string `xml:"VirtualSystemIdentifier"` - VirtualSystemType *string `xml:"VirtualSystemType"` -} - -/* -Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_ResourceAllocationSettingData.xsd -*/ - -type CIMResourceAllocationSettingData struct { - ElementName string `xml:"ElementName"` - InstanceID string `xml:"InstanceID"` - - ResourceType *uint16 `xml:"ResourceType"` - OtherResourceType *string `xml:"OtherResourceType"` - ResourceSubType *string `xml:"ResourceSubType"` - - AddressOnParent *string `xml:"AddressOnParent"` - Address *string `xml:"Address"` - AllocationUnits *string `xml:"AllocationUnits"` - AutomaticAllocation *bool `xml:"AutomaticAllocation"` - AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` - Caption *string `xml:"Caption"` - Connection []string `xml:"Connection"` - ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` - Description *string `xml:"Description"` - HostResource []string `xml:"HostResource"` - Limit *uint64 `xml:"Limit"` - MappingBehavior *uint `xml:"MappingBehavior"` - Parent *string `xml:"Parent"` - PoolID *string `xml:"PoolID"` - Reservation *uint64 `xml:"Reservation"` - VirtualQuantity *uint `xml:"VirtualQuantity"` - VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` - Weight *uint `xml:"Weight"` -} diff --git a/vendor/github.com/vmware/govmomi/ovf/doc.go b/vendor/github.com/vmware/govmomi/ovf/doc.go deleted file mode 100644 index 6284b1ac5..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -/* -Package ovf provides functionality to unmarshal and inspect the structure -of an OVF file. It is not a complete implementation of the specification and -is intended to be used to import virtual infrastructure into vSphere. - -For a complete specification of the OVF standard, refer to: -https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf -*/ -package ovf diff --git a/vendor/github.com/vmware/govmomi/ovf/env.go b/vendor/github.com/vmware/govmomi/ovf/env.go deleted file mode 100644 index 5a5fc2f62..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/env.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package ovf - -import ( - "bytes" - "encoding/xml" - "fmt" -) - -const ( - ovfEnvHeader = `` - ovfEnvPlatformSection = ` - %s - %s - %s - %s - ` - ovfEnvPropertyHeader = `` - ovfEnvPropertyEntry = `` - ovfEnvPropertyFooter = `` - ovfEnvFooter = `` -) - -type Env struct { - XMLName xml.Name `xml:"http://schemas.dmtf.org/ovf/environment/1 Environment"` - ID string `xml:"id,attr"` - EsxID string `xml:"http://www.vmware.com/schema/ovfenv esxId,attr"` - - Platform *PlatformSection `xml:"PlatformSection"` - Property *PropertySection `xml:"PropertySection"` -} - -type PlatformSection struct { - Kind string `xml:"Kind"` - Version string `xml:"Version"` - Vendor string `xml:"Vendor"` - Locale string `xml:"Locale"` -} - -type PropertySection struct { - Properties []EnvProperty `xml:"Property"` -} - -type EnvProperty struct { - Key string `xml:"key,attr"` - Value string `xml:"value,attr"` -} - -// Marshal marshals Env to xml by using xml.Marshal. -func (e Env) Marshal() (string, error) { - x, err := xml.Marshal(e) - if err != nil { - return "", err - } - - return fmt.Sprintf("%s%s", xml.Header, x), nil -} - -// MarshalManual manually marshals Env to xml suitable for a vApp guest. -// It exists to overcome the lack of expressiveness in Go's XML namespaces. -func (e Env) MarshalManual() string { - var buffer bytes.Buffer - - buffer.WriteString(xml.Header) - buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) - buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) - - buffer.WriteString(fmt.Sprintf(ovfEnvPropertyHeader)) - for _, p := range e.Property.Properties { - buffer.WriteString(fmt.Sprintf(ovfEnvPropertyEntry, p.Key, p.Value)) - } - buffer.WriteString(fmt.Sprintf(ovfEnvPropertyFooter)) - - buffer.WriteString(fmt.Sprintf(ovfEnvFooter)) - - return buffer.String() -} diff --git a/vendor/github.com/vmware/govmomi/ovf/envelope.go b/vendor/github.com/vmware/govmomi/ovf/envelope.go deleted file mode 100644 index af96b1548..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/envelope.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package ovf - -type Envelope struct { - References []File `xml:"References>File"` - - // Package level meta-data - Annotation *AnnotationSection `xml:"AnnotationSection"` - Product *ProductSection `xml:"ProductSection"` - Network *NetworkSection `xml:"NetworkSection"` - Disk *DiskSection `xml:"DiskSection"` - OperatingSystem *OperatingSystemSection `xml:"OperatingSystemSection"` - Eula *EulaSection `xml:"EulaSection"` - VirtualHardware *VirtualHardwareSection `xml:"VirtualHardwareSection"` - ResourceAllocation *ResourceAllocationSection `xml:"ResourceAllocationSection"` - DeploymentOption *DeploymentOptionSection `xml:"DeploymentOptionSection"` - - // Content: A VirtualSystem or a VirtualSystemCollection - VirtualSystem *VirtualSystem `xml:"VirtualSystem"` -} - -type VirtualSystem struct { - Content - - Annotation []AnnotationSection `xml:"AnnotationSection"` - Product []ProductSection `xml:"ProductSection"` - OperatingSystem []OperatingSystemSection `xml:"OperatingSystemSection"` - Eula []EulaSection `xml:"EulaSection"` - VirtualHardware []VirtualHardwareSection `xml:"VirtualHardwareSection"` -} - -type File struct { - ID string `xml:"id,attr"` - Href string `xml:"href,attr"` - Size uint `xml:"size,attr"` - Compression *string `xml:"compression,attr"` - ChunkSize *int `xml:"chunkSize,attr"` -} - -type Content struct { - ID string `xml:"id,attr"` - Info string `xml:"Info"` - Name *string `xml:"Name"` -} - -type Section struct { - Required *bool `xml:"required,attr"` - Info string `xml:"Info"` -} - -type AnnotationSection struct { - Section - - Annotation string `xml:"Annotation"` -} - -type ProductSection struct { - Section - - Class *string `xml:"class,attr"` - Instance *string `xml:"instance,attr"` - - Product string `xml:"Product"` - Vendor string `xml:"Vendor"` - Version string `xml:"Version"` - FullVersion string `xml:"FullVersion"` - ProductURL string `xml:"ProductUrl"` - VendorURL string `xml:"VendorUrl"` - AppURL string `xml:"AppUrl"` - Property []Property `xml:"Property"` -} - -type Property struct { - Key string `xml:"key,attr"` - Type string `xml:"type,attr"` - Qualifiers *string `xml:"qualifiers,attr"` - UserConfigurable *bool `xml:"userConfigurable,attr"` - Default *string `xml:"value,attr"` - Password *bool `xml:"password,attr"` - - Label *string `xml:"Label"` - Description *string `xml:"Description"` - - Values []PropertyConfigurationValue `xml:"Value"` -} - -type PropertyConfigurationValue struct { - Value string `xml:"value,attr"` - Configuration *string `xml:"configuration,attr"` -} - -type NetworkSection struct { - Section - - Networks []Network `xml:"Network"` -} - -type Network struct { - Name string `xml:"name,attr"` - - Description string `xml:"Description"` -} - -type DiskSection struct { - Section - - Disks []VirtualDiskDesc `xml:"Disk"` -} - -type VirtualDiskDesc struct { - DiskID string `xml:"diskId,attr"` - FileRef *string `xml:"fileRef,attr"` - Capacity string `xml:"capacity,attr"` - CapacityAllocationUnits *string `xml:"capacityAllocationUnits,attr"` - Format *string `xml:"format,attr"` - PopulatedSize *int `xml:"populatedSize,attr"` - ParentRef *string `xml:"parentRef,attr"` -} - -type OperatingSystemSection struct { - Section - - ID uint16 `xml:"id,attr"` - Version *string `xml:"version,attr"` - OSType *string `xml:"osType,attr"` - - Description *string `xml:"Description"` -} - -type EulaSection struct { - Section - - License string `xml:"License"` -} - -type VirtualHardwareSection struct { - Section - - ID *string `xml:"id,attr"` - Transport *string `xml:"transport,attr"` - - System *VirtualSystemSettingData `xml:"System"` - Item []ResourceAllocationSettingData `xml:"Item"` -} - -type VirtualSystemSettingData struct { - CIMVirtualSystemSettingData -} - -type ResourceAllocationSettingData struct { - CIMResourceAllocationSettingData - - Required *bool `xml:"required,attr"` - Configuration *string `xml:"configuration,attr"` - Bound *string `xml:"bound,attr"` -} - -type ResourceAllocationSection struct { - Section - - Item []ResourceAllocationSettingData `xml:"Item"` -} - -type DeploymentOptionSection struct { - Section - - Configuration []DeploymentOptionConfiguration `xml:"Configuration"` -} - -type DeploymentOptionConfiguration struct { - ID string `xml:"id,attr"` - Default *bool `xml:"default,attr"` - - Label string `xml:"Label"` - Description string `xml:"Description"` -} diff --git a/vendor/github.com/vmware/govmomi/ovf/ovf.go b/vendor/github.com/vmware/govmomi/ovf/ovf.go deleted file mode 100644 index eea02d677..000000000 --- a/vendor/github.com/vmware/govmomi/ovf/ovf.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package ovf - -import ( - "encoding/xml" - "io" -) - -func Unmarshal(r io.Reader) (*Envelope, error) { - var e Envelope - - dec := xml.NewDecoder(r) - err := dec.Decode(&e) - if err != nil { - return nil, err - } - - return &e, nil -} diff --git a/vendor/github.com/vmware/govmomi/scripts/.gitignore b/vendor/github.com/vmware/govmomi/scripts/.gitignore deleted file mode 100644 index d0153ee29..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.wireshark-* diff --git a/vendor/github.com/vmware/govmomi/scripts/contributors.sh b/vendor/github.com/vmware/govmomi/scripts/contributors.sh deleted file mode 100644 index 609873842..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/contributors.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -outfile="CONTRIBUTORS" -tmpfile="CONTRIBUTORS.tmp" -cp "${outfile}" "${tmpfile}" - -# Make sure the email address of every contributor is listed -git shortlog -sne | while read line; do - name=$(perl -pe 's/\d+\s+//' <<<"${line}") - email=$(grep -Po '(?<=<).*(?=>)' <<<"${name}") - if ! grep -q "${email}" "${outfile}"; then - echo "${name}" >> "${tmpfile}" - fi -done - -# Sort entries -( - sed -ne '1,5p' "${tmpfile}" - sed -ne '1,5!p' "${tmpfile}" | sort -) > "${outfile}" - -rm -f "${tmpfile}" diff --git a/vendor/github.com/vmware/govmomi/scripts/debug-ls.sh b/vendor/github.com/vmware/govmomi/scripts/debug-ls.sh deleted file mode 100644 index 0cb51abf8..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/debug-ls.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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. - -set -e - -# This script shows for every request in a debug trace how long it took -# and the name of the request body. - -function body-name { - ( - xmllint --shell $1 <` to save GOVC_* variables. -# * Execute `govc-env ` to load GOVC_* variables. -# - -_govc_env_dir=$HOME/.govmomi/env -mkdir -p "${_govc_env_dir}" - -_govc-env-complete() { - local w="${COMP_WORDS[COMP_CWORD]}" - local c="$(find ${_govc_env_dir} -mindepth 1 -maxdepth 1 -type f | sort | xargs -r -L1 basename | xargs echo)" - - # Only allow completion if preceding argument if the function itself - if [ "$3" == "govc-env" ]; then - COMPREPLY=( $(compgen -W "${c}" -- "${w}") ) - fi -} - -govc-env() { - # Print current environment - if [ -z "$1" ]; then - for VAR in $(env | grep ^GOVC_ | cut -d= -f1); do - echo "export ${VAR}='${!VAR}'" - done - - return - fi - - # Save current environment - if [ "$1" == "--save" ]; then - govc-env > ${_govc_env_dir}/$2 - return - fi - - # Load specified environment - source ${_govc_env_dir}/$1 -} - -complete -F _govc-env-complete govc-env - diff --git a/vendor/github.com/vmware/govmomi/scripts/headers/go.txt b/vendor/github.com/vmware/govmomi/scripts/headers/go.txt deleted file mode 100644 index 7dfe744e9..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/headers/go.txt +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright (c) ${YEARS} VMware, Inc. All Rights Reserved. - -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/vmware/govmomi/scripts/headers/rb.txt b/vendor/github.com/vmware/govmomi/scripts/headers/rb.txt deleted file mode 100644 index 1c3bd22d4..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/headers/rb.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) ${YEARS} VMware, Inc. All Rights Reserved. -# -# 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/vmware/govmomi/scripts/license.sh b/vendor/github.com/vmware/govmomi/scripts/license.sh deleted file mode 100644 index d47cad02c..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/license.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -e - -header_dir=$(dirname $0)/headers - -tmpfile=$(mktemp) -trap "rm -f ${tmpfile}" EXIT - -git ls-files | while read file; do - years=( $(git log --format='%ai' $file | cut -d- -f1 | sort -u) ) - num_years=${#years[@]} - - if [ "${num_years}" == 0 ]; then - export YEARS="$(date +%Y)" - else - yearA=${years[0]} - yearB=${years[$((${num_years}-1))]} - - if [ ${yearA} == ${yearB} ]; then - export YEARS="${yearA}" - else - export YEARS="${yearA}-${yearB}" - fi - fi - - case "$file" in - vim25/xml/*) - # Ignore - ;; - *.go) - sed -e "s/\${YEARS}/${YEARS}/" ${header_dir}/go.txt > ${tmpfile} - last_header_line=$(grep -n '\*/' ${file} | head -1 | cut -d: -f1) - tail -n +$((${last_header_line} + 1)) ${file} >> ${tmpfile} - mv ${tmpfile} ${file} - ;; - *.rb) - sed -e "s/\${YEARS}/${YEARS}/" ${header_dir}/rb.txt > ${tmpfile} - last_header_line=$(grep -n '^$' ${file} | head -1 | cut -d: -f1) - tail -n +$((${last_header_line})) ${file} >> ${tmpfile} - mv ${tmpfile} ${file} - ;; - *) - echo "Unhandled file: $file" - ;; - esac -done - diff --git a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore b/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore deleted file mode 100644 index cd5d9c70b..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.box -*.ova -.vagrant diff --git a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile b/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile deleted file mode 100644 index 705799b74..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile +++ /dev/null @@ -1,13 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Using the VCSA base box, no provisioning, inventory will be empty. - -Vagrant.configure("2") do |config| - config.vm.hostname = "vcsa" - - config.vm.box = "vcsa" - config.vm.synced_folder ".", "/vagrant", disabled: true - - config.vm.network "forwarded_port", guest: 443, host: 16443 -end diff --git a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh b/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh deleted file mode 100644 index 487253b21..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$(uname -s)" == "Darwin" ]; then - PATH="/Applications/VMware Fusion.app/Contents/Library:$PATH" - PATH="/Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool:$PATH" -fi - -ovf="$1" - -if [ -z "$ovf" ]; then - ovf="./VMware-vCenter-Server-Appliance-5.5.0.10300-2000350_OVA10.ova" -fi - -# check for greadlink and gmktemp -readlink=$(type -p greadlink readlink | head -1) -mktemp=$(type -p gmktemp mktemp | head -1) - -dir=$($readlink -nf $(dirname $0)) -tmp=$($mktemp -d) -trap "rm -rf $tmp" EXIT - -cd $tmp - -echo "Converting ovf..." -ovftool \ - --noSSLVerify \ - --acceptAllEulas \ - --overwrite \ - --powerOffTarget \ - $ovf vcsa.vmx - -echo "Starting vm..." -vmrun start vcsa.vmx nogui - -echo "Waiting for vm ip..." -ip=$(vmrun getGuestIPAddress vcsa.vmx -wait) - -echo "Configuring vm for use with vagrant..." -vmrun -gu root -gp vmware CopyFileFromHostToGuest vcsa.vmx \ - $dir/vagrant.sh /tmp/vagrant.sh - -vmrun -gu root -gp vmware runProgramInGuest vcsa.vmx \ - /bin/sh -e /tmp/vagrant.sh - -vmrun -gu root -gp vmware deleteFileInGuest vcsa.vmx \ - /tmp/vagrant.sh - -echo "Configuring vCenter Server Appliance..." - -ssh_opts="-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -T" - -ssh ${ssh_opts} -i ~/.vagrant.d/insecure_private_key vagrant@$ip < ./metadata.json - -cd $dir - -tar -C $tmp -cvzf vcsa.box . - -vagrant box add --name vcsa vcsa.box diff --git a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh b/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh deleted file mode 100644 index 976cc17de..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -useradd vagrant -m -s /bin/bash -groupmod -A vagrant wheel - -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - -mkdir ~vagrant/.ssh -wget --no-check-certificate \ - https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub \ - -O ~vagrant/.ssh/authorized_keys -chown -R vagrant ~vagrant/.ssh -chmod -R go-rwsx ~vagrant/.ssh - -sed -i -e 's/^#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config -sed -i -e 's/^AllowTcpForwarding no//' /etc/ssh/sshd_config -sed -i -e 's/^PermitTunnel no//' /etc/ssh/sshd_config -sed -i -e 's/^MaxSessions 1//' /etc/ssh/sshd_config - -# disable password expiration -for uid in root vagrant; do - chage -I -1 -E -1 -m 0 -M -1 $uid -done diff --git a/vendor/github.com/vmware/govmomi/scripts/wireshark-esx.sh b/vendor/github.com/vmware/govmomi/scripts/wireshark-esx.sh deleted file mode 100644 index d1b2427d5..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/wireshark-esx.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -e -# -# Capture ESXi traffic and decrypt SOAP traffic on port 443 via wireshark - -# Device to capture -dev="${1-vmk0}" - -# Device to get the ip for wireshark ssl_keys config -if [ "$dev" = "lo0" ] ; then - ip_dev="vmk0" -else - ip_dev="$dev" -fi - -ip=$(govc host.info -k -json | \ - jq -r ".HostSystems[].Config.Network.Vnic[] | select(.Device == \"${ip_dev}\") | .Spec.Ip.IpAddress") - -scp=(scp) -ssh=(ssh) - -# Check if vagrant ssh-config applies to $ip -if [ -d ".vagrant" ] ; then - vssh_opts=($(vagrant ssh-config | awk NF | awk -v ORS=' ' '{print "-o " $1 "=" $2}')) - if grep "HostName=${ip}" >/dev/null <<<"${vssh_opts[*]}" ; then - ssh_opts=("${vssh_opts[@]}") - fi -fi - -# Otherwise, use default ssh opts + sshpass if available -if [ ${#ssh_opts[@]} -eq 0 ] ; then - userpass=$(awk -F// '{print $NF}' <<<"$GOVC_URL" | awk -F@ '{print $1}') - username=$(awk -F: '{print $1}' <<<"$userpass") - password=$(awk -F: '{print $2}' <<<"$userpass") - - ssh_opts=(-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o User=${username}) - - if [ -x "$(which sshpass)" ] ; then - if [ -z "$password" ] ; then - password="$GOVC_PASSWORD" - fi - scp=(sshpass -p $password scp) - ssh=(sshpass -p $password ssh) - fi -fi - -if [ "$dev" != "lo0" ] ; then - # If you change this filter, be sure to exclude the ssh port (not tcp port 22) - filter="host $ip and \(port 80 or port 443\)" - - dst="$HOME/.wireshark/rui-${ip}.key" - if [ ! -f "$dst" ] ; then - # Copy key from ESX - "${scp[@]}" "${ssh_opts[@]}" "${ip}:/etc/vmware/ssl/rui.key" "$dst" - fi - - if ! grep "$ip" ~/.wireshark/ssl_keys 2>/dev/null ; then - # Add key to wireshark ssl_keys config - echo "adding rui.key for $ip" - - cat <> ~/.wireshark/ssl_keys -"$ip","443","http","$dst","" -EOF - fi -fi - -echo "Capturing $dev on $ip..." - -"${ssh[@]}" "${ssh_opts[@]}" "$ip" tcpdump-uw -i "$dev" -s0 -v -w - "$filter" | wireshark -k -i - diff --git a/vendor/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh b/vendor/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh deleted file mode 100644 index ea762ebd9..000000000 --- a/vendor/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -e -# -# Capture SOAP traffic between web client and vpxd on 127.0.0.1:8085. -# -# Caveats: tested with VCSA 6.0, unlikely to work for other versions. -# - -set -e - -cache_deb() { - wget $1 - ar x *.deb data.tar.gz - tar zxf data.tar.gz - rm -f data.tar.gz - rm -f *.deb -} - -dirname="$(dirname $0)" -basename="$(basename $0)" -bindir="${dirname}/.${basename}" - -mkdir -p "${bindir}" - -# Cache binaries required to run tcpdump on vcsa -if [ ! -f "${bindir}/.done" ]; then - pushd ${bindir} - cache_deb https://launchpadlibrarian.net/200649143/libssl0.9.8_0.9.8k-7ubuntu8.27_amd64.deb - cache_deb https://launchpadlibrarian.net/37430984/libpcap0.8_1.0.0-6_amd64.deb - cache_deb https://launchpadlibrarian.net/41774869/tcpdump_4.0.0-6ubuntu3_amd64.deb - touch .done - popd -fi - -scp=(scp) -ssh=(ssh) - -# Extract host from GOVC_URL -userpasshost=$(awk -F/ '{print $(NF-1)}' <<<"$GOVC_URL") -host=$(awk -F@ '{print $NF}' <<<"$userpasshost") -username=root -password="$GOVC_PASSWORD" - -if [ -x "$(which sshpass)" ] ; then - scp=(sshpass -p "$password" scp) - ssh=(sshpass -p "$password" ssh) -fi - -ssh_opts=(-o UserKnownHostsFile=/dev/null - -o StrictHostKeyChecking=no - -o LogLevel=FATAL - -o User=${username} - -o ControlMaster=no) -dev="lo" -filter="port 8085" -tcpdump="env LD_LIBRARY_PATH=/tmp /tmp/tcpdump" - -echo "Capturing $dev on $host..." - -"${scp[@]}" "${ssh_opts[@]}" \ - "${bindir}/lib/libcrypto.so.0.9.8" \ - "${bindir}/usr/lib/libpcap.so.0.8" \ - "${bindir}/usr/sbin/tcpdump" \ - "${host}:/tmp" - -"${ssh[@]}" "${ssh_opts[@]}" "$host" ${tcpdump} -i "$dev" -s0 -v -w - "$filter" | wireshark -k -i - 2>/dev/null diff --git a/vendor/github.com/vmware/govmomi/test/doc.go b/vendor/github.com/vmware/govmomi/test/doc.go deleted file mode 100644 index 4bcff639a..000000000 --- a/vendor/github.com/vmware/govmomi/test/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -/* -Package test contains functions that implement common functionality between -tests. The code (non-test) in this package intentionally does not take any -dependendies outside the vim25 tree. -*/ -package test diff --git a/vendor/github.com/vmware/govmomi/test/functional/helper.go b/vendor/github.com/vmware/govmomi/test/functional/helper.go deleted file mode 100644 index 1852200cf..000000000 --- a/vendor/github.com/vmware/govmomi/test/functional/helper.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package functional - -import ( - "testing" - - "github.com/vmware/govmomi/find" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/test" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Helper struct { - *testing.T - - c *vim25.Client - f *find.Finder - fns []func() -} - -func NewHelper(t *testing.T) *Helper { - h := &Helper{ - T: t, - - c: test.NewAuthenticatedClient(t), - fns: make([]func(), 0), - } - - h.f = find.NewFinder(h.c, true) - - return h -} - -func (h *Helper) Defer(fn func()) { - h.fns = append(h.fns, fn) -} - -func (h *Helper) Teardown() { - for _, fn := range h.fns { - fn() - } -} - -func (h *Helper) RequireVirtualCenter() { - var expect = "VirtualCenter" - var actual = h.c.ServiceContent.About.ApiType - if actual != expect { - h.Skipf("Requires %s, running against %s", expect, actual) - } -} - -func (h *Helper) Datacenter() *object.Datacenter { - dc, err := h.f.DefaultDatacenter(context.Background()) - if err != nil { - h.Fatal(err) - } - - h.f.SetDatacenter(dc) - - return dc -} - -func (h *Helper) DatacenterFolders() *object.DatacenterFolders { - df, err := h.Datacenter().Folders(context.Background()) - if err != nil { - h.Fatal(err) - } - - return df -} - -func (h *Helper) ComputeResource() *object.ComputeResource { - cr, err := h.f.DefaultComputeResource(context.Background()) - if err != nil { - h.Fatal(err) - } - - return cr -} - -func (h *Helper) LocalDatastores(ctx context.Context, cr *object.ComputeResource) ([]*object.Datastore, error) { - // List datastores for compute resource - dss, err := cr.Datastores(ctx) - if err != nil { - return nil, err - } - - // Filter local datastores - var ldss []*object.Datastore - for _, ds := range dss { - var mds mo.Datastore - err = property.DefaultCollector(h.c).RetrieveOne(ctx, ds.Reference(), nil, &mds) - if err != nil { - return nil, err - } - - switch i := mds.Info.(type) { - case *types.VmfsDatastoreInfo: - if i.Vmfs.Local != nil && *i.Vmfs.Local == true { - break - } - default: - continue - } - - ds.InventoryPath = mds.Name - ldss = append(ldss, ds) - } - - return ldss, nil -} diff --git a/vendor/github.com/vmware/govmomi/test/helper.go b/vendor/github.com/vmware/govmomi/test/helper.go deleted file mode 100644 index f69db7500..000000000 --- a/vendor/github.com/vmware/govmomi/test/helper.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package test - -import ( - "net/url" - "os" - "testing" - - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// URL parses the GOVMOMI_TEST_URL environment variable if set. -func URL() *url.URL { - s := os.Getenv("GOVMOMI_TEST_URL") - if s == "" { - return nil - } - u, err := soap.ParseURL(s) - if err != nil { - panic(err) - } - return u -} - -// NewAuthenticatedClient creates a new vim25.Client, authenticates the user -// specified in the test URL, and returns it. -func NewAuthenticatedClient(t *testing.T) *vim25.Client { - u := URL() - if u == nil { - t.SkipNow() - } - - soapClient := soap.NewClient(u, true) - vimClient, err := vim25.NewClient(context.Background(), soapClient) - if err != nil { - t.Fatal(err) - } - - req := types.Login{ - This: *vimClient.ServiceContent.SessionManager, - } - - req.UserName = u.User.Username() - if pw, ok := u.User.Password(); ok { - req.Password = pw - } - - _, err = methods.Login(context.Background(), vimClient, &req) - if err != nil { - t.Fatal(err) - } - - return vimClient -} diff --git a/vendor/github.com/vmware/govmomi/units/size.go b/vendor/github.com/vmware/govmomi/units/size.go deleted file mode 100644 index 48208364a..000000000 --- a/vendor/github.com/vmware/govmomi/units/size.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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. -*/ - -package units - -import ( - "errors" - "fmt" - "regexp" - "strconv" -) - -type ByteSize int64 - -const ( - _ = iota - KB = 1 << (10 * iota) - MB - GB - TB - PB - EB -) - -func (b ByteSize) String() string { - switch { - case b >= EB: - return fmt.Sprintf("%.1fEB", float32(b)/EB) - case b >= PB: - return fmt.Sprintf("%.1fPB", float32(b)/PB) - case b >= TB: - return fmt.Sprintf("%.1fTB", float32(b)/TB) - case b >= GB: - return fmt.Sprintf("%.1fGB", float32(b)/GB) - case b >= MB: - return fmt.Sprintf("%.1fMB", float32(b)/MB) - case b >= KB: - return fmt.Sprintf("%.1fKB", float32(b)/KB) - } - return fmt.Sprintf("%dB", b) -} - -var bytesRegexp = regexp.MustCompile(`^(?i)(\d+)([BKMGTPE]?)(ib|b)?$`) - -func (b *ByteSize) Set(s string) error { - m := bytesRegexp.FindStringSubmatch(s) - if len(m) == 0 { - return errors.New("invalid byte value") - } - - i, err := strconv.ParseInt(m[1], 10, 64) - if err != nil { - return err - } - *b = ByteSize(i) - - switch m[2] { - case "B", "b", "": - case "K", "k": - *b *= ByteSize(KB) - case "M", "m": - *b *= ByteSize(MB) - case "G", "g": - *b *= ByteSize(GB) - case "T", "t": - *b *= ByteSize(TB) - case "P", "p": - *b *= ByteSize(PB) - case "E", "e": - *b *= ByteSize(EB) - default: - return errors.New("invalid byte suffix") - } - - return nil -} diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml b/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml deleted file mode 100644 index be218c052..000000000 --- a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - domain-c7 - - host - - host-14 - host-17 - host-19 - host-52 - - - - diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml b/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml deleted file mode 100644 index 05d369d85..000000000 --- a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - host-10 - - name - host-01.example.com - - - - host-30 - - name - host-02.example.com - - - diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml b/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml deleted file mode 100644 index ed44167f4..000000000 --- a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - vm-411 - - config.name - kubernetes-master - - - config.uuid - 422ec880-ab06-06b4-23f3-beb7a052a4c9 - - - diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml b/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml deleted file mode 100644 index 2a7fcdbdf..000000000 --- a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - SessionManager - - defaultLocale - en - - - messageLocaleList - - ja - zh_CN - en - de - zh_TW - ko - fr - - - - message - - - group-d1 - System.View - - - - - - sessionList - - - group-d1 - Sessions.TerminateSession - - - - - - diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml b/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml deleted file mode 100644 index 54baaf5ff..000000000 --- a/vendor/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - vm-411 - - config.bootOptions - - 0 - false - false - 10000 - - - - diff --git a/vendor/github.com/ziutek/mymysql/autorc/LICENSE b/vendor/github.com/ziutek/mymysql/autorc/LICENSE deleted file mode 100644 index 8eab9a6ec..000000000 --- a/vendor/github.com/ziutek/mymysql/autorc/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2010, Michal Derkacz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go deleted file mode 100644 index 741eeb13f..000000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go +++ /dev/null @@ -1,892 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package terminal - -import ( - "bytes" - "io" - "sync" - "unicode/utf8" -) - -// EscapeCodes contains escape sequences that can be written to the terminal in -// order to achieve different styles of text. -type EscapeCodes struct { - // Foreground colors - Black, Red, Green, Yellow, Blue, Magenta, Cyan, White []byte - - // Reset all attributes - Reset []byte -} - -var vt100EscapeCodes = EscapeCodes{ - Black: []byte{keyEscape, '[', '3', '0', 'm'}, - Red: []byte{keyEscape, '[', '3', '1', 'm'}, - Green: []byte{keyEscape, '[', '3', '2', 'm'}, - Yellow: []byte{keyEscape, '[', '3', '3', 'm'}, - Blue: []byte{keyEscape, '[', '3', '4', 'm'}, - Magenta: []byte{keyEscape, '[', '3', '5', 'm'}, - Cyan: []byte{keyEscape, '[', '3', '6', 'm'}, - White: []byte{keyEscape, '[', '3', '7', 'm'}, - - Reset: []byte{keyEscape, '[', '0', 'm'}, -} - -// Terminal contains the state for running a VT100 terminal that is capable of -// reading lines of input. -type Terminal struct { - // AutoCompleteCallback, if non-null, is called for each keypress with - // the full input line and the current position of the cursor (in - // bytes, as an index into |line|). If it returns ok=false, the key - // press is processed normally. Otherwise it returns a replacement line - // and the new cursor position. - AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) - - // Escape contains a pointer to the escape codes for this terminal. - // It's always a valid pointer, although the escape codes themselves - // may be empty if the terminal doesn't support them. - Escape *EscapeCodes - - // lock protects the terminal and the state in this object from - // concurrent processing of a key press and a Write() call. - lock sync.Mutex - - c io.ReadWriter - prompt []rune - - // line is the current line being entered. - line []rune - // pos is the logical position of the cursor in line - pos int - // echo is true if local echo is enabled - echo bool - // pasteActive is true iff there is a bracketed paste operation in - // progress. - pasteActive bool - - // cursorX contains the current X value of the cursor where the left - // edge is 0. cursorY contains the row number where the first row of - // the current line is 0. - cursorX, cursorY int - // maxLine is the greatest value of cursorY so far. - maxLine int - - termWidth, termHeight int - - // outBuf contains the terminal data to be sent. - outBuf []byte - // remainder contains the remainder of any partial key sequences after - // a read. It aliases into inBuf. - remainder []byte - inBuf [256]byte - - // history contains previously entered commands so that they can be - // accessed with the up and down keys. - history stRingBuffer - // historyIndex stores the currently accessed history entry, where zero - // means the immediately previous entry. - historyIndex int - // When navigating up and down the history it's possible to return to - // the incomplete, initial line. That value is stored in - // historyPending. - historyPending string -} - -// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is -// a local terminal, that terminal must first have been put into raw mode. -// prompt is a string that is written at the start of each input line (i.e. -// "> "). -func NewTerminal(c io.ReadWriter, prompt string) *Terminal { - return &Terminal{ - Escape: &vt100EscapeCodes, - c: c, - prompt: []rune(prompt), - termWidth: 80, - termHeight: 24, - echo: true, - historyIndex: -1, - } -} - -const ( - keyCtrlD = 4 - keyCtrlU = 21 - keyEnter = '\r' - keyEscape = 27 - keyBackspace = 127 - keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota - keyUp - keyDown - keyLeft - keyRight - keyAltLeft - keyAltRight - keyHome - keyEnd - keyDeleteWord - keyDeleteLine - keyClearScreen - keyPasteStart - keyPasteEnd -) - -var pasteStart = []byte{keyEscape, '[', '2', '0', '0', '~'} -var pasteEnd = []byte{keyEscape, '[', '2', '0', '1', '~'} - -// bytesToKey tries to parse a key sequence from b. If successful, it returns -// the key and the remainder of the input. Otherwise it returns utf8.RuneError. -func bytesToKey(b []byte, pasteActive bool) (rune, []byte) { - if len(b) == 0 { - return utf8.RuneError, nil - } - - if !pasteActive { - switch b[0] { - case 1: // ^A - return keyHome, b[1:] - case 5: // ^E - return keyEnd, b[1:] - case 8: // ^H - return keyBackspace, b[1:] - case 11: // ^K - return keyDeleteLine, b[1:] - case 12: // ^L - return keyClearScreen, b[1:] - case 23: // ^W - return keyDeleteWord, b[1:] - } - } - - if b[0] != keyEscape { - if !utf8.FullRune(b) { - return utf8.RuneError, b - } - r, l := utf8.DecodeRune(b) - return r, b[l:] - } - - if !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' { - switch b[2] { - case 'A': - return keyUp, b[3:] - case 'B': - return keyDown, b[3:] - case 'C': - return keyRight, b[3:] - case 'D': - return keyLeft, b[3:] - case 'H': - return keyHome, b[3:] - case 'F': - return keyEnd, b[3:] - } - } - - if !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' { - switch b[5] { - case 'C': - return keyAltRight, b[6:] - case 'D': - return keyAltLeft, b[6:] - } - } - - if !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) { - return keyPasteStart, b[6:] - } - - if pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteEnd) { - return keyPasteEnd, b[6:] - } - - // If we get here then we have a key that we don't recognise, or a - // partial sequence. It's not clear how one should find the end of a - // sequence without knowing them all, but it seems that [a-zA-Z~] only - // appears at the end of a sequence. - for i, c := range b[0:] { - if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '~' { - return keyUnknown, b[i+1:] - } - } - - return utf8.RuneError, b -} - -// queue appends data to the end of t.outBuf -func (t *Terminal) queue(data []rune) { - t.outBuf = append(t.outBuf, []byte(string(data))...) -} - -var eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'} -var space = []rune{' '} - -func isPrintable(key rune) bool { - isInSurrogateArea := key >= 0xd800 && key <= 0xdbff - return key >= 32 && !isInSurrogateArea -} - -// moveCursorToPos appends data to t.outBuf which will move the cursor to the -// given, logical position in the text. -func (t *Terminal) moveCursorToPos(pos int) { - if !t.echo { - return - } - - x := visualLength(t.prompt) + pos - y := x / t.termWidth - x = x % t.termWidth - - up := 0 - if y < t.cursorY { - up = t.cursorY - y - } - - down := 0 - if y > t.cursorY { - down = y - t.cursorY - } - - left := 0 - if x < t.cursorX { - left = t.cursorX - x - } - - right := 0 - if x > t.cursorX { - right = x - t.cursorX - } - - t.cursorX = x - t.cursorY = y - t.move(up, down, left, right) -} - -func (t *Terminal) move(up, down, left, right int) { - movement := make([]rune, 3*(up+down+left+right)) - m := movement - for i := 0; i < up; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'A' - m = m[3:] - } - for i := 0; i < down; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'B' - m = m[3:] - } - for i := 0; i < left; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'D' - m = m[3:] - } - for i := 0; i < right; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'C' - m = m[3:] - } - - t.queue(movement) -} - -func (t *Terminal) clearLineToRight() { - op := []rune{keyEscape, '[', 'K'} - t.queue(op) -} - -const maxLineLength = 4096 - -func (t *Terminal) setLine(newLine []rune, newPos int) { - if t.echo { - t.moveCursorToPos(0) - t.writeLine(newLine) - for i := len(newLine); i < len(t.line); i++ { - t.writeLine(space) - } - t.moveCursorToPos(newPos) - } - t.line = newLine - t.pos = newPos -} - -func (t *Terminal) advanceCursor(places int) { - t.cursorX += places - t.cursorY += t.cursorX / t.termWidth - if t.cursorY > t.maxLine { - t.maxLine = t.cursorY - } - t.cursorX = t.cursorX % t.termWidth - - if places > 0 && t.cursorX == 0 { - // Normally terminals will advance the current position - // when writing a character. But that doesn't happen - // for the last character in a line. However, when - // writing a character (except a new line) that causes - // a line wrap, the position will be advanced two - // places. - // - // So, if we are stopping at the end of a line, we - // need to write a newline so that our cursor can be - // advanced to the next line. - t.outBuf = append(t.outBuf, '\n') - } -} - -func (t *Terminal) eraseNPreviousChars(n int) { - if n == 0 { - return - } - - if t.pos < n { - n = t.pos - } - t.pos -= n - t.moveCursorToPos(t.pos) - - copy(t.line[t.pos:], t.line[n+t.pos:]) - t.line = t.line[:len(t.line)-n] - if t.echo { - t.writeLine(t.line[t.pos:]) - for i := 0; i < n; i++ { - t.queue(space) - } - t.advanceCursor(n) - t.moveCursorToPos(t.pos) - } -} - -// countToLeftWord returns then number of characters from the cursor to the -// start of the previous word. -func (t *Terminal) countToLeftWord() int { - if t.pos == 0 { - return 0 - } - - pos := t.pos - 1 - for pos > 0 { - if t.line[pos] != ' ' { - break - } - pos-- - } - for pos > 0 { - if t.line[pos] == ' ' { - pos++ - break - } - pos-- - } - - return t.pos - pos -} - -// countToRightWord returns then number of characters from the cursor to the -// start of the next word. -func (t *Terminal) countToRightWord() int { - pos := t.pos - for pos < len(t.line) { - if t.line[pos] == ' ' { - break - } - pos++ - } - for pos < len(t.line) { - if t.line[pos] != ' ' { - break - } - pos++ - } - return pos - t.pos -} - -// visualLength returns the number of visible glyphs in s. -func visualLength(runes []rune) int { - inEscapeSeq := false - length := 0 - - for _, r := range runes { - switch { - case inEscapeSeq: - if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') { - inEscapeSeq = false - } - case r == '\x1b': - inEscapeSeq = true - default: - length++ - } - } - - return length -} - -// handleKey processes the given key and, optionally, returns a line of text -// that the user has entered. -func (t *Terminal) handleKey(key rune) (line string, ok bool) { - if t.pasteActive && key != keyEnter { - t.addKeyToLine(key) - return - } - - switch key { - case keyBackspace: - if t.pos == 0 { - return - } - t.eraseNPreviousChars(1) - case keyAltLeft: - // move left by a word. - t.pos -= t.countToLeftWord() - t.moveCursorToPos(t.pos) - case keyAltRight: - // move right by a word. - t.pos += t.countToRightWord() - t.moveCursorToPos(t.pos) - case keyLeft: - if t.pos == 0 { - return - } - t.pos-- - t.moveCursorToPos(t.pos) - case keyRight: - if t.pos == len(t.line) { - return - } - t.pos++ - t.moveCursorToPos(t.pos) - case keyHome: - if t.pos == 0 { - return - } - t.pos = 0 - t.moveCursorToPos(t.pos) - case keyEnd: - if t.pos == len(t.line) { - return - } - t.pos = len(t.line) - t.moveCursorToPos(t.pos) - case keyUp: - entry, ok := t.history.NthPreviousEntry(t.historyIndex + 1) - if !ok { - return "", false - } - if t.historyIndex == -1 { - t.historyPending = string(t.line) - } - t.historyIndex++ - runes := []rune(entry) - t.setLine(runes, len(runes)) - case keyDown: - switch t.historyIndex { - case -1: - return - case 0: - runes := []rune(t.historyPending) - t.setLine(runes, len(runes)) - t.historyIndex-- - default: - entry, ok := t.history.NthPreviousEntry(t.historyIndex - 1) - if ok { - t.historyIndex-- - runes := []rune(entry) - t.setLine(runes, len(runes)) - } - } - case keyEnter: - t.moveCursorToPos(len(t.line)) - t.queue([]rune("\r\n")) - line = string(t.line) - ok = true - t.line = t.line[:0] - t.pos = 0 - t.cursorX = 0 - t.cursorY = 0 - t.maxLine = 0 - case keyDeleteWord: - // Delete zero or more spaces and then one or more characters. - t.eraseNPreviousChars(t.countToLeftWord()) - case keyDeleteLine: - // Delete everything from the current cursor position to the - // end of line. - for i := t.pos; i < len(t.line); i++ { - t.queue(space) - t.advanceCursor(1) - } - t.line = t.line[:t.pos] - t.moveCursorToPos(t.pos) - case keyCtrlD: - // Erase the character under the current position. - // The EOF case when the line is empty is handled in - // readLine(). - if t.pos < len(t.line) { - t.pos++ - t.eraseNPreviousChars(1) - } - case keyCtrlU: - t.eraseNPreviousChars(t.pos) - case keyClearScreen: - // Erases the screen and moves the cursor to the home position. - t.queue([]rune("\x1b[2J\x1b[H")) - t.queue(t.prompt) - t.cursorX, t.cursorY = 0, 0 - t.advanceCursor(visualLength(t.prompt)) - t.setLine(t.line, t.pos) - default: - if t.AutoCompleteCallback != nil { - prefix := string(t.line[:t.pos]) - suffix := string(t.line[t.pos:]) - - t.lock.Unlock() - newLine, newPos, completeOk := t.AutoCompleteCallback(prefix+suffix, len(prefix), key) - t.lock.Lock() - - if completeOk { - t.setLine([]rune(newLine), utf8.RuneCount([]byte(newLine)[:newPos])) - return - } - } - if !isPrintable(key) { - return - } - if len(t.line) == maxLineLength { - return - } - t.addKeyToLine(key) - } - return -} - -// addKeyToLine inserts the given key at the current position in the current -// line. -func (t *Terminal) addKeyToLine(key rune) { - if len(t.line) == cap(t.line) { - newLine := make([]rune, len(t.line), 2*(1+len(t.line))) - copy(newLine, t.line) - t.line = newLine - } - t.line = t.line[:len(t.line)+1] - copy(t.line[t.pos+1:], t.line[t.pos:]) - t.line[t.pos] = key - if t.echo { - t.writeLine(t.line[t.pos:]) - } - t.pos++ - t.moveCursorToPos(t.pos) -} - -func (t *Terminal) writeLine(line []rune) { - for len(line) != 0 { - remainingOnLine := t.termWidth - t.cursorX - todo := len(line) - if todo > remainingOnLine { - todo = remainingOnLine - } - t.queue(line[:todo]) - t.advanceCursor(visualLength(line[:todo])) - line = line[todo:] - } -} - -func (t *Terminal) Write(buf []byte) (n int, err error) { - t.lock.Lock() - defer t.lock.Unlock() - - if t.cursorX == 0 && t.cursorY == 0 { - // This is the easy case: there's nothing on the screen that we - // have to move out of the way. - return t.c.Write(buf) - } - - // We have a prompt and possibly user input on the screen. We - // have to clear it first. - t.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */) - t.cursorX = 0 - t.clearLineToRight() - - for t.cursorY > 0 { - t.move(1 /* up */, 0, 0, 0) - t.cursorY-- - t.clearLineToRight() - } - - if _, err = t.c.Write(t.outBuf); err != nil { - return - } - t.outBuf = t.outBuf[:0] - - if n, err = t.c.Write(buf); err != nil { - return - } - - t.writeLine(t.prompt) - if t.echo { - t.writeLine(t.line) - } - - t.moveCursorToPos(t.pos) - - if _, err = t.c.Write(t.outBuf); err != nil { - return - } - t.outBuf = t.outBuf[:0] - return -} - -// ReadPassword temporarily changes the prompt and reads a password, without -// echo, from the terminal. -func (t *Terminal) ReadPassword(prompt string) (line string, err error) { - t.lock.Lock() - defer t.lock.Unlock() - - oldPrompt := t.prompt - t.prompt = []rune(prompt) - t.echo = false - - line, err = t.readLine() - - t.prompt = oldPrompt - t.echo = true - - return -} - -// ReadLine returns a line of input from the terminal. -func (t *Terminal) ReadLine() (line string, err error) { - t.lock.Lock() - defer t.lock.Unlock() - - return t.readLine() -} - -func (t *Terminal) readLine() (line string, err error) { - // t.lock must be held at this point - - if t.cursorX == 0 && t.cursorY == 0 { - t.writeLine(t.prompt) - t.c.Write(t.outBuf) - t.outBuf = t.outBuf[:0] - } - - lineIsPasted := t.pasteActive - - for { - rest := t.remainder - lineOk := false - for !lineOk { - var key rune - key, rest = bytesToKey(rest, t.pasteActive) - if key == utf8.RuneError { - break - } - if !t.pasteActive { - if key == keyCtrlD { - if len(t.line) == 0 { - return "", io.EOF - } - } - if key == keyPasteStart { - t.pasteActive = true - if len(t.line) == 0 { - lineIsPasted = true - } - continue - } - } else if key == keyPasteEnd { - t.pasteActive = false - continue - } - if !t.pasteActive { - lineIsPasted = false - } - line, lineOk = t.handleKey(key) - } - if len(rest) > 0 { - n := copy(t.inBuf[:], rest) - t.remainder = t.inBuf[:n] - } else { - t.remainder = nil - } - t.c.Write(t.outBuf) - t.outBuf = t.outBuf[:0] - if lineOk { - if t.echo { - t.historyIndex = -1 - t.history.Add(line) - } - if lineIsPasted { - err = ErrPasteIndicator - } - return - } - - // t.remainder is a slice at the beginning of t.inBuf - // containing a partial key sequence - readBuf := t.inBuf[len(t.remainder):] - var n int - - t.lock.Unlock() - n, err = t.c.Read(readBuf) - t.lock.Lock() - - if err != nil { - return - } - - t.remainder = t.inBuf[:n+len(t.remainder)] - } - - panic("unreachable") // for Go 1.0. -} - -// SetPrompt sets the prompt to be used when reading subsequent lines. -func (t *Terminal) SetPrompt(prompt string) { - t.lock.Lock() - defer t.lock.Unlock() - - t.prompt = []rune(prompt) -} - -func (t *Terminal) clearAndRepaintLinePlusNPrevious(numPrevLines int) { - // Move cursor to column zero at the start of the line. - t.move(t.cursorY, 0, t.cursorX, 0) - t.cursorX, t.cursorY = 0, 0 - t.clearLineToRight() - for t.cursorY < numPrevLines { - // Move down a line - t.move(0, 1, 0, 0) - t.cursorY++ - t.clearLineToRight() - } - // Move back to beginning. - t.move(t.cursorY, 0, 0, 0) - t.cursorX, t.cursorY = 0, 0 - - t.queue(t.prompt) - t.advanceCursor(visualLength(t.prompt)) - t.writeLine(t.line) - t.moveCursorToPos(t.pos) -} - -func (t *Terminal) SetSize(width, height int) error { - t.lock.Lock() - defer t.lock.Unlock() - - if width == 0 { - width = 1 - } - - oldWidth := t.termWidth - t.termWidth, t.termHeight = width, height - - switch { - case width == oldWidth: - // If the width didn't change then nothing else needs to be - // done. - return nil - case len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0: - // If there is nothing on current line and no prompt printed, - // just do nothing - return nil - case width < oldWidth: - // Some terminals (e.g. xterm) will truncate lines that were - // too long when shinking. Others, (e.g. gnome-terminal) will - // attempt to wrap them. For the former, repainting t.maxLine - // works great, but that behaviour goes badly wrong in the case - // of the latter because they have doubled every full line. - - // We assume that we are working on a terminal that wraps lines - // and adjust the cursor position based on every previous line - // wrapping and turning into two. This causes the prompt on - // xterms to move upwards, which isn't great, but it avoids a - // huge mess with gnome-terminal. - if t.cursorX >= t.termWidth { - t.cursorX = t.termWidth - 1 - } - t.cursorY *= 2 - t.clearAndRepaintLinePlusNPrevious(t.maxLine * 2) - case width > oldWidth: - // If the terminal expands then our position calculations will - // be wrong in the future because we think the cursor is - // |t.pos| chars into the string, but there will be a gap at - // the end of any wrapped line. - // - // But the position will actually be correct until we move, so - // we can move back to the beginning and repaint everything. - t.clearAndRepaintLinePlusNPrevious(t.maxLine) - } - - _, err := t.c.Write(t.outBuf) - t.outBuf = t.outBuf[:0] - return err -} - -type pasteIndicatorError struct{} - -func (pasteIndicatorError) Error() string { - return "terminal: ErrPasteIndicator not correctly handled" -} - -// ErrPasteIndicator may be returned from ReadLine as the error, in addition -// to valid line data. It indicates that bracketed paste mode is enabled and -// that the returned line consists only of pasted data. Programs may wish to -// interpret pasted data more literally than typed data. -var ErrPasteIndicator = pasteIndicatorError{} - -// SetBracketedPasteMode requests that the terminal bracket paste operations -// with markers. Not all terminals support this but, if it is supported, then -// enabling this mode will stop any autocomplete callback from running due to -// pastes. Additionally, any lines that are completely pasted will be returned -// from ReadLine with the error set to ErrPasteIndicator. -func (t *Terminal) SetBracketedPasteMode(on bool) { - if on { - io.WriteString(t.c, "\x1b[?2004h") - } else { - io.WriteString(t.c, "\x1b[?2004l") - } -} - -// stRingBuffer is a ring buffer of strings. -type stRingBuffer struct { - // entries contains max elements. - entries []string - max int - // head contains the index of the element most recently added to the ring. - head int - // size contains the number of elements in the ring. - size int -} - -func (s *stRingBuffer) Add(a string) { - if s.entries == nil { - const defaultNumEntries = 100 - s.entries = make([]string, defaultNumEntries) - s.max = defaultNumEntries - } - - s.head = (s.head + 1) % s.max - s.entries[s.head] = a - if s.size < s.max { - s.size++ - } -} - -// NthPreviousEntry returns the value passed to the nth previous call to Add. -// If n is zero then the immediately prior value is returned, if one, then the -// next most recent, and so on. If such an element doesn't exist then ok is -// false. -func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) { - if n >= s.size { - return "", false - } - index := s.head - n - if index < 0 { - index += s.max - } - return s.entries[index], true -} diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util.go b/vendor/golang.org/x/crypto/ssh/terminal/util.go deleted file mode 100644 index 0763c9a97..000000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux,!appengine netbsd openbsd - -// Package terminal provides support functions for dealing with terminals, as -// commonly found on UNIX systems. -// -// Putting a terminal into raw mode is the most common requirement: -// -// oldState, err := terminal.MakeRaw(0) -// if err != nil { -// panic(err) -// } -// defer terminal.Restore(0, oldState) -package terminal - -import ( - "io" - "syscall" - "unsafe" -) - -// State contains the state of a terminal. -type State struct { - termios syscall.Termios -} - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - var termios syscall.Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd int) (*State, error) { - var oldState State - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 { - return nil, err - } - - newState := oldState.termios - newState.Iflag &^= syscall.ISTRIP | syscall.INLCR | syscall.ICRNL | syscall.IGNCR | syscall.IXON | syscall.IXOFF - newState.Lflag &^= syscall.ECHO | syscall.ICANON | syscall.ISIG - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 { - return nil, err - } - - return &oldState, nil -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - var oldState State - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 { - return nil, err - } - - return &oldState, nil -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, state *State) error { - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&state.termios)), 0, 0, 0) - return err -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - var dimensions [4]uint16 - - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(&dimensions)), 0, 0, 0); err != 0 { - return -1, -1, err - } - return int(dimensions[1]), int(dimensions[0]), nil -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - var oldState syscall.Termios - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState)), 0, 0, 0); err != 0 { - return nil, err - } - - newState := oldState - newState.Lflag &^= syscall.ECHO - newState.Lflag |= syscall.ICANON | syscall.ISIG - newState.Iflag |= syscall.ICRNL - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 { - return nil, err - } - - defer func() { - syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&oldState)), 0, 0, 0) - }() - - var buf [16]byte - var ret []byte - for { - n, err := syscall.Read(fd, buf[:]) - if err != nil { - return nil, err - } - if n == 0 { - if len(ret) == 0 { - return nil, io.EOF - } - break - } - if buf[n-1] == '\n' { - n-- - } - ret = append(ret, buf[:n]...) - if n < len(buf) { - break - } - } - - return ret, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go b/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go deleted file mode 100644 index 9c1ffd145..000000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd - -package terminal - -import "syscall" - -const ioctlReadTermios = syscall.TIOCGETA -const ioctlWriteTermios = syscall.TIOCSETA diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go b/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go deleted file mode 100644 index 5883b22d7..000000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package terminal - -// These constants are declared here, rather than importing -// them from the syscall package as some syscall packages, even -// on linux, for example gccgo, do not declare them. -const ioctlReadTermios = 0x5401 // syscall.TCGETS -const ioctlWriteTermios = 0x5402 // syscall.TCSETS diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go deleted file mode 100644 index 2dd6c3d97..000000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package terminal provides support functions for dealing with terminals, as -// commonly found on UNIX systems. -// -// Putting a terminal into raw mode is the most common requirement: -// -// oldState, err := terminal.MakeRaw(0) -// if err != nil { -// panic(err) -// } -// defer terminal.Restore(0, oldState) -package terminal - -import ( - "io" - "syscall" - "unsafe" -) - -const ( - enableLineInput = 2 - enableEchoInput = 4 - enableProcessedInput = 1 - enableWindowInput = 8 - enableMouseInput = 16 - enableInsertMode = 32 - enableQuickEditMode = 64 - enableExtendedFlags = 128 - enableAutoPosition = 256 - enableProcessedOutput = 1 - enableWrapAtEolOutput = 2 -) - -var kernel32 = syscall.NewLazyDLL("kernel32.dll") - -var ( - procGetConsoleMode = kernel32.NewProc("GetConsoleMode") - procSetConsoleMode = kernel32.NewProc("SetConsoleMode") - procGetConsoleScreenBufferInfo = kernel32.NewProc("GetConsoleScreenBufferInfo") -) - -type ( - short int16 - word uint16 - - coord struct { - x short - y short - } - smallRect struct { - left short - top short - right short - bottom short - } - consoleScreenBufferInfo struct { - size coord - cursorPosition coord - attributes word - window smallRect - maximumWindowSize coord - } -) - -type State struct { - mode uint32 -} - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - var st uint32 - r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - return r != 0 && e == 0 -} - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd int) (*State, error) { - var st uint32 - _, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - if e != 0 { - return nil, error(e) - } - st &^= (enableEchoInput | enableProcessedInput | enableLineInput | enableProcessedOutput) - _, _, e = syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(st), 0) - if e != 0 { - return nil, error(e) - } - return &State{st}, nil -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - var st uint32 - _, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - if e != 0 { - return nil, error(e) - } - return &State{st}, nil -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, state *State) error { - _, _, err := syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(state.mode), 0) - return err -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - var info consoleScreenBufferInfo - _, _, e := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&info)), 0) - if e != 0 { - return 0, 0, error(e) - } - return int(info.size.x), int(info.size.y), nil -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - var st uint32 - _, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - if e != 0 { - return nil, error(e) - } - old := st - - st &^= (enableEchoInput) - st |= (enableProcessedInput | enableLineInput | enableProcessedOutput) - _, _, e = syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(st), 0) - if e != 0 { - return nil, error(e) - } - - defer func() { - syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(old), 0) - }() - - var buf [16]byte - var ret []byte - for { - n, err := syscall.Read(syscall.Handle(fd), buf[:]) - if err != nil { - return nil, err - } - if n == 0 { - if len(ret) == 0 { - return nil, io.EOF - } - break - } - if buf[n-1] == '\n' { - n-- - } - if n > 0 && buf[n-1] == '\r' { - n-- - } - ret = append(ret, buf[:n]...) - if n < len(buf) { - break - } - } - - return ret, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/test/doc.go b/vendor/golang.org/x/crypto/ssh/test/doc.go deleted file mode 100644 index 29ad65e96..000000000 --- a/vendor/golang.org/x/crypto/ssh/test/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This package contains integration tests for the -// golang.org/x/crypto/ssh package. -package test diff --git a/vendor/golang.org/x/oauth2/bitbucket/bitbucket.go b/vendor/golang.org/x/oauth2/bitbucket/bitbucket.go deleted file mode 100644 index 44af1f1a9..000000000 --- a/vendor/golang.org/x/oauth2/bitbucket/bitbucket.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The oauth2 Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package bitbucket provides constants for using OAuth2 to access Bitbucket. -package bitbucket - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is Bitbucket's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://bitbucket.org/site/oauth2/authorize", - TokenURL: "https://bitbucket.org/site/oauth2/access_token", -} diff --git a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go deleted file mode 100644 index a47e46559..000000000 --- a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package clientcredentials implements the OAuth2.0 "client credentials" token flow, -// also known as the "two-legged OAuth 2.0". -// -// This should be used when the client is acting on its own behalf or when the client -// is the resource owner. It may also be used when requesting access to protected -// resources based on an authorization previously arranged with the authorization -// server. -// -// See http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.4 -package clientcredentials - -import ( - "net/http" - "net/url" - "strings" - - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/internal" -) - -// tokenFromInternal maps an *internal.Token struct into -// an *oauth2.Token struct. -func tokenFromInternal(t *internal.Token) *oauth2.Token { - if t == nil { - return nil - } - tk := &oauth2.Token{ - AccessToken: t.AccessToken, - TokenType: t.TokenType, - RefreshToken: t.RefreshToken, - Expiry: t.Expiry, - } - return tk.WithExtra(t.Raw) -} - -// retrieveToken takes a *Config and uses that to retrieve an *internal.Token. -// This token is then mapped from *internal.Token into an *oauth2.Token which is -// returned along with an error. -func retrieveToken(ctx context.Context, c *Config, v url.Values) (*oauth2.Token, error) { - tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.TokenURL, v) - if err != nil { - return nil, err - } - return tokenFromInternal(tk), nil -} - -// Client Credentials Config describes a 2-legged OAuth2 flow, with both the -// client application information and the server's endpoint URLs. -type Config struct { - // ClientID is the application's ID. - ClientID string - - // ClientSecret is the application's secret. - ClientSecret string - - // TokenURL is the resource server's token endpoint - // URL. This is a constant specific to each server. - TokenURL string - - // Scope specifies optional requested permissions. - Scopes []string -} - -// Token uses client credentials to retrieve a token. -// The HTTP client to use is derived from the context. -// If nil, http.DefaultClient is used. -func (c *Config) Token(ctx context.Context) (*oauth2.Token, error) { - return retrieveToken(ctx, c, url.Values{ - "grant_type": {"client_credentials"}, - "scope": internal.CondVal(strings.Join(c.Scopes, " ")), - }) -} - -// Client returns an HTTP client using the provided token. -// The token will auto-refresh as necessary. The underlying -// HTTP transport will be obtained using the provided context. -// The returned client and its Transport should not be modified. -func (c *Config) Client(ctx context.Context) *http.Client { - return oauth2.NewClient(ctx, c.TokenSource(ctx)) -} - -// TokenSource returns a TokenSource that returns t until t expires, -// automatically refreshing it as necessary using the provided context and the -// client ID and client secret. -// -// Most users will use Config.Client instead. -func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { - source := &tokenSource{ - ctx: ctx, - conf: c, - } - return oauth2.ReuseTokenSource(nil, source) -} - -type tokenSource struct { - ctx context.Context - conf *Config -} - -// Token refreshes the token by using a new client credentials request. -// tokens received this way do not include a refresh token -func (c *tokenSource) Token() (*oauth2.Token, error) { - return retrieveToken(c.ctx, c.conf, url.Values{ - "grant_type": {"client_credentials"}, - "scope": internal.CondVal(strings.Join(c.conf.Scopes, " ")), - }) -} diff --git a/vendor/golang.org/x/oauth2/facebook/facebook.go b/vendor/golang.org/x/oauth2/facebook/facebook.go deleted file mode 100644 index 51c1480bd..000000000 --- a/vendor/golang.org/x/oauth2/facebook/facebook.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package facebook provides constants for using OAuth2 to access Facebook. -package facebook - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is Facebook's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://www.facebook.com/dialog/oauth", - TokenURL: "https://graph.facebook.com/oauth/access_token", -} diff --git a/vendor/golang.org/x/oauth2/github/github.go b/vendor/golang.org/x/oauth2/github/github.go deleted file mode 100644 index 26502a368..000000000 --- a/vendor/golang.org/x/oauth2/github/github.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package github provides constants for using OAuth2 to access Github. -package github - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is Github's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://github.com/login/oauth/authorize", - TokenURL: "https://github.com/login/oauth/access_token", -} diff --git a/vendor/golang.org/x/oauth2/linkedin/linkedin.go b/vendor/golang.org/x/oauth2/linkedin/linkedin.go deleted file mode 100644 index 30c212b10..000000000 --- a/vendor/golang.org/x/oauth2/linkedin/linkedin.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package linkedin provides constants for using OAuth2 to access LinkedIn. -package linkedin - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is LinkedIn's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://www.linkedin.com/uas/oauth2/authorization", - TokenURL: "https://www.linkedin.com/uas/oauth2/accessToken", -} diff --git a/vendor/golang.org/x/oauth2/microsoft/microsoft.go b/vendor/golang.org/x/oauth2/microsoft/microsoft.go deleted file mode 100644 index a097f813e..000000000 --- a/vendor/golang.org/x/oauth2/microsoft/microsoft.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package microsoft provides constants for using OAuth2 to access Windows Live ID. -package microsoft - -import ( - "golang.org/x/oauth2" -) - -// LiveConnectEndpoint is Windows's Live ID OAuth 2.0 endpoint. -var LiveConnectEndpoint = oauth2.Endpoint{ - AuthURL: "https://login.live.com/oauth20_authorize.srf", - TokenURL: "https://login.live.com/oauth20_token.srf", -} diff --git a/vendor/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go b/vendor/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go deleted file mode 100644 index 60741ce9d..000000000 --- a/vendor/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package odnoklassniki provides constants for using OAuth2 to access Odnoklassniki. -package odnoklassniki - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is Odnoklassniki's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://www.odnoklassniki.ru/oauth/authorize", - TokenURL: "https://api.odnoklassniki.ru/oauth/token.do", -} diff --git a/vendor/golang.org/x/oauth2/paypal/paypal.go b/vendor/golang.org/x/oauth2/paypal/paypal.go deleted file mode 100644 index 32308322f..000000000 --- a/vendor/golang.org/x/oauth2/paypal/paypal.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package paypal provides constants for using OAuth2 to access PayPal. -package paypal - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is PayPal's OAuth 2.0 endpoint in live (production) environment. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", - TokenURL: "https://api.paypal.com/v1/identity/openidconnect/tokenservice", -} - -// SandboxEndpoint is PayPal's OAuth 2.0 endpoint in sandbox (testing) environment. -var SandboxEndpoint = oauth2.Endpoint{ - AuthURL: "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", - TokenURL: "https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice", -} diff --git a/vendor/golang.org/x/oauth2/vk/vk.go b/vendor/golang.org/x/oauth2/vk/vk.go deleted file mode 100644 index 6463482cf..000000000 --- a/vendor/golang.org/x/oauth2/vk/vk.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package vk provides constants for using OAuth2 to access VK.com. -package vk - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is VK's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://oauth.vk.com/authorize", - TokenURL: "https://oauth.vk.com/access_token", -} diff --git a/vendor/golang.org/x/sys/AUTHORS b/vendor/golang.org/x/sys/AUTHORS deleted file mode 100644 index 15167cd74..000000000 --- a/vendor/golang.org/x/sys/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/sys/CONTRIBUTING.md b/vendor/golang.org/x/sys/CONTRIBUTING.md deleted file mode 100644 index 88dff59bc..000000000 --- a/vendor/golang.org/x/sys/CONTRIBUTING.md +++ /dev/null @@ -1,31 +0,0 @@ -# Contributing to Go - -Go is an open source project. - -It is the work of hundreds of contributors. We appreciate your help! - - -## Filing issues - -When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: - -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? - -General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. -The gophers there will answer or ask you to file an issue if you've tripped over a bug. - -## Contributing code - -Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) -before sending patches. - -**We do not accept GitHub pull requests** -(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). - -Unless otherwise noted, the Go source files are distributed under -the BSD-style license found in the LICENSE file. - diff --git a/vendor/golang.org/x/sys/CONTRIBUTORS b/vendor/golang.org/x/sys/CONTRIBUTORS deleted file mode 100644 index 1c4577e96..000000000 --- a/vendor/golang.org/x/sys/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/sys/README b/vendor/golang.org/x/sys/README deleted file mode 100644 index bd422b40c..000000000 --- a/vendor/golang.org/x/sys/README +++ /dev/null @@ -1,3 +0,0 @@ -This repository holds supplemental Go packages for low-level interactions with the operating system. - -To submit changes to this repository, see http://golang.org/doc/contribute.html. diff --git a/vendor/golang.org/x/sys/codereview.cfg b/vendor/golang.org/x/sys/codereview.cfg deleted file mode 100644 index 3f8b14b64..000000000 --- a/vendor/golang.org/x/sys/codereview.cfg +++ /dev/null @@ -1 +0,0 @@ -issuerepo: golang/go diff --git a/vendor/golang.org/x/sys/plan9/asm.s b/vendor/golang.org/x/sys/plan9/asm.s deleted file mode 100644 index d4ca868f1..000000000 --- a/vendor/golang.org/x/sys/plan9/asm.s +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -TEXT ·use(SB),NOSPLIT,$0 - RET diff --git a/vendor/golang.org/x/sys/plan9/asm_plan9_386.s b/vendor/golang.org/x/sys/plan9/asm_plan9_386.s deleted file mode 100644 index bc5cab1f3..000000000 --- a/vendor/golang.org/x/sys/plan9/asm_plan9_386.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -// -// System call support for 386, Plan 9 -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-32 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-44 - JMP syscall·Syscall6(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) - -TEXT ·seek(SB),NOSPLIT,$0-36 - JMP syscall·seek(SB) - -TEXT ·exit(SB),NOSPLIT,$4-4 - JMP syscall·exit(SB) diff --git a/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s b/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s deleted file mode 100644 index d3448e675..000000000 --- a/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -// -// System call support for amd64, Plan 9 -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-64 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-88 - JMP syscall·Syscall6(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) - -TEXT ·seek(SB),NOSPLIT,$0-56 - JMP syscall·seek(SB) - -TEXT ·exit(SB),NOSPLIT,$8-8 - JMP syscall·exit(SB) diff --git a/vendor/golang.org/x/sys/plan9/const_plan9.go b/vendor/golang.org/x/sys/plan9/const_plan9.go deleted file mode 100644 index 430dac0a0..000000000 --- a/vendor/golang.org/x/sys/plan9/const_plan9.go +++ /dev/null @@ -1,59 +0,0 @@ -package plan9 - -// Plan 9 Constants - -// Open modes -const ( - O_RDONLY = 0 - O_WRONLY = 1 - O_RDWR = 2 - O_TRUNC = 16 - O_CLOEXEC = 32 - O_EXCL = 0x1000 -) - -// Rfork flags -const ( - RFNAMEG = 1 << 0 - RFENVG = 1 << 1 - RFFDG = 1 << 2 - RFNOTEG = 1 << 3 - RFPROC = 1 << 4 - RFMEM = 1 << 5 - RFNOWAIT = 1 << 6 - RFCNAMEG = 1 << 10 - RFCENVG = 1 << 11 - RFCFDG = 1 << 12 - RFREND = 1 << 13 - RFNOMNT = 1 << 14 -) - -// Qid.Type bits -const ( - QTDIR = 0x80 - QTAPPEND = 0x40 - QTEXCL = 0x20 - QTMOUNT = 0x10 - QTAUTH = 0x08 - QTTMP = 0x04 - QTFILE = 0x00 -) - -// Dir.Mode bits -const ( - DMDIR = 0x80000000 - DMAPPEND = 0x40000000 - DMEXCL = 0x20000000 - DMMOUNT = 0x10000000 - DMAUTH = 0x08000000 - DMTMP = 0x04000000 - DMREAD = 0x4 - DMWRITE = 0x2 - DMEXEC = 0x1 -) - -const ( - STATMAX = 65535 - ERRMAX = 128 - STATFIXLEN = 49 -) diff --git a/vendor/golang.org/x/sys/plan9/dir_plan9.go b/vendor/golang.org/x/sys/plan9/dir_plan9.go deleted file mode 100644 index 0955e0c53..000000000 --- a/vendor/golang.org/x/sys/plan9/dir_plan9.go +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Plan 9 directory marshalling. See intro(5). - -package plan9 - -import "errors" - -var ( - ErrShortStat = errors.New("stat buffer too short") - ErrBadStat = errors.New("malformed stat buffer") - ErrBadName = errors.New("bad character in file name") -) - -// A Qid represents a 9P server's unique identification for a file. -type Qid struct { - Path uint64 // the file server's unique identification for the file - Vers uint32 // version number for given Path - Type uint8 // the type of the file (plan9.QTDIR for example) -} - -// A Dir contains the metadata for a file. -type Dir struct { - // system-modified data - Type uint16 // server type - Dev uint32 // server subtype - - // file data - Qid Qid // unique id from server - Mode uint32 // permissions - Atime uint32 // last read time - Mtime uint32 // last write time - Length int64 // file length - Name string // last element of path - Uid string // owner name - Gid string // group name - Muid string // last modifier name -} - -var nullDir = Dir{ - Type: ^uint16(0), - Dev: ^uint32(0), - Qid: Qid{ - Path: ^uint64(0), - Vers: ^uint32(0), - Type: ^uint8(0), - }, - Mode: ^uint32(0), - Atime: ^uint32(0), - Mtime: ^uint32(0), - Length: ^int64(0), -} - -// Null assigns special "don't touch" values to members of d to -// avoid modifying them during plan9.Wstat. -func (d *Dir) Null() { *d = nullDir } - -// Marshal encodes a 9P stat message corresponding to d into b -// -// If there isn't enough space in b for a stat message, ErrShortStat is returned. -func (d *Dir) Marshal(b []byte) (n int, err error) { - n = STATFIXLEN + len(d.Name) + len(d.Uid) + len(d.Gid) + len(d.Muid) - if n > len(b) { - return n, ErrShortStat - } - - for _, c := range d.Name { - if c == '/' { - return n, ErrBadName - } - } - - b = pbit16(b, uint16(n)-2) - b = pbit16(b, d.Type) - b = pbit32(b, d.Dev) - b = pbit8(b, d.Qid.Type) - b = pbit32(b, d.Qid.Vers) - b = pbit64(b, d.Qid.Path) - b = pbit32(b, d.Mode) - b = pbit32(b, d.Atime) - b = pbit32(b, d.Mtime) - b = pbit64(b, uint64(d.Length)) - b = pstring(b, d.Name) - b = pstring(b, d.Uid) - b = pstring(b, d.Gid) - b = pstring(b, d.Muid) - - return n, nil -} - -// UnmarshalDir decodes a single 9P stat message from b and returns the resulting Dir. -// -// If b is too small to hold a valid stat message, ErrShortStat is returned. -// -// If the stat message itself is invalid, ErrBadStat is returned. -func UnmarshalDir(b []byte) (*Dir, error) { - if len(b) < STATFIXLEN { - return nil, ErrShortStat - } - size, buf := gbit16(b) - if len(b) != int(size)+2 { - return nil, ErrBadStat - } - b = buf - - var d Dir - d.Type, b = gbit16(b) - d.Dev, b = gbit32(b) - d.Qid.Type, b = gbit8(b) - d.Qid.Vers, b = gbit32(b) - d.Qid.Path, b = gbit64(b) - d.Mode, b = gbit32(b) - d.Atime, b = gbit32(b) - d.Mtime, b = gbit32(b) - - n, b := gbit64(b) - d.Length = int64(n) - - var ok bool - if d.Name, b, ok = gstring(b); !ok { - return nil, ErrBadStat - } - if d.Uid, b, ok = gstring(b); !ok { - return nil, ErrBadStat - } - if d.Gid, b, ok = gstring(b); !ok { - return nil, ErrBadStat - } - if d.Muid, b, ok = gstring(b); !ok { - return nil, ErrBadStat - } - - return &d, nil -} - -// pbit8 copies the 8-bit number v to b and returns the remaining slice of b. -func pbit8(b []byte, v uint8) []byte { - b[0] = byte(v) - return b[1:] -} - -// pbit16 copies the 16-bit number v to b in little-endian order and returns the remaining slice of b. -func pbit16(b []byte, v uint16) []byte { - b[0] = byte(v) - b[1] = byte(v >> 8) - return b[2:] -} - -// pbit32 copies the 32-bit number v to b in little-endian order and returns the remaining slice of b. -func pbit32(b []byte, v uint32) []byte { - b[0] = byte(v) - b[1] = byte(v >> 8) - b[2] = byte(v >> 16) - b[3] = byte(v >> 24) - return b[4:] -} - -// pbit64 copies the 64-bit number v to b in little-endian order and returns the remaining slice of b. -func pbit64(b []byte, v uint64) []byte { - b[0] = byte(v) - b[1] = byte(v >> 8) - b[2] = byte(v >> 16) - b[3] = byte(v >> 24) - b[4] = byte(v >> 32) - b[5] = byte(v >> 40) - b[6] = byte(v >> 48) - b[7] = byte(v >> 56) - return b[8:] -} - -// pstring copies the string s to b, prepending it with a 16-bit length in little-endian order, and -// returning the remaining slice of b.. -func pstring(b []byte, s string) []byte { - b = pbit16(b, uint16(len(s))) - n := copy(b, s) - return b[n:] -} - -// gbit8 reads an 8-bit number from b and returns it with the remaining slice of b. -func gbit8(b []byte) (uint8, []byte) { - return uint8(b[0]), b[1:] -} - -// gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b. -func gbit16(b []byte) (uint16, []byte) { - return uint16(b[0]) | uint16(b[1])<<8, b[2:] -} - -// gbit32 reads a 32-bit number in little-endian order from b and returns it with the remaining slice of b. -func gbit32(b []byte) (uint32, []byte) { - return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24, b[4:] -} - -// gbit64 reads a 64-bit number in little-endian order from b and returns it with the remaining slice of b. -func gbit64(b []byte) (uint64, []byte) { - lo := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 - hi := uint32(b[4]) | uint32(b[5])<<8 | uint32(b[6])<<16 | uint32(b[7])<<24 - return uint64(lo) | uint64(hi)<<32, b[8:] -} - -// gstring reads a string from b, prefixed with a 16-bit length in little-endian order. -// It returns the string with the remaining slice of b and a boolean. If the length is -// greater than the number of bytes in b, the boolean will be false. -func gstring(b []byte) (string, []byte, bool) { - n, b := gbit16(b) - if int(n) > len(b) { - return "", b, false - } - return string(b[:n]), b[n:], true -} diff --git a/vendor/golang.org/x/sys/plan9/env_plan9.go b/vendor/golang.org/x/sys/plan9/env_plan9.go deleted file mode 100644 index 25a96e7ea..000000000 --- a/vendor/golang.org/x/sys/plan9/env_plan9.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Plan 9 environment variables. - -package plan9 - -import ( - "syscall" -) - -func Getenv(key string) (value string, found bool) { - return syscall.Getenv(key) -} - -func Setenv(key, value string) error { - return syscall.Setenv(key, value) -} - -func Clearenv() { - syscall.Clearenv() -} - -func Environ() []string { - return syscall.Environ() -} diff --git a/vendor/golang.org/x/sys/plan9/env_unset.go b/vendor/golang.org/x/sys/plan9/env_unset.go deleted file mode 100644 index c37fc26e4..000000000 --- a/vendor/golang.org/x/sys/plan9/env_unset.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.4 - -package plan9 - -import "syscall" - -func Unsetenv(key string) error { - // This was added in Go 1.4. - return syscall.Unsetenv(key) -} diff --git a/vendor/golang.org/x/sys/plan9/errors_plan9.go b/vendor/golang.org/x/sys/plan9/errors_plan9.go deleted file mode 100644 index 110cf6a30..000000000 --- a/vendor/golang.org/x/sys/plan9/errors_plan9.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package plan9 - -import "syscall" - -// Constants -const ( - // Invented values to support what package os expects. - O_CREAT = 0x02000 - O_APPEND = 0x00400 - O_NOCTTY = 0x00000 - O_NONBLOCK = 0x00000 - O_SYNC = 0x00000 - O_ASYNC = 0x00000 - - S_IFMT = 0x1f000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 -) - -// Errors -var ( - EINVAL = syscall.NewError("bad arg in system call") - ENOTDIR = syscall.NewError("not a directory") - EISDIR = syscall.NewError("file is a directory") - ENOENT = syscall.NewError("file does not exist") - EEXIST = syscall.NewError("file already exists") - EMFILE = syscall.NewError("no free file descriptors") - EIO = syscall.NewError("i/o error") - ENAMETOOLONG = syscall.NewError("file name too long") - EINTR = syscall.NewError("interrupted") - EPERM = syscall.NewError("permission denied") - EBUSY = syscall.NewError("no free devices") - ETIMEDOUT = syscall.NewError("connection timed out") - EPLAN9 = syscall.NewError("not supported by plan 9") - - // The following errors do not correspond to any - // Plan 9 system messages. Invented to support - // what package os and others expect. - EACCES = syscall.NewError("access permission denied") - EAFNOSUPPORT = syscall.NewError("address family not supported by protocol") -) diff --git a/vendor/golang.org/x/sys/plan9/mkall.sh b/vendor/golang.org/x/sys/plan9/mkall.sh deleted file mode 100755 index 9f73c6066..000000000 --- a/vendor/golang.org/x/sys/plan9/mkall.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# The plan9 package provides access to the raw system call -# interface of the underlying operating system. Porting Go to -# a new architecture/operating system combination requires -# some manual effort, though there are tools that automate -# much of the process. The auto-generated files have names -# beginning with z. -# -# This script runs or (given -n) prints suggested commands to generate z files -# for the current system. Running those commands is not automatic. -# This script is documentation more than anything else. -# -# * asm_${GOOS}_${GOARCH}.s -# -# This hand-written assembly file implements system call dispatch. -# There are three entry points: -# -# func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); -# func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); -# func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); -# -# The first and second are the standard ones; they differ only in -# how many arguments can be passed to the kernel. -# The third is for low-level use by the ForkExec wrapper; -# unlike the first two, it does not call into the scheduler to -# let it know that a system call is running. -# -# * syscall_${GOOS}.go -# -# This hand-written Go file implements system calls that need -# special handling and lists "//sys" comments giving prototypes -# for ones that can be auto-generated. Mksyscall reads those -# comments to generate the stubs. -# -# * syscall_${GOOS}_${GOARCH}.go -# -# Same as syscall_${GOOS}.go except that it contains code specific -# to ${GOOS} on one particular architecture. -# -# * types_${GOOS}.c -# -# This hand-written C file includes standard C headers and then -# creates typedef or enum names beginning with a dollar sign -# (use of $ in variable names is a gcc extension). The hardest -# part about preparing this file is figuring out which headers to -# include and which symbols need to be #defined to get the -# actual data structures that pass through to the kernel system calls. -# Some C libraries present alternate versions for binary compatibility -# and translate them on the way in and out of system calls, but -# there is almost always a #define that can get the real ones. -# See types_darwin.c and types_linux.c for examples. -# -# * zerror_${GOOS}_${GOARCH}.go -# -# This machine-generated file defines the system's error numbers, -# error strings, and signal numbers. The generator is "mkerrors.sh". -# Usually no arguments are needed, but mkerrors.sh will pass its -# arguments on to godefs. -# -# * zsyscall_${GOOS}_${GOARCH}.go -# -# Generated by mksyscall.pl; see syscall_${GOOS}.go above. -# -# * zsysnum_${GOOS}_${GOARCH}.go -# -# Generated by mksysnum_${GOOS}. -# -# * ztypes_${GOOS}_${GOARCH}.go -# -# Generated by godefs; see types_${GOOS}.c above. - -GOOSARCH="${GOOS}_${GOARCH}" - -# defaults -mksyscall="./mksyscall.pl" -mkerrors="./mkerrors.sh" -zerrors="zerrors_$GOOSARCH.go" -mksysctl="" -zsysctl="zsysctl_$GOOSARCH.go" -mksysnum= -mktypes= -run="sh" - -case "$1" in --syscalls) - for i in zsyscall*go - do - sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i - rm _$i - done - exit 0 - ;; --n) - run="cat" - shift -esac - -case "$#" in -0) - ;; -*) - echo 'usage: mkall.sh [-n]' 1>&2 - exit 2 -esac - -case "$GOOSARCH" in -_* | *_ | _) - echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 - exit 1 - ;; -plan9_386) - mkerrors= - mksyscall="./mksyscall.pl -l32 -plan9" - mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" - mktypes="XXX" - ;; -*) - echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 - exit 1 - ;; -esac - -( - if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi - case "$GOOS" in - plan9) - syscall_goos="syscall_$GOOS.go" - if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go"; fi - ;; - esac - if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi - if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi - if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go |gofmt >ztypes_$GOOSARCH.go"; fi -) | $run diff --git a/vendor/golang.org/x/sys/plan9/mkerrors.sh b/vendor/golang.org/x/sys/plan9/mkerrors.sh deleted file mode 100755 index 052c86d94..000000000 --- a/vendor/golang.org/x/sys/plan9/mkerrors.sh +++ /dev/null @@ -1,246 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# Generate Go code listing errors and other #defined constant -# values (ENAMETOOLONG etc.), by asking the preprocessor -# about the definitions. - -unset LANG -export LC_ALL=C -export LC_CTYPE=C - -CC=${CC:-gcc} - -uname=$(uname) - -includes=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -' - -ccflags="$@" - -# Write go tool cgo -godefs input. -( - echo package plan9 - echo - echo '/*' - indirect="includes_$(uname)" - echo "${!indirect} $includes" - echo '*/' - echo 'import "C"' - echo - echo 'const (' - - # The gcc command line prints all the #defines - # it encounters while processing the input - echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | - awk ' - $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} - - $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers - $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} - $2 ~ /^(SCM_SRCRT)$/ {next} - $2 ~ /^(MAP_FAILED)$/ {next} - - $2 !~ /^ETH_/ && - $2 !~ /^EPROC_/ && - $2 !~ /^EQUIV_/ && - $2 !~ /^EXPR_/ && - $2 ~ /^E[A-Z0-9_]+$/ || - $2 ~ /^B[0-9_]+$/ || - $2 ~ /^V[A-Z0-9]+$/ || - $2 ~ /^CS[A-Z0-9]/ || - $2 ~ /^I(SIG|CANON|CRNL|EXTEN|MAXBEL|STRIP|UTF8)$/ || - $2 ~ /^IGN/ || - $2 ~ /^IX(ON|ANY|OFF)$/ || - $2 ~ /^IN(LCR|PCK)$/ || - $2 ~ /(^FLU?SH)|(FLU?SH$)/ || - $2 ~ /^C(LOCAL|READ)$/ || - $2 == "BRKINT" || - $2 == "HUPCL" || - $2 == "PENDIN" || - $2 == "TOSTOP" || - $2 ~ /^PAR/ || - $2 ~ /^SIG[^_]/ || - $2 ~ /^O[CNPFP][A-Z]+[^_][A-Z]+$/ || - $2 ~ /^IN_/ || - $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || - $2 == "ICMPV6_FILTER" || - $2 == "SOMAXCONN" || - $2 == "NAME_MAX" || - $2 == "IFNAMSIZ" || - $2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ || - $2 ~ /^SYSCTL_VERS/ || - $2 ~ /^(MS|MNT)_/ || - $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || - $2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ || - $2 ~ /^LINUX_REBOOT_CMD_/ || - $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || - $2 !~ "NLA_TYPE_MASK" && - $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ || - $2 ~ /^SIOC/ || - $2 ~ /^TIOC/ || - $2 !~ "RTF_BITS" && - $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || - $2 ~ /^BIOC/ || - $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || - $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ || - $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || - $2 ~ /^CLONE_[A-Z_]+/ || - $2 !~ /^(BPF_TIMEVAL)$/ && - $2 ~ /^(BPF|DLT)_/ || - $2 !~ "WMESGLEN" && - $2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)} - $2 ~ /^__WCOREFLAG$/ {next} - $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} - - {next} - ' | sort - - echo ')' -) >_const.go - -# Pull out the error names for later. -errors=$( - echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | - sort -) - -# Pull out the signal names for later. -signals=$( - echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | - egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | - sort -) - -# Again, writing regexps to a file. -echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | - sort >_error.grep -echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | - egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | - sort >_signal.grep - -echo '// mkerrors.sh' "$@" -echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT' -echo -go tool cgo -godefs -- "$@" _const.go >_error.out -cat _error.out | grep -vf _error.grep | grep -vf _signal.grep -echo -echo '// Errors' -echo 'const (' -cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= Errno(\1)/' -echo ')' - -echo -echo '// Signals' -echo 'const (' -cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= Signal(\1)/' -echo ')' - -# Run C program to print error and syscall strings. -( - echo -E " -#include -#include -#include -#include -#include -#include - -#define nelem(x) (sizeof(x)/sizeof((x)[0])) - -enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below - -int errors[] = { -" - for i in $errors - do - echo -E ' '$i, - done - - echo -E " -}; - -int signals[] = { -" - for i in $signals - do - echo -E ' '$i, - done - - # Use -E because on some systems bash builtin interprets \n itself. - echo -E ' -}; - -static int -intcmp(const void *a, const void *b) -{ - return *(int*)a - *(int*)b; -} - -int -main(void) -{ - int i, j, e; - char buf[1024], *p; - - printf("\n\n// Error table\n"); - printf("var errors = [...]string {\n"); - qsort(errors, nelem(errors), sizeof errors[0], intcmp); - for(i=0; i 0 && errors[i-1] == e) - continue; - strcpy(buf, strerror(e)); - // lowercase first letter: Bad -> bad, but STREAM -> STREAM. - if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) - buf[0] += a - A; - printf("\t%d: \"%s\",\n", e, buf); - } - printf("}\n\n"); - - printf("\n\n// Signal table\n"); - printf("var signals = [...]string {\n"); - qsort(signals, nelem(signals), sizeof signals[0], intcmp); - for(i=0; i 0 && signals[i-1] == e) - continue; - strcpy(buf, strsignal(e)); - // lowercase first letter: Bad -> bad, but STREAM -> STREAM. - if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) - buf[0] += a - A; - // cut trailing : number. - p = strrchr(buf, ":"[0]); - if(p) - *p = '\0'; - printf("\t%d: \"%s\",\n", e, buf); - } - printf("}\n\n"); - - return 0; -} - -' -) >_errors.c - -$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out diff --git a/vendor/golang.org/x/sys/plan9/mksyscall.pl b/vendor/golang.org/x/sys/plan9/mksyscall.pl deleted file mode 100755 index ce8e1e4f3..000000000 --- a/vendor/golang.org/x/sys/plan9/mksyscall.pl +++ /dev/null @@ -1,319 +0,0 @@ -#!/usr/bin/env perl -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# This program reads a file containing function prototypes -# (like syscall_plan9.go) and generates system call bodies. -# The prototypes are marked by lines beginning with "//sys" -# and read like func declarations if //sys is replaced by func, but: -# * The parameter lists must give a name for each argument. -# This includes return parameters. -# * The parameter lists must give a type for each argument: -# the (x, y, z int) shorthand is not allowed. -# * If the return parameter is an error number, it must be named errno. - -# A line beginning with //sysnb is like //sys, except that the -# goroutine will not be suspended during the execution of the system -# call. This must only be used for system calls which can never -# block, as otherwise the system call could cause all goroutines to -# hang. - -use strict; - -my $cmdline = "mksyscall.pl " . join(' ', @ARGV); -my $errors = 0; -my $_32bit = ""; -my $plan9 = 0; -my $openbsd = 0; -my $netbsd = 0; -my $dragonfly = 0; -my $nacl = 0; -my $arm = 0; # 64-bit value should use (even, odd)-pair - -if($ARGV[0] eq "-b32") { - $_32bit = "big-endian"; - shift; -} elsif($ARGV[0] eq "-l32") { - $_32bit = "little-endian"; - shift; -} -if($ARGV[0] eq "-plan9") { - $plan9 = 1; - shift; -} -if($ARGV[0] eq "-openbsd") { - $openbsd = 1; - shift; -} -if($ARGV[0] eq "-netbsd") { - $netbsd = 1; - shift; -} -if($ARGV[0] eq "-dragonfly") { - $dragonfly = 1; - shift; -} -if($ARGV[0] eq "-nacl") { - $nacl = 1; - shift; -} -if($ARGV[0] eq "-arm") { - $arm = 1; - shift; -} - -if($ARGV[0] =~ /^-/) { - print STDERR "usage: mksyscall.pl [-b32 | -l32] [file ...]\n"; - exit 1; -} - -sub parseparamlist($) { - my ($list) = @_; - $list =~ s/^\s*//; - $list =~ s/\s*$//; - if($list eq "") { - return (); - } - return split(/\s*,\s*/, $list); -} - -sub parseparam($) { - my ($p) = @_; - if($p !~ /^(\S*) (\S*)$/) { - print STDERR "$ARGV:$.: malformed parameter: $p\n"; - $errors = 1; - return ("xx", "int"); - } - return ($1, $2); -} - -my $text = ""; -while(<>) { - chomp; - s/\s+/ /g; - s/^\s+//; - s/\s+$//; - my $nonblock = /^\/\/sysnb /; - next if !/^\/\/sys / && !$nonblock; - - # Line must be of the form - # func Open(path string, mode int, perm int) (fd int, errno error) - # Split into name, in params, out params. - if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$/) { - print STDERR "$ARGV:$.: malformed //sys declaration\n"; - $errors = 1; - next; - } - my ($func, $in, $out, $sysname) = ($2, $3, $4, $5); - - # Split argument lists on comma. - my @in = parseparamlist($in); - my @out = parseparamlist($out); - - # Try in vain to keep people from editing this file. - # The theory is that they jump into the middle of the file - # without reading the header. - $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; - - # Go function header. - my $out_decl = @out ? sprintf(" (%s)", join(', ', @out)) : ""; - $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out_decl; - - # Check if err return available - my $errvar = ""; - foreach my $p (@out) { - my ($name, $type) = parseparam($p); - if($type eq "error") { - $errvar = $name; - last; - } - } - - # Prepare arguments to Syscall. - my @args = (); - my @uses = (); - my $n = 0; - foreach my $p (@in) { - my ($name, $type) = parseparam($p); - if($type =~ /^\*/) { - push @args, "uintptr(unsafe.Pointer($name))"; - } elsif($type eq "string" && $errvar ne "") { - $text .= "\tvar _p$n *byte\n"; - $text .= "\t_p$n, $errvar = BytePtrFromString($name)\n"; - $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; - push @args, "uintptr(unsafe.Pointer(_p$n))"; - push @uses, "use(unsafe.Pointer(_p$n))"; - $n++; - } elsif($type eq "string") { - print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; - $text .= "\tvar _p$n *byte\n"; - $text .= "\t_p$n, _ = BytePtrFromString($name)\n"; - push @args, "uintptr(unsafe.Pointer(_p$n))"; - push @uses, "use(unsafe.Pointer(_p$n))"; - $n++; - } elsif($type =~ /^\[\](.*)/) { - # Convert slice into pointer, length. - # Have to be careful not to take address of &a[0] if len == 0: - # pass dummy pointer in that case. - # Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). - $text .= "\tvar _p$n unsafe.Pointer\n"; - $text .= "\tif len($name) > 0 {\n\t\t_p$n = unsafe.Pointer(\&${name}[0])\n\t}"; - $text .= " else {\n\t\t_p$n = unsafe.Pointer(&_zero)\n\t}"; - $text .= "\n"; - push @args, "uintptr(_p$n)", "uintptr(len($name))"; - $n++; - } elsif($type eq "int64" && ($openbsd || $netbsd)) { - push @args, "0"; - if($_32bit eq "big-endian") { - push @args, "uintptr($name>>32)", "uintptr($name)"; - } elsif($_32bit eq "little-endian") { - push @args, "uintptr($name)", "uintptr($name>>32)"; - } else { - push @args, "uintptr($name)"; - } - } elsif($type eq "int64" && $dragonfly) { - if ($func !~ /^extp(read|write)/i) { - push @args, "0"; - } - if($_32bit eq "big-endian") { - push @args, "uintptr($name>>32)", "uintptr($name)"; - } elsif($_32bit eq "little-endian") { - push @args, "uintptr($name)", "uintptr($name>>32)"; - } else { - push @args, "uintptr($name)"; - } - } elsif($type eq "int64" && $_32bit ne "") { - if(@args % 2 && $arm) { - # arm abi specifies 64-bit argument uses - # (even, odd) pair - push @args, "0" - } - if($_32bit eq "big-endian") { - push @args, "uintptr($name>>32)", "uintptr($name)"; - } else { - push @args, "uintptr($name)", "uintptr($name>>32)"; - } - } else { - push @args, "uintptr($name)"; - } - } - - # Determine which form to use; pad args with zeros. - my $asm = "Syscall"; - if ($nonblock) { - $asm = "RawSyscall"; - } - if(@args <= 3) { - while(@args < 3) { - push @args, "0"; - } - } elsif(@args <= 6) { - $asm .= "6"; - while(@args < 6) { - push @args, "0"; - } - } elsif(@args <= 9) { - $asm .= "9"; - while(@args < 9) { - push @args, "0"; - } - } else { - print STDERR "$ARGV:$.: too many arguments to system call\n"; - } - - # System call number. - if($sysname eq "") { - $sysname = "SYS_$func"; - $sysname =~ s/([a-z])([A-Z])/${1}_$2/g; # turn FooBar into Foo_Bar - $sysname =~ y/a-z/A-Z/; - if($nacl) { - $sysname =~ y/A-Z/a-z/; - } - } - - # Actual call. - my $args = join(', ', @args); - my $call = "$asm($sysname, $args)"; - - # Assign return values. - my $body = ""; - my @ret = ("_", "_", "_"); - my $do_errno = 0; - for(my $i=0; $i<@out; $i++) { - my $p = $out[$i]; - my ($name, $type) = parseparam($p); - my $reg = ""; - if($name eq "err" && !$plan9) { - $reg = "e1"; - $ret[2] = $reg; - $do_errno = 1; - } elsif($name eq "err" && $plan9) { - $ret[0] = "r0"; - $ret[2] = "e1"; - next; - } else { - $reg = sprintf("r%d", $i); - $ret[$i] = $reg; - } - if($type eq "bool") { - $reg = "$reg != 0"; - } - if($type eq "int64" && $_32bit ne "") { - # 64-bit number in r1:r0 or r0:r1. - if($i+2 > @out) { - print STDERR "$ARGV:$.: not enough registers for int64 return\n"; - } - if($_32bit eq "big-endian") { - $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i, $i+1); - } else { - $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i+1, $i); - } - $ret[$i] = sprintf("r%d", $i); - $ret[$i+1] = sprintf("r%d", $i+1); - } - if($reg ne "e1" || $plan9) { - $body .= "\t$name = $type($reg)\n"; - } - } - if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") { - $text .= "\t$call\n"; - } else { - $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; - } - foreach my $use (@uses) { - $text .= "\t$use\n"; - } - $text .= $body; - - if ($plan9 && $ret[2] eq "e1") { - $text .= "\tif int32(r0) == -1 {\n"; - $text .= "\t\terr = e1\n"; - $text .= "\t}\n"; - } elsif ($do_errno) { - $text .= "\tif e1 != 0 {\n"; - $text .= "\t\terr = e1\n"; - $text .= "\t}\n"; - } - $text .= "\treturn\n"; - $text .= "}\n\n"; -} - -chomp $text; -chomp $text; - -if($errors) { - exit 1; -} - -print <= 10 { - buf[i] = byte(val%10 + '0') - i-- - val /= 10 - } - buf[i] = byte(val + '0') - return string(buf[i:]) -} diff --git a/vendor/golang.org/x/sys/plan9/syscall.go b/vendor/golang.org/x/sys/plan9/syscall.go deleted file mode 100644 index df6f8c5b9..000000000 --- a/vendor/golang.org/x/sys/plan9/syscall.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build plan9 - -// Package plan9 contains an interface to the low-level operating system -// primitives. OS details vary depending on the underlying system, and -// by default, godoc will display the OS-specific documentation for the current -// system. If you want godoc to display documentation for another -// system, set $GOOS and $GOARCH to the desired system. For example, if -// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS -// to freebsd and $GOARCH to arm. -// The primary use of this package is inside other packages that provide a more -// portable interface to the system, such as "os", "time" and "net". Use -// those packages rather than this one if you can. -// For details of the functions and data types in this package consult -// the manuals for the appropriate operating system. -// These calls return err == nil to indicate success; otherwise -// err represents an operating system error describing the failure and -// holds a value of type syscall.ErrorString. -package plan9 // import "golang.org/x/sys/plan9" - -import "unsafe" - -// ByteSliceFromString returns a NUL-terminated slice of bytes -// containing the text of s. If s contains a NUL byte at any -// location, it returns (nil, EINVAL). -func ByteSliceFromString(s string) ([]byte, error) { - for i := 0; i < len(s); i++ { - if s[i] == 0 { - return nil, EINVAL - } - } - a := make([]byte, len(s)+1) - copy(a, s) - return a, nil -} - -// BytePtrFromString returns a pointer to a NUL-terminated array of -// bytes containing the text of s. If s contains a NUL byte at any -// location, it returns (nil, EINVAL). -func BytePtrFromString(s string) (*byte, error) { - a, err := ByteSliceFromString(s) - if err != nil { - return nil, err - } - return &a[0], nil -} - -// Single-word zero for use when we need a valid pointer to 0 bytes. -// See mksyscall.pl. -var _zero uintptr - -func (ts *Timespec) Unix() (sec int64, nsec int64) { - return int64(ts.Sec), int64(ts.Nsec) -} - -func (tv *Timeval) Unix() (sec int64, nsec int64) { - return int64(tv.Sec), int64(tv.Usec) * 1000 -} - -func (ts *Timespec) Nano() int64 { - return int64(ts.Sec)*1e9 + int64(ts.Nsec) -} - -func (tv *Timeval) Nano() int64 { - return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 -} - -// use is a no-op, but the compiler cannot see that it is. -// Calling use(p) ensures that p is kept live until that point. -//go:noescape -func use(p unsafe.Pointer) diff --git a/vendor/golang.org/x/sys/plan9/syscall_plan9.go b/vendor/golang.org/x/sys/plan9/syscall_plan9.go deleted file mode 100644 index d39d07de1..000000000 --- a/vendor/golang.org/x/sys/plan9/syscall_plan9.go +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Plan 9 system calls. -// This file is compiled as ordinary Go code, -// but it is also input to mksyscall, -// which parses the //sys lines and generates system call stubs. -// Note that sometimes we use a lowercase //sys name and -// wrap it in our own nicer implementation. - -package plan9 - -import ( - "syscall" - "unsafe" -) - -// A Note is a string describing a process note. -// It implements the os.Signal interface. -type Note string - -func (n Note) Signal() {} - -func (n Note) String() string { - return string(n) -} - -var ( - Stdin = 0 - Stdout = 1 - Stderr = 2 -) - -// For testing: clients can set this flag to force -// creation of IPv6 sockets to return EAFNOSUPPORT. -var SocketDisableIPv6 bool - -func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.ErrorString) -func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.ErrorString) -func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) -func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) - -func atoi(b []byte) (n uint) { - n = 0 - for i := 0; i < len(b); i++ { - n = n*10 + uint(b[i]-'0') - } - return -} - -func cstring(s []byte) string { - for i := range s { - if s[i] == 0 { - return string(s[0:i]) - } - } - return string(s) -} - -func errstr() string { - var buf [ERRMAX]byte - - RawSyscall(SYS_ERRSTR, uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf)), 0) - - buf[len(buf)-1] = 0 - return cstring(buf[:]) -} - -// Implemented in assembly to import from runtime. -func exit(code int) - -func Exit(code int) { exit(code) } - -func readnum(path string) (uint, error) { - var b [12]byte - - fd, e := Open(path, O_RDONLY) - if e != nil { - return 0, e - } - defer Close(fd) - - n, e := Pread(fd, b[:], 0) - - if e != nil { - return 0, e - } - - m := 0 - for ; m < n && b[m] == ' '; m++ { - } - - return atoi(b[m : n-1]), nil -} - -func Getpid() (pid int) { - n, _ := readnum("#c/pid") - return int(n) -} - -func Getppid() (ppid int) { - n, _ := readnum("#c/ppid") - return int(n) -} - -func Read(fd int, p []byte) (n int, err error) { - return Pread(fd, p, -1) -} - -func Write(fd int, p []byte) (n int, err error) { - return Pwrite(fd, p, -1) -} - -var ioSync int64 - -//sys fd2path(fd int, buf []byte) (err error) -func Fd2path(fd int) (path string, err error) { - var buf [512]byte - - e := fd2path(fd, buf[:]) - if e != nil { - return "", e - } - return cstring(buf[:]), nil -} - -//sys pipe(p *[2]int32) (err error) -func Pipe(p []int) (err error) { - if len(p) != 2 { - return syscall.ErrorString("bad arg in system call") - } - var pp [2]int32 - err = pipe(&pp) - p[0] = int(pp[0]) - p[1] = int(pp[1]) - return -} - -// Underlying system call writes to newoffset via pointer. -// Implemented in assembly to avoid allocation. -func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) - -func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - newoffset, e := seek(0, fd, offset, whence) - - if newoffset == -1 { - err = syscall.ErrorString(e) - } - return -} - -func Mkdir(path string, mode uint32) (err error) { - fd, err := Create(path, O_RDONLY, DMDIR|mode) - - if fd != -1 { - Close(fd) - } - - return -} - -type Waitmsg struct { - Pid int - Time [3]uint32 - Msg string -} - -func (w Waitmsg) Exited() bool { return true } -func (w Waitmsg) Signaled() bool { return false } - -func (w Waitmsg) ExitStatus() int { - if len(w.Msg) == 0 { - // a normal exit returns no message - return 0 - } - return 1 -} - -//sys await(s []byte) (n int, err error) -func Await(w *Waitmsg) (err error) { - var buf [512]byte - var f [5][]byte - - n, err := await(buf[:]) - - if err != nil || w == nil { - return - } - - nf := 0 - p := 0 - for i := 0; i < n && nf < len(f)-1; i++ { - if buf[i] == ' ' { - f[nf] = buf[p:i] - p = i + 1 - nf++ - } - } - f[nf] = buf[p:] - nf++ - - if nf != len(f) { - return syscall.ErrorString("invalid wait message") - } - w.Pid = int(atoi(f[0])) - w.Time[0] = uint32(atoi(f[1])) - w.Time[1] = uint32(atoi(f[2])) - w.Time[2] = uint32(atoi(f[3])) - w.Msg = cstring(f[4]) - if w.Msg == "''" { - // await() returns '' for no error - w.Msg = "" - } - return -} - -func Unmount(name, old string) (err error) { - fixwd() - oldp, err := BytePtrFromString(old) - if err != nil { - return err - } - oldptr := uintptr(unsafe.Pointer(oldp)) - - var r0 uintptr - var e syscall.ErrorString - - // bind(2) man page: If name is zero, everything bound or mounted upon old is unbound or unmounted. - if name == "" { - r0, _, e = Syscall(SYS_UNMOUNT, _zero, oldptr, 0) - } else { - namep, err := BytePtrFromString(name) - if err != nil { - return err - } - r0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(namep)), oldptr, 0) - } - - if int32(r0) == -1 { - err = e - } - return -} - -func Fchdir(fd int) (err error) { - path, err := Fd2path(fd) - - if err != nil { - return - } - - return Chdir(path) -} - -type Timespec struct { - Sec int32 - Nsec int32 -} - -type Timeval struct { - Sec int32 - Usec int32 -} - -func NsecToTimeval(nsec int64) (tv Timeval) { - nsec += 999 // round up to microsecond - tv.Usec = int32(nsec % 1e9 / 1e3) - tv.Sec = int32(nsec / 1e9) - return -} - -func nsec() int64 { - var scratch int64 - - r0, _, _ := Syscall(SYS_NSEC, uintptr(unsafe.Pointer(&scratch)), 0, 0) - // TODO(aram): remove hack after I fix _nsec in the pc64 kernel. - if r0 == 0 { - return scratch - } - return int64(r0) -} - -func Gettimeofday(tv *Timeval) error { - nsec := nsec() - *tv = NsecToTimeval(nsec) - return nil -} - -func Getpagesize() int { return 0x1000 } - -func Getegid() (egid int) { return -1 } -func Geteuid() (euid int) { return -1 } -func Getgid() (gid int) { return -1 } -func Getuid() (uid int) { return -1 } - -func Getgroups() (gids []int, err error) { - return make([]int, 0), nil -} - -//sys open(path string, mode int) (fd int, err error) -func Open(path string, mode int) (fd int, err error) { - fixwd() - return open(path, mode) -} - -//sys create(path string, mode int, perm uint32) (fd int, err error) -func Create(path string, mode int, perm uint32) (fd int, err error) { - fixwd() - return create(path, mode, perm) -} - -//sys remove(path string) (err error) -func Remove(path string) error { - fixwd() - return remove(path) -} - -//sys stat(path string, edir []byte) (n int, err error) -func Stat(path string, edir []byte) (n int, err error) { - fixwd() - return stat(path, edir) -} - -//sys bind(name string, old string, flag int) (err error) -func Bind(name string, old string, flag int) (err error) { - fixwd() - return bind(name, old, flag) -} - -//sys mount(fd int, afd int, old string, flag int, aname string) (err error) -func Mount(fd int, afd int, old string, flag int, aname string) (err error) { - fixwd() - return mount(fd, afd, old, flag, aname) -} - -//sys wstat(path string, edir []byte) (err error) -func Wstat(path string, edir []byte) (err error) { - fixwd() - return wstat(path, edir) -} - -//sys chdir(path string) (err error) -//sys Dup(oldfd int, newfd int) (fd int, err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) -//sys Close(fd int) (err error) -//sys Fstat(fd int, edir []byte) (n int, err error) -//sys Fwstat(fd int, edir []byte) (err error) diff --git a/vendor/golang.org/x/sys/plan9/syscall_test.go b/vendor/golang.org/x/sys/plan9/syscall_test.go deleted file mode 100644 index 8f829bad0..000000000 --- a/vendor/golang.org/x/sys/plan9/syscall_test.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build plan9 - -package plan9_test - -import ( - "testing" - - "golang.org/x/sys/plan9" -) - -func testSetGetenv(t *testing.T, key, value string) { - err := plan9.Setenv(key, value) - if err != nil { - t.Fatalf("Setenv failed to set %q: %v", value, err) - } - newvalue, found := plan9.Getenv(key) - if !found { - t.Fatalf("Getenv failed to find %v variable (want value %q)", key, value) - } - if newvalue != value { - t.Fatalf("Getenv(%v) = %q; want %q", key, newvalue, value) - } -} - -func TestEnv(t *testing.T) { - testSetGetenv(t, "TESTENV", "AVALUE") - // make sure TESTENV gets set to "", not deleted - testSetGetenv(t, "TESTENV", "") -} diff --git a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go deleted file mode 100644 index b35598ad9..000000000 --- a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go +++ /dev/null @@ -1,292 +0,0 @@ -// mksyscall.pl -l32 -plan9 syscall_plan9.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package plan9 - -import "unsafe" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func fd2path(fd int, buf []byte) (err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pipe(p *[2]int32) (err error) { - r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func await(s []byte) (n int, err error) { - var _p0 unsafe.Pointer - if len(s) > 0 { - _p0 = unsafe.Pointer(&s[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func open(path string, mode int) (fd int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) - fd = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func create(path string, mode int, perm uint32) (fd int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) - fd = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func remove(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func stat(path string, edir []byte) (n int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(edir) > 0 { - _p1 = unsafe.Pointer(&edir[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) - use(unsafe.Pointer(_p0)) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func bind(name string, old string, flag int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(name) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(old) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func mount(fd int, afd int, old string, flag int, aname string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(old) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(aname) - if err != nil { - return - } - r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func wstat(path string, edir []byte) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(edir) > 0 { - _p1 = unsafe.Pointer(&edir[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) - use(unsafe.Pointer(_p0)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func chdir(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Dup(oldfd int, newfd int) (fd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) - fd = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Pread(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Close(fd int) (err error) { - r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstat(fd int, edir []byte) (n int, err error) { - var _p0 unsafe.Pointer - if len(edir) > 0 { - _p0 = unsafe.Pointer(&edir[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fwstat(fd int, edir []byte) (err error) { - var _p0 unsafe.Pointer - if len(edir) > 0 { - _p0 = unsafe.Pointer(&edir[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) - if int32(r0) == -1 { - err = e1 - } - return -} diff --git a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go b/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go deleted file mode 100644 index b35598ad9..000000000 --- a/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go +++ /dev/null @@ -1,292 +0,0 @@ -// mksyscall.pl -l32 -plan9 syscall_plan9.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package plan9 - -import "unsafe" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func fd2path(fd int, buf []byte) (err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func pipe(p *[2]int32) (err error) { - r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func await(s []byte) (n int, err error) { - var _p0 unsafe.Pointer - if len(s) > 0 { - _p0 = unsafe.Pointer(&s[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func open(path string, mode int) (fd int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) - fd = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func create(path string, mode int, perm uint32) (fd int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) - fd = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func remove(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func stat(path string, edir []byte) (n int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(edir) > 0 { - _p1 = unsafe.Pointer(&edir[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) - use(unsafe.Pointer(_p0)) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func bind(name string, old string, flag int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(name) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(old) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func mount(fd int, afd int, old string, flag int, aname string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(old) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(aname) - if err != nil { - return - } - r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func wstat(path string, edir []byte) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(edir) > 0 { - _p1 = unsafe.Pointer(&edir[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) - use(unsafe.Pointer(_p0)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func chdir(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Dup(oldfd int, newfd int) (fd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) - fd = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Pread(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Close(fd int) (err error) { - r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstat(fd int, edir []byte) (n int, err error) { - var _p0 unsafe.Pointer - if len(edir) > 0 { - _p0 = unsafe.Pointer(&edir[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) - n = int(r0) - if int32(r0) == -1 { - err = e1 - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fwstat(fd int, edir []byte) (err error) { - var _p0 unsafe.Pointer - if len(edir) > 0 { - _p0 = unsafe.Pointer(&edir[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) - if int32(r0) == -1 { - err = e1 - } - return -} diff --git a/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go b/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go deleted file mode 100644 index 22e8abd43..000000000 --- a/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go +++ /dev/null @@ -1,49 +0,0 @@ -// mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h -// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT - -package plan9 - -const ( - SYS_SYSR1 = 0 - SYS_BIND = 2 - SYS_CHDIR = 3 - SYS_CLOSE = 4 - SYS_DUP = 5 - SYS_ALARM = 6 - SYS_EXEC = 7 - SYS_EXITS = 8 - SYS_FAUTH = 10 - SYS_SEGBRK = 12 - SYS_OPEN = 14 - SYS_OSEEK = 16 - SYS_SLEEP = 17 - SYS_RFORK = 19 - SYS_PIPE = 21 - SYS_CREATE = 22 - SYS_FD2PATH = 23 - SYS_BRK_ = 24 - SYS_REMOVE = 25 - SYS_NOTIFY = 28 - SYS_NOTED = 29 - SYS_SEGATTACH = 30 - SYS_SEGDETACH = 31 - SYS_SEGFREE = 32 - SYS_SEGFLUSH = 33 - SYS_RENDEZVOUS = 34 - SYS_UNMOUNT = 35 - SYS_SEMACQUIRE = 37 - SYS_SEMRELEASE = 38 - SYS_SEEK = 39 - SYS_FVERSION = 40 - SYS_ERRSTR = 41 - SYS_STAT = 42 - SYS_FSTAT = 43 - SYS_WSTAT = 44 - SYS_FWSTAT = 45 - SYS_MOUNT = 46 - SYS_AWAIT = 47 - SYS_PREAD = 50 - SYS_PWRITE = 51 - SYS_TSEMACQUIRE = 52 - SYS_NSEC = 53 -) diff --git a/vendor/golang.org/x/sys/windows/asm.s b/vendor/golang.org/x/sys/windows/asm.s deleted file mode 100644 index d4ca868f1..000000000 --- a/vendor/golang.org/x/sys/windows/asm.s +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -TEXT ·use(SB),NOSPLIT,$0 - RET diff --git a/vendor/golang.org/x/sys/windows/asm_windows_386.s b/vendor/golang.org/x/sys/windows/asm_windows_386.s deleted file mode 100644 index 1c20dd2f8..000000000 --- a/vendor/golang.org/x/sys/windows/asm_windows_386.s +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// -// System calls for 386, Windows are implemented in runtime/syscall_windows.goc -// - -TEXT ·getprocaddress(SB), 7, $0-8 - JMP syscall·getprocaddress(SB) - -TEXT ·loadlibrary(SB), 7, $0-4 - JMP syscall·loadlibrary(SB) diff --git a/vendor/golang.org/x/sys/windows/asm_windows_amd64.s b/vendor/golang.org/x/sys/windows/asm_windows_amd64.s deleted file mode 100644 index 4d025ab55..000000000 --- a/vendor/golang.org/x/sys/windows/asm_windows_amd64.s +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// -// System calls for amd64, Windows are implemented in runtime/syscall_windows.goc -// - -TEXT ·getprocaddress(SB), 7, $0-32 - JMP syscall·getprocaddress(SB) - -TEXT ·loadlibrary(SB), 7, $0-8 - JMP syscall·loadlibrary(SB) diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go deleted file mode 100644 index 7f9f05f93..000000000 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows - -import ( - "sync" - "sync/atomic" - "syscall" - "unsafe" -) - -// DLLError describes reasons for DLL load failures. -type DLLError struct { - Err error - ObjName string - Msg string -} - -func (e *DLLError) Error() string { return e.Msg } - -// Implemented in runtime/syscall_windows.goc; we provide jumps to them in our assembly file. -func loadlibrary(filename *uint16) (handle uintptr, err syscall.Errno) -func getprocaddress(handle uintptr, procname *uint8) (proc uintptr, err syscall.Errno) - -// A DLL implements access to a single DLL. -type DLL struct { - Name string - Handle Handle -} - -// LoadDLL loads DLL file into memory. -func LoadDLL(name string) (dll *DLL, err error) { - namep, err := UTF16PtrFromString(name) - if err != nil { - return nil, err - } - h, e := loadlibrary(namep) - if e != 0 { - return nil, &DLLError{ - Err: e, - ObjName: name, - Msg: "Failed to load " + name + ": " + e.Error(), - } - } - d := &DLL{ - Name: name, - Handle: Handle(h), - } - return d, nil -} - -// MustLoadDLL is like LoadDLL but panics if load operation failes. -func MustLoadDLL(name string) *DLL { - d, e := LoadDLL(name) - if e != nil { - panic(e) - } - return d -} - -// FindProc searches DLL d for procedure named name and returns *Proc -// if found. It returns an error if search fails. -func (d *DLL) FindProc(name string) (proc *Proc, err error) { - namep, err := BytePtrFromString(name) - if err != nil { - return nil, err - } - a, e := getprocaddress(uintptr(d.Handle), namep) - if e != 0 { - return nil, &DLLError{ - Err: e, - ObjName: name, - Msg: "Failed to find " + name + " procedure in " + d.Name + ": " + e.Error(), - } - } - p := &Proc{ - Dll: d, - Name: name, - addr: a, - } - return p, nil -} - -// MustFindProc is like FindProc but panics if search fails. -func (d *DLL) MustFindProc(name string) *Proc { - p, e := d.FindProc(name) - if e != nil { - panic(e) - } - return p -} - -// Release unloads DLL d from memory. -func (d *DLL) Release() (err error) { - return FreeLibrary(d.Handle) -} - -// A Proc implements access to a procedure inside a DLL. -type Proc struct { - Dll *DLL - Name string - addr uintptr -} - -// Addr returns the address of the procedure represented by p. -// The return value can be passed to Syscall to run the procedure. -func (p *Proc) Addr() uintptr { - return p.addr -} - -// Call executes procedure p with arguments a. It will panic, if more then 15 arguments -// are supplied. -// -// The returned error is always non-nil, constructed from the result of GetLastError. -// Callers must inspect the primary return value to decide whether an error occurred -// (according to the semantics of the specific function being called) before consulting -// the error. The error will be guaranteed to contain windows.Errno. -func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { - switch len(a) { - case 0: - return syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0) - case 1: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0) - case 2: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0) - case 3: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2]) - case 4: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0) - case 5: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0) - case 6: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5]) - case 7: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0) - case 8: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0) - case 9: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]) - case 10: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0) - case 11: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0) - case 12: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11]) - case 13: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0) - case 14: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0) - case 15: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14]) - default: - panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".") - } - return -} - -// A LazyDLL implements access to a single DLL. -// It will delay the load of the DLL until the first -// call to its Handle method or to one of its -// LazyProc's Addr method. -type LazyDLL struct { - mu sync.Mutex - dll *DLL // non nil once DLL is loaded - Name string -} - -// Load loads DLL file d.Name into memory. It returns an error if fails. -// Load will not try to load DLL, if it is already loaded into memory. -func (d *LazyDLL) Load() error { - // Non-racy version of: - // if d.dll == nil { - if atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll))) == nil { - d.mu.Lock() - defer d.mu.Unlock() - if d.dll == nil { - dll, e := LoadDLL(d.Name) - if e != nil { - return e - } - // Non-racy version of: - // d.dll = dll - atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll)), unsafe.Pointer(dll)) - } - } - return nil -} - -// mustLoad is like Load but panics if search fails. -func (d *LazyDLL) mustLoad() { - e := d.Load() - if e != nil { - panic(e) - } -} - -// Handle returns d's module handle. -func (d *LazyDLL) Handle() uintptr { - d.mustLoad() - return uintptr(d.dll.Handle) -} - -// NewProc returns a LazyProc for accessing the named procedure in the DLL d. -func (d *LazyDLL) NewProc(name string) *LazyProc { - return &LazyProc{l: d, Name: name} -} - -// NewLazyDLL creates new LazyDLL associated with DLL file. -func NewLazyDLL(name string) *LazyDLL { - return &LazyDLL{Name: name} -} - -// A LazyProc implements access to a procedure inside a LazyDLL. -// It delays the lookup until the Addr method is called. -type LazyProc struct { - mu sync.Mutex - Name string - l *LazyDLL - proc *Proc -} - -// Find searches DLL for procedure named p.Name. It returns -// an error if search fails. Find will not search procedure, -// if it is already found and loaded into memory. -func (p *LazyProc) Find() error { - // Non-racy version of: - // if p.proc == nil { - if atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc))) == nil { - p.mu.Lock() - defer p.mu.Unlock() - if p.proc == nil { - e := p.l.Load() - if e != nil { - return e - } - proc, e := p.l.dll.FindProc(p.Name) - if e != nil { - return e - } - // Non-racy version of: - // p.proc = proc - atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc)), unsafe.Pointer(proc)) - } - } - return nil -} - -// mustFind is like Find but panics if search fails. -func (p *LazyProc) mustFind() { - e := p.Find() - if e != nil { - panic(e) - } -} - -// Addr returns the address of the procedure represented by p. -// The return value can be passed to Syscall to run the procedure. -func (p *LazyProc) Addr() uintptr { - p.mustFind() - return p.proc.Addr() -} - -// Call executes procedure p with arguments a. It will panic, if more then 15 arguments -// are supplied. -// -// The returned error is always non-nil, constructed from the result of GetLastError. -// Callers must inspect the primary return value to decide whether an error occurred -// (according to the semantics of the specific function being called) before consulting -// the error. The error will be guaranteed to contain windows.Errno. -func (p *LazyProc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { - p.mustFind() - return p.proc.Call(a...) -} diff --git a/vendor/golang.org/x/sys/windows/env_unset.go b/vendor/golang.org/x/sys/windows/env_unset.go deleted file mode 100644 index 999ffac43..000000000 --- a/vendor/golang.org/x/sys/windows/env_unset.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.4 - -package windows - -import "syscall" - -func Unsetenv(key string) error { - // This was added in Go 1.4. - return syscall.Unsetenv(key) -} diff --git a/vendor/golang.org/x/sys/windows/env_windows.go b/vendor/golang.org/x/sys/windows/env_windows.go deleted file mode 100644 index a9d8ef4b7..000000000 --- a/vendor/golang.org/x/sys/windows/env_windows.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Windows environment variables. - -package windows - -import "syscall" - -func Getenv(key string) (value string, found bool) { - return syscall.Getenv(key) -} - -func Setenv(key, value string) error { - return syscall.Setenv(key, value) -} - -func Clearenv() { - syscall.Clearenv() -} - -func Environ() []string { - return syscall.Environ() -} diff --git a/vendor/golang.org/x/sys/windows/eventlog.go b/vendor/golang.org/x/sys/windows/eventlog.go deleted file mode 100644 index 40af946e1..000000000 --- a/vendor/golang.org/x/sys/windows/eventlog.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package windows - -const ( - EVENTLOG_SUCCESS = 0 - EVENTLOG_ERROR_TYPE = 1 - EVENTLOG_WARNING_TYPE = 2 - EVENTLOG_INFORMATION_TYPE = 4 - EVENTLOG_AUDIT_SUCCESS = 8 - EVENTLOG_AUDIT_FAILURE = 16 -) - -//sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW -//sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource -//sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW diff --git a/vendor/golang.org/x/sys/windows/exec_windows.go b/vendor/golang.org/x/sys/windows/exec_windows.go deleted file mode 100644 index 3606c3a8b..000000000 --- a/vendor/golang.org/x/sys/windows/exec_windows.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Fork, exec, wait, etc. - -package windows - -// EscapeArg rewrites command line argument s as prescribed -// in http://msdn.microsoft.com/en-us/library/ms880421. -// This function returns "" (2 double quotes) if s is empty. -// Alternatively, these transformations are done: -// - every back slash (\) is doubled, but only if immediately -// followed by double quote ("); -// - every double quote (") is escaped by back slash (\); -// - finally, s is wrapped with double quotes (arg -> "arg"), -// but only if there is space or tab inside s. -func EscapeArg(s string) string { - if len(s) == 0 { - return "\"\"" - } - n := len(s) - hasSpace := false - for i := 0; i < len(s); i++ { - switch s[i] { - case '"', '\\': - n++ - case ' ', '\t': - hasSpace = true - } - } - if hasSpace { - n += 2 - } - if n == len(s) { - return s - } - - qs := make([]byte, n) - j := 0 - if hasSpace { - qs[j] = '"' - j++ - } - slashes := 0 - for i := 0; i < len(s); i++ { - switch s[i] { - default: - slashes = 0 - qs[j] = s[i] - case '\\': - slashes++ - qs[j] = s[i] - case '"': - for ; slashes > 0; slashes-- { - qs[j] = '\\' - j++ - } - qs[j] = '\\' - j++ - qs[j] = s[i] - } - j++ - } - if hasSpace { - for ; slashes > 0; slashes-- { - qs[j] = '\\' - j++ - } - qs[j] = '"' - j++ - } - return string(qs[:j]) -} - -func CloseOnExec(fd Handle) { - SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0) -} - -// FullPath retrieves the full path of the specified file. -func FullPath(name string) (path string, err error) { - p, err := UTF16PtrFromString(name) - if err != nil { - return "", err - } - n := uint32(100) - for { - buf := make([]uint16, n) - n, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil) - if err != nil { - return "", err - } - if n <= uint32(len(buf)) { - return UTF16ToString(buf[:n]), nil - } - } -} diff --git a/vendor/golang.org/x/sys/windows/race.go b/vendor/golang.org/x/sys/windows/race.go deleted file mode 100644 index 343e18ab6..000000000 --- a/vendor/golang.org/x/sys/windows/race.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows,race - -package windows - -import ( - "runtime" - "unsafe" -) - -const raceenabled = true - -func raceAcquire(addr unsafe.Pointer) { - runtime.RaceAcquire(addr) -} - -func raceReleaseMerge(addr unsafe.Pointer) { - runtime.RaceReleaseMerge(addr) -} - -func raceReadRange(addr unsafe.Pointer, len int) { - runtime.RaceReadRange(addr, len) -} - -func raceWriteRange(addr unsafe.Pointer, len int) { - runtime.RaceWriteRange(addr, len) -} diff --git a/vendor/golang.org/x/sys/windows/race0.go b/vendor/golang.org/x/sys/windows/race0.go deleted file mode 100644 index 17af843b9..000000000 --- a/vendor/golang.org/x/sys/windows/race0.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows,!race - -package windows - -import ( - "unsafe" -) - -const raceenabled = false - -func raceAcquire(addr unsafe.Pointer) { -} - -func raceReleaseMerge(addr unsafe.Pointer) { -} - -func raceReadRange(addr unsafe.Pointer, len int) { -} - -func raceWriteRange(addr unsafe.Pointer, len int) { -} diff --git a/vendor/golang.org/x/sys/windows/registry/export_test.go b/vendor/golang.org/x/sys/windows/registry/export_test.go deleted file mode 100644 index 8badf6fdc..000000000 --- a/vendor/golang.org/x/sys/windows/registry/export_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package registry - -func (k Key) SetValue(name string, valtype uint32, data []byte) error { - return k.setValue(name, valtype, data) -} diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/vendor/golang.org/x/sys/windows/registry/key.go deleted file mode 100644 index f087ce5ad..000000000 --- a/vendor/golang.org/x/sys/windows/registry/key.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package registry provides access to the Windows registry. -// -// Here is a simple example, opening a registry key and reading a string value from it. -// -// k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) -// if err != nil { -// log.Fatal(err) -// } -// defer k.Close() -// -// s, _, err := k.GetStringValue("SystemRoot") -// if err != nil { -// log.Fatal(err) -// } -// fmt.Printf("Windows system root is %q\n", s) -// -package registry - -import ( - "io" - "syscall" - "time" -) - -const ( - // Registry key security and access rights. - // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878.aspx - // for details. - ALL_ACCESS = 0xf003f - CREATE_LINK = 0x00020 - CREATE_SUB_KEY = 0x00004 - ENUMERATE_SUB_KEYS = 0x00008 - EXECUTE = 0x20019 - NOTIFY = 0x00010 - QUERY_VALUE = 0x00001 - READ = 0x20019 - SET_VALUE = 0x00002 - WOW64_32KEY = 0x00200 - WOW64_64KEY = 0x00100 - WRITE = 0x20006 -) - -// Key is a handle to an open Windows registry key. -// Keys can be obtained by calling OpenKey; there are -// also some predefined root keys such as CURRENT_USER. -// Keys can be used directly in the Windows API. -type Key syscall.Handle - -const ( - // Windows defines some predefined root keys that are always open. - // An application can use these keys as entry points to the registry. - // Normally these keys are used in OpenKey to open new keys, - // but they can also be used anywhere a Key is required. - CLASSES_ROOT = Key(syscall.HKEY_CLASSES_ROOT) - CURRENT_USER = Key(syscall.HKEY_CURRENT_USER) - LOCAL_MACHINE = Key(syscall.HKEY_LOCAL_MACHINE) - USERS = Key(syscall.HKEY_USERS) - CURRENT_CONFIG = Key(syscall.HKEY_CURRENT_CONFIG) -) - -// Close closes open key k. -func (k Key) Close() error { - return syscall.RegCloseKey(syscall.Handle(k)) -} - -// OpenKey opens a new key with path name relative to key k. -// It accepts any open key, including CURRENT_USER and others, -// and returns the new key and an error. -// The access parameter specifies desired access rights to the -// key to be opened. -func OpenKey(k Key, path string, access uint32) (Key, error) { - p, err := syscall.UTF16PtrFromString(path) - if err != nil { - return 0, err - } - var subkey syscall.Handle - err = syscall.RegOpenKeyEx(syscall.Handle(k), p, 0, access, &subkey) - if err != nil { - return 0, err - } - return Key(subkey), nil -} - -// ReadSubKeyNames returns the names of subkeys of key k. -// The parameter n controls the number of returned names, -// analogous to the way os.File.Readdirnames works. -func (k Key) ReadSubKeyNames(n int) ([]string, error) { - ki, err := k.Stat() - if err != nil { - return nil, err - } - names := make([]string, 0, ki.SubKeyCount) - buf := make([]uint16, ki.MaxSubKeyLen+1) // extra room for terminating zero byte -loopItems: - for i := uint32(0); ; i++ { - if n > 0 { - if len(names) == n { - return names, nil - } - } - l := uint32(len(buf)) - for { - err := syscall.RegEnumKeyEx(syscall.Handle(k), i, &buf[0], &l, nil, nil, nil, nil) - if err == nil { - break - } - if err == syscall.ERROR_MORE_DATA { - // Double buffer size and try again. - l = uint32(2 * len(buf)) - buf = make([]uint16, l) - continue - } - if err == _ERROR_NO_MORE_ITEMS { - break loopItems - } - return names, err - } - names = append(names, syscall.UTF16ToString(buf[:l])) - } - if n > len(names) { - return names, io.EOF - } - return names, nil -} - -// CreateKey creates a key named path under open key k. -// CreateKey returns the new key and a boolean flag that reports -// whether the key already existed. -// The access parameter specifies the access rights for the key -// to be created. -func CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool, err error) { - var h syscall.Handle - var d uint32 - err = regCreateKeyEx(syscall.Handle(k), syscall.StringToUTF16Ptr(path), - 0, nil, _REG_OPTION_NON_VOLATILE, access, nil, &h, &d) - if err != nil { - return 0, false, err - } - return Key(h), d == _REG_OPENED_EXISTING_KEY, nil -} - -// DeleteKey deletes the subkey path of key k and its values. -func DeleteKey(k Key, path string) error { - return regDeleteKey(syscall.Handle(k), syscall.StringToUTF16Ptr(path)) -} - -// A KeyInfo describes the statistics of a key. It is returned by Stat. -type KeyInfo struct { - SubKeyCount uint32 - MaxSubKeyLen uint32 // size of the key's subkey with the longest name, in Unicode characters, not including the terminating zero byte - ValueCount uint32 - MaxValueNameLen uint32 // size of the key's longest value name, in Unicode characters, not including the terminating zero byte - MaxValueLen uint32 // longest data component among the key's values, in bytes - lastWriteTime syscall.Filetime -} - -// ModTime returns the key's last write time. -func (ki *KeyInfo) ModTime() time.Time { - return time.Unix(0, ki.lastWriteTime.Nanoseconds()) -} - -// Stat retrieves information about the open key k. -func (k Key) Stat() (*KeyInfo, error) { - var ki KeyInfo - err := syscall.RegQueryInfoKey(syscall.Handle(k), nil, nil, nil, - &ki.SubKeyCount, &ki.MaxSubKeyLen, nil, &ki.ValueCount, - &ki.MaxValueNameLen, &ki.MaxValueLen, nil, &ki.lastWriteTime) - if err != nil { - return nil, err - } - return &ki, nil -} diff --git a/vendor/golang.org/x/sys/windows/registry/registry_test.go b/vendor/golang.org/x/sys/windows/registry/registry_test.go deleted file mode 100644 index 9c1b7820e..000000000 --- a/vendor/golang.org/x/sys/windows/registry/registry_test.go +++ /dev/null @@ -1,756 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package registry_test - -import ( - "bytes" - "crypto/rand" - "os" - "syscall" - "testing" - "time" - "unsafe" - - "golang.org/x/sys/windows/registry" -) - -func randKeyName(prefix string) string { - const numbers = "0123456789" - buf := make([]byte, 10) - rand.Read(buf) - for i, b := range buf { - buf[i] = numbers[b%byte(len(numbers))] - } - return prefix + string(buf) -} - -func TestReadSubKeyNames(t *testing.T) { - k, err := registry.OpenKey(registry.CLASSES_ROOT, "TypeLib", registry.ENUMERATE_SUB_KEYS|registry.QUERY_VALUE) - if err != nil { - t.Fatal(err) - } - defer k.Close() - - names, err := k.ReadSubKeyNames(-1) - if err != nil { - t.Fatal(err) - } - var foundStdOle bool - for _, name := range names { - // Every PC has "stdole 2.0 OLE Automation" library installed. - if name == "{00020430-0000-0000-C000-000000000046}" { - foundStdOle = true - } - } - if !foundStdOle { - t.Fatal("could not find stdole 2.0 OLE Automation") - } -} - -func TestCreateOpenDeleteKey(t *testing.T) { - k, err := registry.OpenKey(registry.CURRENT_USER, "Software", registry.QUERY_VALUE) - if err != nil { - t.Fatal(err) - } - defer k.Close() - - testKName := randKeyName("TestCreateOpenDeleteKey_") - - testK, exist, err := registry.CreateKey(k, testKName, registry.CREATE_SUB_KEY) - if err != nil { - t.Fatal(err) - } - defer testK.Close() - - if exist { - t.Fatalf("key %q already exists", testKName) - } - - testKAgain, exist, err := registry.CreateKey(k, testKName, registry.CREATE_SUB_KEY) - if err != nil { - t.Fatal(err) - } - defer testKAgain.Close() - - if !exist { - t.Fatalf("key %q should already exist", testKName) - } - - testKOpened, err := registry.OpenKey(k, testKName, registry.ENUMERATE_SUB_KEYS) - if err != nil { - t.Fatal(err) - } - defer testKOpened.Close() - - err = registry.DeleteKey(k, testKName) - if err != nil { - t.Fatal(err) - } - - testKOpenedAgain, err := registry.OpenKey(k, testKName, registry.ENUMERATE_SUB_KEYS) - if err == nil { - defer testKOpenedAgain.Close() - t.Fatalf("key %q should already been deleted", testKName) - } - if err != registry.ErrNotExist { - t.Fatalf(`unexpected error ("not exist" expected): %v`, err) - } -} - -func equalStringSlice(a, b []string) bool { - if len(a) != len(b) { - return false - } - if a == nil { - return true - } - for i := range a { - if a[i] != b[i] { - return false - } - } - return true -} - -type ValueTest struct { - Type uint32 - Name string - Value interface{} - WillFail bool -} - -var ValueTests = []ValueTest{ - {Type: registry.SZ, Name: "String1", Value: ""}, - {Type: registry.SZ, Name: "String2", Value: "\000", WillFail: true}, - {Type: registry.SZ, Name: "String3", Value: "Hello World"}, - {Type: registry.SZ, Name: "String4", Value: "Hello World\000", WillFail: true}, - {Type: registry.EXPAND_SZ, Name: "ExpString1", Value: ""}, - {Type: registry.EXPAND_SZ, Name: "ExpString2", Value: "\000", WillFail: true}, - {Type: registry.EXPAND_SZ, Name: "ExpString3", Value: "Hello World"}, - {Type: registry.EXPAND_SZ, Name: "ExpString4", Value: "Hello\000World", WillFail: true}, - {Type: registry.EXPAND_SZ, Name: "ExpString5", Value: "%PATH%"}, - {Type: registry.EXPAND_SZ, Name: "ExpString6", Value: "%NO_SUCH_VARIABLE%"}, - {Type: registry.EXPAND_SZ, Name: "ExpString7", Value: "%PATH%;."}, - {Type: registry.BINARY, Name: "Binary1", Value: []byte{}}, - {Type: registry.BINARY, Name: "Binary2", Value: []byte{1, 2, 3}}, - {Type: registry.BINARY, Name: "Binary3", Value: []byte{3, 2, 1, 0, 1, 2, 3}}, - {Type: registry.DWORD, Name: "Dword1", Value: uint64(0)}, - {Type: registry.DWORD, Name: "Dword2", Value: uint64(1)}, - {Type: registry.DWORD, Name: "Dword3", Value: uint64(0xff)}, - {Type: registry.DWORD, Name: "Dword4", Value: uint64(0xffff)}, - {Type: registry.QWORD, Name: "Qword1", Value: uint64(0)}, - {Type: registry.QWORD, Name: "Qword2", Value: uint64(1)}, - {Type: registry.QWORD, Name: "Qword3", Value: uint64(0xff)}, - {Type: registry.QWORD, Name: "Qword4", Value: uint64(0xffff)}, - {Type: registry.QWORD, Name: "Qword5", Value: uint64(0xffffff)}, - {Type: registry.QWORD, Name: "Qword6", Value: uint64(0xffffffff)}, - {Type: registry.MULTI_SZ, Name: "MultiString1", Value: []string{"a", "b", "c"}}, - {Type: registry.MULTI_SZ, Name: "MultiString2", Value: []string{"abc", "", "cba"}}, - {Type: registry.MULTI_SZ, Name: "MultiString3", Value: []string{""}}, - {Type: registry.MULTI_SZ, Name: "MultiString4", Value: []string{"abcdef"}}, - {Type: registry.MULTI_SZ, Name: "MultiString5", Value: []string{"\000"}, WillFail: true}, - {Type: registry.MULTI_SZ, Name: "MultiString6", Value: []string{"a\000b"}, WillFail: true}, - {Type: registry.MULTI_SZ, Name: "MultiString7", Value: []string{"ab", "\000", "cd"}, WillFail: true}, - {Type: registry.MULTI_SZ, Name: "MultiString8", Value: []string{"\000", "cd"}, WillFail: true}, - {Type: registry.MULTI_SZ, Name: "MultiString9", Value: []string{"ab", "\000"}, WillFail: true}, -} - -func setValues(t *testing.T, k registry.Key) { - for _, test := range ValueTests { - var err error - switch test.Type { - case registry.SZ: - err = k.SetStringValue(test.Name, test.Value.(string)) - case registry.EXPAND_SZ: - err = k.SetExpandStringValue(test.Name, test.Value.(string)) - case registry.MULTI_SZ: - err = k.SetStringsValue(test.Name, test.Value.([]string)) - case registry.BINARY: - err = k.SetBinaryValue(test.Name, test.Value.([]byte)) - case registry.DWORD: - err = k.SetDWordValue(test.Name, uint32(test.Value.(uint64))) - case registry.QWORD: - err = k.SetQWordValue(test.Name, test.Value.(uint64)) - default: - t.Fatalf("unsupported type %d for %s value", test.Type, test.Name) - } - if test.WillFail { - if err == nil { - t.Fatalf("setting %s value %q should fail, but succeeded", test.Name, test.Value) - } - } else { - if err != nil { - t.Fatal(err) - } - } - } -} - -func enumerateValues(t *testing.T, k registry.Key) { - names, err := k.ReadValueNames(-1) - if err != nil { - t.Error(err) - return - } - haveNames := make(map[string]bool) - for _, n := range names { - haveNames[n] = false - } - for _, test := range ValueTests { - wantFound := !test.WillFail - _, haveFound := haveNames[test.Name] - if wantFound && !haveFound { - t.Errorf("value %s is not found while enumerating", test.Name) - } - if haveFound && !wantFound { - t.Errorf("value %s is found while enumerating, but expected to fail", test.Name) - } - if haveFound { - delete(haveNames, test.Name) - } - } - for n, v := range haveNames { - t.Errorf("value %s (%v) is found while enumerating, but has not been cretaed", n, v) - } -} - -func testErrNotExist(t *testing.T, name string, err error) { - if err == nil { - t.Errorf("%s value should not exist", name) - return - } - if err != registry.ErrNotExist { - t.Errorf("reading %s value should return 'not exist' error, but got: %s", name, err) - return - } -} - -func testErrUnexpectedType(t *testing.T, test ValueTest, gottype uint32, err error) { - if err == nil { - t.Errorf("GetXValue(%q) should not succeed", test.Name) - return - } - if err != registry.ErrUnexpectedType { - t.Errorf("reading %s value should return 'unexpected key value type' error, but got: %s", test.Name, err) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } -} - -func testGetStringValue(t *testing.T, k registry.Key, test ValueTest) { - got, gottype, err := k.GetStringValue(test.Name) - if err != nil { - t.Errorf("GetStringValue(%s) failed: %v", test.Name, err) - return - } - if got != test.Value { - t.Errorf("want %s value %q, got %q", test.Name, test.Value, got) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } - if gottype == registry.EXPAND_SZ { - _, err = registry.ExpandString(got) - if err != nil { - t.Errorf("ExpandString(%s) failed: %v", got, err) - return - } - } -} - -func testGetIntegerValue(t *testing.T, k registry.Key, test ValueTest) { - got, gottype, err := k.GetIntegerValue(test.Name) - if err != nil { - t.Errorf("GetIntegerValue(%s) failed: %v", test.Name, err) - return - } - if got != test.Value.(uint64) { - t.Errorf("want %s value %v, got %v", test.Name, test.Value, got) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } -} - -func testGetBinaryValue(t *testing.T, k registry.Key, test ValueTest) { - got, gottype, err := k.GetBinaryValue(test.Name) - if err != nil { - t.Errorf("GetBinaryValue(%s) failed: %v", test.Name, err) - return - } - if !bytes.Equal(got, test.Value.([]byte)) { - t.Errorf("want %s value %v, got %v", test.Name, test.Value, got) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } -} - -func testGetStringsValue(t *testing.T, k registry.Key, test ValueTest) { - got, gottype, err := k.GetStringsValue(test.Name) - if err != nil { - t.Errorf("GetStringsValue(%s) failed: %v", test.Name, err) - return - } - if !equalStringSlice(got, test.Value.([]string)) { - t.Errorf("want %s value %#v, got %#v", test.Name, test.Value, got) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } -} - -func testGetValue(t *testing.T, k registry.Key, test ValueTest, size int) { - if size <= 0 { - return - } - // read data with no buffer - gotsize, gottype, err := k.GetValue(test.Name, nil) - if err != nil { - t.Errorf("GetValue(%s, [%d]byte) failed: %v", test.Name, size, err) - return - } - if gotsize != size { - t.Errorf("want %s value size of %d, got %v", test.Name, size, gotsize) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } - // read data with short buffer - gotsize, gottype, err = k.GetValue(test.Name, make([]byte, size-1)) - if err == nil { - t.Errorf("GetValue(%s, [%d]byte) should fail, but suceeded", test.Name, size-1) - return - } - if err != registry.ErrShortBuffer { - t.Errorf("reading %s value should return 'short buffer' error, but got: %s", test.Name, err) - return - } - if gotsize != size { - t.Errorf("want %s value size of %d, got %v", test.Name, size, gotsize) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } - // read full data - gotsize, gottype, err = k.GetValue(test.Name, make([]byte, size)) - if err != nil { - t.Errorf("GetValue(%s, [%d]byte) failed: %v", test.Name, size, err) - return - } - if gotsize != size { - t.Errorf("want %s value size of %d, got %v", test.Name, size, gotsize) - return - } - if gottype != test.Type { - t.Errorf("want %s value type %v, got %v", test.Name, test.Type, gottype) - return - } - // check GetValue returns ErrNotExist as required - _, _, err = k.GetValue(test.Name+"_not_there", make([]byte, size)) - if err == nil { - t.Errorf("GetValue(%q) should not succeed", test.Name) - return - } - if err != registry.ErrNotExist { - t.Errorf("GetValue(%q) should return 'not exist' error, but got: %s", test.Name, err) - return - } -} - -func testValues(t *testing.T, k registry.Key) { - for _, test := range ValueTests { - switch test.Type { - case registry.SZ, registry.EXPAND_SZ: - if test.WillFail { - _, _, err := k.GetStringValue(test.Name) - testErrNotExist(t, test.Name, err) - } else { - testGetStringValue(t, k, test) - _, gottype, err := k.GetIntegerValue(test.Name) - testErrUnexpectedType(t, test, gottype, err) - // Size of utf16 string in bytes is not perfect, - // but correct for current test values. - // Size also includes terminating 0. - testGetValue(t, k, test, (len(test.Value.(string))+1)*2) - } - _, _, err := k.GetStringValue(test.Name + "_string_not_created") - testErrNotExist(t, test.Name+"_string_not_created", err) - case registry.DWORD, registry.QWORD: - testGetIntegerValue(t, k, test) - _, gottype, err := k.GetBinaryValue(test.Name) - testErrUnexpectedType(t, test, gottype, err) - _, _, err = k.GetIntegerValue(test.Name + "_int_not_created") - testErrNotExist(t, test.Name+"_int_not_created", err) - size := 8 - if test.Type == registry.DWORD { - size = 4 - } - testGetValue(t, k, test, size) - case registry.BINARY: - testGetBinaryValue(t, k, test) - _, gottype, err := k.GetStringsValue(test.Name) - testErrUnexpectedType(t, test, gottype, err) - _, _, err = k.GetBinaryValue(test.Name + "_byte_not_created") - testErrNotExist(t, test.Name+"_byte_not_created", err) - testGetValue(t, k, test, len(test.Value.([]byte))) - case registry.MULTI_SZ: - if test.WillFail { - _, _, err := k.GetStringsValue(test.Name) - testErrNotExist(t, test.Name, err) - } else { - testGetStringsValue(t, k, test) - _, gottype, err := k.GetStringValue(test.Name) - testErrUnexpectedType(t, test, gottype, err) - size := 0 - for _, s := range test.Value.([]string) { - size += len(s) + 1 // nil terminated - } - size += 1 // extra nil at the end - size *= 2 // count bytes, not uint16 - testGetValue(t, k, test, size) - } - _, _, err := k.GetStringsValue(test.Name + "_strings_not_created") - testErrNotExist(t, test.Name+"_strings_not_created", err) - default: - t.Errorf("unsupported type %d for %s value", test.Type, test.Name) - continue - } - } -} - -func testStat(t *testing.T, k registry.Key) { - subk, _, err := registry.CreateKey(k, "subkey", registry.CREATE_SUB_KEY) - if err != nil { - t.Error(err) - return - } - defer subk.Close() - - defer registry.DeleteKey(k, "subkey") - - ki, err := k.Stat() - if err != nil { - t.Error(err) - return - } - if ki.SubKeyCount != 1 { - t.Error("key must have 1 subkey") - } - if ki.MaxSubKeyLen != 6 { - t.Error("key max subkey name length must be 6") - } - if ki.ValueCount != 24 { - t.Errorf("key must have 24 values, but is %d", ki.ValueCount) - } - if ki.MaxValueNameLen != 12 { - t.Errorf("key max value name length must be 10, but is %d", ki.MaxValueNameLen) - } - if ki.MaxValueLen != 38 { - t.Errorf("key max value length must be 38, but is %d", ki.MaxValueLen) - } - if mt, ct := ki.ModTime(), time.Now(); ct.Sub(mt) > 100*time.Millisecond { - t.Errorf("key mod time is not close to current time: mtime=%v current=%v delta=%v", mt, ct, ct.Sub(mt)) - } -} - -func deleteValues(t *testing.T, k registry.Key) { - for _, test := range ValueTests { - if test.WillFail { - continue - } - err := k.DeleteValue(test.Name) - if err != nil { - t.Error(err) - continue - } - } - names, err := k.ReadValueNames(-1) - if err != nil { - t.Error(err) - return - } - if len(names) != 0 { - t.Errorf("some values remain after deletion: %v", names) - } -} - -func TestValues(t *testing.T) { - softwareK, err := registry.OpenKey(registry.CURRENT_USER, "Software", registry.QUERY_VALUE) - if err != nil { - t.Fatal(err) - } - defer softwareK.Close() - - testKName := randKeyName("TestValues_") - - k, exist, err := registry.CreateKey(softwareK, testKName, registry.CREATE_SUB_KEY|registry.QUERY_VALUE|registry.SET_VALUE) - if err != nil { - t.Fatal(err) - } - defer k.Close() - - if exist { - t.Fatalf("key %q already exists", testKName) - } - - defer registry.DeleteKey(softwareK, testKName) - - setValues(t, k) - - enumerateValues(t, k) - - testValues(t, k) - - testStat(t, k) - - deleteValues(t, k) -} - -func walkKey(t *testing.T, k registry.Key, kname string) { - names, err := k.ReadValueNames(-1) - if err != nil { - t.Fatalf("reading value names of %s failed: %v", kname, err) - } - for _, name := range names { - _, valtype, err := k.GetValue(name, nil) - if err != nil { - t.Fatalf("reading value type of %s of %s failed: %v", name, kname, err) - } - switch valtype { - case registry.NONE: - case registry.SZ: - _, _, err := k.GetStringValue(name) - if err != nil { - t.Error(err) - } - case registry.EXPAND_SZ: - s, _, err := k.GetStringValue(name) - if err != nil { - t.Error(err) - } - _, err = registry.ExpandString(s) - if err != nil { - t.Error(err) - } - case registry.DWORD, registry.QWORD: - _, _, err := k.GetIntegerValue(name) - if err != nil { - t.Error(err) - } - case registry.BINARY: - _, _, err := k.GetBinaryValue(name) - if err != nil { - t.Error(err) - } - case registry.MULTI_SZ: - _, _, err := k.GetStringsValue(name) - if err != nil { - t.Error(err) - } - case registry.FULL_RESOURCE_DESCRIPTOR, registry.RESOURCE_LIST, registry.RESOURCE_REQUIREMENTS_LIST: - // TODO: not implemented - default: - t.Fatalf("value type %d of %s of %s failed: %v", valtype, name, kname, err) - } - } - - names, err = k.ReadSubKeyNames(-1) - if err != nil { - t.Fatalf("reading sub-keys of %s failed: %v", kname, err) - } - for _, name := range names { - func() { - subk, err := registry.OpenKey(k, name, registry.ENUMERATE_SUB_KEYS|registry.QUERY_VALUE) - if err != nil { - if err == syscall.ERROR_ACCESS_DENIED { - // ignore error, if we are not allowed to access this key - return - } - t.Fatalf("opening sub-keys %s of %s failed: %v", name, kname, err) - } - defer subk.Close() - - walkKey(t, subk, kname+`\`+name) - }() - } -} - -func TestWalkFullRegistry(t *testing.T) { - if testing.Short() { - t.Skip("skipping long running test in short mode") - } - walkKey(t, registry.CLASSES_ROOT, "CLASSES_ROOT") - walkKey(t, registry.CURRENT_USER, "CURRENT_USER") - walkKey(t, registry.LOCAL_MACHINE, "LOCAL_MACHINE") - walkKey(t, registry.USERS, "USERS") - walkKey(t, registry.CURRENT_CONFIG, "CURRENT_CONFIG") -} - -func TestExpandString(t *testing.T) { - got, err := registry.ExpandString("%PATH%") - if err != nil { - t.Fatal(err) - } - want := os.Getenv("PATH") - if got != want { - t.Errorf("want %q string expanded, got %q", want, got) - } -} - -func TestInvalidValues(t *testing.T) { - softwareK, err := registry.OpenKey(registry.CURRENT_USER, "Software", registry.QUERY_VALUE) - if err != nil { - t.Fatal(err) - } - defer softwareK.Close() - - testKName := randKeyName("TestInvalidValues_") - - k, exist, err := registry.CreateKey(softwareK, testKName, registry.CREATE_SUB_KEY|registry.QUERY_VALUE|registry.SET_VALUE) - if err != nil { - t.Fatal(err) - } - defer k.Close() - - if exist { - t.Fatalf("key %q already exists", testKName) - } - - defer registry.DeleteKey(softwareK, testKName) - - var tests = []struct { - Type uint32 - Name string - Data []byte - }{ - {registry.DWORD, "Dword1", nil}, - {registry.DWORD, "Dword2", []byte{1, 2, 3}}, - {registry.QWORD, "Qword1", nil}, - {registry.QWORD, "Qword2", []byte{1, 2, 3}}, - {registry.QWORD, "Qword3", []byte{1, 2, 3, 4, 5, 6, 7}}, - {registry.MULTI_SZ, "MultiString1", nil}, - {registry.MULTI_SZ, "MultiString2", []byte{0}}, - {registry.MULTI_SZ, "MultiString3", []byte{'a', 'b', 0}}, - {registry.MULTI_SZ, "MultiString4", []byte{'a', 0, 0, 'b', 0}}, - {registry.MULTI_SZ, "MultiString5", []byte{'a', 0, 0}}, - } - - for _, test := range tests { - err := k.SetValue(test.Name, test.Type, test.Data) - if err != nil { - t.Fatalf("SetValue for %q failed: %v", test.Name, err) - } - } - - for _, test := range tests { - switch test.Type { - case registry.DWORD, registry.QWORD: - value, valType, err := k.GetIntegerValue(test.Name) - if err == nil { - t.Errorf("GetIntegerValue(%q) succeeded. Returns type=%d value=%v", test.Name, valType, value) - } - case registry.MULTI_SZ: - value, valType, err := k.GetStringsValue(test.Name) - if err == nil { - if len(value) != 0 { - t.Errorf("GetStringsValue(%q) succeeded. Returns type=%d value=%v", test.Name, valType, value) - } - } - default: - t.Errorf("unsupported type %d for %s value", test.Type, test.Name) - } - } -} - -func TestGetMUIStringValue(t *testing.T) { - if err := registry.LoadRegLoadMUIString(); err != nil { - t.Skip("regLoadMUIString not supported; skipping") - } - if err := procGetDynamicTimeZoneInformation.Find(); err != nil { - t.Skipf("%s not supported; skipping", procGetDynamicTimeZoneInformation.Name) - } - var dtzi DynamicTimezoneinformation - if _, err := GetDynamicTimeZoneInformation(&dtzi); err != nil { - t.Fatal(err) - } - tzKeyName := syscall.UTF16ToString(dtzi.TimeZoneKeyName[:]) - timezoneK, err := registry.OpenKey(registry.LOCAL_MACHINE, - `SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\`+tzKeyName, registry.READ) - if err != nil { - t.Fatal(err) - } - defer timezoneK.Close() - - type testType struct { - name string - want string - } - var tests = []testType{ - {"MUI_Std", syscall.UTF16ToString(dtzi.StandardName[:])}, - } - if dtzi.DynamicDaylightTimeDisabled == 0 { - tests = append(tests, testType{"MUI_Dlt", syscall.UTF16ToString(dtzi.DaylightName[:])}) - } - - for _, test := range tests { - got, err := timezoneK.GetMUIStringValue(test.name) - if err != nil { - t.Error("GetMUIStringValue:", err) - } - - if got != test.want { - t.Errorf("GetMUIStringValue: %s: Got %q, want %q", test.name, got, test.want) - } - } -} - -type DynamicTimezoneinformation struct { - Bias int32 - StandardName [32]uint16 - StandardDate syscall.Systemtime - StandardBias int32 - DaylightName [32]uint16 - DaylightDate syscall.Systemtime - DaylightBias int32 - TimeZoneKeyName [128]uint16 - DynamicDaylightTimeDisabled uint8 -} - -var ( - kernel32DLL = syscall.NewLazyDLL("kernel32") - - procGetDynamicTimeZoneInformation = kernel32DLL.NewProc("GetDynamicTimeZoneInformation") -) - -func GetDynamicTimeZoneInformation(dtzi *DynamicTimezoneinformation) (rc uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetDynamicTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(dtzi)), 0, 0) - rc = uint32(r0) - if rc == 0xffffffff { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} diff --git a/vendor/golang.org/x/sys/windows/registry/syscall.go b/vendor/golang.org/x/sys/windows/registry/syscall.go deleted file mode 100644 index 5426cae90..000000000 --- a/vendor/golang.org/x/sys/windows/registry/syscall.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package registry - -import "syscall" - -//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall.go - -const ( - _REG_OPTION_NON_VOLATILE = 0 - - _REG_CREATED_NEW_KEY = 1 - _REG_OPENED_EXISTING_KEY = 2 - - _ERROR_NO_MORE_ITEMS syscall.Errno = 259 -) - -func LoadRegLoadMUIString() error { - return procRegLoadMUIStringW.Find() -} - -//sys regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) = advapi32.RegCreateKeyExW -//sys regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) = advapi32.RegDeleteKeyW -//sys regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) = advapi32.RegSetValueExW -//sys regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegEnumValueW -//sys regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) = advapi32.RegDeleteValueW -//sys regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) = advapi32.RegLoadMUIStringW - -//sys expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) = kernel32.ExpandEnvironmentStringsW diff --git a/vendor/golang.org/x/sys/windows/registry/value.go b/vendor/golang.org/x/sys/windows/registry/value.go deleted file mode 100644 index 71d4e15ba..000000000 --- a/vendor/golang.org/x/sys/windows/registry/value.go +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package registry - -import ( - "errors" - "io" - "syscall" - "unicode/utf16" - "unsafe" -) - -const ( - // Registry value types. - NONE = 0 - SZ = 1 - EXPAND_SZ = 2 - BINARY = 3 - DWORD = 4 - DWORD_BIG_ENDIAN = 5 - LINK = 6 - MULTI_SZ = 7 - RESOURCE_LIST = 8 - FULL_RESOURCE_DESCRIPTOR = 9 - RESOURCE_REQUIREMENTS_LIST = 10 - QWORD = 11 -) - -var ( - // ErrShortBuffer is returned when the buffer was too short for the operation. - ErrShortBuffer = syscall.ERROR_MORE_DATA - - // ErrNotExist is returned when a registry key or value does not exist. - ErrNotExist = syscall.ERROR_FILE_NOT_FOUND - - // ErrUnexpectedType is returned by Get*Value when the value's type was unexpected. - ErrUnexpectedType = errors.New("unexpected key value type") -) - -// GetValue retrieves the type and data for the specified value associated -// with an open key k. It fills up buffer buf and returns the retrieved -// byte count n. If buf is too small to fit the stored value it returns -// ErrShortBuffer error along with the required buffer size n. -// If no buffer is provided, it returns true and actual buffer size n. -// If no buffer is provided, GetValue returns the value's type only. -// If the value does not exist, the error returned is ErrNotExist. -// -// GetValue is a low level function. If value's type is known, use the appropriate -// Get*Value function instead. -func (k Key) GetValue(name string, buf []byte) (n int, valtype uint32, err error) { - pname, err := syscall.UTF16PtrFromString(name) - if err != nil { - return 0, 0, err - } - var pbuf *byte - if len(buf) > 0 { - pbuf = (*byte)(unsafe.Pointer(&buf[0])) - } - l := uint32(len(buf)) - err = syscall.RegQueryValueEx(syscall.Handle(k), pname, nil, &valtype, pbuf, &l) - if err != nil { - return int(l), valtype, err - } - return int(l), valtype, nil -} - -func (k Key) getValue(name string, buf []byte) (date []byte, valtype uint32, err error) { - p, err := syscall.UTF16PtrFromString(name) - if err != nil { - return nil, 0, err - } - var t uint32 - n := uint32(len(buf)) - for { - err = syscall.RegQueryValueEx(syscall.Handle(k), p, nil, &t, (*byte)(unsafe.Pointer(&buf[0])), &n) - if err == nil { - return buf[:n], t, nil - } - if err != syscall.ERROR_MORE_DATA { - return nil, 0, err - } - if n <= uint32(len(buf)) { - return nil, 0, err - } - buf = make([]byte, n) - } -} - -// GetStringValue retrieves the string value for the specified -// value name associated with an open key k. It also returns the value's type. -// If value does not exist, GetStringValue returns ErrNotExist. -// If value is not SZ or EXPAND_SZ, it will return the correct value -// type and ErrUnexpectedType. -func (k Key) GetStringValue(name string) (val string, valtype uint32, err error) { - data, typ, err2 := k.getValue(name, make([]byte, 64)) - if err2 != nil { - return "", typ, err2 - } - switch typ { - case SZ, EXPAND_SZ: - default: - return "", typ, ErrUnexpectedType - } - if len(data) == 0 { - return "", typ, nil - } - u := (*[1 << 29]uint16)(unsafe.Pointer(&data[0]))[:] - return syscall.UTF16ToString(u), typ, nil -} - -// GetMUIStringValue retrieves the localized string value for -// the specified value name associated with an open key k. -// If the value name doesn't exist or the localized string value -// can't be resolved, GetMUIStringValue returns ErrNotExist. -// GetMUIStringValue panics if the system doesn't support -// regLoadMUIString; use LoadRegLoadMUIString to check if -// regLoadMUIString is supported before calling this function. -func (k Key) GetMUIStringValue(name string) (string, error) { - pname, err := syscall.UTF16PtrFromString(name) - if err != nil { - return "", err - } - - buf := make([]uint16, 1024) - var buflen uint32 - var pdir *uint16 - - err = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir) - if err == syscall.ERROR_FILE_NOT_FOUND { // Try fallback path - - // Try to resolve the string value using the system directory as - // a DLL search path; this assumes the string value is of the form - // @[path]\dllname,-strID but with no path given, e.g. @tzres.dll,-320. - - // This approach works with tzres.dll but may have to be revised - // in the future to allow callers to provide custom search paths. - - var s string - s, err = ExpandString("%SystemRoot%\\system32\\") - if err != nil { - return "", err - } - pdir, err = syscall.UTF16PtrFromString(s) - if err != nil { - return "", err - } - - err = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir) - } - - for err == syscall.ERROR_MORE_DATA { // Grow buffer if needed - if buflen <= uint32(len(buf)) { - break // Buffer not growing, assume race; break - } - buf = make([]uint16, buflen) - err = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir) - } - - if err != nil { - return "", err - } - - return syscall.UTF16ToString(buf), nil -} - -// ExpandString expands environment-variable strings and replaces -// them with the values defined for the current user. -// Use ExpandString to expand EXPAND_SZ strings. -func ExpandString(value string) (string, error) { - if value == "" { - return "", nil - } - p, err := syscall.UTF16PtrFromString(value) - if err != nil { - return "", err - } - r := make([]uint16, 100) - for { - n, err := expandEnvironmentStrings(p, &r[0], uint32(len(r))) - if err != nil { - return "", err - } - if n <= uint32(len(r)) { - u := (*[1 << 29]uint16)(unsafe.Pointer(&r[0]))[:] - return syscall.UTF16ToString(u), nil - } - r = make([]uint16, n) - } -} - -// GetStringsValue retrieves the []string value for the specified -// value name associated with an open key k. It also returns the value's type. -// If value does not exist, GetStringsValue returns ErrNotExist. -// If value is not MULTI_SZ, it will return the correct value -// type and ErrUnexpectedType. -func (k Key) GetStringsValue(name string) (val []string, valtype uint32, err error) { - data, typ, err2 := k.getValue(name, make([]byte, 64)) - if err2 != nil { - return nil, typ, err2 - } - if typ != MULTI_SZ { - return nil, typ, ErrUnexpectedType - } - if len(data) == 0 { - return nil, typ, nil - } - p := (*[1 << 29]uint16)(unsafe.Pointer(&data[0]))[:len(data)/2] - if len(p) == 0 { - return nil, typ, nil - } - if p[len(p)-1] == 0 { - p = p[:len(p)-1] // remove terminating null - } - val = make([]string, 0, 5) - from := 0 - for i, c := range p { - if c == 0 { - val = append(val, string(utf16.Decode(p[from:i]))) - from = i + 1 - } - } - return val, typ, nil -} - -// GetIntegerValue retrieves the integer value for the specified -// value name associated with an open key k. It also returns the value's type. -// If value does not exist, GetIntegerValue returns ErrNotExist. -// If value is not DWORD or QWORD, it will return the correct value -// type and ErrUnexpectedType. -func (k Key) GetIntegerValue(name string) (val uint64, valtype uint32, err error) { - data, typ, err2 := k.getValue(name, make([]byte, 8)) - if err2 != nil { - return 0, typ, err2 - } - switch typ { - case DWORD: - if len(data) != 4 { - return 0, typ, errors.New("DWORD value is not 4 bytes long") - } - return uint64(*(*uint32)(unsafe.Pointer(&data[0]))), DWORD, nil - case QWORD: - if len(data) != 8 { - return 0, typ, errors.New("QWORD value is not 8 bytes long") - } - return uint64(*(*uint64)(unsafe.Pointer(&data[0]))), QWORD, nil - default: - return 0, typ, ErrUnexpectedType - } -} - -// GetBinaryValue retrieves the binary value for the specified -// value name associated with an open key k. It also returns the value's type. -// If value does not exist, GetBinaryValue returns ErrNotExist. -// If value is not BINARY, it will return the correct value -// type and ErrUnexpectedType. -func (k Key) GetBinaryValue(name string) (val []byte, valtype uint32, err error) { - data, typ, err2 := k.getValue(name, make([]byte, 64)) - if err2 != nil { - return nil, typ, err2 - } - if typ != BINARY { - return nil, typ, ErrUnexpectedType - } - return data, typ, nil -} - -func (k Key) setValue(name string, valtype uint32, data []byte) error { - p, err := syscall.UTF16PtrFromString(name) - if err != nil { - return err - } - if len(data) == 0 { - return regSetValueEx(syscall.Handle(k), p, 0, valtype, nil, 0) - } - return regSetValueEx(syscall.Handle(k), p, 0, valtype, &data[0], uint32(len(data))) -} - -// SetDWordValue sets the data and type of a name value -// under key k to value and DWORD. -func (k Key) SetDWordValue(name string, value uint32) error { - return k.setValue(name, DWORD, (*[4]byte)(unsafe.Pointer(&value))[:]) -} - -// SetQWordValue sets the data and type of a name value -// under key k to value and QWORD. -func (k Key) SetQWordValue(name string, value uint64) error { - return k.setValue(name, QWORD, (*[8]byte)(unsafe.Pointer(&value))[:]) -} - -func (k Key) setStringValue(name string, valtype uint32, value string) error { - v, err := syscall.UTF16FromString(value) - if err != nil { - return err - } - buf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[:len(v)*2] - return k.setValue(name, valtype, buf) -} - -// SetStringValue sets the data and type of a name value -// under key k to value and SZ. The value must not contain a zero byte. -func (k Key) SetStringValue(name, value string) error { - return k.setStringValue(name, SZ, value) -} - -// SetExpandStringValue sets the data and type of a name value -// under key k to value and EXPAND_SZ. The value must not contain a zero byte. -func (k Key) SetExpandStringValue(name, value string) error { - return k.setStringValue(name, EXPAND_SZ, value) -} - -// SetStringsValue sets the data and type of a name value -// under key k to value and MULTI_SZ. The value strings -// must not contain a zero byte. -func (k Key) SetStringsValue(name string, value []string) error { - ss := "" - for _, s := range value { - for i := 0; i < len(s); i++ { - if s[i] == 0 { - return errors.New("string cannot have 0 inside") - } - } - ss += s + "\x00" - } - v := utf16.Encode([]rune(ss + "\x00")) - buf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[:len(v)*2] - return k.setValue(name, MULTI_SZ, buf) -} - -// SetBinaryValue sets the data and type of a name value -// under key k to value and BINARY. -func (k Key) SetBinaryValue(name string, value []byte) error { - return k.setValue(name, BINARY, value) -} - -// DeleteValue removes a named value from the key k. -func (k Key) DeleteValue(name string) error { - return regDeleteValue(syscall.Handle(k), syscall.StringToUTF16Ptr(name)) -} - -// ReadValueNames returns the value names of key k. -// The parameter n controls the number of returned names, -// analogous to the way os.File.Readdirnames works. -func (k Key) ReadValueNames(n int) ([]string, error) { - ki, err := k.Stat() - if err != nil { - return nil, err - } - names := make([]string, 0, ki.ValueCount) - buf := make([]uint16, ki.MaxValueNameLen+1) // extra room for terminating null character -loopItems: - for i := uint32(0); ; i++ { - if n > 0 { - if len(names) == n { - return names, nil - } - } - l := uint32(len(buf)) - for { - err := regEnumValue(syscall.Handle(k), i, &buf[0], &l, nil, nil, nil, nil) - if err == nil { - break - } - if err == syscall.ERROR_MORE_DATA { - // Double buffer size and try again. - l = uint32(2 * len(buf)) - buf = make([]uint16, l) - continue - } - if err == _ERROR_NO_MORE_ITEMS { - break loopItems - } - return names, err - } - names = append(names, syscall.UTF16ToString(buf[:l])) - } - if n > len(names) { - return names, io.EOF - } - return names, nil -} diff --git a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go deleted file mode 100644 index 9c17675a2..000000000 --- a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go +++ /dev/null @@ -1,82 +0,0 @@ -// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT - -package registry - -import "unsafe" -import "syscall" - -var _ unsafe.Pointer - -var ( - modadvapi32 = syscall.NewLazyDLL("advapi32.dll") - modkernel32 = syscall.NewLazyDLL("kernel32.dll") - - procRegCreateKeyExW = modadvapi32.NewProc("RegCreateKeyExW") - procRegDeleteKeyW = modadvapi32.NewProc("RegDeleteKeyW") - procRegSetValueExW = modadvapi32.NewProc("RegSetValueExW") - procRegEnumValueW = modadvapi32.NewProc("RegEnumValueW") - procRegDeleteValueW = modadvapi32.NewProc("RegDeleteValueW") - procRegLoadMUIStringW = modadvapi32.NewProc("RegLoadMUIStringW") - procExpandEnvironmentStringsW = modkernel32.NewProc("ExpandEnvironmentStringsW") -) - -func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) { - r0, _, _ := syscall.Syscall9(procRegCreateKeyExW.Addr(), 9, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition))) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) { - r0, _, _ := syscall.Syscall(procRegDeleteKeyW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(subkey)), 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegSetValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize)) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { - r0, _, _ := syscall.Syscall9(procRegEnumValueW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)), 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) { - r0, _, _ := syscall.Syscall(procRegDeleteValueW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(name)), 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) { - r0, _, _ := syscall.Syscall9(procRegLoadMUIStringW.Addr(), 7, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)), 0, 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go deleted file mode 100644 index ca09bdd70..000000000 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ /dev/null @@ -1,435 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows - -import ( - "syscall" - "unsafe" -) - -const ( - STANDARD_RIGHTS_REQUIRED = 0xf0000 - STANDARD_RIGHTS_READ = 0x20000 - STANDARD_RIGHTS_WRITE = 0x20000 - STANDARD_RIGHTS_EXECUTE = 0x20000 - STANDARD_RIGHTS_ALL = 0x1F0000 -) - -const ( - NameUnknown = 0 - NameFullyQualifiedDN = 1 - NameSamCompatible = 2 - NameDisplay = 3 - NameUniqueId = 6 - NameCanonical = 7 - NameUserPrincipal = 8 - NameCanonicalEx = 9 - NameServicePrincipal = 10 - NameDnsDomain = 12 -) - -// This function returns 1 byte BOOLEAN rather than the 4 byte BOOL. -// http://blogs.msdn.com/b/drnick/archive/2007/12/19/windows-and-upn-format-credentials.aspx -//sys TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.TranslateNameW -//sys GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.GetUserNameExW - -// TranslateAccountName converts a directory service -// object name from one format to another. -func TranslateAccountName(username string, from, to uint32, initSize int) (string, error) { - u, e := UTF16PtrFromString(username) - if e != nil { - return "", e - } - n := uint32(50) - for { - b := make([]uint16, n) - e = TranslateName(u, from, to, &b[0], &n) - if e == nil { - return UTF16ToString(b[:n]), nil - } - if e != ERROR_INSUFFICIENT_BUFFER { - return "", e - } - if n <= uint32(len(b)) { - return "", e - } - } -} - -const ( - // do not reorder - NetSetupUnknownStatus = iota - NetSetupUnjoined - NetSetupWorkgroupName - NetSetupDomainName -) - -type UserInfo10 struct { - Name *uint16 - Comment *uint16 - UsrComment *uint16 - FullName *uint16 -} - -//sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo -//sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation -//sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree - -const ( - // do not reorder - SidTypeUser = 1 + iota - SidTypeGroup - SidTypeDomain - SidTypeAlias - SidTypeWellKnownGroup - SidTypeDeletedAccount - SidTypeInvalid - SidTypeUnknown - SidTypeComputer - SidTypeLabel -) - -type SidIdentifierAuthority struct { - Value [6]byte -} - -var ( - SECURITY_NULL_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 0}} - SECURITY_WORLD_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 1}} - SECURITY_LOCAL_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 2}} - SECURITY_CREATOR_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 3}} - SECURITY_NON_UNIQUE_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 4}} - SECURITY_NT_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 5}} - SECURITY_MANDATORY_LABEL_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 16}} -) - -const ( - SECURITY_NULL_RID = 0 - SECURITY_WORLD_RID = 0 - SECURITY_LOCAL_RID = 0 - SECURITY_CREATOR_OWNER_RID = 0 - SECURITY_CREATOR_GROUP_RID = 1 - SECURITY_DIALUP_RID = 1 - SECURITY_NETWORK_RID = 2 - SECURITY_BATCH_RID = 3 - SECURITY_INTERACTIVE_RID = 4 - SECURITY_LOGON_IDS_RID = 5 - SECURITY_SERVICE_RID = 6 - SECURITY_LOCAL_SYSTEM_RID = 18 - SECURITY_BUILTIN_DOMAIN_RID = 32 - SECURITY_PRINCIPAL_SELF_RID = 10 - SECURITY_CREATOR_OWNER_SERVER_RID = 0x2 - SECURITY_CREATOR_GROUP_SERVER_RID = 0x3 - SECURITY_LOGON_IDS_RID_COUNT = 0x3 - SECURITY_ANONYMOUS_LOGON_RID = 0x7 - SECURITY_PROXY_RID = 0x8 - SECURITY_ENTERPRISE_CONTROLLERS_RID = 0x9 - SECURITY_SERVER_LOGON_RID = SECURITY_ENTERPRISE_CONTROLLERS_RID - SECURITY_AUTHENTICATED_USER_RID = 0xb - SECURITY_RESTRICTED_CODE_RID = 0xc - SECURITY_NT_NON_UNIQUE_RID = 0x15 -) - -//sys LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountSidW -//sys LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountNameW -//sys ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) = advapi32.ConvertSidToStringSidW -//sys ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) = advapi32.ConvertStringSidToSidW -//sys GetLengthSid(sid *SID) (len uint32) = advapi32.GetLengthSid -//sys CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) = advapi32.CopySid -//sys AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) = advapi32.AllocateAndInitializeSid -//sys FreeSid(sid *SID) (err error) [failretval!=0] = advapi32.FreeSid -//sys EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) = advapi32.EqualSid - -// The security identifier (SID) structure is a variable-length -// structure used to uniquely identify users or groups. -type SID struct{} - -// StringToSid converts a string-format security identifier -// sid into a valid, functional sid. -func StringToSid(s string) (*SID, error) { - var sid *SID - p, e := UTF16PtrFromString(s) - if e != nil { - return nil, e - } - e = ConvertStringSidToSid(p, &sid) - if e != nil { - return nil, e - } - defer LocalFree((Handle)(unsafe.Pointer(sid))) - return sid.Copy() -} - -// LookupSID retrieves a security identifier sid for the account -// and the name of the domain on which the account was found. -// System specify target computer to search. -func LookupSID(system, account string) (sid *SID, domain string, accType uint32, err error) { - if len(account) == 0 { - return nil, "", 0, syscall.EINVAL - } - acc, e := UTF16PtrFromString(account) - if e != nil { - return nil, "", 0, e - } - var sys *uint16 - if len(system) > 0 { - sys, e = UTF16PtrFromString(system) - if e != nil { - return nil, "", 0, e - } - } - n := uint32(50) - dn := uint32(50) - for { - b := make([]byte, n) - db := make([]uint16, dn) - sid = (*SID)(unsafe.Pointer(&b[0])) - e = LookupAccountName(sys, acc, sid, &n, &db[0], &dn, &accType) - if e == nil { - return sid, UTF16ToString(db), accType, nil - } - if e != ERROR_INSUFFICIENT_BUFFER { - return nil, "", 0, e - } - if n <= uint32(len(b)) { - return nil, "", 0, e - } - } -} - -// String converts sid to a string format -// suitable for display, storage, or transmission. -func (sid *SID) String() (string, error) { - var s *uint16 - e := ConvertSidToStringSid(sid, &s) - if e != nil { - return "", e - } - defer LocalFree((Handle)(unsafe.Pointer(s))) - return UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:]), nil -} - -// Len returns the length, in bytes, of a valid security identifier sid. -func (sid *SID) Len() int { - return int(GetLengthSid(sid)) -} - -// Copy creates a duplicate of security identifier sid. -func (sid *SID) Copy() (*SID, error) { - b := make([]byte, sid.Len()) - sid2 := (*SID)(unsafe.Pointer(&b[0])) - e := CopySid(uint32(len(b)), sid2, sid) - if e != nil { - return nil, e - } - return sid2, nil -} - -// LookupAccount retrieves the name of the account for this sid -// and the name of the first domain on which this sid is found. -// System specify target computer to search for. -func (sid *SID) LookupAccount(system string) (account, domain string, accType uint32, err error) { - var sys *uint16 - if len(system) > 0 { - sys, err = UTF16PtrFromString(system) - if err != nil { - return "", "", 0, err - } - } - n := uint32(50) - dn := uint32(50) - for { - b := make([]uint16, n) - db := make([]uint16, dn) - e := LookupAccountSid(sys, sid, &b[0], &n, &db[0], &dn, &accType) - if e == nil { - return UTF16ToString(b), UTF16ToString(db), accType, nil - } - if e != ERROR_INSUFFICIENT_BUFFER { - return "", "", 0, e - } - if n <= uint32(len(b)) { - return "", "", 0, e - } - } -} - -const ( - // do not reorder - TOKEN_ASSIGN_PRIMARY = 1 << iota - TOKEN_DUPLICATE - TOKEN_IMPERSONATE - TOKEN_QUERY - TOKEN_QUERY_SOURCE - TOKEN_ADJUST_PRIVILEGES - TOKEN_ADJUST_GROUPS - TOKEN_ADJUST_DEFAULT - - TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | - TOKEN_ASSIGN_PRIMARY | - TOKEN_DUPLICATE | - TOKEN_IMPERSONATE | - TOKEN_QUERY | - TOKEN_QUERY_SOURCE | - TOKEN_ADJUST_PRIVILEGES | - TOKEN_ADJUST_GROUPS | - TOKEN_ADJUST_DEFAULT - TOKEN_READ = STANDARD_RIGHTS_READ | TOKEN_QUERY - TOKEN_WRITE = STANDARD_RIGHTS_WRITE | - TOKEN_ADJUST_PRIVILEGES | - TOKEN_ADJUST_GROUPS | - TOKEN_ADJUST_DEFAULT - TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE -) - -const ( - // do not reorder - TokenUser = 1 + iota - TokenGroups - TokenPrivileges - TokenOwner - TokenPrimaryGroup - TokenDefaultDacl - TokenSource - TokenType - TokenImpersonationLevel - TokenStatistics - TokenRestrictedSids - TokenSessionId - TokenGroupsAndPrivileges - TokenSessionReference - TokenSandBoxInert - TokenAuditPolicy - TokenOrigin - TokenElevationType - TokenLinkedToken - TokenElevation - TokenHasRestrictions - TokenAccessInformation - TokenVirtualizationAllowed - TokenVirtualizationEnabled - TokenIntegrityLevel - TokenUIAccess - TokenMandatoryPolicy - TokenLogonSid - MaxTokenInfoClass -) - -type SIDAndAttributes struct { - Sid *SID - Attributes uint32 -} - -type Tokenuser struct { - User SIDAndAttributes -} - -type Tokenprimarygroup struct { - PrimaryGroup *SID -} - -type Tokengroups struct { - GroupCount uint32 - Groups [1]SIDAndAttributes -} - -//sys OpenProcessToken(h Handle, access uint32, token *Token) (err error) = advapi32.OpenProcessToken -//sys GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) = advapi32.GetTokenInformation -//sys GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) = userenv.GetUserProfileDirectoryW - -// An access token contains the security information for a logon session. -// The system creates an access token when a user logs on, and every -// process executed on behalf of the user has a copy of the token. -// The token identifies the user, the user's groups, and the user's -// privileges. The system uses the token to control access to securable -// objects and to control the ability of the user to perform various -// system-related operations on the local computer. -type Token Handle - -// OpenCurrentProcessToken opens the access token -// associated with current process. -func OpenCurrentProcessToken() (Token, error) { - p, e := GetCurrentProcess() - if e != nil { - return 0, e - } - var t Token - e = OpenProcessToken(p, TOKEN_QUERY, &t) - if e != nil { - return 0, e - } - return t, nil -} - -// Close releases access to access token. -func (t Token) Close() error { - return CloseHandle(Handle(t)) -} - -// getInfo retrieves a specified type of information about an access token. -func (t Token) getInfo(class uint32, initSize int) (unsafe.Pointer, error) { - n := uint32(initSize) - for { - b := make([]byte, n) - e := GetTokenInformation(t, class, &b[0], uint32(len(b)), &n) - if e == nil { - return unsafe.Pointer(&b[0]), nil - } - if e != ERROR_INSUFFICIENT_BUFFER { - return nil, e - } - if n <= uint32(len(b)) { - return nil, e - } - } -} - -// GetTokenUser retrieves access token t user account information. -func (t Token) GetTokenUser() (*Tokenuser, error) { - i, e := t.getInfo(TokenUser, 50) - if e != nil { - return nil, e - } - return (*Tokenuser)(i), nil -} - -// GetTokenGroups retrieves group accounts associated with access token t. -func (t Token) GetTokenGroups() (*Tokengroups, error) { - i, e := t.getInfo(TokenGroups, 50) - if e != nil { - return nil, e - } - return (*Tokengroups)(i), nil -} - -// GetTokenPrimaryGroup retrieves access token t primary group information. -// A pointer to a SID structure representing a group that will become -// the primary group of any objects created by a process using this access token. -func (t Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error) { - i, e := t.getInfo(TokenPrimaryGroup, 50) - if e != nil { - return nil, e - } - return (*Tokenprimarygroup)(i), nil -} - -// GetUserProfileDirectory retrieves path to the -// root directory of the access token t user's profile. -func (t Token) GetUserProfileDirectory() (string, error) { - n := uint32(100) - for { - b := make([]uint16, n) - e := GetUserProfileDirectory(t, &b[0], &n) - if e == nil { - return UTF16ToString(b), nil - } - if e != ERROR_INSUFFICIENT_BUFFER { - return "", e - } - if n <= uint32(len(b)) { - return "", e - } - } -} diff --git a/vendor/golang.org/x/sys/windows/service.go b/vendor/golang.org/x/sys/windows/service.go deleted file mode 100644 index 1c11d392f..000000000 --- a/vendor/golang.org/x/sys/windows/service.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package windows - -const ( - SC_MANAGER_CONNECT = 1 - SC_MANAGER_CREATE_SERVICE = 2 - SC_MANAGER_ENUMERATE_SERVICE = 4 - SC_MANAGER_LOCK = 8 - SC_MANAGER_QUERY_LOCK_STATUS = 16 - SC_MANAGER_MODIFY_BOOT_CONFIG = 32 - SC_MANAGER_ALL_ACCESS = 0xf003f -) - -//sys OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenSCManagerW - -const ( - SERVICE_KERNEL_DRIVER = 1 - SERVICE_FILE_SYSTEM_DRIVER = 2 - SERVICE_ADAPTER = 4 - SERVICE_RECOGNIZER_DRIVER = 8 - SERVICE_WIN32_OWN_PROCESS = 16 - SERVICE_WIN32_SHARE_PROCESS = 32 - SERVICE_WIN32 = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS - SERVICE_INTERACTIVE_PROCESS = 256 - SERVICE_DRIVER = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | SERVICE_RECOGNIZER_DRIVER - SERVICE_TYPE_ALL = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS - - SERVICE_BOOT_START = 0 - SERVICE_SYSTEM_START = 1 - SERVICE_AUTO_START = 2 - SERVICE_DEMAND_START = 3 - SERVICE_DISABLED = 4 - - SERVICE_ERROR_IGNORE = 0 - SERVICE_ERROR_NORMAL = 1 - SERVICE_ERROR_SEVERE = 2 - SERVICE_ERROR_CRITICAL = 3 - - SC_STATUS_PROCESS_INFO = 0 - - SERVICE_STOPPED = 1 - SERVICE_START_PENDING = 2 - SERVICE_STOP_PENDING = 3 - SERVICE_RUNNING = 4 - SERVICE_CONTINUE_PENDING = 5 - SERVICE_PAUSE_PENDING = 6 - SERVICE_PAUSED = 7 - SERVICE_NO_CHANGE = 0xffffffff - - SERVICE_ACCEPT_STOP = 1 - SERVICE_ACCEPT_PAUSE_CONTINUE = 2 - SERVICE_ACCEPT_SHUTDOWN = 4 - SERVICE_ACCEPT_PARAMCHANGE = 8 - SERVICE_ACCEPT_NETBINDCHANGE = 16 - SERVICE_ACCEPT_HARDWAREPROFILECHANGE = 32 - SERVICE_ACCEPT_POWEREVENT = 64 - SERVICE_ACCEPT_SESSIONCHANGE = 128 - - SERVICE_CONTROL_STOP = 1 - SERVICE_CONTROL_PAUSE = 2 - SERVICE_CONTROL_CONTINUE = 3 - SERVICE_CONTROL_INTERROGATE = 4 - SERVICE_CONTROL_SHUTDOWN = 5 - SERVICE_CONTROL_PARAMCHANGE = 6 - SERVICE_CONTROL_NETBINDADD = 7 - SERVICE_CONTROL_NETBINDREMOVE = 8 - SERVICE_CONTROL_NETBINDENABLE = 9 - SERVICE_CONTROL_NETBINDDISABLE = 10 - SERVICE_CONTROL_DEVICEEVENT = 11 - SERVICE_CONTROL_HARDWAREPROFILECHANGE = 12 - SERVICE_CONTROL_POWEREVENT = 13 - SERVICE_CONTROL_SESSIONCHANGE = 14 - - SERVICE_ACTIVE = 1 - SERVICE_INACTIVE = 2 - SERVICE_STATE_ALL = 3 - - SERVICE_QUERY_CONFIG = 1 - SERVICE_CHANGE_CONFIG = 2 - SERVICE_QUERY_STATUS = 4 - SERVICE_ENUMERATE_DEPENDENTS = 8 - SERVICE_START = 16 - SERVICE_STOP = 32 - SERVICE_PAUSE_CONTINUE = 64 - SERVICE_INTERROGATE = 128 - SERVICE_USER_DEFINED_CONTROL = 256 - SERVICE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS | SERVICE_START | SERVICE_STOP | SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_USER_DEFINED_CONTROL - SERVICE_RUNS_IN_SYSTEM_PROCESS = 1 - SERVICE_CONFIG_DESCRIPTION = 1 - SERVICE_CONFIG_FAILURE_ACTIONS = 2 - - NO_ERROR = 0 -) - -type SERVICE_STATUS struct { - ServiceType uint32 - CurrentState uint32 - ControlsAccepted uint32 - Win32ExitCode uint32 - ServiceSpecificExitCode uint32 - CheckPoint uint32 - WaitHint uint32 -} - -type SERVICE_TABLE_ENTRY struct { - ServiceName *uint16 - ServiceProc uintptr -} - -type QUERY_SERVICE_CONFIG struct { - ServiceType uint32 - StartType uint32 - ErrorControl uint32 - BinaryPathName *uint16 - LoadOrderGroup *uint16 - TagId uint32 - Dependencies *uint16 - ServiceStartName *uint16 - DisplayName *uint16 -} - -type SERVICE_DESCRIPTION struct { - Description *uint16 -} - -//sys CloseServiceHandle(handle Handle) (err error) = advapi32.CloseServiceHandle -//sys CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) [failretval==0] = advapi32.CreateServiceW -//sys OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenServiceW -//sys DeleteService(service Handle) (err error) = advapi32.DeleteService -//sys StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) = advapi32.StartServiceW -//sys QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) = advapi32.QueryServiceStatus -//sys ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) = advapi32.ControlService -//sys StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) = advapi32.StartServiceCtrlDispatcherW -//sys SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) = advapi32.SetServiceStatus -//sys ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) = advapi32.ChangeServiceConfigW -//sys QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfigW -//sys ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) = advapi32.ChangeServiceConfig2W -//sys QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfig2W diff --git a/vendor/golang.org/x/sys/windows/str.go b/vendor/golang.org/x/sys/windows/str.go deleted file mode 100644 index 917cc2aae..000000000 --- a/vendor/golang.org/x/sys/windows/str.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package windows - -func itoa(val int) string { // do it here rather than with fmt to avoid dependency - if val < 0 { - return "-" + itoa(-val) - } - var buf [32]byte // big enough for int64 - i := len(buf) - 1 - for val >= 10 { - buf[i] = byte(val%10 + '0') - i-- - val /= 10 - } - buf[i] = byte(val + '0') - return string(buf[i:]) -} diff --git a/vendor/golang.org/x/sys/windows/svc/debug/log.go b/vendor/golang.org/x/sys/windows/svc/debug/log.go deleted file mode 100644 index e51ab42a1..000000000 --- a/vendor/golang.org/x/sys/windows/svc/debug/log.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package debug - -import ( - "os" - "strconv" -) - -// Log interface allows different log implementations to be used. -type Log interface { - Close() error - Info(eid uint32, msg string) error - Warning(eid uint32, msg string) error - Error(eid uint32, msg string) error -} - -// ConsoleLog provides access to the console. -type ConsoleLog struct { - Name string -} - -// New creates new ConsoleLog. -func New(source string) *ConsoleLog { - return &ConsoleLog{Name: source} -} - -// Close closes console log l. -func (l *ConsoleLog) Close() error { - return nil -} - -func (l *ConsoleLog) report(kind string, eid uint32, msg string) error { - s := l.Name + "." + kind + "(" + strconv.Itoa(int(eid)) + "): " + msg + "\n" - _, err := os.Stdout.Write([]byte(s)) - return err -} - -// Info writes an information event msg with event id eid to the console l. -func (l *ConsoleLog) Info(eid uint32, msg string) error { - return l.report("info", eid, msg) -} - -// Warning writes an warning event msg with event id eid to the console l. -func (l *ConsoleLog) Warning(eid uint32, msg string) error { - return l.report("warn", eid, msg) -} - -// Error writes an error event msg with event id eid to the console l. -func (l *ConsoleLog) Error(eid uint32, msg string) error { - return l.report("error", eid, msg) -} diff --git a/vendor/golang.org/x/sys/windows/svc/debug/service.go b/vendor/golang.org/x/sys/windows/svc/debug/service.go deleted file mode 100644 index d5ab94b2c..000000000 --- a/vendor/golang.org/x/sys/windows/svc/debug/service.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package debug provides facilities to execute svc.Handler on console. -// -package debug - -import ( - "os" - "os/signal" - "syscall" - - "golang.org/x/sys/windows/svc" -) - -// Run executes service name by calling appropriate handler function. -// The process is running on console, unlike real service. Use Ctrl+C to -// send "Stop" command to your service. -func Run(name string, handler svc.Handler) error { - cmds := make(chan svc.ChangeRequest) - changes := make(chan svc.Status) - - sig := make(chan os.Signal) - signal.Notify(sig) - - go func() { - status := svc.Status{State: svc.Stopped} - for { - select { - case <-sig: - cmds <- svc.ChangeRequest{svc.Stop, status} - case status = <-changes: - } - } - }() - - _, errno := handler.Execute([]string{name}, cmds, changes) - if errno != 0 { - return syscall.Errno(errno) - } - return nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/event.go b/vendor/golang.org/x/sys/windows/svc/event.go deleted file mode 100644 index 0508e2288..000000000 --- a/vendor/golang.org/x/sys/windows/svc/event.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package svc - -import ( - "errors" - - "golang.org/x/sys/windows" -) - -// event represents auto-reset, initially non-signaled Windows event. -// It is used to communicate between go and asm parts of this package. -type event struct { - h windows.Handle -} - -func newEvent() (*event, error) { - h, err := windows.CreateEvent(nil, 0, 0, nil) - if err != nil { - return nil, err - } - return &event{h: h}, nil -} - -func (e *event) Close() error { - return windows.CloseHandle(e.h) -} - -func (e *event) Set() error { - return windows.SetEvent(e.h) -} - -func (e *event) Wait() error { - s, err := windows.WaitForSingleObject(e.h, windows.INFINITE) - switch s { - case windows.WAIT_OBJECT_0: - break - case windows.WAIT_FAILED: - return err - default: - return errors.New("unexpected result from WaitForSingleObject") - } - return nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/eventlog/install.go b/vendor/golang.org/x/sys/windows/svc/eventlog/install.go deleted file mode 100644 index c76a3760a..000000000 --- a/vendor/golang.org/x/sys/windows/svc/eventlog/install.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package eventlog - -import ( - "errors" - - "golang.org/x/sys/windows" - "golang.org/x/sys/windows/registry" -) - -const ( - // Log levels. - Info = windows.EVENTLOG_INFORMATION_TYPE - Warning = windows.EVENTLOG_WARNING_TYPE - Error = windows.EVENTLOG_ERROR_TYPE -) - -const addKeyName = `SYSTEM\CurrentControlSet\Services\EventLog\Application` - -// Install modifies PC registry to allow logging with an event source src. -// It adds all required keys and values to the event log registry key. -// Install uses msgFile as the event message file. If useExpandKey is true, -// the event message file is installed as REG_EXPAND_SZ value, -// otherwise as REG_SZ. Use bitwise of log.Error, log.Warning and -// log.Info to specify events supported by the new event source. -func Install(src, msgFile string, useExpandKey bool, eventsSupported uint32) error { - appkey, err := registry.OpenKey(registry.LOCAL_MACHINE, addKeyName, registry.CREATE_SUB_KEY) - if err != nil { - return err - } - defer appkey.Close() - - sk, alreadyExist, err := registry.CreateKey(appkey, src, registry.SET_VALUE) - if err != nil { - return err - } - defer sk.Close() - if alreadyExist { - return errors.New(addKeyName + `\` + src + " registry key already exists") - } - - err = sk.SetDWordValue("CustomSource", 1) - if err != nil { - return err - } - if useExpandKey { - err = sk.SetExpandStringValue("EventMessageFile", msgFile) - } else { - err = sk.SetStringValue("EventMessageFile", msgFile) - } - if err != nil { - return err - } - err = sk.SetDWordValue("TypesSupported", eventsSupported) - if err != nil { - return err - } - return nil -} - -// InstallAsEventCreate is the same as Install, but uses -// %SystemRoot%\System32\EventCreate.exe as the event message file. -func InstallAsEventCreate(src string, eventsSupported uint32) error { - return Install(src, "%SystemRoot%\\System32\\EventCreate.exe", true, eventsSupported) -} - -// Remove deletes all registry elements installed by the correspondent Install. -func Remove(src string) error { - appkey, err := registry.OpenKey(registry.LOCAL_MACHINE, addKeyName, registry.SET_VALUE) - if err != nil { - return err - } - defer appkey.Close() - return registry.DeleteKey(appkey, src) -} diff --git a/vendor/golang.org/x/sys/windows/svc/eventlog/log.go b/vendor/golang.org/x/sys/windows/svc/eventlog/log.go deleted file mode 100644 index 46e5153d0..000000000 --- a/vendor/golang.org/x/sys/windows/svc/eventlog/log.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package eventlog implements access to Windows event log. -// -package eventlog - -import ( - "errors" - "syscall" - - "golang.org/x/sys/windows" -) - -// Log provides access to the system log. -type Log struct { - Handle windows.Handle -} - -// Open retrieves a handle to the specified event log. -func Open(source string) (*Log, error) { - return OpenRemote("", source) -} - -// OpenRemote does the same as Open, but on different computer host. -func OpenRemote(host, source string) (*Log, error) { - if source == "" { - return nil, errors.New("Specify event log source") - } - var s *uint16 - if host != "" { - s = syscall.StringToUTF16Ptr(host) - } - h, err := windows.RegisterEventSource(s, syscall.StringToUTF16Ptr(source)) - if err != nil { - return nil, err - } - return &Log{Handle: h}, nil -} - -// Close closes event log l. -func (l *Log) Close() error { - return windows.DeregisterEventSource(l.Handle) -} - -func (l *Log) report(etype uint16, eid uint32, msg string) error { - ss := []*uint16{syscall.StringToUTF16Ptr(msg)} - return windows.ReportEvent(l.Handle, etype, 0, eid, 0, 1, 0, &ss[0], nil) -} - -// Info writes an information event msg with event id eid to the end of event log l. -// When EventCreate.exe is used, eid must be between 1 and 1000. -func (l *Log) Info(eid uint32, msg string) error { - return l.report(windows.EVENTLOG_INFORMATION_TYPE, eid, msg) -} - -// Warning writes an warning event msg with event id eid to the end of event log l. -// When EventCreate.exe is used, eid must be between 1 and 1000. -func (l *Log) Warning(eid uint32, msg string) error { - return l.report(windows.EVENTLOG_WARNING_TYPE, eid, msg) -} - -// Error writes an error event msg with event id eid to the end of event log l. -// When EventCreate.exe is used, eid must be between 1 and 1000. -func (l *Log) Error(eid uint32, msg string) error { - return l.report(windows.EVENTLOG_ERROR_TYPE, eid, msg) -} diff --git a/vendor/golang.org/x/sys/windows/svc/eventlog/log_test.go b/vendor/golang.org/x/sys/windows/svc/eventlog/log_test.go deleted file mode 100644 index 4dd8ad9e7..000000000 --- a/vendor/golang.org/x/sys/windows/svc/eventlog/log_test.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package eventlog_test - -import ( - "testing" - - "golang.org/x/sys/windows/svc/eventlog" -) - -func TestLog(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode - it modifies system logs") - } - - const name = "mylog" - const supports = eventlog.Error | eventlog.Warning | eventlog.Info - err := eventlog.InstallAsEventCreate(name, supports) - if err != nil { - t.Fatalf("Install failed: %s", err) - } - defer func() { - err = eventlog.Remove(name) - if err != nil { - t.Fatalf("Remove failed: %s", err) - } - }() - - l, err := eventlog.Open(name) - if err != nil { - t.Fatalf("Open failed: %s", err) - } - defer l.Close() - - err = l.Info(1, "info") - if err != nil { - t.Fatalf("Info failed: %s", err) - } - err = l.Warning(2, "warning") - if err != nil { - t.Fatalf("Warning failed: %s", err) - } - err = l.Error(3, "error") - if err != nil { - t.Fatalf("Error failed: %s", err) - } -} diff --git a/vendor/golang.org/x/sys/windows/svc/example/beep.go b/vendor/golang.org/x/sys/windows/svc/example/beep.go deleted file mode 100644 index dcf23408d..000000000 --- a/vendor/golang.org/x/sys/windows/svc/example/beep.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package main - -import ( - "syscall" -) - -// BUG(brainman): MessageBeep Windows api is broken on Windows 7, -// so this example does not beep when runs as service on Windows 7. - -var ( - beepFunc = syscall.MustLoadDLL("user32.dll").MustFindProc("MessageBeep") -) - -func beep() { - beepFunc.Call(0xffffffff) -} diff --git a/vendor/golang.org/x/sys/windows/svc/example/install.go b/vendor/golang.org/x/sys/windows/svc/example/install.go deleted file mode 100644 index 39cb00d2a..000000000 --- a/vendor/golang.org/x/sys/windows/svc/example/install.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package main - -import ( - "fmt" - "os" - "path/filepath" - - "golang.org/x/sys/windows/svc/eventlog" - "golang.org/x/sys/windows/svc/mgr" -) - -func exePath() (string, error) { - prog := os.Args[0] - p, err := filepath.Abs(prog) - if err != nil { - return "", err - } - fi, err := os.Stat(p) - if err == nil { - if !fi.Mode().IsDir() { - return p, nil - } - err = fmt.Errorf("%s is directory", p) - } - if filepath.Ext(p) == "" { - p += ".exe" - fi, err := os.Stat(p) - if err == nil { - if !fi.Mode().IsDir() { - return p, nil - } - err = fmt.Errorf("%s is directory", p) - } - } - return "", err -} - -func installService(name, desc string) error { - exepath, err := exePath() - if err != nil { - return err - } - m, err := mgr.Connect() - if err != nil { - return err - } - defer m.Disconnect() - s, err := m.OpenService(name) - if err == nil { - s.Close() - return fmt.Errorf("service %s already exists", name) - } - s, err = m.CreateService(name, exepath, mgr.Config{DisplayName: desc}, "is", "auto-started") - if err != nil { - return err - } - defer s.Close() - err = eventlog.InstallAsEventCreate(name, eventlog.Error|eventlog.Warning|eventlog.Info) - if err != nil { - s.Delete() - return fmt.Errorf("SetupEventLogSource() failed: %s", err) - } - return nil -} - -func removeService(name string) error { - m, err := mgr.Connect() - if err != nil { - return err - } - defer m.Disconnect() - s, err := m.OpenService(name) - if err != nil { - return fmt.Errorf("service %s is not installed", name) - } - defer s.Close() - err = s.Delete() - if err != nil { - return err - } - err = eventlog.Remove(name) - if err != nil { - return fmt.Errorf("RemoveEventLogSource() failed: %s", err) - } - return nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/example/main.go b/vendor/golang.org/x/sys/windows/svc/example/main.go deleted file mode 100644 index dc96c081a..000000000 --- a/vendor/golang.org/x/sys/windows/svc/example/main.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Example service program that beeps. -// -// The program demonstrates how to create Windows service and -// install / remove it on a computer. It also shows how to -// stop / start / pause / continue any service, and how to -// write to event log. It also shows how to use debug -// facilities available in debug package. -// -package main - -import ( - "fmt" - "log" - "os" - "strings" - - "golang.org/x/sys/windows/svc" -) - -func usage(errmsg string) { - fmt.Fprintf(os.Stderr, - "%s\n\n"+ - "usage: %s \n"+ - " where is one of\n"+ - " install, remove, debug, start, stop, pause or continue.\n", - errmsg, os.Args[0]) - os.Exit(2) -} - -func main() { - const svcName = "myservice" - - isIntSess, err := svc.IsAnInteractiveSession() - if err != nil { - log.Fatalf("failed to determine if we are running in an interactive session: %v", err) - } - if !isIntSess { - runService(svcName, false) - return - } - - if len(os.Args) < 2 { - usage("no command specified") - } - - cmd := strings.ToLower(os.Args[1]) - switch cmd { - case "debug": - runService(svcName, true) - return - case "install": - err = installService(svcName, "my service") - case "remove": - err = removeService(svcName) - case "start": - err = startService(svcName) - case "stop": - err = controlService(svcName, svc.Stop, svc.Stopped) - case "pause": - err = controlService(svcName, svc.Pause, svc.Paused) - case "continue": - err = controlService(svcName, svc.Continue, svc.Running) - default: - usage(fmt.Sprintf("invalid command %s", cmd)) - } - if err != nil { - log.Fatalf("failed to %s %s: %v", cmd, svcName, err) - } - return -} diff --git a/vendor/golang.org/x/sys/windows/svc/example/manage.go b/vendor/golang.org/x/sys/windows/svc/example/manage.go deleted file mode 100644 index 782dbd96c..000000000 --- a/vendor/golang.org/x/sys/windows/svc/example/manage.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package main - -import ( - "fmt" - "time" - - "golang.org/x/sys/windows/svc" - "golang.org/x/sys/windows/svc/mgr" -) - -func startService(name string) error { - m, err := mgr.Connect() - if err != nil { - return err - } - defer m.Disconnect() - s, err := m.OpenService(name) - if err != nil { - return fmt.Errorf("could not access service: %v", err) - } - defer s.Close() - err = s.Start("is", "manual-started") - if err != nil { - return fmt.Errorf("could not start service: %v", err) - } - return nil -} - -func controlService(name string, c svc.Cmd, to svc.State) error { - m, err := mgr.Connect() - if err != nil { - return err - } - defer m.Disconnect() - s, err := m.OpenService(name) - if err != nil { - return fmt.Errorf("could not access service: %v", err) - } - defer s.Close() - status, err := s.Control(c) - if err != nil { - return fmt.Errorf("could not send control=%d: %v", c, err) - } - timeout := time.Now().Add(10 * time.Second) - for status.State != to { - if timeout.Before(time.Now()) { - return fmt.Errorf("timeout waiting for service to go to state=%d", to) - } - time.Sleep(300 * time.Millisecond) - status, err = s.Query() - if err != nil { - return fmt.Errorf("could not retrieve service status: %v", err) - } - } - return nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/example/service.go b/vendor/golang.org/x/sys/windows/svc/example/service.go deleted file mode 100644 index 237e80984..000000000 --- a/vendor/golang.org/x/sys/windows/svc/example/service.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package main - -import ( - "fmt" - "time" - - "golang.org/x/sys/windows/svc" - "golang.org/x/sys/windows/svc/debug" - "golang.org/x/sys/windows/svc/eventlog" -) - -var elog debug.Log - -type myservice struct{} - -func (m *myservice) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) { - const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue - changes <- svc.Status{State: svc.StartPending} - fasttick := time.Tick(500 * time.Millisecond) - slowtick := time.Tick(2 * time.Second) - tick := fasttick - changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted} -loop: - for { - select { - case <-tick: - beep() - elog.Info(1, "beep") - case c := <-r: - switch c.Cmd { - case svc.Interrogate: - changes <- c.CurrentStatus - // Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4 - time.Sleep(100 * time.Millisecond) - changes <- c.CurrentStatus - case svc.Stop, svc.Shutdown: - break loop - case svc.Pause: - changes <- svc.Status{State: svc.Paused, Accepts: cmdsAccepted} - tick = slowtick - case svc.Continue: - changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted} - tick = fasttick - default: - elog.Error(1, fmt.Sprintf("unexpected control request #%d", c)) - } - } - } - changes <- svc.Status{State: svc.StopPending} - return -} - -func runService(name string, isDebug bool) { - var err error - if isDebug { - elog = debug.New(name) - } else { - elog, err = eventlog.Open(name) - if err != nil { - return - } - } - defer elog.Close() - - elog.Info(1, fmt.Sprintf("starting %s service", name)) - run := svc.Run - if isDebug { - run = debug.Run - } - err = run(name, &myservice{}) - if err != nil { - elog.Error(1, fmt.Sprintf("%s service failed: %v", name, err)) - return - } - elog.Info(1, fmt.Sprintf("%s service stopped", name)) -} diff --git a/vendor/golang.org/x/sys/windows/svc/go12.c b/vendor/golang.org/x/sys/windows/svc/go12.c deleted file mode 100644 index 6f1be1fa3..000000000 --- a/vendor/golang.org/x/sys/windows/svc/go12.c +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows -// +build !go1.3 - -// copied from pkg/runtime -typedef unsigned int uint32; -typedef unsigned long long int uint64; -#ifdef _64BIT -typedef uint64 uintptr; -#else -typedef uint32 uintptr; -#endif - -// from sys_386.s or sys_amd64.s -void ·servicemain(void); - -void -·getServiceMain(uintptr *r) -{ - *r = (uintptr)·servicemain; -} diff --git a/vendor/golang.org/x/sys/windows/svc/go12.go b/vendor/golang.org/x/sys/windows/svc/go12.go deleted file mode 100644 index 6f0a924ea..000000000 --- a/vendor/golang.org/x/sys/windows/svc/go12.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows -// +build !go1.3 - -package svc - -// from go12.c -func getServiceMain(r *uintptr) diff --git a/vendor/golang.org/x/sys/windows/svc/go13.go b/vendor/golang.org/x/sys/windows/svc/go13.go deleted file mode 100644 index 432a9e796..000000000 --- a/vendor/golang.org/x/sys/windows/svc/go13.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows -// +build go1.3 - -package svc - -import "unsafe" - -const ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const - -// Should be a built-in for unsafe.Pointer? -func add(p unsafe.Pointer, x uintptr) unsafe.Pointer { - return unsafe.Pointer(uintptr(p) + x) -} - -// funcPC returns the entry PC of the function f. -// It assumes that f is a func value. Otherwise the behavior is undefined. -func funcPC(f interface{}) uintptr { - return **(**uintptr)(add(unsafe.Pointer(&f), ptrSize)) -} - -// from sys_386.s and sys_amd64.s -func servicectlhandler(ctl uint32) uintptr -func servicemain(argc uint32, argv **uint16) - -func getServiceMain(r *uintptr) { - *r = funcPC(servicemain) -} diff --git a/vendor/golang.org/x/sys/windows/svc/mgr/config.go b/vendor/golang.org/x/sys/windows/svc/mgr/config.go deleted file mode 100644 index 0a6edba4f..000000000 --- a/vendor/golang.org/x/sys/windows/svc/mgr/config.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package mgr - -import ( - "syscall" - "unicode/utf16" - "unsafe" - - "golang.org/x/sys/windows" -) - -const ( - // Service start types. - StartManual = windows.SERVICE_DEMAND_START // the service must be started manually - StartAutomatic = windows.SERVICE_AUTO_START // the service will start by itself whenever the computer reboots - StartDisabled = windows.SERVICE_DISABLED // the service cannot be started - - // The severity of the error, and action taken, - // if this service fails to start. - ErrorCritical = windows.SERVICE_ERROR_CRITICAL - ErrorIgnore = windows.SERVICE_ERROR_IGNORE - ErrorNormal = windows.SERVICE_ERROR_NORMAL - ErrorSevere = windows.SERVICE_ERROR_SEVERE -) - -// TODO(brainman): Password is not returned by windows.QueryServiceConfig, not sure how to get it. - -type Config struct { - ServiceType uint32 - StartType uint32 - ErrorControl uint32 - BinaryPathName string // fully qualified path to the service binary file, can also include arguments for an auto-start service - LoadOrderGroup string - TagId uint32 - Dependencies []string - ServiceStartName string // name of the account under which the service should run - DisplayName string - Password string - Description string -} - -func toString(p *uint16) string { - if p == nil { - return "" - } - return syscall.UTF16ToString((*[4096]uint16)(unsafe.Pointer(p))[:]) -} - -func toStringSlice(ps *uint16) []string { - if ps == nil { - return nil - } - r := make([]string, 0) - for from, i, p := 0, 0, (*[1 << 24]uint16)(unsafe.Pointer(ps)); true; i++ { - if p[i] == 0 { - // empty string marks the end - if i <= from { - break - } - r = append(r, string(utf16.Decode(p[from:i]))) - from = i + 1 - } - } - return r -} - -// Config retrieves service s configuration paramteres. -func (s *Service) Config() (Config, error) { - var p *windows.QUERY_SERVICE_CONFIG - n := uint32(1024) - for { - b := make([]byte, n) - p = (*windows.QUERY_SERVICE_CONFIG)(unsafe.Pointer(&b[0])) - err := windows.QueryServiceConfig(s.Handle, p, n, &n) - if err == nil { - break - } - if err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER { - return Config{}, err - } - if n <= uint32(len(b)) { - return Config{}, err - } - } - - var p2 *windows.SERVICE_DESCRIPTION - n = uint32(1024) - for { - b := make([]byte, n) - p2 = (*windows.SERVICE_DESCRIPTION)(unsafe.Pointer(&b[0])) - err := windows.QueryServiceConfig2(s.Handle, - windows.SERVICE_CONFIG_DESCRIPTION, &b[0], n, &n) - if err == nil { - break - } - if err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER { - return Config{}, err - } - if n <= uint32(len(b)) { - return Config{}, err - } - } - - return Config{ - ServiceType: p.ServiceType, - StartType: p.StartType, - ErrorControl: p.ErrorControl, - BinaryPathName: toString(p.BinaryPathName), - LoadOrderGroup: toString(p.LoadOrderGroup), - TagId: p.TagId, - Dependencies: toStringSlice(p.Dependencies), - ServiceStartName: toString(p.ServiceStartName), - DisplayName: toString(p.DisplayName), - Description: toString(p2.Description), - }, nil -} - -func updateDescription(handle windows.Handle, desc string) error { - d := windows.SERVICE_DESCRIPTION{toPtr(desc)} - return windows.ChangeServiceConfig2(handle, - windows.SERVICE_CONFIG_DESCRIPTION, (*byte)(unsafe.Pointer(&d))) -} - -// UpdateConfig updates service s configuration parameters. -func (s *Service) UpdateConfig(c Config) error { - err := windows.ChangeServiceConfig(s.Handle, c.ServiceType, c.StartType, - c.ErrorControl, toPtr(c.BinaryPathName), toPtr(c.LoadOrderGroup), - nil, toStringBlock(c.Dependencies), toPtr(c.ServiceStartName), - toPtr(c.Password), toPtr(c.DisplayName)) - if err != nil { - return err - } - return updateDescription(s.Handle, c.Description) -} diff --git a/vendor/golang.org/x/sys/windows/svc/mgr/mgr.go b/vendor/golang.org/x/sys/windows/svc/mgr/mgr.go deleted file mode 100644 index da8ceb6ed..000000000 --- a/vendor/golang.org/x/sys/windows/svc/mgr/mgr.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package mgr can be used to manage Windows service programs. -// It can be used to install and remove them. It can also start, -// stop and pause them. The package can query / change current -// service state and config parameters. -// -package mgr - -import ( - "syscall" - "unicode/utf16" - - "golang.org/x/sys/windows" -) - -// Mgr is used to manage Windows service. -type Mgr struct { - Handle windows.Handle -} - -// Connect establishes a connection to the service control manager. -func Connect() (*Mgr, error) { - return ConnectRemote("") -} - -// ConnectRemote establishes a connection to the -// service control manager on computer named host. -func ConnectRemote(host string) (*Mgr, error) { - var s *uint16 - if host != "" { - s = syscall.StringToUTF16Ptr(host) - } - h, err := windows.OpenSCManager(s, nil, windows.SC_MANAGER_ALL_ACCESS) - if err != nil { - return nil, err - } - return &Mgr{Handle: h}, nil -} - -// Disconnect closes connection to the service control manager m. -func (m *Mgr) Disconnect() error { - return windows.CloseServiceHandle(m.Handle) -} - -func toPtr(s string) *uint16 { - if len(s) == 0 { - return nil - } - return syscall.StringToUTF16Ptr(s) -} - -// toStringBlock terminates strings in ss with 0, and then -// concatenates them together. It also adds extra 0 at the end. -func toStringBlock(ss []string) *uint16 { - if len(ss) == 0 { - return nil - } - t := "" - for _, s := range ss { - if s != "" { - t += s + "\x00" - } - } - if t == "" { - return nil - } - t += "\x00" - return &utf16.Encode([]rune(t))[0] -} - -// CreateService installs new service name on the system. -// The service will be executed by running exepath binary. -// Use config c to specify service parameters. -// If service StartType is set to StartAutomatic, -// args will be passed to svc.Handle.Execute. -func (m *Mgr) CreateService(name, exepath string, c Config, args ...string) (*Service, error) { - if c.StartType == 0 { - c.StartType = StartManual - } - if c.ErrorControl == 0 { - c.ErrorControl = ErrorNormal - } - if c.ServiceType == 0 { - c.ServiceType = windows.SERVICE_WIN32_OWN_PROCESS - } - s := syscall.EscapeArg(exepath) - for _, v := range args { - s += " " + syscall.EscapeArg(v) - } - h, err := windows.CreateService(m.Handle, toPtr(name), toPtr(c.DisplayName), - windows.SERVICE_ALL_ACCESS, c.ServiceType, - c.StartType, c.ErrorControl, toPtr(s), toPtr(c.LoadOrderGroup), - nil, toStringBlock(c.Dependencies), toPtr(c.ServiceStartName), toPtr(c.Password)) - if err != nil { - return nil, err - } - if c.Description != "" { - err = updateDescription(h, c.Description) - if err != nil { - return nil, err - } - } - return &Service{Name: name, Handle: h}, nil -} - -// OpenService retrieves access to service name, so it can -// be interrogated and controlled. -func (m *Mgr) OpenService(name string) (*Service, error) { - h, err := windows.OpenService(m.Handle, syscall.StringToUTF16Ptr(name), windows.SERVICE_ALL_ACCESS) - if err != nil { - return nil, err - } - return &Service{Name: name, Handle: h}, nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/mgr/mgr_test.go b/vendor/golang.org/x/sys/windows/svc/mgr/mgr_test.go deleted file mode 100644 index 78be970c0..000000000 --- a/vendor/golang.org/x/sys/windows/svc/mgr/mgr_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package mgr_test - -import ( - "os" - "path/filepath" - "sort" - "strings" - "syscall" - "testing" - "time" - - "golang.org/x/sys/windows/svc/mgr" -) - -func TestOpenLanManServer(t *testing.T) { - m, err := mgr.Connect() - if err != nil { - if errno, ok := err.(syscall.Errno); ok && errno == syscall.ERROR_ACCESS_DENIED { - t.Skip("Skipping test: we don't have rights to manage services.") - } - t.Fatalf("SCM connection failed: %s", err) - } - defer m.Disconnect() - - s, err := m.OpenService("LanmanServer") - if err != nil { - t.Fatalf("OpenService(lanmanserver) failed: %s", err) - } - defer s.Close() - - _, err = s.Config() - if err != nil { - t.Fatalf("Config failed: %s", err) - } -} - -func install(t *testing.T, m *mgr.Mgr, name, exepath string, c mgr.Config) { - // Sometimes it takes a while for the service to get - // removed after previous test run. - for i := 0; ; i++ { - s, err := m.OpenService(name) - if err != nil { - break - } - s.Close() - - if i > 10 { - t.Fatalf("service %s already exists", name) - } - time.Sleep(300 * time.Millisecond) - } - - s, err := m.CreateService(name, exepath, c) - if err != nil { - t.Fatalf("CreateService(%s) failed: %v", name, err) - } - defer s.Close() -} - -func depString(d []string) string { - if len(d) == 0 { - return "" - } - for i := range d { - d[i] = strings.ToLower(d[i]) - } - ss := sort.StringSlice(d) - ss.Sort() - return strings.Join([]string(ss), " ") -} - -func testConfig(t *testing.T, s *mgr.Service, should mgr.Config) mgr.Config { - is, err := s.Config() - if err != nil { - t.Fatalf("Config failed: %s", err) - } - if should.DisplayName != is.DisplayName { - t.Fatalf("config mismatch: DisplayName is %q, but should have %q", is.DisplayName, should.DisplayName) - } - if should.StartType != is.StartType { - t.Fatalf("config mismatch: StartType is %v, but should have %v", is.StartType, should.StartType) - } - if should.Description != is.Description { - t.Fatalf("config mismatch: Description is %q, but should have %q", is.Description, should.Description) - } - if depString(should.Dependencies) != depString(is.Dependencies) { - t.Fatalf("config mismatch: Dependencies is %v, but should have %v", is.Dependencies, should.Dependencies) - } - return is -} - -func remove(t *testing.T, s *mgr.Service) { - err := s.Delete() - if err != nil { - t.Fatalf("Delete failed: %s", err) - } -} - -func TestMyService(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode - it modifies system services") - } - - const name = "myservice" - - m, err := mgr.Connect() - if err != nil { - if errno, ok := err.(syscall.Errno); ok && errno == syscall.ERROR_ACCESS_DENIED { - t.Skip("Skipping test: we don't have rights to manage services.") - } - t.Fatalf("SCM connection failed: %s", err) - } - defer m.Disconnect() - - c := mgr.Config{ - StartType: mgr.StartDisabled, - DisplayName: "my service", - Description: "my service is just a test", - Dependencies: []string{"LanmanServer", "W32Time"}, - } - - exename := os.Args[0] - exepath, err := filepath.Abs(exename) - if err != nil { - t.Fatalf("filepath.Abs(%s) failed: %s", exename, err) - } - - install(t, m, name, exepath, c) - - s, err := m.OpenService(name) - if err != nil { - t.Fatalf("service %s is not installed", name) - } - defer s.Close() - - c.BinaryPathName = exepath - c = testConfig(t, s, c) - - c.StartType = mgr.StartManual - err = s.UpdateConfig(c) - if err != nil { - t.Fatalf("UpdateConfig failed: %v", err) - } - - testConfig(t, s, c) - - remove(t, s) -} diff --git a/vendor/golang.org/x/sys/windows/svc/mgr/service.go b/vendor/golang.org/x/sys/windows/svc/mgr/service.go deleted file mode 100644 index 465f3c3d2..000000000 --- a/vendor/golang.org/x/sys/windows/svc/mgr/service.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package mgr - -import ( - "syscall" - - "golang.org/x/sys/windows" - "golang.org/x/sys/windows/svc" -) - -// TODO(brainman): Use EnumDependentServices to enumerate dependent services. - -// TODO(brainman): Use EnumServicesStatus to enumerate services in the specified service control manager database. - -// Service is used to access Windows service. -type Service struct { - Name string - Handle windows.Handle -} - -// Delete marks service s for deletion from the service control manager database. -func (s *Service) Delete() error { - return windows.DeleteService(s.Handle) -} - -// Close relinquish access to the service s. -func (s *Service) Close() error { - return windows.CloseServiceHandle(s.Handle) -} - -// Start starts service s. -// args will be passed to svc.Handler.Execute. -func (s *Service) Start(args ...string) error { - var p **uint16 - if len(args) > 0 { - vs := make([]*uint16, len(args)) - for i, _ := range vs { - vs[i] = syscall.StringToUTF16Ptr(args[i]) - } - p = &vs[0] - } - return windows.StartService(s.Handle, uint32(len(args)), p) -} - -// Control sends state change request c to the servce s. -func (s *Service) Control(c svc.Cmd) (svc.Status, error) { - var t windows.SERVICE_STATUS - err := windows.ControlService(s.Handle, uint32(c), &t) - if err != nil { - return svc.Status{}, err - } - return svc.Status{ - State: svc.State(t.CurrentState), - Accepts: svc.Accepted(t.ControlsAccepted), - }, nil -} - -// Query returns current status of service s. -func (s *Service) Query() (svc.Status, error) { - var t windows.SERVICE_STATUS - err := windows.QueryServiceStatus(s.Handle, &t) - if err != nil { - return svc.Status{}, err - } - return svc.Status{ - State: svc.State(t.CurrentState), - Accepts: svc.Accepted(t.ControlsAccepted), - }, nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/security.go b/vendor/golang.org/x/sys/windows/svc/security.go deleted file mode 100644 index 6fbc9236e..000000000 --- a/vendor/golang.org/x/sys/windows/svc/security.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package svc - -import ( - "unsafe" - - "golang.org/x/sys/windows" -) - -func allocSid(subAuth0 uint32) (*windows.SID, error) { - var sid *windows.SID - err := windows.AllocateAndInitializeSid(&windows.SECURITY_NT_AUTHORITY, - 1, subAuth0, 0, 0, 0, 0, 0, 0, 0, &sid) - if err != nil { - return nil, err - } - return sid, nil -} - -// IsAnInteractiveSession determines if calling process is running interactively. -// It queries the process token for membership in the Interactive group. -// http://stackoverflow.com/questions/2668851/how-do-i-detect-that-my-application-is-running-as-service-or-in-an-interactive-s -func IsAnInteractiveSession() (bool, error) { - interSid, err := allocSid(windows.SECURITY_INTERACTIVE_RID) - if err != nil { - return false, err - } - defer windows.FreeSid(interSid) - - serviceSid, err := allocSid(windows.SECURITY_SERVICE_RID) - if err != nil { - return false, err - } - defer windows.FreeSid(serviceSid) - - t, err := windows.OpenCurrentProcessToken() - if err != nil { - return false, err - } - defer t.Close() - - gs, err := t.GetTokenGroups() - if err != nil { - return false, err - } - p := unsafe.Pointer(&gs.Groups[0]) - groups := (*[2 << 20]windows.SIDAndAttributes)(p)[:gs.GroupCount] - for _, g := range groups { - if windows.EqualSid(g.Sid, interSid) { - return true, nil - } - if windows.EqualSid(g.Sid, serviceSid) { - return false, nil - } - } - return false, nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/service.go b/vendor/golang.org/x/sys/windows/svc/service.go deleted file mode 100644 index 9864f7a72..000000000 --- a/vendor/golang.org/x/sys/windows/svc/service.go +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package svc provides everything required to build Windows service. -// -package svc - -import ( - "errors" - "runtime" - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -// State describes service execution state (Stopped, Running and so on). -type State uint32 - -const ( - Stopped = State(windows.SERVICE_STOPPED) - StartPending = State(windows.SERVICE_START_PENDING) - StopPending = State(windows.SERVICE_STOP_PENDING) - Running = State(windows.SERVICE_RUNNING) - ContinuePending = State(windows.SERVICE_CONTINUE_PENDING) - PausePending = State(windows.SERVICE_PAUSE_PENDING) - Paused = State(windows.SERVICE_PAUSED) -) - -// Cmd represents service state change request. It is sent to a service -// by the service manager, and should be actioned upon by the service. -type Cmd uint32 - -const ( - Stop = Cmd(windows.SERVICE_CONTROL_STOP) - Pause = Cmd(windows.SERVICE_CONTROL_PAUSE) - Continue = Cmd(windows.SERVICE_CONTROL_CONTINUE) - Interrogate = Cmd(windows.SERVICE_CONTROL_INTERROGATE) - Shutdown = Cmd(windows.SERVICE_CONTROL_SHUTDOWN) -) - -// Accepted is used to describe commands accepted by the service. -// Note that Interrogate is always accepted. -type Accepted uint32 - -const ( - AcceptStop = Accepted(windows.SERVICE_ACCEPT_STOP) - AcceptShutdown = Accepted(windows.SERVICE_ACCEPT_SHUTDOWN) - AcceptPauseAndContinue = Accepted(windows.SERVICE_ACCEPT_PAUSE_CONTINUE) -) - -// Status combines State and Accepted commands to fully describe running service. -type Status struct { - State State - Accepts Accepted - CheckPoint uint32 // used to report progress during a lengthy operation - WaitHint uint32 // estimated time required for a pending operation, in milliseconds -} - -// ChangeRequest is sent to the service Handler to request service status change. -type ChangeRequest struct { - Cmd Cmd - CurrentStatus Status -} - -// Handler is the interface that must be implemented to build Windows service. -type Handler interface { - - // Execute will be called by the package code at the start of - // the service, and the service will exit once Execute completes. - // Inside Execute you must read service change requests from r and - // act accordingly. You must keep service control manager up to date - // about state of your service by writing into s as required. - // args contains service name followed by argument strings passed - // to the service. - // You can provide service exit code in exitCode return parameter, - // with 0 being "no error". You can also indicate if exit code, - // if any, is service specific or not by using svcSpecificEC - // parameter. - Execute(args []string, r <-chan ChangeRequest, s chan<- Status) (svcSpecificEC bool, exitCode uint32) -} - -var ( - // These are used by asm code. - goWaitsH uintptr - cWaitsH uintptr - ssHandle uintptr - sName *uint16 - sArgc uintptr - sArgv **uint16 - ctlHandlerProc uintptr - cSetEvent uintptr - cWaitForSingleObject uintptr - cRegisterServiceCtrlHandlerW uintptr -) - -func init() { - k := syscall.MustLoadDLL("kernel32.dll") - cSetEvent = k.MustFindProc("SetEvent").Addr() - cWaitForSingleObject = k.MustFindProc("WaitForSingleObject").Addr() - a := syscall.MustLoadDLL("advapi32.dll") - cRegisterServiceCtrlHandlerW = a.MustFindProc("RegisterServiceCtrlHandlerW").Addr() -} - -type ctlEvent struct { - cmd Cmd - errno uint32 -} - -// service provides access to windows service api. -type service struct { - name string - h windows.Handle - cWaits *event - goWaits *event - c chan ctlEvent - handler Handler -} - -func newService(name string, handler Handler) (*service, error) { - var s service - var err error - s.name = name - s.c = make(chan ctlEvent) - s.handler = handler - s.cWaits, err = newEvent() - if err != nil { - return nil, err - } - s.goWaits, err = newEvent() - if err != nil { - s.cWaits.Close() - return nil, err - } - return &s, nil -} - -func (s *service) close() error { - s.cWaits.Close() - s.goWaits.Close() - return nil -} - -type exitCode struct { - isSvcSpecific bool - errno uint32 -} - -func (s *service) updateStatus(status *Status, ec *exitCode) error { - if s.h == 0 { - return errors.New("updateStatus with no service status handle") - } - var t windows.SERVICE_STATUS - t.ServiceType = windows.SERVICE_WIN32_OWN_PROCESS - t.CurrentState = uint32(status.State) - if status.Accepts&AcceptStop != 0 { - t.ControlsAccepted |= windows.SERVICE_ACCEPT_STOP - } - if status.Accepts&AcceptShutdown != 0 { - t.ControlsAccepted |= windows.SERVICE_ACCEPT_SHUTDOWN - } - if status.Accepts&AcceptPauseAndContinue != 0 { - t.ControlsAccepted |= windows.SERVICE_ACCEPT_PAUSE_CONTINUE - } - if ec.errno == 0 { - t.Win32ExitCode = windows.NO_ERROR - t.ServiceSpecificExitCode = windows.NO_ERROR - } else if ec.isSvcSpecific { - t.Win32ExitCode = uint32(windows.ERROR_SERVICE_SPECIFIC_ERROR) - t.ServiceSpecificExitCode = ec.errno - } else { - t.Win32ExitCode = ec.errno - t.ServiceSpecificExitCode = windows.NO_ERROR - } - t.CheckPoint = status.CheckPoint - t.WaitHint = status.WaitHint - return windows.SetServiceStatus(s.h, &t) -} - -const ( - sysErrSetServiceStatusFailed = uint32(syscall.APPLICATION_ERROR) + iota - sysErrNewThreadInCallback -) - -func (s *service) run() { - s.goWaits.Wait() - s.h = windows.Handle(ssHandle) - argv := (*[100]*int16)(unsafe.Pointer(sArgv))[:sArgc] - args := make([]string, len(argv)) - for i, a := range argv { - args[i] = syscall.UTF16ToString((*[1 << 20]uint16)(unsafe.Pointer(a))[:]) - } - - cmdsToHandler := make(chan ChangeRequest) - changesFromHandler := make(chan Status) - exitFromHandler := make(chan exitCode) - - go func() { - ss, errno := s.handler.Execute(args, cmdsToHandler, changesFromHandler) - exitFromHandler <- exitCode{ss, errno} - }() - - status := Status{State: Stopped} - ec := exitCode{isSvcSpecific: true, errno: 0} - var outch chan ChangeRequest - inch := s.c - var cmd Cmd -loop: - for { - select { - case r := <-inch: - if r.errno != 0 { - ec.errno = r.errno - break loop - } - inch = nil - outch = cmdsToHandler - cmd = r.cmd - case outch <- ChangeRequest{cmd, status}: - inch = s.c - outch = nil - case c := <-changesFromHandler: - err := s.updateStatus(&c, &ec) - if err != nil { - // best suitable error number - ec.errno = sysErrSetServiceStatusFailed - if err2, ok := err.(syscall.Errno); ok { - ec.errno = uint32(err2) - } - break loop - } - status = c - case ec = <-exitFromHandler: - break loop - } - } - - s.updateStatus(&Status{State: Stopped}, &ec) - s.cWaits.Set() -} - -func newCallback(fn interface{}) (cb uintptr, err error) { - defer func() { - r := recover() - if r == nil { - return - } - cb = 0 - switch v := r.(type) { - case string: - err = errors.New(v) - case error: - err = v - default: - err = errors.New("unexpected panic in syscall.NewCallback") - } - }() - return syscall.NewCallback(fn), nil -} - -// BUG(brainman): There is no mechanism to run multiple services -// inside one single executable. Perhaps, it can be overcome by -// using RegisterServiceCtrlHandlerEx Windows api. - -// Run executes service name by calling appropriate handler function. -func Run(name string, handler Handler) error { - runtime.LockOSThread() - - tid := windows.GetCurrentThreadId() - - s, err := newService(name, handler) - if err != nil { - return err - } - - ctlHandler := func(ctl uint32) uintptr { - e := ctlEvent{cmd: Cmd(ctl)} - // We assume that this callback function is running on - // the same thread as Run. Nowhere in MS documentation - // I could find statement to guarantee that. So putting - // check here to verify, otherwise things will go bad - // quickly, if ignored. - i := windows.GetCurrentThreadId() - if i != tid { - e.errno = sysErrNewThreadInCallback - } - s.c <- e - return 0 - } - - var svcmain uintptr - getServiceMain(&svcmain) - t := []windows.SERVICE_TABLE_ENTRY{ - {syscall.StringToUTF16Ptr(s.name), svcmain}, - {nil, 0}, - } - - goWaitsH = uintptr(s.goWaits.h) - cWaitsH = uintptr(s.cWaits.h) - sName = t[0].ServiceName - ctlHandlerProc, err = newCallback(ctlHandler) - if err != nil { - return err - } - - go s.run() - - err = windows.StartServiceCtrlDispatcher(&t[0]) - if err != nil { - return err - } - return nil -} diff --git a/vendor/golang.org/x/sys/windows/svc/svc_test.go b/vendor/golang.org/x/sys/windows/svc/svc_test.go deleted file mode 100644 index 764da54a5..000000000 --- a/vendor/golang.org/x/sys/windows/svc/svc_test.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package svc_test - -import ( - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "testing" - "time" - - "golang.org/x/sys/windows/svc" - "golang.org/x/sys/windows/svc/mgr" -) - -func getState(t *testing.T, s *mgr.Service) svc.State { - status, err := s.Query() - if err != nil { - t.Fatalf("Query(%s) failed: %s", s.Name, err) - } - return status.State -} - -func testState(t *testing.T, s *mgr.Service, want svc.State) { - have := getState(t, s) - if have != want { - t.Fatalf("%s state is=%d want=%d", s.Name, have, want) - } -} - -func waitState(t *testing.T, s *mgr.Service, want svc.State) { - for i := 0; ; i++ { - have := getState(t, s) - if have == want { - return - } - if i > 10 { - t.Fatalf("%s state is=%d, waiting timeout", s.Name, have) - } - time.Sleep(300 * time.Millisecond) - } -} - -func TestExample(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode - it modifies system services") - } - - const name = "myservice" - - m, err := mgr.Connect() - if err != nil { - t.Fatalf("SCM connection failed: %s", err) - } - defer m.Disconnect() - - dir, err := ioutil.TempDir("", "svc") - if err != nil { - t.Fatalf("failed to create temp directory: %v", err) - } - defer os.RemoveAll(dir) - - exepath := filepath.Join(dir, "a.exe") - o, err := exec.Command("go", "build", "-o", exepath, "golang.org/x/sys/windows/svc/example").CombinedOutput() - if err != nil { - t.Fatalf("failed to build service program: %v\n%v", err, string(o)) - } - - s, err := m.OpenService(name) - if err == nil { - err = s.Delete() - if err != nil { - s.Close() - t.Fatalf("Delete failed: %s", err) - } - s.Close() - } - s, err = m.CreateService(name, exepath, mgr.Config{DisplayName: "my service"}, "is", "auto-started") - if err != nil { - t.Fatalf("CreateService(%s) failed: %v", name, err) - } - defer s.Close() - - testState(t, s, svc.Stopped) - err = s.Start("is", "manual-started") - if err != nil { - t.Fatalf("Start(%s) failed: %s", s.Name, err) - } - waitState(t, s, svc.Running) - time.Sleep(1 * time.Second) - - // testing deadlock from issues 4. - _, err = s.Control(svc.Interrogate) - if err != nil { - t.Fatalf("Control(%s) failed: %s", s.Name, err) - } - _, err = s.Control(svc.Interrogate) - if err != nil { - t.Fatalf("Control(%s) failed: %s", s.Name, err) - } - time.Sleep(1 * time.Second) - - _, err = s.Control(svc.Stop) - if err != nil { - t.Fatalf("Control(%s) failed: %s", s.Name, err) - } - waitState(t, s, svc.Stopped) - - err = s.Delete() - if err != nil { - t.Fatalf("Delete failed: %s", err) - } -} diff --git a/vendor/golang.org/x/sys/windows/svc/sys_386.s b/vendor/golang.org/x/sys/windows/svc/sys_386.s deleted file mode 100644 index 5e11bfadb..000000000 --- a/vendor/golang.org/x/sys/windows/svc/sys_386.s +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// func servicemain(argc uint32, argv **uint16) -TEXT ·servicemain(SB),7,$0 - MOVL argc+0(FP), AX - MOVL AX, ·sArgc(SB) - MOVL argv+4(FP), AX - MOVL AX, ·sArgv(SB) - - PUSHL BP - PUSHL BX - PUSHL SI - PUSHL DI - - SUBL $12, SP - - MOVL ·sName(SB), AX - MOVL AX, (SP) - MOVL $·servicectlhandler(SB), AX - MOVL AX, 4(SP) - MOVL ·cRegisterServiceCtrlHandlerW(SB), AX - MOVL SP, BP - CALL AX - MOVL BP, SP - CMPL AX, $0 - JE exit - MOVL AX, ·ssHandle(SB) - - MOVL ·goWaitsH(SB), AX - MOVL AX, (SP) - MOVL ·cSetEvent(SB), AX - MOVL SP, BP - CALL AX - MOVL BP, SP - - MOVL ·cWaitsH(SB), AX - MOVL AX, (SP) - MOVL $-1, AX - MOVL AX, 4(SP) - MOVL ·cWaitForSingleObject(SB), AX - MOVL SP, BP - CALL AX - MOVL BP, SP - -exit: - ADDL $12, SP - - POPL DI - POPL SI - POPL BX - POPL BP - - MOVL 0(SP), CX - ADDL $12, SP - JMP CX - -// I do not know why, but this seems to be the only way to call -// ctlHandlerProc on Windows 7. - -// func servicectlhandler(ctl uint32) uintptr -TEXT ·servicectlhandler(SB),7,$0 - MOVL ·ctlHandlerProc(SB), CX - JMP CX diff --git a/vendor/golang.org/x/sys/windows/svc/sys_amd64.s b/vendor/golang.org/x/sys/windows/svc/sys_amd64.s deleted file mode 100644 index 87dbec839..000000000 --- a/vendor/golang.org/x/sys/windows/svc/sys_amd64.s +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// func servicemain(argc uint32, argv **uint16) -TEXT ·servicemain(SB),7,$0 - MOVL CX, ·sArgc(SB) - MOVL DX, ·sArgv(SB) - - SUBQ $32, SP // stack for the first 4 syscall params - - MOVQ ·sName(SB), CX - MOVQ $·servicectlhandler(SB), DX - MOVQ ·cRegisterServiceCtrlHandlerW(SB), AX - CALL AX - CMPQ AX, $0 - JE exit - MOVQ AX, ·ssHandle(SB) - - MOVQ ·goWaitsH(SB), CX - MOVQ ·cSetEvent(SB), AX - CALL AX - - MOVQ ·cWaitsH(SB), CX - MOVQ $4294967295, DX - MOVQ ·cWaitForSingleObject(SB), AX - CALL AX - -exit: - ADDQ $32, SP - RET - -// I do not know why, but this seems to be the only way to call -// ctlHandlerProc on Windows 7. - -// func servicectlhandler(ctl uint32) uintptr -TEXT ·servicectlhandler(SB),7,$0 - MOVQ ·ctlHandlerProc(SB), AX - JMP AX diff --git a/vendor/golang.org/x/sys/windows/syscall.go b/vendor/golang.org/x/sys/windows/syscall.go deleted file mode 100644 index a8cc609b3..000000000 --- a/vendor/golang.org/x/sys/windows/syscall.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package windows contains an interface to the low-level operating system -// primitives. OS details vary depending on the underlying system, and -// by default, godoc will display the OS-specific documentation for the current -// system. If you want godoc to display syscall documentation for another -// system, set $GOOS and $GOARCH to the desired system. For example, if -// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS -// to freebsd and $GOARCH to arm. -// The primary use of this package is inside other packages that provide a more -// portable interface to the system, such as "os", "time" and "net". Use -// those packages rather than this one if you can. -// For details of the functions and data types in this package consult -// the manuals for the appropriate operating system. -// These calls return err == nil to indicate success; otherwise -// err represents an operating system error describing the failure and -// holds a value of type syscall.Errno. -package windows // import "golang.org/x/sys/windows" - -import ( - "syscall" - "unsafe" -) - -// ByteSliceFromString returns a NUL-terminated slice of bytes -// containing the text of s. If s contains a NUL byte at any -// location, it returns (nil, syscall.EINVAL). -func ByteSliceFromString(s string) ([]byte, error) { - for i := 0; i < len(s); i++ { - if s[i] == 0 { - return nil, syscall.EINVAL - } - } - a := make([]byte, len(s)+1) - copy(a, s) - return a, nil -} - -// BytePtrFromString returns a pointer to a NUL-terminated array of -// bytes containing the text of s. If s contains a NUL byte at any -// location, it returns (nil, syscall.EINVAL). -func BytePtrFromString(s string) (*byte, error) { - a, err := ByteSliceFromString(s) - if err != nil { - return nil, err - } - return &a[0], nil -} - -// Single-word zero for use when we need a valid pointer to 0 bytes. -// See mksyscall.pl. -var _zero uintptr - -func (ts *Timespec) Unix() (sec int64, nsec int64) { - return int64(ts.Sec), int64(ts.Nsec) -} - -func (tv *Timeval) Unix() (sec int64, nsec int64) { - return int64(tv.Sec), int64(tv.Usec) * 1000 -} - -func (ts *Timespec) Nano() int64 { - return int64(ts.Sec)*1e9 + int64(ts.Nsec) -} - -func (tv *Timeval) Nano() int64 { - return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 -} - -// use is a no-op, but the compiler cannot see that it is. -// Calling use(p) ensures that p is kept live until that point. -//go:noescape -func use(p unsafe.Pointer) diff --git a/vendor/golang.org/x/sys/windows/syscall_test.go b/vendor/golang.org/x/sys/windows/syscall_test.go deleted file mode 100644 index 62588b91b..000000000 --- a/vendor/golang.org/x/sys/windows/syscall_test.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package windows_test - -import ( - "testing" - - "golang.org/x/sys/windows" -) - -func testSetGetenv(t *testing.T, key, value string) { - err := windows.Setenv(key, value) - if err != nil { - t.Fatalf("Setenv failed to set %q: %v", value, err) - } - newvalue, found := windows.Getenv(key) - if !found { - t.Fatalf("Getenv failed to find %v variable (want value %q)", key, value) - } - if newvalue != value { - t.Fatalf("Getenv(%v) = %q; want %q", key, newvalue, value) - } -} - -func TestEnv(t *testing.T) { - testSetGetenv(t, "TESTENV", "AVALUE") - // make sure TESTENV gets set to "", not deleted - testSetGetenv(t, "TESTENV", "") -} diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go deleted file mode 100644 index 75def6092..000000000 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ /dev/null @@ -1,990 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Windows system calls. - -package windows - -import ( - errorspkg "errors" - "sync" - "syscall" - "unicode/utf16" - "unsafe" -) - -//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go - -type Handle uintptr - -const InvalidHandle = ^Handle(0) - -// StringToUTF16 is deprecated. Use UTF16FromString instead. -// If s contains a NUL byte this function panics instead of -// returning an error. -func StringToUTF16(s string) []uint16 { - a, err := UTF16FromString(s) - if err != nil { - panic("windows: string with NUL passed to StringToUTF16") - } - return a -} - -// UTF16FromString returns the UTF-16 encoding of the UTF-8 string -// s, with a terminating NUL added. If s contains a NUL byte at any -// location, it returns (nil, syscall.EINVAL). -func UTF16FromString(s string) ([]uint16, error) { - for i := 0; i < len(s); i++ { - if s[i] == 0 { - return nil, syscall.EINVAL - } - } - return utf16.Encode([]rune(s + "\x00")), nil -} - -// UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s, -// with a terminating NUL removed. -func UTF16ToString(s []uint16) string { - for i, v := range s { - if v == 0 { - s = s[0:i] - break - } - } - return string(utf16.Decode(s)) -} - -// StringToUTF16Ptr is deprecated. Use UTF16PtrFromString instead. -// If s contains a NUL byte this function panics instead of -// returning an error. -func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] } - -// UTF16PtrFromString returns pointer to the UTF-16 encoding of -// the UTF-8 string s, with a terminating NUL added. If s -// contains a NUL byte at any location, it returns (nil, syscall.EINVAL). -func UTF16PtrFromString(s string) (*uint16, error) { - a, err := UTF16FromString(s) - if err != nil { - return nil, err - } - return &a[0], nil -} - -func Getpagesize() int { return 4096 } - -// Converts a Go function to a function pointer conforming -// to the stdcall or cdecl calling convention. This is useful when -// interoperating with Windows code requiring callbacks. -// Implemented in runtime/syscall_windows.goc -func NewCallback(fn interface{}) uintptr -func NewCallbackCDecl(fn interface{}) uintptr - -// windows api calls - -//sys GetLastError() (lasterr error) -//sys LoadLibrary(libname string) (handle Handle, err error) = LoadLibraryW -//sys FreeLibrary(handle Handle) (err error) -//sys GetProcAddress(module Handle, procname string) (proc uintptr, err error) -//sys GetVersion() (ver uint32, err error) -//sys FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) = FormatMessageW -//sys ExitProcess(exitcode uint32) -//sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW -//sys ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) -//sys WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) -//sys SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) [failretval==0xffffffff] -//sys CloseHandle(handle Handle) (err error) -//sys GetStdHandle(stdhandle int) (handle Handle, err error) [failretval==InvalidHandle] -//sys findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) [failretval==InvalidHandle] = FindFirstFileW -//sys findNextFile1(handle Handle, data *win32finddata1) (err error) = FindNextFileW -//sys FindClose(handle Handle) (err error) -//sys GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) -//sys GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) = GetCurrentDirectoryW -//sys SetCurrentDirectory(path *uint16) (err error) = SetCurrentDirectoryW -//sys CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) = CreateDirectoryW -//sys RemoveDirectory(path *uint16) (err error) = RemoveDirectoryW -//sys DeleteFile(path *uint16) (err error) = DeleteFileW -//sys MoveFile(from *uint16, to *uint16) (err error) = MoveFileW -//sys MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) = MoveFileExW -//sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW -//sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW -//sys SetEndOfFile(handle Handle) (err error) -//sys GetSystemTimeAsFileTime(time *Filetime) -//sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff] -//sys CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) -//sys GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) -//sys PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) -//sys CancelIo(s Handle) (err error) -//sys CancelIoEx(s Handle, o *Overlapped) (err error) -//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW -//sys OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) -//sys TerminateProcess(handle Handle, exitcode uint32) (err error) -//sys GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) -//sys GetStartupInfo(startupInfo *StartupInfo) (err error) = GetStartupInfoW -//sys GetCurrentProcess() (pseudoHandle Handle, err error) -//sys GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) -//sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) -//sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff] -//sys GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) = GetTempPathW -//sys CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) -//sys GetFileType(filehandle Handle) (n uint32, err error) -//sys CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) = advapi32.CryptAcquireContextW -//sys CryptReleaseContext(provhandle Handle, flags uint32) (err error) = advapi32.CryptReleaseContext -//sys CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) = advapi32.CryptGenRandom -//sys GetEnvironmentStrings() (envs *uint16, err error) [failretval==nil] = kernel32.GetEnvironmentStringsW -//sys FreeEnvironmentStrings(envs *uint16) (err error) = kernel32.FreeEnvironmentStringsW -//sys GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) = kernel32.GetEnvironmentVariableW -//sys SetEnvironmentVariable(name *uint16, value *uint16) (err error) = kernel32.SetEnvironmentVariableW -//sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) -//sys GetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW -//sys SetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW -//sys GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) = kernel32.GetFileAttributesExW -//sys GetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW -//sys CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) [failretval==nil] = shell32.CommandLineToArgvW -//sys LocalFree(hmem Handle) (handle Handle, err error) [failretval!=0] -//sys SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) -//sys FlushFileBuffers(handle Handle) (err error) -//sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) = kernel32.GetFullPathNameW -//sys GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) = kernel32.GetLongPathNameW -//sys GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) = kernel32.GetShortPathNameW -//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) = kernel32.CreateFileMappingW -//sys MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) -//sys UnmapViewOfFile(addr uintptr) (err error) -//sys FlushViewOfFile(addr uintptr, length uintptr) (err error) -//sys VirtualLock(addr uintptr, length uintptr) (err error) -//sys VirtualUnlock(addr uintptr, length uintptr) (err error) -//sys TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) = mswsock.TransmitFile -//sys ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) = kernel32.ReadDirectoryChangesW -//sys CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) = crypt32.CertOpenSystemStoreW -//sys CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) [failretval==InvalidHandle] = crypt32.CertOpenStore -//sys CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) [failretval==nil] = crypt32.CertEnumCertificatesInStore -//sys CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) = crypt32.CertAddCertificateContextToStore -//sys CertCloseStore(store Handle, flags uint32) (err error) = crypt32.CertCloseStore -//sys CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) = crypt32.CertGetCertificateChain -//sys CertFreeCertificateChain(ctx *CertChainContext) = crypt32.CertFreeCertificateChain -//sys CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) [failretval==nil] = crypt32.CertCreateCertificateContext -//sys CertFreeCertificateContext(ctx *CertContext) (err error) = crypt32.CertFreeCertificateContext -//sys CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) = crypt32.CertVerifyCertificateChainPolicy -//sys RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) = advapi32.RegOpenKeyExW -//sys RegCloseKey(key Handle) (regerrno error) = advapi32.RegCloseKey -//sys RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegQueryInfoKeyW -//sys RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegEnumKeyExW -//sys RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegQueryValueExW -//sys getCurrentProcessId() (pid uint32) = kernel32.GetCurrentProcessId -//sys GetConsoleMode(console Handle, mode *uint32) (err error) = kernel32.GetConsoleMode -//sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW -//sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW -//sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot -//sys Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32FirstW -//sys Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32NextW -//sys DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) -// This function returns 1 byte BOOLEAN rather than the 4 byte BOOL. -//sys CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) [failretval&0xff==0] = CreateSymbolicLinkW -//sys CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) [failretval&0xff==0] = CreateHardLinkW -//sys GetCurrentThreadId() (id uint32) -//sys CreateEvent(eventAttrs *syscall.SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) = kernel32.CreateEventW -//sys SetEvent(event Handle) (err error) = kernel32.SetEvent - -// syscall interface implementation for other packages - -func Exit(code int) { ExitProcess(uint32(code)) } - -func makeInheritSa() *SecurityAttributes { - var sa SecurityAttributes - sa.Length = uint32(unsafe.Sizeof(sa)) - sa.InheritHandle = 1 - return &sa -} - -func Open(path string, mode int, perm uint32) (fd Handle, err error) { - if len(path) == 0 { - return InvalidHandle, ERROR_FILE_NOT_FOUND - } - pathp, err := UTF16PtrFromString(path) - if err != nil { - return InvalidHandle, err - } - var access uint32 - switch mode & (O_RDONLY | O_WRONLY | O_RDWR) { - case O_RDONLY: - access = GENERIC_READ - case O_WRONLY: - access = GENERIC_WRITE - case O_RDWR: - access = GENERIC_READ | GENERIC_WRITE - } - if mode&O_CREAT != 0 { - access |= GENERIC_WRITE - } - if mode&O_APPEND != 0 { - access &^= GENERIC_WRITE - access |= FILE_APPEND_DATA - } - sharemode := uint32(FILE_SHARE_READ | FILE_SHARE_WRITE) - var sa *SecurityAttributes - if mode&O_CLOEXEC == 0 { - sa = makeInheritSa() - } - var createmode uint32 - switch { - case mode&(O_CREAT|O_EXCL) == (O_CREAT | O_EXCL): - createmode = CREATE_NEW - case mode&(O_CREAT|O_TRUNC) == (O_CREAT | O_TRUNC): - createmode = CREATE_ALWAYS - case mode&O_CREAT == O_CREAT: - createmode = OPEN_ALWAYS - case mode&O_TRUNC == O_TRUNC: - createmode = TRUNCATE_EXISTING - default: - createmode = OPEN_EXISTING - } - h, e := CreateFile(pathp, access, sharemode, sa, createmode, FILE_ATTRIBUTE_NORMAL, 0) - return h, e -} - -func Read(fd Handle, p []byte) (n int, err error) { - var done uint32 - e := ReadFile(fd, p, &done, nil) - if e != nil { - if e == ERROR_BROKEN_PIPE { - // NOTE(brainman): work around ERROR_BROKEN_PIPE is returned on reading EOF from stdin - return 0, nil - } - return 0, e - } - if raceenabled { - if done > 0 { - raceWriteRange(unsafe.Pointer(&p[0]), int(done)) - } - raceAcquire(unsafe.Pointer(&ioSync)) - } - return int(done), nil -} - -func Write(fd Handle, p []byte) (n int, err error) { - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - var done uint32 - e := WriteFile(fd, p, &done, nil) - if e != nil { - return 0, e - } - if raceenabled && done > 0 { - raceReadRange(unsafe.Pointer(&p[0]), int(done)) - } - return int(done), nil -} - -var ioSync int64 - -func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) { - var w uint32 - switch whence { - case 0: - w = FILE_BEGIN - case 1: - w = FILE_CURRENT - case 2: - w = FILE_END - } - hi := int32(offset >> 32) - lo := int32(offset) - // use GetFileType to check pipe, pipe can't do seek - ft, _ := GetFileType(fd) - if ft == FILE_TYPE_PIPE { - return 0, syscall.EPIPE - } - rlo, e := SetFilePointer(fd, lo, &hi, w) - if e != nil { - return 0, e - } - return int64(hi)<<32 + int64(rlo), nil -} - -func Close(fd Handle) (err error) { - return CloseHandle(fd) -} - -var ( - Stdin = getStdHandle(STD_INPUT_HANDLE) - Stdout = getStdHandle(STD_OUTPUT_HANDLE) - Stderr = getStdHandle(STD_ERROR_HANDLE) -) - -func getStdHandle(h int) (fd Handle) { - r, _ := GetStdHandle(h) - CloseOnExec(r) - return r -} - -const ImplementsGetwd = true - -func Getwd() (wd string, err error) { - b := make([]uint16, 300) - n, e := GetCurrentDirectory(uint32(len(b)), &b[0]) - if e != nil { - return "", e - } - return string(utf16.Decode(b[0:n])), nil -} - -func Chdir(path string) (err error) { - pathp, err := UTF16PtrFromString(path) - if err != nil { - return err - } - return SetCurrentDirectory(pathp) -} - -func Mkdir(path string, mode uint32) (err error) { - pathp, err := UTF16PtrFromString(path) - if err != nil { - return err - } - return CreateDirectory(pathp, nil) -} - -func Rmdir(path string) (err error) { - pathp, err := UTF16PtrFromString(path) - if err != nil { - return err - } - return RemoveDirectory(pathp) -} - -func Unlink(path string) (err error) { - pathp, err := UTF16PtrFromString(path) - if err != nil { - return err - } - return DeleteFile(pathp) -} - -func Rename(oldpath, newpath string) (err error) { - from, err := UTF16PtrFromString(oldpath) - if err != nil { - return err - } - to, err := UTF16PtrFromString(newpath) - if err != nil { - return err - } - return MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING) -} - -func ComputerName() (name string, err error) { - var n uint32 = MAX_COMPUTERNAME_LENGTH + 1 - b := make([]uint16, n) - e := GetComputerName(&b[0], &n) - if e != nil { - return "", e - } - return string(utf16.Decode(b[0:n])), nil -} - -func Ftruncate(fd Handle, length int64) (err error) { - curoffset, e := Seek(fd, 0, 1) - if e != nil { - return e - } - defer Seek(fd, curoffset, 0) - _, e = Seek(fd, length, 0) - if e != nil { - return e - } - e = SetEndOfFile(fd) - if e != nil { - return e - } - return nil -} - -func Gettimeofday(tv *Timeval) (err error) { - var ft Filetime - GetSystemTimeAsFileTime(&ft) - *tv = NsecToTimeval(ft.Nanoseconds()) - return nil -} - -func Pipe(p []Handle) (err error) { - if len(p) != 2 { - return syscall.EINVAL - } - var r, w Handle - e := CreatePipe(&r, &w, makeInheritSa(), 0) - if e != nil { - return e - } - p[0] = r - p[1] = w - return nil -} - -func Utimes(path string, tv []Timeval) (err error) { - if len(tv) != 2 { - return syscall.EINVAL - } - pathp, e := UTF16PtrFromString(path) - if e != nil { - return e - } - h, e := CreateFile(pathp, - FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, - OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0) - if e != nil { - return e - } - defer Close(h) - a := NsecToFiletime(tv[0].Nanoseconds()) - w := NsecToFiletime(tv[1].Nanoseconds()) - return SetFileTime(h, nil, &a, &w) -} - -func UtimesNano(path string, ts []Timespec) (err error) { - if len(ts) != 2 { - return syscall.EINVAL - } - pathp, e := UTF16PtrFromString(path) - if e != nil { - return e - } - h, e := CreateFile(pathp, - FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, - OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0) - if e != nil { - return e - } - defer Close(h) - a := NsecToFiletime(TimespecToNsec(ts[0])) - w := NsecToFiletime(TimespecToNsec(ts[1])) - return SetFileTime(h, nil, &a, &w) -} - -func Fsync(fd Handle) (err error) { - return FlushFileBuffers(fd) -} - -func Chmod(path string, mode uint32) (err error) { - if mode == 0 { - return syscall.EINVAL - } - p, e := UTF16PtrFromString(path) - if e != nil { - return e - } - attrs, e := GetFileAttributes(p) - if e != nil { - return e - } - if mode&S_IWRITE != 0 { - attrs &^= FILE_ATTRIBUTE_READONLY - } else { - attrs |= FILE_ATTRIBUTE_READONLY - } - return SetFileAttributes(p, attrs) -} - -func LoadCancelIoEx() error { - return procCancelIoEx.Find() -} - -func LoadSetFileCompletionNotificationModes() error { - return procSetFileCompletionNotificationModes.Find() -} - -// net api calls - -const socket_error = uintptr(^uint32(0)) - -//sys WSAStartup(verreq uint32, data *WSAData) (sockerr error) = ws2_32.WSAStartup -//sys WSACleanup() (err error) [failretval==socket_error] = ws2_32.WSACleanup -//sys WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) [failretval==socket_error] = ws2_32.WSAIoctl -//sys socket(af int32, typ int32, protocol int32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.socket -//sys Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) [failretval==socket_error] = ws2_32.setsockopt -//sys Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockopt -//sys bind(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.bind -//sys connect(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.connect -//sys getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockname -//sys getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==socket_error] = ws2_32.getpeername -//sys listen(s Handle, backlog int32) (err error) [failretval==socket_error] = ws2_32.listen -//sys shutdown(s Handle, how int32) (err error) [failretval==socket_error] = ws2_32.shutdown -//sys Closesocket(s Handle) (err error) [failretval==socket_error] = ws2_32.closesocket -//sys AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) = mswsock.AcceptEx -//sys GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) = mswsock.GetAcceptExSockaddrs -//sys WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecv -//sys WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASend -//sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom -//sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo -//sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname -//sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname -//sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs -//sys GetProtoByName(name string) (p *Protoent, err error) [failretval==nil] = ws2_32.getprotobyname -//sys DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) = dnsapi.DnsQuery_W -//sys DnsRecordListFree(rl *DNSRecord, freetype uint32) = dnsapi.DnsRecordListFree -//sys DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) = dnsapi.DnsNameCompare_W -//sys GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) = ws2_32.GetAddrInfoW -//sys FreeAddrInfoW(addrinfo *AddrinfoW) = ws2_32.FreeAddrInfoW -//sys GetIfEntry(pIfRow *MibIfRow) (errcode error) = iphlpapi.GetIfEntry -//sys GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) = iphlpapi.GetAdaptersInfo -//sys SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) = kernel32.SetFileCompletionNotificationModes -//sys WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) [failretval==-1] = ws2_32.WSAEnumProtocolsW -//sys GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) = iphlpapi.GetAdaptersAddresses -//sys GetACP() (acp uint32) = kernel32.GetACP -//sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar - -// For testing: clients can set this flag to force -// creation of IPv6 sockets to return EAFNOSUPPORT. -var SocketDisableIPv6 bool - -type RawSockaddrInet4 struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]uint8 -} - -type RawSockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type RawSockaddr struct { - Family uint16 - Data [14]int8 -} - -type RawSockaddrAny struct { - Addr RawSockaddr - Pad [96]int8 -} - -type Sockaddr interface { - sockaddr() (ptr unsafe.Pointer, len int32, err error) // lowercase; only we can define Sockaddrs -} - -type SockaddrInet4 struct { - Port int - Addr [4]byte - raw RawSockaddrInet4 -} - -func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, int32, error) { - if sa.Port < 0 || sa.Port > 0xFFFF { - return nil, 0, syscall.EINVAL - } - sa.raw.Family = AF_INET - p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) - p[0] = byte(sa.Port >> 8) - p[1] = byte(sa.Port) - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } - return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil -} - -type SockaddrInet6 struct { - Port int - ZoneId uint32 - Addr [16]byte - raw RawSockaddrInet6 -} - -func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, int32, error) { - if sa.Port < 0 || sa.Port > 0xFFFF { - return nil, 0, syscall.EINVAL - } - sa.raw.Family = AF_INET6 - p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) - p[0] = byte(sa.Port >> 8) - p[1] = byte(sa.Port) - sa.raw.Scope_id = sa.ZoneId - for i := 0; i < len(sa.Addr); i++ { - sa.raw.Addr[i] = sa.Addr[i] - } - return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil -} - -type SockaddrUnix struct { - Name string -} - -func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) { - // TODO(brainman): implement SockaddrUnix.sockaddr() - return nil, 0, syscall.EWINDOWS -} - -func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) { - switch rsa.Addr.Family { - case AF_UNIX: - return nil, syscall.EWINDOWS - - case AF_INET: - pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) - sa := new(SockaddrInet4) - p := (*[2]byte)(unsafe.Pointer(&pp.Port)) - sa.Port = int(p[0])<<8 + int(p[1]) - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } - return sa, nil - - case AF_INET6: - pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) - sa := new(SockaddrInet6) - p := (*[2]byte)(unsafe.Pointer(&pp.Port)) - sa.Port = int(p[0])<<8 + int(p[1]) - sa.ZoneId = pp.Scope_id - for i := 0; i < len(sa.Addr); i++ { - sa.Addr[i] = pp.Addr[i] - } - return sa, nil - } - return nil, syscall.EAFNOSUPPORT -} - -func Socket(domain, typ, proto int) (fd Handle, err error) { - if domain == AF_INET6 && SocketDisableIPv6 { - return InvalidHandle, syscall.EAFNOSUPPORT - } - return socket(int32(domain), int32(typ), int32(proto)) -} - -func SetsockoptInt(fd Handle, level, opt int, value int) (err error) { - v := int32(value) - return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v))) -} - -func Bind(fd Handle, sa Sockaddr) (err error) { - ptr, n, err := sa.sockaddr() - if err != nil { - return err - } - return bind(fd, ptr, n) -} - -func Connect(fd Handle, sa Sockaddr) (err error) { - ptr, n, err := sa.sockaddr() - if err != nil { - return err - } - return connect(fd, ptr, n) -} - -func Getsockname(fd Handle) (sa Sockaddr, err error) { - var rsa RawSockaddrAny - l := int32(unsafe.Sizeof(rsa)) - if err = getsockname(fd, &rsa, &l); err != nil { - return - } - return rsa.Sockaddr() -} - -func Getpeername(fd Handle) (sa Sockaddr, err error) { - var rsa RawSockaddrAny - l := int32(unsafe.Sizeof(rsa)) - if err = getpeername(fd, &rsa, &l); err != nil { - return - } - return rsa.Sockaddr() -} - -func Listen(s Handle, n int) (err error) { - return listen(s, int32(n)) -} - -func Shutdown(fd Handle, how int) (err error) { - return shutdown(fd, int32(how)) -} - -func WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, overlapped *Overlapped, croutine *byte) (err error) { - rsa, l, err := to.sockaddr() - if err != nil { - return err - } - return WSASendTo(s, bufs, bufcnt, sent, flags, (*RawSockaddrAny)(unsafe.Pointer(rsa)), l, overlapped, croutine) -} - -func LoadGetAddrInfo() error { - return procGetAddrInfoW.Find() -} - -var connectExFunc struct { - once sync.Once - addr uintptr - err error -} - -func LoadConnectEx() error { - connectExFunc.once.Do(func() { - var s Handle - s, connectExFunc.err = Socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) - if connectExFunc.err != nil { - return - } - defer CloseHandle(s) - var n uint32 - connectExFunc.err = WSAIoctl(s, - SIO_GET_EXTENSION_FUNCTION_POINTER, - (*byte)(unsafe.Pointer(&WSAID_CONNECTEX)), - uint32(unsafe.Sizeof(WSAID_CONNECTEX)), - (*byte)(unsafe.Pointer(&connectExFunc.addr)), - uint32(unsafe.Sizeof(connectExFunc.addr)), - &n, nil, 0) - }) - return connectExFunc.err -} - -func connectEx(s Handle, name unsafe.Pointer, namelen int32, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(connectExFunc.addr, 7, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ConnectEx(fd Handle, sa Sockaddr, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) error { - err := LoadConnectEx() - if err != nil { - return errorspkg.New("failed to find ConnectEx: " + err.Error()) - } - ptr, n, err := sa.sockaddr() - if err != nil { - return err - } - return connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped) -} - -// Invented structures to support what package os expects. -type Rusage struct { - CreationTime Filetime - ExitTime Filetime - KernelTime Filetime - UserTime Filetime -} - -type WaitStatus struct { - ExitCode uint32 -} - -func (w WaitStatus) Exited() bool { return true } - -func (w WaitStatus) ExitStatus() int { return int(w.ExitCode) } - -func (w WaitStatus) Signal() Signal { return -1 } - -func (w WaitStatus) CoreDump() bool { return false } - -func (w WaitStatus) Stopped() bool { return false } - -func (w WaitStatus) Continued() bool { return false } - -func (w WaitStatus) StopSignal() Signal { return -1 } - -func (w WaitStatus) Signaled() bool { return false } - -func (w WaitStatus) TrapCause() int { return -1 } - -// Timespec is an invented structure on Windows, but here for -// consistency with the corresponding package for other operating systems. -type Timespec struct { - Sec int64 - Nsec int64 -} - -func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } - -func NsecToTimespec(nsec int64) (ts Timespec) { - ts.Sec = nsec / 1e9 - ts.Nsec = nsec % 1e9 - return -} - -// TODO(brainman): fix all needed for net - -func Accept(fd Handle) (nfd Handle, sa Sockaddr, err error) { return 0, nil, syscall.EWINDOWS } -func Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, err error) { - return 0, nil, syscall.EWINDOWS -} -func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error) { return syscall.EWINDOWS } -func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error) { return syscall.EWINDOWS } - -// The Linger struct is wrong but we only noticed after Go 1. -// sysLinger is the real system call structure. - -// BUG(brainman): The definition of Linger is not appropriate for direct use -// with Setsockopt and Getsockopt. -// Use SetsockoptLinger instead. - -type Linger struct { - Onoff int32 - Linger int32 -} - -type sysLinger struct { - Onoff uint16 - Linger uint16 -} - -type IPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} - -type IPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -func GetsockoptInt(fd Handle, level, opt int) (int, error) { return -1, syscall.EWINDOWS } - -func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { - sys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)} - return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&sys)), int32(unsafe.Sizeof(sys))) -} - -func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { - return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) -} -func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { - return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) -} -func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { - return syscall.EWINDOWS -} - -func Getpid() (pid int) { return int(getCurrentProcessId()) } - -func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) { - // NOTE(rsc): The Win32finddata struct is wrong for the system call: - // the two paths are each one uint16 short. Use the correct struct, - // a win32finddata1, and then copy the results out. - // There is no loss of expressivity here, because the final - // uint16, if it is used, is supposed to be a NUL, and Go doesn't need that. - // For Go 1.1, we might avoid the allocation of win32finddata1 here - // by adding a final Bug [2]uint16 field to the struct and then - // adjusting the fields in the result directly. - var data1 win32finddata1 - handle, err = findFirstFile1(name, &data1) - if err == nil { - copyFindData(data, &data1) - } - return -} - -func FindNextFile(handle Handle, data *Win32finddata) (err error) { - var data1 win32finddata1 - err = findNextFile1(handle, &data1) - if err == nil { - copyFindData(data, &data1) - } - return -} - -func getProcessEntry(pid int) (*ProcessEntry32, error) { - snapshot, err := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) - if err != nil { - return nil, err - } - defer CloseHandle(snapshot) - var procEntry ProcessEntry32 - procEntry.Size = uint32(unsafe.Sizeof(procEntry)) - if err = Process32First(snapshot, &procEntry); err != nil { - return nil, err - } - for { - if procEntry.ProcessID == uint32(pid) { - return &procEntry, nil - } - err = Process32Next(snapshot, &procEntry) - if err != nil { - return nil, err - } - } -} - -func Getppid() (ppid int) { - pe, err := getProcessEntry(Getpid()) - if err != nil { - return -1 - } - return int(pe.ParentProcessID) -} - -// TODO(brainman): fix all needed for os -func Fchdir(fd Handle) (err error) { return syscall.EWINDOWS } -func Link(oldpath, newpath string) (err error) { return syscall.EWINDOWS } -func Symlink(path, link string) (err error) { return syscall.EWINDOWS } - -func Fchmod(fd Handle, mode uint32) (err error) { return syscall.EWINDOWS } -func Chown(path string, uid int, gid int) (err error) { return syscall.EWINDOWS } -func Lchown(path string, uid int, gid int) (err error) { return syscall.EWINDOWS } -func Fchown(fd Handle, uid int, gid int) (err error) { return syscall.EWINDOWS } - -func Getuid() (uid int) { return -1 } -func Geteuid() (euid int) { return -1 } -func Getgid() (gid int) { return -1 } -func Getegid() (egid int) { return -1 } -func Getgroups() (gids []int, err error) { return nil, syscall.EWINDOWS } - -type Signal int - -func (s Signal) Signal() {} - -func (s Signal) String() string { - if 0 <= s && int(s) < len(signals) { - str := signals[s] - if str != "" { - return str - } - } - return "signal " + itoa(int(s)) -} - -func LoadCreateSymbolicLink() error { - return procCreateSymbolicLinkW.Find() -} - -// Readlink returns the destination of the named symbolic link. -func Readlink(path string, buf []byte) (n int, err error) { - fd, err := CreateFile(StringToUTF16Ptr(path), GENERIC_READ, 0, nil, OPEN_EXISTING, - FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, 0) - if err != nil { - return -1, err - } - defer CloseHandle(fd) - - rdbbuf := make([]byte, MAXIMUM_REPARSE_DATA_BUFFER_SIZE) - var bytesReturned uint32 - err = DeviceIoControl(fd, FSCTL_GET_REPARSE_POINT, nil, 0, &rdbbuf[0], uint32(len(rdbbuf)), &bytesReturned, nil) - if err != nil { - return -1, err - } - - rdb := (*reparseDataBuffer)(unsafe.Pointer(&rdbbuf[0])) - var s string - switch rdb.ReparseTag { - case IO_REPARSE_TAG_SYMLINK: - data := (*symbolicLinkReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer)) - p := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0])) - s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2]) - case IO_REPARSE_TAG_MOUNT_POINT: - data := (*mountPointReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer)) - p := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0])) - s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2]) - default: - // the path is not a symlink or junction but another type of reparse - // point - return -1, syscall.ENOENT - } - n = copy(buf, []byte(s)) - - return n, nil -} diff --git a/vendor/golang.org/x/sys/windows/syscall_windows_test.go b/vendor/golang.org/x/sys/windows/syscall_windows_test.go deleted file mode 100644 index 0f73c11ba..000000000 --- a/vendor/golang.org/x/sys/windows/syscall_windows_test.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "syscall" - "testing" - "unsafe" - - "golang.org/x/sys/windows" -) - -func TestWin32finddata(t *testing.T) { - dir, err := ioutil.TempDir("", "go-build") - if err != nil { - t.Fatalf("failed to create temp directory: %v", err) - } - defer os.RemoveAll(dir) - - path := filepath.Join(dir, "long_name.and_extension") - f, err := os.Create(path) - if err != nil { - t.Fatalf("failed to create %v: %v", path, err) - } - f.Close() - - type X struct { - fd windows.Win32finddata - got byte - pad [10]byte // to protect ourselves - - } - var want byte = 2 // it is unlikely to have this character in the filename - x := X{got: want} - - pathp, _ := windows.UTF16PtrFromString(path) - h, err := windows.FindFirstFile(pathp, &(x.fd)) - if err != nil { - t.Fatalf("FindFirstFile failed: %v", err) - } - err = windows.FindClose(h) - if err != nil { - t.Fatalf("FindClose failed: %v", err) - } - - if x.got != want { - t.Fatalf("memory corruption: want=%d got=%d", want, x.got) - } -} - -func TestFormatMessage(t *testing.T) { - dll := windows.MustLoadDLL("pdh.dll") - - pdhOpenQuery := func(datasrc *uint16, userdata uint32, query *windows.Handle) (errno uintptr) { - r0, _, _ := syscall.Syscall(dll.MustFindProc("PdhOpenQueryW").Addr(), 3, uintptr(unsafe.Pointer(datasrc)), uintptr(userdata), uintptr(unsafe.Pointer(query))) - return r0 - } - - pdhCloseQuery := func(query windows.Handle) (errno uintptr) { - r0, _, _ := syscall.Syscall(dll.MustFindProc("PdhCloseQuery").Addr(), 1, uintptr(query), 0, 0) - return r0 - } - - var q windows.Handle - name, err := windows.UTF16PtrFromString("no_such_source") - if err != nil { - t.Fatal(err) - } - errno := pdhOpenQuery(name, 0, &q) - if errno == 0 { - pdhCloseQuery(q) - t.Fatal("PdhOpenQuery succeeded, but expected to fail.") - } - - const flags uint32 = syscall.FORMAT_MESSAGE_FROM_HMODULE | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS - buf := make([]uint16, 300) - _, err = windows.FormatMessage(flags, uintptr(dll.Handle), uint32(errno), 0, buf, nil) - if err != nil { - t.Fatal("FormatMessage for handle=%x and errno=%x failed: %v", dll.Handle, errno, err) - } -} - -func abort(funcname string, err error) { - panic(funcname + " failed: " + err.Error()) -} - -func ExampleLoadLibrary() { - h, err := windows.LoadLibrary("kernel32.dll") - if err != nil { - abort("LoadLibrary", err) - } - defer windows.FreeLibrary(h) - proc, err := windows.GetProcAddress(h, "GetVersion") - if err != nil { - abort("GetProcAddress", err) - } - r, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0) - major := byte(r) - minor := uint8(r >> 8) - build := uint16(r >> 16) - print("windows version ", major, ".", minor, " (Build ", build, ")\n") -} diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go deleted file mode 100644 index 10dd30ae2..000000000 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ /dev/null @@ -1,2220 +0,0 @@ -// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT - -package windows - -import "unsafe" -import "syscall" - -var _ unsafe.Pointer - -var ( - modadvapi32 = syscall.NewLazyDLL("advapi32.dll") - modkernel32 = syscall.NewLazyDLL("kernel32.dll") - modshell32 = syscall.NewLazyDLL("shell32.dll") - modmswsock = syscall.NewLazyDLL("mswsock.dll") - modcrypt32 = syscall.NewLazyDLL("crypt32.dll") - modws2_32 = syscall.NewLazyDLL("ws2_32.dll") - moddnsapi = syscall.NewLazyDLL("dnsapi.dll") - modiphlpapi = syscall.NewLazyDLL("iphlpapi.dll") - modsecur32 = syscall.NewLazyDLL("secur32.dll") - modnetapi32 = syscall.NewLazyDLL("netapi32.dll") - moduserenv = syscall.NewLazyDLL("userenv.dll") - - procRegisterEventSourceW = modadvapi32.NewProc("RegisterEventSourceW") - procDeregisterEventSource = modadvapi32.NewProc("DeregisterEventSource") - procReportEventW = modadvapi32.NewProc("ReportEventW") - procOpenSCManagerW = modadvapi32.NewProc("OpenSCManagerW") - procCloseServiceHandle = modadvapi32.NewProc("CloseServiceHandle") - procCreateServiceW = modadvapi32.NewProc("CreateServiceW") - procOpenServiceW = modadvapi32.NewProc("OpenServiceW") - procDeleteService = modadvapi32.NewProc("DeleteService") - procStartServiceW = modadvapi32.NewProc("StartServiceW") - procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus") - procControlService = modadvapi32.NewProc("ControlService") - procStartServiceCtrlDispatcherW = modadvapi32.NewProc("StartServiceCtrlDispatcherW") - procSetServiceStatus = modadvapi32.NewProc("SetServiceStatus") - procChangeServiceConfigW = modadvapi32.NewProc("ChangeServiceConfigW") - procQueryServiceConfigW = modadvapi32.NewProc("QueryServiceConfigW") - procChangeServiceConfig2W = modadvapi32.NewProc("ChangeServiceConfig2W") - procQueryServiceConfig2W = modadvapi32.NewProc("QueryServiceConfig2W") - procGetLastError = modkernel32.NewProc("GetLastError") - procLoadLibraryW = modkernel32.NewProc("LoadLibraryW") - procFreeLibrary = modkernel32.NewProc("FreeLibrary") - procGetProcAddress = modkernel32.NewProc("GetProcAddress") - procGetVersion = modkernel32.NewProc("GetVersion") - procFormatMessageW = modkernel32.NewProc("FormatMessageW") - procExitProcess = modkernel32.NewProc("ExitProcess") - procCreateFileW = modkernel32.NewProc("CreateFileW") - procReadFile = modkernel32.NewProc("ReadFile") - procWriteFile = modkernel32.NewProc("WriteFile") - procSetFilePointer = modkernel32.NewProc("SetFilePointer") - procCloseHandle = modkernel32.NewProc("CloseHandle") - procGetStdHandle = modkernel32.NewProc("GetStdHandle") - procFindFirstFileW = modkernel32.NewProc("FindFirstFileW") - procFindNextFileW = modkernel32.NewProc("FindNextFileW") - procFindClose = modkernel32.NewProc("FindClose") - procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle") - procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW") - procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") - procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW") - procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW") - procDeleteFileW = modkernel32.NewProc("DeleteFileW") - procMoveFileW = modkernel32.NewProc("MoveFileW") - procMoveFileExW = modkernel32.NewProc("MoveFileExW") - procGetComputerNameW = modkernel32.NewProc("GetComputerNameW") - procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") - procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") - procGetSystemTimeAsFileTime = modkernel32.NewProc("GetSystemTimeAsFileTime") - procGetTimeZoneInformation = modkernel32.NewProc("GetTimeZoneInformation") - procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") - procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") - procPostQueuedCompletionStatus = modkernel32.NewProc("PostQueuedCompletionStatus") - procCancelIo = modkernel32.NewProc("CancelIo") - procCancelIoEx = modkernel32.NewProc("CancelIoEx") - procCreateProcessW = modkernel32.NewProc("CreateProcessW") - procOpenProcess = modkernel32.NewProc("OpenProcess") - procTerminateProcess = modkernel32.NewProc("TerminateProcess") - procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess") - procGetStartupInfoW = modkernel32.NewProc("GetStartupInfoW") - procGetCurrentProcess = modkernel32.NewProc("GetCurrentProcess") - procGetProcessTimes = modkernel32.NewProc("GetProcessTimes") - procDuplicateHandle = modkernel32.NewProc("DuplicateHandle") - procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject") - procGetTempPathW = modkernel32.NewProc("GetTempPathW") - procCreatePipe = modkernel32.NewProc("CreatePipe") - procGetFileType = modkernel32.NewProc("GetFileType") - procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW") - procCryptReleaseContext = modadvapi32.NewProc("CryptReleaseContext") - procCryptGenRandom = modadvapi32.NewProc("CryptGenRandom") - procGetEnvironmentStringsW = modkernel32.NewProc("GetEnvironmentStringsW") - procFreeEnvironmentStringsW = modkernel32.NewProc("FreeEnvironmentStringsW") - procGetEnvironmentVariableW = modkernel32.NewProc("GetEnvironmentVariableW") - procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") - procSetFileTime = modkernel32.NewProc("SetFileTime") - procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW") - procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW") - procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW") - procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") - procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW") - procLocalFree = modkernel32.NewProc("LocalFree") - procSetHandleInformation = modkernel32.NewProc("SetHandleInformation") - procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers") - procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW") - procGetLongPathNameW = modkernel32.NewProc("GetLongPathNameW") - procGetShortPathNameW = modkernel32.NewProc("GetShortPathNameW") - procCreateFileMappingW = modkernel32.NewProc("CreateFileMappingW") - procMapViewOfFile = modkernel32.NewProc("MapViewOfFile") - procUnmapViewOfFile = modkernel32.NewProc("UnmapViewOfFile") - procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile") - procVirtualLock = modkernel32.NewProc("VirtualLock") - procVirtualUnlock = modkernel32.NewProc("VirtualUnlock") - procTransmitFile = modmswsock.NewProc("TransmitFile") - procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW") - procCertOpenSystemStoreW = modcrypt32.NewProc("CertOpenSystemStoreW") - procCertOpenStore = modcrypt32.NewProc("CertOpenStore") - procCertEnumCertificatesInStore = modcrypt32.NewProc("CertEnumCertificatesInStore") - procCertAddCertificateContextToStore = modcrypt32.NewProc("CertAddCertificateContextToStore") - procCertCloseStore = modcrypt32.NewProc("CertCloseStore") - procCertGetCertificateChain = modcrypt32.NewProc("CertGetCertificateChain") - procCertFreeCertificateChain = modcrypt32.NewProc("CertFreeCertificateChain") - procCertCreateCertificateContext = modcrypt32.NewProc("CertCreateCertificateContext") - procCertFreeCertificateContext = modcrypt32.NewProc("CertFreeCertificateContext") - procCertVerifyCertificateChainPolicy = modcrypt32.NewProc("CertVerifyCertificateChainPolicy") - procRegOpenKeyExW = modadvapi32.NewProc("RegOpenKeyExW") - procRegCloseKey = modadvapi32.NewProc("RegCloseKey") - procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW") - procRegEnumKeyExW = modadvapi32.NewProc("RegEnumKeyExW") - procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW") - procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId") - procGetConsoleMode = modkernel32.NewProc("GetConsoleMode") - procWriteConsoleW = modkernel32.NewProc("WriteConsoleW") - procReadConsoleW = modkernel32.NewProc("ReadConsoleW") - procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot") - procProcess32FirstW = modkernel32.NewProc("Process32FirstW") - procProcess32NextW = modkernel32.NewProc("Process32NextW") - procDeviceIoControl = modkernel32.NewProc("DeviceIoControl") - procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW") - procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW") - procGetCurrentThreadId = modkernel32.NewProc("GetCurrentThreadId") - procCreateEventW = modkernel32.NewProc("CreateEventW") - procSetEvent = modkernel32.NewProc("SetEvent") - procWSAStartup = modws2_32.NewProc("WSAStartup") - procWSACleanup = modws2_32.NewProc("WSACleanup") - procWSAIoctl = modws2_32.NewProc("WSAIoctl") - procsocket = modws2_32.NewProc("socket") - procsetsockopt = modws2_32.NewProc("setsockopt") - procgetsockopt = modws2_32.NewProc("getsockopt") - procbind = modws2_32.NewProc("bind") - procconnect = modws2_32.NewProc("connect") - procgetsockname = modws2_32.NewProc("getsockname") - procgetpeername = modws2_32.NewProc("getpeername") - proclisten = modws2_32.NewProc("listen") - procshutdown = modws2_32.NewProc("shutdown") - procclosesocket = modws2_32.NewProc("closesocket") - procAcceptEx = modmswsock.NewProc("AcceptEx") - procGetAcceptExSockaddrs = modmswsock.NewProc("GetAcceptExSockaddrs") - procWSARecv = modws2_32.NewProc("WSARecv") - procWSASend = modws2_32.NewProc("WSASend") - procWSARecvFrom = modws2_32.NewProc("WSARecvFrom") - procWSASendTo = modws2_32.NewProc("WSASendTo") - procgethostbyname = modws2_32.NewProc("gethostbyname") - procgetservbyname = modws2_32.NewProc("getservbyname") - procntohs = modws2_32.NewProc("ntohs") - procgetprotobyname = modws2_32.NewProc("getprotobyname") - procDnsQuery_W = moddnsapi.NewProc("DnsQuery_W") - procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree") - procDnsNameCompare_W = moddnsapi.NewProc("DnsNameCompare_W") - procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") - procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW") - procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") - procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") - procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") - procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW") - procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") - procGetACP = modkernel32.NewProc("GetACP") - procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar") - procTranslateNameW = modsecur32.NewProc("TranslateNameW") - procGetUserNameExW = modsecur32.NewProc("GetUserNameExW") - procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") - procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") - procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") - procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") - procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") - procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") - procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") - procGetLengthSid = modadvapi32.NewProc("GetLengthSid") - procCopySid = modadvapi32.NewProc("CopySid") - procAllocateAndInitializeSid = modadvapi32.NewProc("AllocateAndInitializeSid") - procFreeSid = modadvapi32.NewProc("FreeSid") - procEqualSid = modadvapi32.NewProc("EqualSid") - procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken") - procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation") - procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") -) - -func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func DeregisterEventSource(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CloseServiceHandle(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func DeleteService(service Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { - r1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) { - r1, _, e1 := syscall.Syscall12(procChangeServiceConfigW.Addr(), 11, uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) { - r1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetLastError() (lasterr error) { - r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0) - if r0 != 0 { - lasterr = syscall.Errno(r0) - } - return -} - -func LoadLibrary(libname string) (handle Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(libname) - if err != nil { - return - } - return _LoadLibrary(_p0) -} - -func _LoadLibrary(libname *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FreeLibrary(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetProcAddress(module Handle, procname string) (proc uintptr, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(procname) - if err != nil { - return - } - return _GetProcAddress(module, _p0) -} - -func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { - r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0) - proc = uintptr(r0) - if proc == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetVersion() (ver uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0) - ver = uint32(r0) - if ver == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) { - var _p0 *uint16 - if len(buf) > 0 { - _p0 = &buf[0] - } - r0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)), 0, 0) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ExitProcess(exitcode uint32) { - syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0) - return -} - -func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) - handle = Handle(r0) - if handle == InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) { - var _p0 *byte - if len(buf) > 0 { - _p0 = &buf[0] - } - r1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) { - var _p0 *byte - if len(buf) > 0 { - _p0 = &buf[0] - } - r1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) { - r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0) - newlowoffset = uint32(r0) - if newlowoffset == 0xffffffff { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CloseHandle(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetStdHandle(stdhandle int) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0) - handle = Handle(r0) - if handle == InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0) - handle = Handle(r0) - if handle == InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func findNextFile1(handle Handle, data *win32finddata1) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FindClose(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) { - r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetCurrentDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { - r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func RemoveDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func DeleteFile(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func MoveFile(from *uint16, to *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetComputerName(buf *uint16, n *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetEndOfFile(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetSystemTimeAsFileTime(time *Filetime) { - syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0) - return -} - -func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0) - rc = uint32(r0) - if rc == 0xffffffff { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CancelIo(s Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CancelIoEx(s Handle, o *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) { - var _p0 uint32 - if inheritHandles { - _p0 = 1 - } else { - _p0 = 0 - } - r1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) { - var _p0 uint32 - if inheritHandle { - _p0 = 1 - } else { - _p0 = 0 - } - r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(da), uintptr(_p0), uintptr(pid)) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func TerminateProcess(handle Handle, exitcode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetStartupInfo(startupInfo *StartupInfo) (err error) { - r1, _, e1 := syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetCurrentProcess() (pseudoHandle Handle, err error) { - r0, _, e1 := syscall.Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0) - pseudoHandle = Handle(r0) - if pseudoHandle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) { - var _p0 uint32 - if bInheritHandle { - _p0 = 1 - } else { - _p0 = 0 - } - r1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) { - r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0) - event = uint32(r0) - if event == 0xffffffff { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetFileType(filehandle Handle) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { - r1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetEnvironmentStrings() (envs *uint16, err error) { - r0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0) - envs = (*uint16)(unsafe.Pointer(r0)) - if envs == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FreeEnvironmentStrings(envs *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetFileAttributes(name *uint16) (attrs uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) - attrs = uint32(r0) - if attrs == INVALID_FILE_ATTRIBUTES { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetFileAttributes(name *uint16, attrs uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { - r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetCommandLine() (cmd *uint16) { - r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0) - cmd = (*uint16)(unsafe.Pointer(r0)) - return -} - -func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) { - r0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0) - argv = (*[8192]*[8192]uint16)(unsafe.Pointer(r0)) - if argv == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func LocalFree(hmem Handle) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0) - handle = Handle(r0) - if handle != 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags)) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FlushFileBuffers(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) - n = uint32(r0) - if n == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { - r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0) - addr = uintptr(r0) - if addr == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func UnmapViewOfFile(addr uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FlushViewOfFile(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func VirtualLock(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func VirtualUnlock(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { - var _p0 uint32 - if watchSubTree { - _p0 = 1 - } else { - _p0 = 0 - } - r1, _, e1 := syscall.Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { - r0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0) - store = Handle(r0) - if store == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0) - handle = Handle(r0) - if handle == InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) { - r0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0) - context = (*CertContext)(unsafe.Pointer(r0)) - if context == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) { - r1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertCloseStore(store Handle, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) { - r1, _, e1 := syscall.Syscall9(procCertGetCertificateChain.Addr(), 8, uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertFreeCertificateChain(ctx *CertChainContext) { - syscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0) - return -} - -func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) { - r0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) - context = (*CertContext)(unsafe.Pointer(r0)) - if context == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertFreeCertificateContext(ctx *CertContext) (err error) { - r1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) { - r1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func RegCloseKey(key Handle) (regerrno error) { - r0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) { - r0, _, _ := syscall.Syscall12(procRegQueryInfoKeyW.Addr(), 12, uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) { - r0, _, _ := syscall.Syscall9(procRegEnumKeyExW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)), 0) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegQueryValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) - if r0 != 0 { - regerrno = syscall.Errno(r0) - } - return -} - -func getCurrentProcessId() (pid uint32) { - r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0) - pid = uint32(r0) - return -} - -func GetConsoleMode(console Handle, mode *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) { - r1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) { - r1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0) - handle = Handle(r0) - if handle == InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) - if r1&0xff == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) - if r1&0xff == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetCurrentThreadId() (id uint32) { - r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0) - id = uint32(r0) - return -} - -func CreateEvent(eventAttrs *syscall.SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0) - handle = Handle(r0) - if handle == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func SetEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { - r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0) - if r0 != 0 { - sockerr = syscall.Errno(r0) - } - return -} - -func WSACleanup() (err error) { - r1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { - r1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol)) - handle = Handle(r0) - if handle == InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) { - r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) { - r1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func listen(s Handle, backlog int32) (err error) { - r1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func shutdown(s Handle, how int32) (err error) { - r1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func Closesocket(s Handle) (err error) { - r1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) { - syscall.Syscall9(procGetAcceptExSockaddrs.Addr(), 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0) - return -} - -func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) - if r1 == socket_error { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetHostByName(name string) (h *Hostent, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(name) - if err != nil { - return - } - return _GetHostByName(_p0) -} - -func _GetHostByName(name *byte) (h *Hostent, err error) { - r0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) - h = (*Hostent)(unsafe.Pointer(r0)) - if h == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetServByName(name string, proto string) (s *Servent, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(name) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(proto) - if err != nil { - return - } - return _GetServByName(_p0, _p1) -} - -func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { - r0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0) - s = (*Servent)(unsafe.Pointer(r0)) - if s == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func Ntohs(netshort uint16) (u uint16) { - r0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0) - u = uint16(r0) - return -} - -func GetProtoByName(name string) (p *Protoent, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(name) - if err != nil { - return - } - return _GetProtoByName(_p0) -} - -func _GetProtoByName(name *byte) (p *Protoent, err error) { - r0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) - p = (*Protoent)(unsafe.Pointer(r0)) - if p == nil { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { - var _p0 *uint16 - _p0, status = syscall.UTF16PtrFromString(name) - if status != nil { - return - } - return _DnsQuery(_p0, qtype, options, extra, qrs, pr) -} - -func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { - r0, _, _ := syscall.Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) - if r0 != 0 { - status = syscall.Errno(r0) - } - return -} - -func DnsRecordListFree(rl *DNSRecord, freetype uint32) { - syscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0) - return -} - -func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) { - r0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0) - same = r0 != 0 - return -} - -func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) { - r0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0) - if r0 != 0 { - sockerr = syscall.Errno(r0) - } - return -} - -func FreeAddrInfoW(addrinfo *AddrinfoW) { - syscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0) - return -} - -func GetIfEntry(pIfRow *MibIfRow) (errcode error) { - r0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - -func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { - r0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - -func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) { - r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) - n = int32(r0) - if n == -1 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { - r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0) - if r0 != 0 { - errcode = syscall.Errno(r0) - } - return -} - -func GetACP() (acp uint32) { - r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0) - acp = uint32(r0) - return -} - -func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) { - r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) - nwrite = int32(r0) - if nwrite == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0) - if r1&0xff == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) - if r1&0xff == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { - r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) - if r0 != 0 { - neterr = syscall.Errno(r0) - } - return -} - -func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) { - r0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) - if r0 != 0 { - neterr = syscall.Errno(r0) - } - return -} - -func NetApiBufferFree(buf *byte) (neterr error) { - r0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0) - if r0 != 0 { - neterr = syscall.Errno(r0) - } - return -} - -func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { - r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetLengthSid(sid *SID) (len uint32) { - r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) - len = uint32(r0) - return -} - -func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) { - r1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) { - r1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func FreeSid(sid *SID) (err error) { - r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) - if r1 != 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { - r0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0) - isEqual = r0 != 0 - return -} - -func OpenProcessToken(h Handle, access uint32, token *Token) (err error) { - r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(h), uintptr(access), uintptr(unsafe.Pointer(token))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(t), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} diff --git a/vendor/golang.org/x/sys/windows/ztypes_windows.go b/vendor/golang.org/x/sys/windows/ztypes_windows.go deleted file mode 100644 index 1fe19d1d7..000000000 --- a/vendor/golang.org/x/sys/windows/ztypes_windows.go +++ /dev/null @@ -1,1242 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows - -import "syscall" - -const ( - // Windows errors. - ERROR_FILE_NOT_FOUND syscall.Errno = 2 - ERROR_PATH_NOT_FOUND syscall.Errno = 3 - ERROR_ACCESS_DENIED syscall.Errno = 5 - ERROR_NO_MORE_FILES syscall.Errno = 18 - ERROR_HANDLE_EOF syscall.Errno = 38 - ERROR_NETNAME_DELETED syscall.Errno = 64 - ERROR_FILE_EXISTS syscall.Errno = 80 - ERROR_BROKEN_PIPE syscall.Errno = 109 - ERROR_BUFFER_OVERFLOW syscall.Errno = 111 - ERROR_INSUFFICIENT_BUFFER syscall.Errno = 122 - ERROR_MOD_NOT_FOUND syscall.Errno = 126 - ERROR_PROC_NOT_FOUND syscall.Errno = 127 - ERROR_ALREADY_EXISTS syscall.Errno = 183 - ERROR_ENVVAR_NOT_FOUND syscall.Errno = 203 - ERROR_MORE_DATA syscall.Errno = 234 - ERROR_OPERATION_ABORTED syscall.Errno = 995 - ERROR_IO_PENDING syscall.Errno = 997 - ERROR_SERVICE_SPECIFIC_ERROR syscall.Errno = 1066 - ERROR_NOT_FOUND syscall.Errno = 1168 - ERROR_PRIVILEGE_NOT_HELD syscall.Errno = 1314 - WSAEACCES syscall.Errno = 10013 - WSAECONNRESET syscall.Errno = 10054 -) - -const ( - // Invented values to support what package os expects. - O_RDONLY = 0x00000 - O_WRONLY = 0x00001 - O_RDWR = 0x00002 - O_CREAT = 0x00040 - O_EXCL = 0x00080 - O_NOCTTY = 0x00100 - O_TRUNC = 0x00200 - O_NONBLOCK = 0x00800 - O_APPEND = 0x00400 - O_SYNC = 0x01000 - O_ASYNC = 0x02000 - O_CLOEXEC = 0x80000 -) - -const ( - // More invented values for signals - SIGHUP = Signal(0x1) - SIGINT = Signal(0x2) - SIGQUIT = Signal(0x3) - SIGILL = Signal(0x4) - SIGTRAP = Signal(0x5) - SIGABRT = Signal(0x6) - SIGBUS = Signal(0x7) - SIGFPE = Signal(0x8) - SIGKILL = Signal(0x9) - SIGSEGV = Signal(0xb) - SIGPIPE = Signal(0xd) - SIGALRM = Signal(0xe) - SIGTERM = Signal(0xf) -) - -var signals = [...]string{ - 1: "hangup", - 2: "interrupt", - 3: "quit", - 4: "illegal instruction", - 5: "trace/breakpoint trap", - 6: "aborted", - 7: "bus error", - 8: "floating point exception", - 9: "killed", - 10: "user defined signal 1", - 11: "segmentation fault", - 12: "user defined signal 2", - 13: "broken pipe", - 14: "alarm clock", - 15: "terminated", -} - -const ( - GENERIC_READ = 0x80000000 - GENERIC_WRITE = 0x40000000 - GENERIC_EXECUTE = 0x20000000 - GENERIC_ALL = 0x10000000 - - FILE_LIST_DIRECTORY = 0x00000001 - FILE_APPEND_DATA = 0x00000004 - FILE_WRITE_ATTRIBUTES = 0x00000100 - - FILE_SHARE_READ = 0x00000001 - FILE_SHARE_WRITE = 0x00000002 - FILE_SHARE_DELETE = 0x00000004 - FILE_ATTRIBUTE_READONLY = 0x00000001 - FILE_ATTRIBUTE_HIDDEN = 0x00000002 - FILE_ATTRIBUTE_SYSTEM = 0x00000004 - FILE_ATTRIBUTE_DIRECTORY = 0x00000010 - FILE_ATTRIBUTE_ARCHIVE = 0x00000020 - FILE_ATTRIBUTE_NORMAL = 0x00000080 - FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400 - - INVALID_FILE_ATTRIBUTES = 0xffffffff - - CREATE_NEW = 1 - CREATE_ALWAYS = 2 - OPEN_EXISTING = 3 - OPEN_ALWAYS = 4 - TRUNCATE_EXISTING = 5 - - FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 - FILE_FLAG_BACKUP_SEMANTICS = 0x02000000 - FILE_FLAG_OVERLAPPED = 0x40000000 - - HANDLE_FLAG_INHERIT = 0x00000001 - STARTF_USESTDHANDLES = 0x00000100 - STARTF_USESHOWWINDOW = 0x00000001 - DUPLICATE_CLOSE_SOURCE = 0x00000001 - DUPLICATE_SAME_ACCESS = 0x00000002 - - STD_INPUT_HANDLE = -10 - STD_OUTPUT_HANDLE = -11 - STD_ERROR_HANDLE = -12 - - FILE_BEGIN = 0 - FILE_CURRENT = 1 - FILE_END = 2 - - LANG_ENGLISH = 0x09 - SUBLANG_ENGLISH_US = 0x01 - - FORMAT_MESSAGE_ALLOCATE_BUFFER = 256 - FORMAT_MESSAGE_IGNORE_INSERTS = 512 - FORMAT_MESSAGE_FROM_STRING = 1024 - FORMAT_MESSAGE_FROM_HMODULE = 2048 - FORMAT_MESSAGE_FROM_SYSTEM = 4096 - FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 - FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 - - MAX_PATH = 260 - MAX_LONG_PATH = 32768 - - MAX_COMPUTERNAME_LENGTH = 15 - - TIME_ZONE_ID_UNKNOWN = 0 - TIME_ZONE_ID_STANDARD = 1 - - TIME_ZONE_ID_DAYLIGHT = 2 - IGNORE = 0 - INFINITE = 0xffffffff - - WAIT_TIMEOUT = 258 - WAIT_ABANDONED = 0x00000080 - WAIT_OBJECT_0 = 0x00000000 - WAIT_FAILED = 0xFFFFFFFF - - CREATE_NEW_PROCESS_GROUP = 0x00000200 - CREATE_UNICODE_ENVIRONMENT = 0x00000400 - - PROCESS_TERMINATE = 1 - PROCESS_QUERY_INFORMATION = 0x00000400 - SYNCHRONIZE = 0x00100000 - - PAGE_READONLY = 0x02 - PAGE_READWRITE = 0x04 - PAGE_WRITECOPY = 0x08 - PAGE_EXECUTE_READ = 0x20 - PAGE_EXECUTE_READWRITE = 0x40 - PAGE_EXECUTE_WRITECOPY = 0x80 - - FILE_MAP_COPY = 0x01 - FILE_MAP_WRITE = 0x02 - FILE_MAP_READ = 0x04 - FILE_MAP_EXECUTE = 0x20 - - CTRL_C_EVENT = 0 - CTRL_BREAK_EVENT = 1 - - // Windows reserves errors >= 1<<29 for application use. - APPLICATION_ERROR = 1 << 29 -) - -const ( - // flags for CreateToolhelp32Snapshot - TH32CS_SNAPHEAPLIST = 0x01 - TH32CS_SNAPPROCESS = 0x02 - TH32CS_SNAPTHREAD = 0x04 - TH32CS_SNAPMODULE = 0x08 - TH32CS_SNAPMODULE32 = 0x10 - TH32CS_SNAPALL = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD - TH32CS_INHERIT = 0x80000000 -) - -const ( - // filters for ReadDirectoryChangesW - FILE_NOTIFY_CHANGE_FILE_NAME = 0x001 - FILE_NOTIFY_CHANGE_DIR_NAME = 0x002 - FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x004 - FILE_NOTIFY_CHANGE_SIZE = 0x008 - FILE_NOTIFY_CHANGE_LAST_WRITE = 0x010 - FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x020 - FILE_NOTIFY_CHANGE_CREATION = 0x040 - FILE_NOTIFY_CHANGE_SECURITY = 0x100 -) - -const ( - // do not reorder - FILE_ACTION_ADDED = iota + 1 - FILE_ACTION_REMOVED - FILE_ACTION_MODIFIED - FILE_ACTION_RENAMED_OLD_NAME - FILE_ACTION_RENAMED_NEW_NAME -) - -const ( - // wincrypt.h - PROV_RSA_FULL = 1 - PROV_RSA_SIG = 2 - PROV_DSS = 3 - PROV_FORTEZZA = 4 - PROV_MS_EXCHANGE = 5 - PROV_SSL = 6 - PROV_RSA_SCHANNEL = 12 - PROV_DSS_DH = 13 - PROV_EC_ECDSA_SIG = 14 - PROV_EC_ECNRA_SIG = 15 - PROV_EC_ECDSA_FULL = 16 - PROV_EC_ECNRA_FULL = 17 - PROV_DH_SCHANNEL = 18 - PROV_SPYRUS_LYNKS = 20 - PROV_RNG = 21 - PROV_INTEL_SEC = 22 - PROV_REPLACE_OWF = 23 - PROV_RSA_AES = 24 - CRYPT_VERIFYCONTEXT = 0xF0000000 - CRYPT_NEWKEYSET = 0x00000008 - CRYPT_DELETEKEYSET = 0x00000010 - CRYPT_MACHINE_KEYSET = 0x00000020 - CRYPT_SILENT = 0x00000040 - CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080 - - USAGE_MATCH_TYPE_AND = 0 - USAGE_MATCH_TYPE_OR = 1 - - X509_ASN_ENCODING = 0x00000001 - PKCS_7_ASN_ENCODING = 0x00010000 - - CERT_STORE_PROV_MEMORY = 2 - - CERT_STORE_ADD_ALWAYS = 4 - - CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004 - - CERT_TRUST_NO_ERROR = 0x00000000 - CERT_TRUST_IS_NOT_TIME_VALID = 0x00000001 - CERT_TRUST_IS_REVOKED = 0x00000004 - CERT_TRUST_IS_NOT_SIGNATURE_VALID = 0x00000008 - CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 0x00000010 - CERT_TRUST_IS_UNTRUSTED_ROOT = 0x00000020 - CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 0x00000040 - CERT_TRUST_IS_CYCLIC = 0x00000080 - CERT_TRUST_INVALID_EXTENSION = 0x00000100 - CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 0x00000200 - CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 0x00000400 - CERT_TRUST_INVALID_NAME_CONSTRAINTS = 0x00000800 - CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000 - CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 0x00002000 - CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000 - CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 0x00008000 - CERT_TRUST_IS_OFFLINE_REVOCATION = 0x01000000 - CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 0x02000000 - CERT_TRUST_IS_EXPLICIT_DISTRUST = 0x04000000 - CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT = 0x08000000 - - CERT_CHAIN_POLICY_BASE = 1 - CERT_CHAIN_POLICY_AUTHENTICODE = 2 - CERT_CHAIN_POLICY_AUTHENTICODE_TS = 3 - CERT_CHAIN_POLICY_SSL = 4 - CERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5 - CERT_CHAIN_POLICY_NT_AUTH = 6 - CERT_CHAIN_POLICY_MICROSOFT_ROOT = 7 - CERT_CHAIN_POLICY_EV = 8 - - CERT_E_EXPIRED = 0x800B0101 - CERT_E_ROLE = 0x800B0103 - CERT_E_PURPOSE = 0x800B0106 - CERT_E_UNTRUSTEDROOT = 0x800B0109 - CERT_E_CN_NO_MATCH = 0x800B010F - - AUTHTYPE_CLIENT = 1 - AUTHTYPE_SERVER = 2 -) - -var ( - OID_PKIX_KP_SERVER_AUTH = []byte("1.3.6.1.5.5.7.3.1\x00") - OID_SERVER_GATED_CRYPTO = []byte("1.3.6.1.4.1.311.10.3.3\x00") - OID_SGC_NETSCAPE = []byte("2.16.840.1.113730.4.1\x00") -) - -// Invented values to support what package os expects. -type Timeval struct { - Sec int32 - Usec int32 -} - -func (tv *Timeval) Nanoseconds() int64 { - return (int64(tv.Sec)*1e6 + int64(tv.Usec)) * 1e3 -} - -func NsecToTimeval(nsec int64) (tv Timeval) { - tv.Sec = int32(nsec / 1e9) - tv.Usec = int32(nsec % 1e9 / 1e3) - return -} - -type SecurityAttributes struct { - Length uint32 - SecurityDescriptor uintptr - InheritHandle uint32 -} - -type Overlapped struct { - Internal uintptr - InternalHigh uintptr - Offset uint32 - OffsetHigh uint32 - HEvent Handle -} - -type FileNotifyInformation struct { - NextEntryOffset uint32 - Action uint32 - FileNameLength uint32 - FileName uint16 -} - -type Filetime struct { - LowDateTime uint32 - HighDateTime uint32 -} - -// Nanoseconds returns Filetime ft in nanoseconds -// since Epoch (00:00:00 UTC, January 1, 1970). -func (ft *Filetime) Nanoseconds() int64 { - // 100-nanosecond intervals since January 1, 1601 - nsec := int64(ft.HighDateTime)<<32 + int64(ft.LowDateTime) - // change starting time to the Epoch (00:00:00 UTC, January 1, 1970) - nsec -= 116444736000000000 - // convert into nanoseconds - nsec *= 100 - return nsec -} - -func NsecToFiletime(nsec int64) (ft Filetime) { - // convert into 100-nanosecond - nsec /= 100 - // change starting time to January 1, 1601 - nsec += 116444736000000000 - // split into high / low - ft.LowDateTime = uint32(nsec & 0xffffffff) - ft.HighDateTime = uint32(nsec >> 32 & 0xffffffff) - return ft -} - -type Win32finddata struct { - FileAttributes uint32 - CreationTime Filetime - LastAccessTime Filetime - LastWriteTime Filetime - FileSizeHigh uint32 - FileSizeLow uint32 - Reserved0 uint32 - Reserved1 uint32 - FileName [MAX_PATH - 1]uint16 - AlternateFileName [13]uint16 -} - -// This is the actual system call structure. -// Win32finddata is what we committed to in Go 1. -type win32finddata1 struct { - FileAttributes uint32 - CreationTime Filetime - LastAccessTime Filetime - LastWriteTime Filetime - FileSizeHigh uint32 - FileSizeLow uint32 - Reserved0 uint32 - Reserved1 uint32 - FileName [MAX_PATH]uint16 - AlternateFileName [14]uint16 -} - -func copyFindData(dst *Win32finddata, src *win32finddata1) { - dst.FileAttributes = src.FileAttributes - dst.CreationTime = src.CreationTime - dst.LastAccessTime = src.LastAccessTime - dst.LastWriteTime = src.LastWriteTime - dst.FileSizeHigh = src.FileSizeHigh - dst.FileSizeLow = src.FileSizeLow - dst.Reserved0 = src.Reserved0 - dst.Reserved1 = src.Reserved1 - - // The src is 1 element bigger than dst, but it must be NUL. - copy(dst.FileName[:], src.FileName[:]) - copy(dst.AlternateFileName[:], src.AlternateFileName[:]) -} - -type ByHandleFileInformation struct { - FileAttributes uint32 - CreationTime Filetime - LastAccessTime Filetime - LastWriteTime Filetime - VolumeSerialNumber uint32 - FileSizeHigh uint32 - FileSizeLow uint32 - NumberOfLinks uint32 - FileIndexHigh uint32 - FileIndexLow uint32 -} - -const ( - GetFileExInfoStandard = 0 - GetFileExMaxInfoLevel = 1 -) - -type Win32FileAttributeData struct { - FileAttributes uint32 - CreationTime Filetime - LastAccessTime Filetime - LastWriteTime Filetime - FileSizeHigh uint32 - FileSizeLow uint32 -} - -// ShowWindow constants -const ( - // winuser.h - SW_HIDE = 0 - SW_NORMAL = 1 - SW_SHOWNORMAL = 1 - SW_SHOWMINIMIZED = 2 - SW_SHOWMAXIMIZED = 3 - SW_MAXIMIZE = 3 - SW_SHOWNOACTIVATE = 4 - SW_SHOW = 5 - SW_MINIMIZE = 6 - SW_SHOWMINNOACTIVE = 7 - SW_SHOWNA = 8 - SW_RESTORE = 9 - SW_SHOWDEFAULT = 10 - SW_FORCEMINIMIZE = 11 -) - -type StartupInfo struct { - Cb uint32 - _ *uint16 - Desktop *uint16 - Title *uint16 - X uint32 - Y uint32 - XSize uint32 - YSize uint32 - XCountChars uint32 - YCountChars uint32 - FillAttribute uint32 - Flags uint32 - ShowWindow uint16 - _ uint16 - _ *byte - StdInput Handle - StdOutput Handle - StdErr Handle -} - -type ProcessInformation struct { - Process Handle - Thread Handle - ProcessId uint32 - ThreadId uint32 -} - -type ProcessEntry32 struct { - Size uint32 - Usage uint32 - ProcessID uint32 - DefaultHeapID uintptr - ModuleID uint32 - Threads uint32 - ParentProcessID uint32 - PriClassBase int32 - Flags uint32 - ExeFile [MAX_PATH]uint16 -} - -type Systemtime struct { - Year uint16 - Month uint16 - DayOfWeek uint16 - Day uint16 - Hour uint16 - Minute uint16 - Second uint16 - Milliseconds uint16 -} - -type Timezoneinformation struct { - Bias int32 - StandardName [32]uint16 - StandardDate Systemtime - StandardBias int32 - DaylightName [32]uint16 - DaylightDate Systemtime - DaylightBias int32 -} - -// Socket related. - -const ( - AF_UNSPEC = 0 - AF_UNIX = 1 - AF_INET = 2 - AF_INET6 = 23 - AF_NETBIOS = 17 - - SOCK_STREAM = 1 - SOCK_DGRAM = 2 - SOCK_RAW = 3 - SOCK_SEQPACKET = 5 - - IPPROTO_IP = 0 - IPPROTO_IPV6 = 0x29 - IPPROTO_TCP = 6 - IPPROTO_UDP = 17 - - SOL_SOCKET = 0xffff - SO_REUSEADDR = 4 - SO_KEEPALIVE = 8 - SO_DONTROUTE = 16 - SO_BROADCAST = 32 - SO_LINGER = 128 - SO_RCVBUF = 0x1002 - SO_SNDBUF = 0x1001 - SO_UPDATE_ACCEPT_CONTEXT = 0x700b - SO_UPDATE_CONNECT_CONTEXT = 0x7010 - - IOC_OUT = 0x40000000 - IOC_IN = 0x80000000 - IOC_VENDOR = 0x18000000 - IOC_INOUT = IOC_IN | IOC_OUT - IOC_WS2 = 0x08000000 - SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6 - SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4 - SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12 - - // cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460 - - IP_TOS = 0x3 - IP_TTL = 0x4 - IP_MULTICAST_IF = 0x9 - IP_MULTICAST_TTL = 0xa - IP_MULTICAST_LOOP = 0xb - IP_ADD_MEMBERSHIP = 0xc - IP_DROP_MEMBERSHIP = 0xd - - IPV6_V6ONLY = 0x1b - IPV6_UNICAST_HOPS = 0x4 - IPV6_MULTICAST_IF = 0x9 - IPV6_MULTICAST_HOPS = 0xa - IPV6_MULTICAST_LOOP = 0xb - IPV6_JOIN_GROUP = 0xc - IPV6_LEAVE_GROUP = 0xd - - SOMAXCONN = 0x7fffffff - - TCP_NODELAY = 1 - - SHUT_RD = 0 - SHUT_WR = 1 - SHUT_RDWR = 2 - - WSADESCRIPTION_LEN = 256 - WSASYS_STATUS_LEN = 128 -) - -type WSABuf struct { - Len uint32 - Buf *byte -} - -// Invented values to support what package os expects. -const ( - S_IFMT = 0x1f000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWRITE = 0x80 - S_IWUSR = 0x80 - S_IXUSR = 0x40 -) - -const ( - FILE_TYPE_CHAR = 0x0002 - FILE_TYPE_DISK = 0x0001 - FILE_TYPE_PIPE = 0x0003 - FILE_TYPE_REMOTE = 0x8000 - FILE_TYPE_UNKNOWN = 0x0000 -) - -type Hostent struct { - Name *byte - Aliases **byte - AddrType uint16 - Length uint16 - AddrList **byte -} - -type Protoent struct { - Name *byte - Aliases **byte - Proto uint16 -} - -const ( - DNS_TYPE_A = 0x0001 - DNS_TYPE_NS = 0x0002 - DNS_TYPE_MD = 0x0003 - DNS_TYPE_MF = 0x0004 - DNS_TYPE_CNAME = 0x0005 - DNS_TYPE_SOA = 0x0006 - DNS_TYPE_MB = 0x0007 - DNS_TYPE_MG = 0x0008 - DNS_TYPE_MR = 0x0009 - DNS_TYPE_NULL = 0x000a - DNS_TYPE_WKS = 0x000b - DNS_TYPE_PTR = 0x000c - DNS_TYPE_HINFO = 0x000d - DNS_TYPE_MINFO = 0x000e - DNS_TYPE_MX = 0x000f - DNS_TYPE_TEXT = 0x0010 - DNS_TYPE_RP = 0x0011 - DNS_TYPE_AFSDB = 0x0012 - DNS_TYPE_X25 = 0x0013 - DNS_TYPE_ISDN = 0x0014 - DNS_TYPE_RT = 0x0015 - DNS_TYPE_NSAP = 0x0016 - DNS_TYPE_NSAPPTR = 0x0017 - DNS_TYPE_SIG = 0x0018 - DNS_TYPE_KEY = 0x0019 - DNS_TYPE_PX = 0x001a - DNS_TYPE_GPOS = 0x001b - DNS_TYPE_AAAA = 0x001c - DNS_TYPE_LOC = 0x001d - DNS_TYPE_NXT = 0x001e - DNS_TYPE_EID = 0x001f - DNS_TYPE_NIMLOC = 0x0020 - DNS_TYPE_SRV = 0x0021 - DNS_TYPE_ATMA = 0x0022 - DNS_TYPE_NAPTR = 0x0023 - DNS_TYPE_KX = 0x0024 - DNS_TYPE_CERT = 0x0025 - DNS_TYPE_A6 = 0x0026 - DNS_TYPE_DNAME = 0x0027 - DNS_TYPE_SINK = 0x0028 - DNS_TYPE_OPT = 0x0029 - DNS_TYPE_DS = 0x002B - DNS_TYPE_RRSIG = 0x002E - DNS_TYPE_NSEC = 0x002F - DNS_TYPE_DNSKEY = 0x0030 - DNS_TYPE_DHCID = 0x0031 - DNS_TYPE_UINFO = 0x0064 - DNS_TYPE_UID = 0x0065 - DNS_TYPE_GID = 0x0066 - DNS_TYPE_UNSPEC = 0x0067 - DNS_TYPE_ADDRS = 0x00f8 - DNS_TYPE_TKEY = 0x00f9 - DNS_TYPE_TSIG = 0x00fa - DNS_TYPE_IXFR = 0x00fb - DNS_TYPE_AXFR = 0x00fc - DNS_TYPE_MAILB = 0x00fd - DNS_TYPE_MAILA = 0x00fe - DNS_TYPE_ALL = 0x00ff - DNS_TYPE_ANY = 0x00ff - DNS_TYPE_WINS = 0xff01 - DNS_TYPE_WINSR = 0xff02 - DNS_TYPE_NBSTAT = 0xff01 -) - -const ( - DNS_INFO_NO_RECORDS = 0x251D -) - -const ( - // flags inside DNSRecord.Dw - DnsSectionQuestion = 0x0000 - DnsSectionAnswer = 0x0001 - DnsSectionAuthority = 0x0002 - DnsSectionAdditional = 0x0003 -) - -type DNSSRVData struct { - Target *uint16 - Priority uint16 - Weight uint16 - Port uint16 - Pad uint16 -} - -type DNSPTRData struct { - Host *uint16 -} - -type DNSMXData struct { - NameExchange *uint16 - Preference uint16 - Pad uint16 -} - -type DNSTXTData struct { - StringCount uint16 - StringArray [1]*uint16 -} - -type DNSRecord struct { - Next *DNSRecord - Name *uint16 - Type uint16 - Length uint16 - Dw uint32 - Ttl uint32 - Reserved uint32 - Data [40]byte -} - -const ( - TF_DISCONNECT = 1 - TF_REUSE_SOCKET = 2 - TF_WRITE_BEHIND = 4 - TF_USE_DEFAULT_WORKER = 0 - TF_USE_SYSTEM_THREAD = 16 - TF_USE_KERNEL_APC = 32 -) - -type TransmitFileBuffers struct { - Head uintptr - HeadLength uint32 - Tail uintptr - TailLength uint32 -} - -const ( - IFF_UP = 1 - IFF_BROADCAST = 2 - IFF_LOOPBACK = 4 - IFF_POINTTOPOINT = 8 - IFF_MULTICAST = 16 -) - -const SIO_GET_INTERFACE_LIST = 0x4004747F - -// TODO(mattn): SockaddrGen is union of sockaddr/sockaddr_in/sockaddr_in6_old. -// will be fixed to change variable type as suitable. - -type SockaddrGen [24]byte - -type InterfaceInfo struct { - Flags uint32 - Address SockaddrGen - BroadcastAddress SockaddrGen - Netmask SockaddrGen -} - -type IpAddressString struct { - String [16]byte -} - -type IpMaskString IpAddressString - -type IpAddrString struct { - Next *IpAddrString - IpAddress IpAddressString - IpMask IpMaskString - Context uint32 -} - -const MAX_ADAPTER_NAME_LENGTH = 256 -const MAX_ADAPTER_DESCRIPTION_LENGTH = 128 -const MAX_ADAPTER_ADDRESS_LENGTH = 8 - -type IpAdapterInfo struct { - Next *IpAdapterInfo - ComboIndex uint32 - AdapterName [MAX_ADAPTER_NAME_LENGTH + 4]byte - Description [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]byte - AddressLength uint32 - Address [MAX_ADAPTER_ADDRESS_LENGTH]byte - Index uint32 - Type uint32 - DhcpEnabled uint32 - CurrentIpAddress *IpAddrString - IpAddressList IpAddrString - GatewayList IpAddrString - DhcpServer IpAddrString - HaveWins bool - PrimaryWinsServer IpAddrString - SecondaryWinsServer IpAddrString - LeaseObtained int64 - LeaseExpires int64 -} - -const MAXLEN_PHYSADDR = 8 -const MAX_INTERFACE_NAME_LEN = 256 -const MAXLEN_IFDESCR = 256 - -type MibIfRow struct { - Name [MAX_INTERFACE_NAME_LEN]uint16 - Index uint32 - Type uint32 - Mtu uint32 - Speed uint32 - PhysAddrLen uint32 - PhysAddr [MAXLEN_PHYSADDR]byte - AdminStatus uint32 - OperStatus uint32 - LastChange uint32 - InOctets uint32 - InUcastPkts uint32 - InNUcastPkts uint32 - InDiscards uint32 - InErrors uint32 - InUnknownProtos uint32 - OutOctets uint32 - OutUcastPkts uint32 - OutNUcastPkts uint32 - OutDiscards uint32 - OutErrors uint32 - OutQLen uint32 - DescrLen uint32 - Descr [MAXLEN_IFDESCR]byte -} - -type CertContext struct { - EncodingType uint32 - EncodedCert *byte - Length uint32 - CertInfo uintptr - Store Handle -} - -type CertChainContext struct { - Size uint32 - TrustStatus CertTrustStatus - ChainCount uint32 - Chains **CertSimpleChain - LowerQualityChainCount uint32 - LowerQualityChains **CertChainContext - HasRevocationFreshnessTime uint32 - RevocationFreshnessTime uint32 -} - -type CertSimpleChain struct { - Size uint32 - TrustStatus CertTrustStatus - NumElements uint32 - Elements **CertChainElement - TrustListInfo uintptr - HasRevocationFreshnessTime uint32 - RevocationFreshnessTime uint32 -} - -type CertChainElement struct { - Size uint32 - CertContext *CertContext - TrustStatus CertTrustStatus - RevocationInfo *CertRevocationInfo - IssuanceUsage *CertEnhKeyUsage - ApplicationUsage *CertEnhKeyUsage - ExtendedErrorInfo *uint16 -} - -type CertRevocationInfo struct { - Size uint32 - RevocationResult uint32 - RevocationOid *byte - OidSpecificInfo uintptr - HasFreshnessTime uint32 - FreshnessTime uint32 - CrlInfo uintptr // *CertRevocationCrlInfo -} - -type CertTrustStatus struct { - ErrorStatus uint32 - InfoStatus uint32 -} - -type CertUsageMatch struct { - Type uint32 - Usage CertEnhKeyUsage -} - -type CertEnhKeyUsage struct { - Length uint32 - UsageIdentifiers **byte -} - -type CertChainPara struct { - Size uint32 - RequestedUsage CertUsageMatch - RequstedIssuancePolicy CertUsageMatch - URLRetrievalTimeout uint32 - CheckRevocationFreshnessTime uint32 - RevocationFreshnessTime uint32 - CacheResync *Filetime -} - -type CertChainPolicyPara struct { - Size uint32 - Flags uint32 - ExtraPolicyPara uintptr -} - -type SSLExtraCertChainPolicyPara struct { - Size uint32 - AuthType uint32 - Checks uint32 - ServerName *uint16 -} - -type CertChainPolicyStatus struct { - Size uint32 - Error uint32 - ChainIndex uint32 - ElementIndex uint32 - ExtraPolicyStatus uintptr -} - -const ( - // do not reorder - HKEY_CLASSES_ROOT = 0x80000000 + iota - HKEY_CURRENT_USER - HKEY_LOCAL_MACHINE - HKEY_USERS - HKEY_PERFORMANCE_DATA - HKEY_CURRENT_CONFIG - HKEY_DYN_DATA - - KEY_QUERY_VALUE = 1 - KEY_SET_VALUE = 2 - KEY_CREATE_SUB_KEY = 4 - KEY_ENUMERATE_SUB_KEYS = 8 - KEY_NOTIFY = 16 - KEY_CREATE_LINK = 32 - KEY_WRITE = 0x20006 - KEY_EXECUTE = 0x20019 - KEY_READ = 0x20019 - KEY_WOW64_64KEY = 0x0100 - KEY_WOW64_32KEY = 0x0200 - KEY_ALL_ACCESS = 0xf003f -) - -const ( - // do not reorder - REG_NONE = iota - REG_SZ - REG_EXPAND_SZ - REG_BINARY - REG_DWORD_LITTLE_ENDIAN - REG_DWORD_BIG_ENDIAN - REG_LINK - REG_MULTI_SZ - REG_RESOURCE_LIST - REG_FULL_RESOURCE_DESCRIPTOR - REG_RESOURCE_REQUIREMENTS_LIST - REG_QWORD_LITTLE_ENDIAN - REG_DWORD = REG_DWORD_LITTLE_ENDIAN - REG_QWORD = REG_QWORD_LITTLE_ENDIAN -) - -type AddrinfoW struct { - Flags int32 - Family int32 - Socktype int32 - Protocol int32 - Addrlen uintptr - Canonname *uint16 - Addr uintptr - Next *AddrinfoW -} - -const ( - AI_PASSIVE = 1 - AI_CANONNAME = 2 - AI_NUMERICHOST = 4 -) - -type GUID struct { - Data1 uint32 - Data2 uint16 - Data3 uint16 - Data4 [8]byte -} - -var WSAID_CONNECTEX = GUID{ - 0x25a207b9, - 0xddf3, - 0x4660, - [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}, -} - -const ( - FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 - FILE_SKIP_SET_EVENT_ON_HANDLE = 2 -) - -const ( - WSAPROTOCOL_LEN = 255 - MAX_PROTOCOL_CHAIN = 7 - BASE_PROTOCOL = 1 - LAYERED_PROTOCOL = 0 - - XP1_CONNECTIONLESS = 0x00000001 - XP1_GUARANTEED_DELIVERY = 0x00000002 - XP1_GUARANTEED_ORDER = 0x00000004 - XP1_MESSAGE_ORIENTED = 0x00000008 - XP1_PSEUDO_STREAM = 0x00000010 - XP1_GRACEFUL_CLOSE = 0x00000020 - XP1_EXPEDITED_DATA = 0x00000040 - XP1_CONNECT_DATA = 0x00000080 - XP1_DISCONNECT_DATA = 0x00000100 - XP1_SUPPORT_BROADCAST = 0x00000200 - XP1_SUPPORT_MULTIPOINT = 0x00000400 - XP1_MULTIPOINT_CONTROL_PLANE = 0x00000800 - XP1_MULTIPOINT_DATA_PLANE = 0x00001000 - XP1_QOS_SUPPORTED = 0x00002000 - XP1_UNI_SEND = 0x00008000 - XP1_UNI_RECV = 0x00010000 - XP1_IFS_HANDLES = 0x00020000 - XP1_PARTIAL_MESSAGE = 0x00040000 - XP1_SAN_SUPPORT_SDP = 0x00080000 - - PFL_MULTIPLE_PROTO_ENTRIES = 0x00000001 - PFL_RECOMMENDED_PROTO_ENTRY = 0x00000002 - PFL_HIDDEN = 0x00000004 - PFL_MATCHES_PROTOCOL_ZERO = 0x00000008 - PFL_NETWORKDIRECT_PROVIDER = 0x00000010 -) - -type WSAProtocolInfo struct { - ServiceFlags1 uint32 - ServiceFlags2 uint32 - ServiceFlags3 uint32 - ServiceFlags4 uint32 - ProviderFlags uint32 - ProviderId GUID - CatalogEntryId uint32 - ProtocolChain WSAProtocolChain - Version int32 - AddressFamily int32 - MaxSockAddr int32 - MinSockAddr int32 - SocketType int32 - Protocol int32 - ProtocolMaxOffset int32 - NetworkByteOrder int32 - SecurityScheme int32 - MessageSize uint32 - ProviderReserved uint32 - ProtocolName [WSAPROTOCOL_LEN + 1]uint16 -} - -type WSAProtocolChain struct { - ChainLen int32 - ChainEntries [MAX_PROTOCOL_CHAIN]uint32 -} - -type TCPKeepalive struct { - OnOff uint32 - Time uint32 - Interval uint32 -} - -type symbolicLinkReparseBuffer struct { - SubstituteNameOffset uint16 - SubstituteNameLength uint16 - PrintNameOffset uint16 - PrintNameLength uint16 - Flags uint32 - PathBuffer [1]uint16 -} - -type mountPointReparseBuffer struct { - SubstituteNameOffset uint16 - SubstituteNameLength uint16 - PrintNameOffset uint16 - PrintNameLength uint16 - PathBuffer [1]uint16 -} - -type reparseDataBuffer struct { - ReparseTag uint32 - ReparseDataLength uint16 - Reserved uint16 - - // GenericReparseBuffer - reparseBuffer byte -} - -const ( - FSCTL_GET_REPARSE_POINT = 0x900A8 - MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024 - IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003 - IO_REPARSE_TAG_SYMLINK = 0xA000000C - SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1 -) - -const ( - ComputerNameNetBIOS = 0 - ComputerNameDnsHostname = 1 - ComputerNameDnsDomain = 2 - ComputerNameDnsFullyQualified = 3 - ComputerNamePhysicalNetBIOS = 4 - ComputerNamePhysicalDnsHostname = 5 - ComputerNamePhysicalDnsDomain = 6 - ComputerNamePhysicalDnsFullyQualified = 7 - ComputerNameMax = 8 -) - -const ( - MOVEFILE_REPLACE_EXISTING = 0x1 - MOVEFILE_COPY_ALLOWED = 0x2 - MOVEFILE_DELAY_UNTIL_REBOOT = 0x4 - MOVEFILE_WRITE_THROUGH = 0x8 - MOVEFILE_CREATE_HARDLINK = 0x10 - MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20 -) - -const GAA_FLAG_INCLUDE_PREFIX = 0x00000010 - -const ( - IF_TYPE_OTHER = 1 - IF_TYPE_ETHERNET_CSMACD = 6 - IF_TYPE_ISO88025_TOKENRING = 9 - IF_TYPE_PPP = 23 - IF_TYPE_SOFTWARE_LOOPBACK = 24 - IF_TYPE_ATM = 37 - IF_TYPE_IEEE80211 = 71 - IF_TYPE_TUNNEL = 131 - IF_TYPE_IEEE1394 = 144 -) - -type SocketAddress struct { - Sockaddr *syscall.RawSockaddrAny - SockaddrLength int32 -} - -type IpAdapterUnicastAddress struct { - Length uint32 - Flags uint32 - Next *IpAdapterUnicastAddress - Address SocketAddress - PrefixOrigin int32 - SuffixOrigin int32 - DadState int32 - ValidLifetime uint32 - PreferredLifetime uint32 - LeaseLifetime uint32 - OnLinkPrefixLength uint8 -} - -type IpAdapterAnycastAddress struct { - Length uint32 - Flags uint32 - Next *IpAdapterAnycastAddress - Address SocketAddress -} - -type IpAdapterMulticastAddress struct { - Length uint32 - Flags uint32 - Next *IpAdapterMulticastAddress - Address SocketAddress -} - -type IpAdapterDnsServerAdapter struct { - Length uint32 - Reserved uint32 - Next *IpAdapterDnsServerAdapter - Address SocketAddress -} - -type IpAdapterPrefix struct { - Length uint32 - Flags uint32 - Next *IpAdapterPrefix - Address SocketAddress - PrefixLength uint32 -} - -type IpAdapterAddresses struct { - Length uint32 - IfIndex uint32 - Next *IpAdapterAddresses - AdapterName *byte - FirstUnicastAddress *IpAdapterUnicastAddress - FirstAnycastAddress *IpAdapterAnycastAddress - FirstMulticastAddress *IpAdapterMulticastAddress - FirstDnsServerAddress *IpAdapterDnsServerAdapter - DnsSuffix *uint16 - Description *uint16 - FriendlyName *uint16 - PhysicalAddress [syscall.MAX_ADAPTER_ADDRESS_LENGTH]byte - PhysicalAddressLength uint32 - Flags uint32 - Mtu uint32 - IfType uint32 - OperStatus uint32 - Ipv6IfIndex uint32 - ZoneIndices [16]uint32 - FirstPrefix *IpAdapterPrefix - /* more fields might be present here. */ -} - -const ( - IfOperStatusUp = 1 - IfOperStatusDown = 2 - IfOperStatusTesting = 3 - IfOperStatusUnknown = 4 - IfOperStatusDormant = 5 - IfOperStatusNotPresent = 6 - IfOperStatusLowerLayerDown = 7 -) diff --git a/vendor/golang.org/x/sys/windows/ztypes_windows_386.go b/vendor/golang.org/x/sys/windows/ztypes_windows_386.go deleted file mode 100644 index 10f33be0b..000000000 --- a/vendor/golang.org/x/sys/windows/ztypes_windows_386.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows - -type WSAData struct { - Version uint16 - HighVersion uint16 - Description [WSADESCRIPTION_LEN + 1]byte - SystemStatus [WSASYS_STATUS_LEN + 1]byte - MaxSockets uint16 - MaxUdpDg uint16 - VendorInfo *byte -} - -type Servent struct { - Name *byte - Aliases **byte - Port uint16 - Proto *byte -} diff --git a/vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go b/vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go deleted file mode 100644 index 3f272c249..000000000 --- a/vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows - -type WSAData struct { - Version uint16 - HighVersion uint16 - MaxSockets uint16 - MaxUdpDg uint16 - VendorInfo *byte - Description [WSADESCRIPTION_LEN + 1]byte - SystemStatus [WSASYS_STATUS_LEN + 1]byte -} - -type Servent struct { - Name *byte - Aliases **byte - Proto *byte - Port uint16 -} diff --git a/vendor/google.golang.org/api/compute/v1/compute-api.json b/vendor/google.golang.org/api/compute/v1/compute-api.json index 8d5db8003..bc27bb7c6 100644 --- a/vendor/google.golang.org/api/compute/v1/compute-api.json +++ b/vendor/google.golang.org/api/compute/v1/compute-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/c55dTQvv4NWDkglZO3_PlmckRzg\"", + "etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/aU2RyGSEMbRxHCIqylkOho4GK2M\"", "discoveryVersion": "v1", "id": "compute:v1", "name": "compute", "version": "v1", - "revision": "20160120", + "revision": "20160107", "title": "Compute Engine API", "description": "API for the Google Compute Engine service.", "ownerDomain": "google.com", @@ -746,12 +746,12 @@ }, "maxRate": { "type": "integer", - "description": "The max requests per second (RPS) of the group. Can be used with either balancing mode, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set.", + "description": "The max RPS of the group. Can be used with either balancing mode, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set.", "format": "int32" }, "maxRatePerInstance": { "type": "number", - "description": "The max requests per second (RPS) that a single backed instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.", + "description": "The max RPS that a single backed instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set.", "format": "float" }, "maxUtilization": { @@ -764,7 +764,7 @@ "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity.", + "description": "A BackendService resource. This resource defines a group of backend virtual machines together with their serving capacity.", "properties": { "backends": { "type": "array", @@ -810,7 +810,7 @@ }, "port": { "type": "integer", - "description": "Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80.", + "description": "Deprecated in favor of port name. The TCP port to connect on the backend. The default value is 80.", "format": "int32" }, "portName": { @@ -834,7 +834,7 @@ }, "timeoutSec": { "type": "integer", - "description": "How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. Valid range is [1, 86400].", + "description": "How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds.", "format": "int32" } } @@ -1431,7 +1431,7 @@ }, "network": { "type": "string", - "description": "URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used:\nglobal/networks/default\nIf you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network \n- projects/myproject/global/networks/my-network \n- global/networks/default" + "description": "URL of the network resource for this firewall rule. This field is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:\nglobal/networks/default\nIf you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network \n- projects/myproject/global/networks/my-network \n- global/networks/default" }, "selfLink": { "type": "string", @@ -1555,7 +1555,7 @@ }, "target": { "type": "string", - "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy or TargetHttpsProxy resource. The forwarded traffic must be of a type appropriate to the target object. For example, TargetHttpProxy requires HTTP traffic, and TargetHttpsProxy requires HTTPS traffic." + "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy or TargetHttpsProxy resource." } } }, @@ -2128,7 +2128,7 @@ }, "description": { "type": "string", - "description": "An optional description of this resource. Provide this property when you create the resource." + "description": "An optional textual description of the resource; provided by the client when the resource is created." }, "disks": { "type": "array", @@ -2139,7 +2139,7 @@ }, "id": { "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "description": "[Output Only] Unique identifier for the resource. This identifier is defined by the server.", "format": "uint64" }, "kind": { @@ -2162,7 +2162,7 @@ }, "name": { "type": "string", - "description": "The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." }, "networkInterfaces": { "type": "array", @@ -2177,7 +2177,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for this resource." + "description": "[Output Only] Server defined URL for this resource." }, "serviceAccounts": { "type": "array", @@ -2247,11 +2247,11 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for this resource." + "description": "[Output Only] Server defined URL for this resource." } } }, @@ -2312,10 +2312,6 @@ "description": "[Output Only] The total number of instances in the instance group.", "format": "int32" }, - "subnetwork": { - "type": "string", - "description": "[Output Only] The URL of the subnetwork to which all instances in the instance group belong." - }, "zone": { "type": "string", "description": "[Output Only] The URL of the zone where the instance group is located." @@ -2494,7 +2490,7 @@ }, "creating": { "type": "integer", - "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create one of these instances, it tries again until it creates the instance successfully.", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created.", "format": "int32" }, "deleting": { @@ -2933,11 +2929,11 @@ }, "nextPageToken": { "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for this resource." + "description": "[Output Only] Server defined URL for this resource." } } }, @@ -3213,16 +3209,6 @@ } } }, - "InstancesSetMachineTypeRequest": { - "id": "InstancesSetMachineTypeRequest", - "type": "object", - "properties": { - "machineType": { - "type": "string", - "description": "Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1" - } - } - }, "License": { "id": "License", "type": "object", @@ -3478,7 +3464,7 @@ "properties": { "currentAction": { "type": "string", - "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: \n- NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. \n- CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. \n- CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's target_size value is decreased. \n- RECREATING The managed instance group is recreating this instance. \n- DELETING The managed instance group is permanently deleting this instance. \n- ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. \n- RESTARTING The managed instance group is restarting the instance. \n- REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.", + "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: \n- NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. \n- CREATING The managed instance group is creating this instance. \n- RECREATING The managed instance group is recreating this instance. \n- DELETING The managed instance group is permanently deleting this instance. \n- ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. \n- RESTARTING The managed instance group is restarting the instance. \n- REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.", "enum": [ "ABANDONING", "CREATING", @@ -3643,10 +3629,6 @@ "description": "The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}" }, - "autoCreateSubnetworks": { - "type": "boolean", - "description": "When set to true, the network is created in \"auto subnet mode\". When set to false, the network is in \"custom subnet mode\".\n\nIn \"auto subnet mode\", a newly created network is assigned the default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork per region." - }, "creationTimestamp": { "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." @@ -3683,13 +3665,6 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." - }, - "subnetworks": { - "type": "array", - "description": "[Output Only] Server-defined fully-qualified URLs for all subnetworks in this network.", - "items": { - "type": "string" - } } } }, @@ -3721,10 +3696,6 @@ "networkIP": { "type": "string", "description": "[Output Only] An optional IPV4 internal network address assigned to the instance for this network interface." - }, - "subnetwork": { - "type": "string", - "description": "The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork \n- zones/zone/subnetworks/subnetwork" } } }, @@ -3813,7 +3784,7 @@ }, "httpErrorStatusCode": { "type": "integer", - "description": "[Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned. For example, a 404 means the resource was not found.", "format": "int32" }, "id": { @@ -3840,12 +3811,12 @@ }, "progress": { "type": "integer", - "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.", + "description": "[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.", "format": "int32" }, "region": { "type": "string", - "description": "[Output Only] URL of the region where the operation resides. Only available when performing regional operations." + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." }, "selfLink": { "type": "string", @@ -3954,7 +3925,7 @@ }, "zone": { "type": "string", - "description": "[Output Only] URL of the zone where the operation resides. Only available when performing per-zone operations." + "description": "[Output Only] URL of the zone where the operation resides." } } }, @@ -4103,7 +4074,7 @@ "properties": { "defaultService": { "type": "string", - "description": "The full or partial URL to the BackendService resource. This will be used if none of the pathRules defined by this PathMatcher is matched by the URL's path portion. For example, the following are all valid URLs to a BackendService resource: \n- https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService \n- compute/v1/projects/project/global/backendServices/backendService \n- global/backendServices/backendService" + "description": "The URL to the BackendService resource. This will be used if none of the pathRules defined by this PathMatcher is met by the URL's path portion." }, "description": { "type": "string", @@ -4191,7 +4162,7 @@ }, "usageExportLocation": { "$ref": "UsageExportLocation", - "description": "The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored." + "description": "The location in Cloud Storage and naming method of the daily usage report." } } }, @@ -4229,7 +4200,6 @@ "SSD_TOTAL_GB", "SSL_CERTIFICATES", "STATIC_ADDRESSES", - "SUBNETWORKS", "TARGET_HTTPS_PROXIES", "TARGET_HTTP_PROXIES", "TARGET_INSTANCES", @@ -4265,7 +4235,6 @@ "", "", "", - "", "" ] }, @@ -4383,7 +4352,7 @@ "Route": { "id": "Route", "type": "object", - "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with instances by tags and the set of Routes for a particular instance is called its routing table. For each packet leaving a instance, the system searches that instance's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the nextHop field of the winning Route -- either to another instance destination, a instance gateway or a Google Compute Engien-operated gateway. Packets that do not match any Route in the sending instance's routing table are dropped.", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with instances by tag and the set of Routes for a particular instance is called its routing table. For each packet leaving a instance, the system searches that instance's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the nextHop field of the winning Route -- either to another instance destination, a instance gateway or a Google Compute Engien-operated gateway. Packets that do not match any Route in the sending instance's routing table are dropped.", "properties": { "creationTimestamp": { "type": "string", @@ -4433,11 +4402,11 @@ }, "nextHopGateway": { "type": "string", - "description": "The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/\u003cproject-id\u003e/global/gateways/default-internet-gateway" + "description": "The URL to a gateway that should handle matching packets. Currently, this is only the internet gateway: projects/\u003cproject-id\u003e/global/gateways/default-internet-gateway" }, "nextHopInstance": { "type": "string", - "description": "The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example:\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/" + "description": "The fully-qualified URL to an instance that should handle matching packets. For example:\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/" }, "nextHopIp": { "type": "string", @@ -4453,7 +4422,7 @@ }, "priority": { "type": "integer", - "description": "The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of two routes with equal prefix length, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.", + "description": "Breaks ties between Routes of equal specificity. Routes with smaller values win when tied with routes with larger values. Default value is 1000. A valid range is between 0 and 65535.", "format": "uint32", "annotations": { "required": [ @@ -4556,7 +4525,7 @@ }, "items": { "type": "array", - "description": "[Output Only] A list of Route resources.", + "description": "A list of Route resources.", "items": { "$ref": "Route" } @@ -4619,7 +4588,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server-defined URL for the resource." + "description": "[Output Only] Server defined URL for the resource." } } }, @@ -4687,7 +4656,7 @@ }, "sourceDisk": { "type": "string", - "description": "[Output Only] The source disk used to create this snapshot." + "description": "The source disk used to create this snapshot." }, "sourceDiskId": { "type": "string", @@ -4741,7 +4710,7 @@ }, "items": { "type": "array", - "description": "[Output Only] A list of Snapshot resources.", + "description": "A list of Snapshot resources.", "items": { "$ref": "Snapshot" } @@ -4764,7 +4733,7 @@ "SslCertificate": { "id": "SslCertificate", "type": "object", - "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user.", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to global HTTPS loadbalancer to serve secure connections.", "properties": { "certificate": { "type": "string", @@ -4834,194 +4803,6 @@ } } }, - "Subnetwork": { - "id": "Subnetwork", - "type": "object", - "description": "A Subnetwork resource.", - "properties": { - "creationTimestamp": { - "type": "string", - "description": "[Output Only] Creation timestamp in RFC3339 text format." - }, - "description": { - "type": "string", - "description": "An optional description of this resource. Provide this property when you create the resource." - }, - "gatewayAddress": { - "type": "string", - "description": "[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork." - }, - "id": { - "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", - "format": "uint64" - }, - "ipCidrRange": { - "type": "string", - "description": "The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network." - }, - "kind": { - "type": "string", - "description": "[Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources.", - "default": "compute#subnetwork" - }, - "name": { - "type": "string", - "description": "The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" - }, - "network": { - "type": "string", - "description": "The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks." - }, - "region": { - "type": "string", - "description": "[Output Only] URL of the region where the Subnetwork resides." - }, - "selfLink": { - "type": "string", - "description": "[Output Only] Server-defined URL for the resource." - } - } - }, - "SubnetworkAggregatedList": { - "id": "SubnetworkAggregatedList", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." - }, - "items": { - "type": "object", - "description": "[Output] A map of scoped Subnetwork lists.", - "additionalProperties": { - "$ref": "SubnetworksScopedList", - "description": "Name of the scope containing this set of Subnetworks." - } - }, - "kind": { - "type": "string", - "description": "[Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks.", - "default": "compute#subnetworkAggregatedList" - }, - "nextPageToken": { - "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." - }, - "selfLink": { - "type": "string", - "description": "[Output Only] Server-defined URL for this resource." - } - } - }, - "SubnetworkList": { - "id": "SubnetworkList", - "type": "object", - "description": "Contains a list of Subnetwork resources.", - "properties": { - "id": { - "type": "string", - "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server." - }, - "items": { - "type": "array", - "description": "The Subnetwork resources.", - "items": { - "$ref": "Subnetwork" - } - }, - "kind": { - "type": "string", - "description": "[Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks.", - "default": "compute#subnetworkList" - }, - "nextPageToken": { - "type": "string", - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results." - }, - "selfLink": { - "type": "string", - "description": "[Output Only] Server-defined URL for this resource." - } - } - }, - "SubnetworksScopedList": { - "id": "SubnetworksScopedList", - "type": "object", - "properties": { - "subnetworks": { - "type": "array", - "description": "List of subnetworks contained in this scope.", - "items": { - "$ref": "Subnetwork" - } - }, - "warning": { - "type": "object", - "description": "An informational warning that appears when the list of addresses is empty.", - "properties": { - "code": { - "type": "string", - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "DEPRECATED_RESOURCE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "INJECTED_KERNELS_DEPRECATED", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_NOT_DELETED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNREACHABLE" - ], - "enumDescriptions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "data": { - "type": "array", - "description": "[Output Only] Metadata about this warning in key: value format. For example:\n\"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" }", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource, and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding)." - }, - "value": { - "type": "string", - "description": "[Output Only] A warning data value corresponding to the key." - } - } - } - }, - "message": { - "type": "string", - "description": "[Output Only] A human-readable description of the warning code." - } - } - } - } - }, "Tags": { "id": "Tags", "type": "object", @@ -5157,7 +4938,7 @@ }, "sslCertificates": { "type": "array", - "description": "URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. Currently exactly one SSL certificate must be specified.", + "description": "URLs to SslCertificate resources that are used to authenticate connections to Backends. Currently exactly one SSL certificate must be specified.", "items": { "type": "string" } @@ -6097,7 +5878,7 @@ "properties": { "bucketName": { "type": "string", - "description": "The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket." + "description": "The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This is just the bucket name, with no gs:// or https://storage.googleapis.com/ in front of it." }, "reportNamePrefix": { "type": "string", @@ -6136,13 +5917,6 @@ "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", "default": "compute#vpnTunnel" }, - "localTrafficSelector": { - "type": "array", - "description": "Local traffic selector to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint.", - "items": { - "type": "string" - } - }, "name": { "type": "string", "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", @@ -6167,7 +5941,7 @@ }, "sharedSecret": { "type": "string", - "description": "Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway." + "description": "Shared secret used to set the secure session between the GCE VPN gateway and the peer VPN gateway." }, "sharedSecretHash": { "type": "string", @@ -6469,7 +6243,7 @@ "id": "compute.addresses.aggregatedList", "path": "{project}/aggregated/addresses", "httpMethod": "GET", - "description": "Retrieves an aggregated list of addresses.", + "description": "Retrieves the list of addresses grouped by scope.", "parameters": { "filter": { "type": "string", @@ -6633,7 +6407,7 @@ "id": "compute.addresses.list", "path": "{project}/regions/{region}/addresses", "httpMethod": "GET", - "description": "Retrieves a list of address resources contained within the specified region.", + "description": "Retrieves the list of address resources contained within the specified region.", "parameters": { "filter": { "type": "string", @@ -6690,7 +6464,7 @@ "id": "compute.autoscalers.aggregatedList", "path": "{project}/aggregated/autoscalers", "httpMethod": "GET", - "description": "Retrieves an aggregated list of autoscalers.", + "description": "Retrieves the list of autoscalers grouped by scope.", "parameters": { "filter": { "type": "string", @@ -6854,7 +6628,7 @@ "id": "compute.autoscalers.list", "path": "{project}/zones/{zone}/autoscalers", "httpMethod": "GET", - "description": "Retrieves a list of autoscaler resources contained within the specified zone.", + "description": "Retrieves the list of autoscaler resources contained within the specified zone.", "parameters": { "filter": { "type": "string", @@ -7100,7 +6874,7 @@ "id": "compute.backendServices.insert", "path": "{project}/global/backendServices", "httpMethod": "POST", - "description": "Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.", + "description": "Creates a BackendService resource in the specified project using the data included in the request.", "parameters": { "project": { "type": "string", @@ -7173,7 +6947,7 @@ "id": "compute.backendServices.patch", "path": "{project}/global/backendServices/{backendService}", "httpMethod": "PATCH", - "description": "Updates the entire content of the BackendService resource. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + "description": "Update the entire content of the BackendService resource. This method supports patch semantics.", "parameters": { "backendService": { "type": "string", @@ -7209,7 +6983,7 @@ "id": "compute.backendServices.update", "path": "{project}/global/backendServices/{backendService}", "httpMethod": "PUT", - "description": "Updates the entire content of the BackendService resource. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.", + "description": "Update the entire content of the BackendService resource.", "parameters": { "backendService": { "type": "string", @@ -7249,7 +7023,7 @@ "id": "compute.diskTypes.aggregatedList", "path": "{project}/aggregated/diskTypes", "httpMethod": "GET", - "description": "Retrieves an aggregated list of disk type resources.", + "description": "Retrieves the list of disk type resources grouped by scope.", "parameters": { "filter": { "type": "string", @@ -7336,7 +7110,7 @@ "id": "compute.diskTypes.list", "path": "{project}/zones/{zone}/diskTypes", "httpMethod": "GET", - "description": "Retrieves a list of disk type resources available to the specified project.", + "description": "Retrieves the list of disk type resources available to the specified project.", "parameters": { "filter": { "type": "string", @@ -7393,7 +7167,7 @@ "id": "compute.disks.aggregatedList", "path": "{project}/aggregated/disks", "httpMethod": "GET", - "description": "Retrieves an aggregated list of persistent disks.", + "description": "Retrieves the list of persistent disks grouped by scope.", "parameters": { "filter": { "type": "string", @@ -7606,7 +7380,7 @@ "id": "compute.disks.list", "path": "{project}/zones/{zone}/disks", "httpMethod": "GET", - "description": "Retrieves a list of persistent disks contained within the specified zone.", + "description": "Retrieves the list of persistent disks contained within the specified zone.", "parameters": { "filter": { "type": "string", @@ -7879,7 +7653,7 @@ "id": "compute.forwardingRules.aggregatedList", "path": "{project}/aggregated/forwardingRules", "httpMethod": "GET", - "description": "Retrieves an aggregated list of forwarding rules.", + "description": "Retrieves the list of forwarding rules grouped by scope.", "parameters": { "filter": { "type": "string", @@ -8043,7 +7817,7 @@ "id": "compute.forwardingRules.list", "path": "{project}/regions/{region}/forwardingRules", "httpMethod": "GET", - "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.", + "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", "parameters": { "filter": { "type": "string", @@ -8239,7 +8013,7 @@ "id": "compute.globalAddresses.list", "path": "{project}/global/addresses", "httpMethod": "GET", - "description": "Retrieves a list of global address resources.", + "description": "Retrieves the list of global address resources.", "parameters": { "filter": { "type": "string", @@ -8383,7 +8157,7 @@ "id": "compute.globalForwardingRules.list", "path": "{project}/global/forwardingRules", "httpMethod": "GET", - "description": "Retrieves a list of ForwardingRule resources available to the specified project.", + "description": "Retrieves the list of ForwardingRule resources available to the specified project.", "parameters": { "filter": { "type": "string", @@ -8468,7 +8242,7 @@ "id": "compute.globalOperations.aggregatedList", "path": "{project}/aggregated/operations", "httpMethod": "GET", - "description": "Retrieves an aggregated list of all operations.", + "description": "Retrieves the list of all operations grouped by scope.", "parameters": { "filter": { "type": "string", @@ -8577,7 +8351,7 @@ "id": "compute.globalOperations.list", "path": "{project}/global/operations", "httpMethod": "GET", - "description": "Retrieves a list of Operation resources contained within the specified project.", + "description": "Retrieves the list of Operation resources contained within the specified project.", "parameters": { "filter": { "type": "string", @@ -9328,7 +9102,7 @@ "id": "compute.instanceGroupManagers.delete", "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", "httpMethod": "DELETE", - "description": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.", + "description": "Deletes the specified managed instance group and all of the instances in that group.", "parameters": { "instanceGroupManager": { "type": "string", @@ -9753,7 +9527,7 @@ "id": "compute.instanceGroups.addInstances", "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", "httpMethod": "POST", - "description": "Adds a list of instances to the specified instance group. Read Adding instances for more information.", + "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork.", "parameters": { "instanceGroup": { "type": "string", @@ -9840,7 +9614,7 @@ "id": "compute.instanceGroups.delete", "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", "httpMethod": "DELETE", - "description": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.", + "description": "Deletes the specified instance group. The instances in the group are not deleted.", "parameters": { "instanceGroup": { "type": "string", @@ -10223,7 +9997,7 @@ "id": "compute.instanceTemplates.insert", "path": "{project}/global/instanceTemplates", "httpMethod": "POST", - "description": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.", + "description": "Creates an instance template in the specified project using the data that is included in the request.", "parameters": { "project": { "type": "string", @@ -10860,50 +10634,6 @@ "https://www.googleapis.com/auth/compute" ] }, - "setMachineType": { - "id": "compute.instances.setMachineType", - "path": "{project}/zones/{zone}/instances/{instance}/setMachineType", - "httpMethod": "POST", - "description": "Changes the machine type for a stopped instance to the machine type specified in the request.", - "parameters": { - "instance": { - "type": "string", - "description": "Name of the instance scoping this request.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - }, - "project": { - "type": "string", - "description": "Project ID for this request.", - "required": true, - "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - "location": "path" - }, - "zone": { - "type": "string", - "description": "The name of the zone for this request.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - } - }, - "parameterOrder": [ - "project", - "zone", - "instance" - ], - "request": { - "$ref": "InstancesSetMachineTypeRequest" - }, - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute" - ] - }, "setMetadata": { "id": "compute.instances.setMetadata", "path": "{project}/zones/{zone}/instances/{instance}/setMetadata", @@ -11040,7 +10770,7 @@ "id": "compute.instances.start", "path": "{project}/zones/{zone}/instances/{instance}/start", "httpMethod": "POST", - "description": "Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", + "description": "This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", "parameters": { "instance": { "type": "string", @@ -11081,7 +10811,7 @@ "id": "compute.instances.stop", "path": "{project}/zones/{zone}/instances/{instance}/stop", "httpMethod": "POST", - "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", + "description": "This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance.", "parameters": { "instance": { "type": "string", @@ -11164,7 +10894,7 @@ "id": "compute.machineTypes.aggregatedList", "path": "{project}/aggregated/machineTypes", "httpMethod": "GET", - "description": "Retrieves an aggregated list of machine type resources.", + "description": "Retrieves the list of machine type resources grouped by scope.", "parameters": { "filter": { "type": "string", @@ -11251,7 +10981,7 @@ "id": "compute.machineTypes.list", "path": "{project}/zones/{zone}/machineTypes", "httpMethod": "GET", - "description": "Retrieves a list of machine type resources available to the specified project.", + "description": "Retrieves the list of machine type resources available to the specified project.", "parameters": { "filter": { "type": "string", @@ -11653,7 +11383,7 @@ }, "region": { "type": "string", - "description": "Name of the region scoping this request.", + "description": "Name of the zone scoping this request.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -11677,7 +11407,7 @@ "id": "compute.regionOperations.list", "path": "{project}/regions/{region}/operations", "httpMethod": "GET", - "description": "Retrieves a list of Operation resources contained within the specified region.", + "description": "Retrieves the list of Operation resources contained within the specified region.", "parameters": { "filter": { "type": "string", @@ -12215,227 +11945,6 @@ } } }, - "subnetworks": { - "methods": { - "aggregatedList": { - "id": "compute.subnetworks.aggregatedList", - "path": "{project}/aggregated/subnetworks", - "httpMethod": "GET", - "description": "Retrieves an aggregated list of subnetworks.", - "parameters": { - "filter": { - "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions meaning that resources must match all expressions to pass the filters.", - "location": "query" - }, - "maxResults": { - "type": "integer", - "description": "The maximum number of results per page that Compute Engine should return. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.", - "default": "500", - "format": "uint32", - "minimum": "0", - "maximum": "500", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", - "location": "query" - }, - "project": { - "type": "string", - "description": "Project ID for this request.", - "required": true, - "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - "location": "path" - } - }, - "parameterOrder": [ - "project" - ], - "response": { - "$ref": "SubnetworkAggregatedList" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" - ] - }, - "delete": { - "id": "compute.subnetworks.delete", - "path": "{project}/regions/{region}/subnetworks/{subnetwork}", - "httpMethod": "DELETE", - "description": "Deletes the specified subnetwork.", - "parameters": { - "project": { - "type": "string", - "description": "Project ID for this request.", - "required": true, - "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - "location": "path" - }, - "region": { - "type": "string", - "description": "Name of the region scoping this request.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - }, - "subnetwork": { - "type": "string", - "description": "Name of the Subnetwork resource to delete.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - } - }, - "parameterOrder": [ - "project", - "region", - "subnetwork" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute" - ] - }, - "get": { - "id": "compute.subnetworks.get", - "path": "{project}/regions/{region}/subnetworks/{subnetwork}", - "httpMethod": "GET", - "description": "Returns the specified subnetwork.", - "parameters": { - "project": { - "type": "string", - "description": "Project ID for this request.", - "required": true, - "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - "location": "path" - }, - "region": { - "type": "string", - "description": "Name of the region scoping this request.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - }, - "subnetwork": { - "type": "string", - "description": "Name of the Subnetwork resource to return.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - } - }, - "parameterOrder": [ - "project", - "region", - "subnetwork" - ], - "response": { - "$ref": "Subnetwork" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" - ] - }, - "insert": { - "id": "compute.subnetworks.insert", - "path": "{project}/regions/{region}/subnetworks", - "httpMethod": "POST", - "description": "Creates a subnetwork in the specified project using the data included in the request.", - "parameters": { - "project": { - "type": "string", - "description": "Project ID for this request.", - "required": true, - "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - "location": "path" - }, - "region": { - "type": "string", - "description": "Name of the region scoping this request.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - } - }, - "parameterOrder": [ - "project", - "region" - ], - "request": { - "$ref": "Subnetwork" - }, - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute" - ] - }, - "list": { - "id": "compute.subnetworks.list", - "path": "{project}/regions/{region}/subnetworks", - "httpMethod": "GET", - "description": "Retrieves a list of subnetworks available to the specified project.", - "parameters": { - "filter": { - "type": "string", - "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions meaning that resources must match all expressions to pass the filters.", - "location": "query" - }, - "maxResults": { - "type": "integer", - "description": "The maximum number of results per page that Compute Engine should return. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.", - "default": "500", - "format": "uint32", - "minimum": "0", - "maximum": "500", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", - "location": "query" - }, - "project": { - "type": "string", - "description": "Project ID for this request.", - "required": true, - "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - "location": "path" - }, - "region": { - "type": "string", - "description": "Name of the region scoping this request.", - "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "location": "path" - } - }, - "parameterOrder": [ - "project", - "region" - ], - "response": { - "$ref": "SubnetworkList" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly" - ] - } - } - }, "targetHttpProxies": { "methods": { "delete": { @@ -12838,7 +12347,7 @@ "id": "compute.targetInstances.aggregatedList", "path": "{project}/aggregated/targetInstances", "httpMethod": "GET", - "description": "Retrieves an aggregated list of target instances.", + "description": "Retrieves the list of target instances grouped by scope.", "parameters": { "filter": { "type": "string", @@ -13002,7 +12511,7 @@ "id": "compute.targetInstances.list", "path": "{project}/zones/{zone}/targetInstances", "httpMethod": "GET", - "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.", + "description": "Retrieves the list of TargetInstance resources available to the specified project and zone.", "parameters": { "filter": { "type": "string", @@ -13145,7 +12654,7 @@ "id": "compute.targetPools.aggregatedList", "path": "{project}/aggregated/targetPools", "httpMethod": "GET", - "description": "Retrieves an aggregated list of target pools.", + "description": "Retrieves the list of target pools grouped by scope.", "parameters": { "filter": { "type": "string", @@ -13273,7 +12782,7 @@ "id": "compute.targetPools.getHealth", "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth", "httpMethod": "POST", - "description": "Gets the most recent health check results for each IP for the given instance that is referenced by the given TargetPool.", + "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", "parameters": { "project": { "type": "string", @@ -13353,7 +12862,7 @@ "id": "compute.targetPools.list", "path": "{project}/regions/{region}/targetPools", "httpMethod": "GET", - "description": "Retrieves a list of TargetPool resources available to the specified project and region.", + "description": "Retrieves the list of TargetPool resources available to the specified project and region.", "parameters": { "filter": { "type": "string", @@ -13546,7 +13055,7 @@ "id": "compute.targetVpnGateways.aggregatedList", "path": "{project}/aggregated/targetVpnGateways", "httpMethod": "GET", - "description": "Retrieves an aggregated list of target VPN gateways .", + "description": "Retrieves the list of target VPN gateways grouped by scope.", "parameters": { "filter": { "type": "string", @@ -13710,7 +13219,7 @@ "id": "compute.targetVpnGateways.list", "path": "{project}/regions/{region}/targetVpnGateways", "httpMethod": "GET", - "description": "Retrieves a list of TargetVpnGateway resources available to the specified project and region.", + "description": "Retrieves the list of TargetVpnGateway resources available to the specified project and region.", "parameters": { "filter": { "type": "string", @@ -13907,7 +13416,7 @@ "id": "compute.urlMaps.patch", "path": "{project}/global/urlMaps/{urlMap}", "httpMethod": "PATCH", - "description": "Updates the entire content of the UrlMap resource. This method supports patch semantics.", + "description": "Update the entire content of the UrlMap resource. This method supports patch semantics.", "parameters": { "project": { "type": "string", @@ -13943,7 +13452,7 @@ "id": "compute.urlMaps.update", "path": "{project}/global/urlMaps/{urlMap}", "httpMethod": "PUT", - "description": "Updates the entire content of the UrlMap resource.", + "description": "Update the entire content of the UrlMap resource.", "parameters": { "project": { "type": "string", @@ -13979,7 +13488,7 @@ "id": "compute.urlMaps.validate", "path": "{project}/global/urlMaps/{urlMap}/validate", "httpMethod": "POST", - "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.", + "description": "Run static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.", "parameters": { "project": { "type": "string", @@ -14019,7 +13528,7 @@ "id": "compute.vpnTunnels.aggregatedList", "path": "{project}/aggregated/vpnTunnels", "httpMethod": "GET", - "description": "Retrieves an aggregated list of VPN tunnels.", + "description": "Retrieves the list of VPN tunnels grouped by scope.", "parameters": { "filter": { "type": "string", @@ -14183,7 +13692,7 @@ "id": "compute.vpnTunnels.list", "path": "{project}/regions/{region}/vpnTunnels", "httpMethod": "GET", - "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.", + "description": "Retrieves the list of VpnTunnel resources contained in the specified project and region.", "parameters": { "filter": { "type": "string", @@ -14320,7 +13829,7 @@ "id": "compute.zoneOperations.list", "path": "{project}/zones/{zone}/operations", "httpMethod": "GET", - "description": "Retrieves a list of Operation resources contained within the specified zone.", + "description": "Retrieves the list of Operation resources contained within the specified zone.", "parameters": { "filter": { "type": "string", diff --git a/vendor/google.golang.org/api/compute/v1/compute-gen.go b/vendor/google.golang.org/api/compute/v1/compute-gen.go index 442346aa7..c5882702e 100644 --- a/vendor/google.golang.org/api/compute/v1/compute-gen.go +++ b/vendor/google.golang.org/api/compute/v1/compute-gen.go @@ -7,7 +7,7 @@ // import "google.golang.org/api/compute/v1" // ... // computeService, err := compute.New(oauthHttpClient) -package compute // import "google.golang.org/api/compute/v1" +package compute import ( "bytes" @@ -97,7 +97,6 @@ func New(client *http.Client) (*Service, error) { s.Routes = NewRoutesService(s) s.Snapshots = NewSnapshotsService(s) s.SslCertificates = NewSslCertificatesService(s) - s.Subnetworks = NewSubnetworksService(s) s.TargetHttpProxies = NewTargetHttpProxiesService(s) s.TargetHttpsProxies = NewTargetHttpsProxiesService(s) s.TargetInstances = NewTargetInstancesService(s) @@ -167,8 +166,6 @@ type Service struct { SslCertificates *SslCertificatesService - Subnetworks *SubnetworksService - TargetHttpProxies *TargetHttpProxiesService TargetHttpsProxies *TargetHttpsProxiesService @@ -429,15 +426,6 @@ type SslCertificatesService struct { s *Service } -func NewSubnetworksService(s *Service) *SubnetworksService { - rs := &SubnetworksService{s: s} - return rs -} - -type SubnetworksService struct { - s *Service -} - func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService { rs := &TargetHttpProxiesService{s: s} return rs @@ -1382,15 +1370,15 @@ type Backend struct { // fully-qualified URL, rather than a partial URL. Group string `json:"group,omitempty"` - // MaxRate: The max requests per second (RPS) of the group. Can be used - // with either balancing mode, but required if RATE mode. For RATE mode, - // either maxRate or maxRatePerInstance must be set. + // MaxRate: The max RPS of the group. Can be used with either balancing + // mode, but required if RATE mode. For RATE mode, either maxRate or + // maxRatePerInstance must be set. MaxRate int64 `json:"maxRate,omitempty"` - // MaxRatePerInstance: The max requests per second (RPS) that a single - // backed instance can handle. This is used to calculate the capacity of - // the group. Can be used in either balancing mode. For RATE mode, - // either maxRate or maxRatePerInstance must be set. + // MaxRatePerInstance: The max RPS that a single backed instance can + // handle. This is used to calculate the capacity of the group. Can be + // used in either balancing mode. For RATE mode, either maxRate or + // maxRatePerInstance must be set. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"` // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio @@ -1414,7 +1402,8 @@ func (s *Backend) MarshalJSON() ([]byte, error) { } // BackendService: A BackendService resource. This resource defines a -// group of backend virtual machines and their serving capacity. +// group of backend virtual machines together with their serving +// capacity. type BackendService struct { // Backends: The list of backends that serve this BackendService. Backends []*Backend `json:"backends,omitempty"` @@ -1456,8 +1445,8 @@ type BackendService struct { // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // Port: Deprecated in favor of portName. The TCP port to connect on the - // backend. The default value is 80. + // Port: Deprecated in favor of port name. The TCP port to connect on + // the backend. The default value is 80. Port int64 `json:"port,omitempty"` // PortName: Name of backend port. The same name should appear in the @@ -1473,8 +1462,7 @@ type BackendService struct { SelfLink string `json:"selfLink,omitempty"` // TimeoutSec: How many seconds to wait for the backend before - // considering it a failed request. Default is 30 seconds. Valid range - // is [1, 86400]. + // considering it a failed request. Default is 30 seconds. TimeoutSec int64 `json:"timeoutSec,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -2246,9 +2234,10 @@ type Firewall struct { // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // Network: URL of the network resource for this firewall rule. If not - // specified when creating a firewall rule, the default network is - // used: + // Network: URL of the network resource for this firewall rule. This + // field is required for creating an instance but optional when creating + // a firewall rule. If not specified when creating a firewall rule, the + // default network is used: // global/networks/default // If you choose to specify this property, you can specify the network // as a full or partial URL. For example, the following are all valid @@ -2445,9 +2434,6 @@ type ForwardingRule struct { // traffic. For regional forwarding rules, this target must live in the // same region as the forwarding rule. For global forwarding rules, this // target must be a global TargetHttpProxy or TargetHttpsProxy resource. - // The forwarded traffic must be of a type appropriate to the target - // object. For example, TargetHttpProxy requires HTTP traffic, and - // TargetHttpsProxy requires HTTPS traffic. Target string `json:"target,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -3171,16 +3157,16 @@ type Instance struct { // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` - // Description: An optional description of this resource. Provide this - // property when you create the resource. + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. Description string `json:"description,omitempty"` // Disks: Array of disks associated with this instance. Persistent disks // must be created before you can assign them. Disks []*AttachedDisk `json:"disks,omitempty"` - // Id: [Output Only] The unique identifier for the resource. This - // identifier is defined by the server. + // Id: [Output Only] Unique identifier for the resource. This identifier + // is defined by the server. Id uint64 `json:"id,omitempty,string"` // Kind: [Output Only] Type of the resource. Always compute#instance for @@ -3215,14 +3201,13 @@ type Instance struct { // This includes custom metadata and predefined keys. Metadata *Metadata `json:"metadata,omitempty"` - // Name: The name of the resource, provided by the client when initially - // creating the resource. The resource name must be 1-63 characters - // long, and comply with RFC1035. Specifically, the name must be 1-63 - // characters long and match the regular expression - // [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a - // lowercase letter, and all following characters must be a dash, - // lowercase letter, or digit, except the last character, which cannot - // be a dash. + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` // NetworkInterfaces: An array of configurations for this interface. @@ -3233,7 +3218,7 @@ type Instance struct { // Scheduling: Scheduling options for this instance. Scheduling *Scheduling `json:"scheduling,omitempty"` - // SelfLink: [Output Only] Server-defined URL for this resource. + // SelfLink: [Output Only] Server defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` // ServiceAccounts: A list of service accounts, with their specified @@ -3304,15 +3289,11 @@ type InstanceAggregatedList struct { // resources. Kind string `json:"kind,omitempty"` - // NextPageToken: [Output Only] This token allows you to get the next - // page of results for list requests. If the number of results is larger - // than maxResults, use the nextPageToken as a value for the query - // parameter pageToken in the next list request. Subsequent list - // requests will have their own nextPageToken to continue paging through - // the results. + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server-defined URL for this resource. + // SelfLink: [Output Only] Server defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -3383,10 +3364,6 @@ type InstanceGroup struct { // group. Size int64 `json:"size,omitempty"` - // Subnetwork: [Output Only] The URL of the subnetwork to which all - // instances in the instance group belong. - Subnetwork string `json:"subnetwork,omitempty"` - // Zone: [Output Only] The URL of the zone where the instance group is // located. Zone string `json:"zone,omitempty"` @@ -3596,8 +3573,7 @@ type InstanceGroupManagerActionsSummary struct { // Creating: [Output Only] The number of instances in the managed // instance group that are scheduled to be created or are currently - // being created. If the group fails to create one of these instances, - // it tries again until it creates the instance successfully. + // being created. Creating int64 `json:"creating,omitempty"` // Deleting: [Output Only] The number of instances in the managed @@ -4220,15 +4196,11 @@ type InstanceList struct { // lists of Instance resources. Kind string `json:"kind,omitempty"` - // NextPageToken: [Output Only] This token allows you to get the next - // page of results for list requests. If the number of results is larger - // than maxResults, use the nextPageToken as a value for the query - // parameter pageToken in the next list request. Subsequent list - // requests will have their own nextPageToken to continue paging through - // the results. + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server-defined URL for this resource. + // SelfLink: [Output Only] Server defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -4599,27 +4571,6 @@ func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields) } -type InstancesSetMachineTypeRequest struct { - // MachineType: Full or partial URL of the machine type resource. See - // Machine Types for a full list of machine types. For example: - // zones/us-central1-f/machineTypes/n1-standard-1 - MachineType string `json:"machineType,omitempty"` - - // ForceSendFields is a list of field names (e.g. "MachineType") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) { - type noMethod InstancesSetMachineTypeRequest - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - // License: A license resource. type License struct { // ChargesUseFee: [Output Only] If true, the customer will be charged @@ -4943,13 +4894,7 @@ type ManagedInstance struct { // instance group has scheduled for the instance. Possible values: // - NONE The instance is running, and the managed instance group does // not have any scheduled actions for this instance. - // - CREATING The managed instance group is creating this instance. If - // the group fails to create this instance, it will try again until it - // is successful. - // - CREATING_WITHOUT_RETRIES The managed instance group is attempting - // to create this instance only once. If the group fails to create this - // instance, it does not try again and the group's target_size value is - // decreased. + // - CREATING The managed instance group is creating this instance. // - RECREATING The managed instance group is recreating this instance. // // - DELETING The managed instance group is permanently deleting this @@ -5176,15 +5121,6 @@ type Network struct { // 192.168.0.0/16. Provided by the client when the network is created. IPv4Range string `json:"IPv4Range,omitempty"` - // AutoCreateSubnetworks: When set to true, the network is created in - // "auto subnet mode". When set to false, the network is in "custom - // subnet mode". - // - // In "auto subnet mode", a newly created network is assigned the - // default CIDR of 10.128.0.0/9 and it automatically creates one - // subnetwork per region. - AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"` - // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` @@ -5218,10 +5154,6 @@ type Network struct { // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` - // Subnetworks: [Output Only] Server-defined fully-qualified URLs for - // all subnetworks in this network. - Subnetworks []string `json:"subnetworks,omitempty"` - // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` @@ -5273,18 +5205,6 @@ type NetworkInterface struct { // assigned to the instance for this network interface. NetworkIP string `json:"networkIP,omitempty"` - // Subnetwork: The URL of the Subnetwork resource for this instance. If - // the network resource is in legacy mode, do not provide this property. - // If the network is in auto subnet mode, providing the subnetwork is - // optional. If the network is in custom subnet mode, then this field - // should be specified. If you specify this property, you can specify - // the subnetwork as a full or partial URL. For example, the following - // are all valid URLs: - // - - // https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork - // - zones/zone/subnetworks/subnetwork - Subnetwork string `json:"subnetwork,omitempty"` - // ForceSendFields is a list of field names (e.g. "AccessConfigs") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, @@ -5371,8 +5291,8 @@ type Operation struct { HttpErrorMessage string `json:"httpErrorMessage,omitempty"` // HttpErrorStatusCode: [Output Only] If the operation fails, this field - // contains the HTTP error status code that was returned. For example, a - // 404 means the resource was not found. + // contains the HTTP error message that was returned. For example, a 404 + // means the resource was not found. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` // Id: [Output Only] The unique identifier for the resource. This @@ -5396,13 +5316,13 @@ type Operation struct { // Progress: [Output Only] An optional progress indicator that ranges // from 0 to 100. There is no requirement that this be linear or support - // any granularity of operations. This should not be used to guess when - // the operation will be complete. This number should monotonically + // any granularity of operations. This should not be used to guess at + // when the operation will be complete. This number should monotonically // increase as the operation progresses. Progress int64 `json:"progress,omitempty"` // Region: [Output Only] URL of the region where the operation resides. - // Only available when performing regional operations. + // Only applicable for regional resources. Region string `json:"region,omitempty"` // SelfLink: [Output Only] Server-defined URL for the resource. @@ -5441,8 +5361,7 @@ type Operation struct { // processing of the operation, this field will be populated. Warnings []*OperationWarnings `json:"warnings,omitempty"` - // Zone: [Output Only] URL of the zone where the operation resides. Only - // available when performing per-zone operations. + // Zone: [Output Only] URL of the zone where the operation resides. Zone string `json:"zone,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -5776,15 +5695,9 @@ func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) { // BackendService from the longest-matched rule will serve the URL. If // no rule was matched, the default service will be used. type PathMatcher struct { - // DefaultService: The full or partial URL to the BackendService - // resource. This will be used if none of the pathRules defined by this - // PathMatcher is matched by the URL's path portion. For example, the - // following are all valid URLs to a BackendService resource: - // - - // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService - // - compute/v1/projects/project/global/backendServices/backendService - // - // - global/backendServices/backendService + // DefaultService: The URL to the BackendService resource. This will be + // used if none of the pathRules defined by this PathMatcher is met by + // the URL's path portion. DefaultService string `json:"defaultService,omitempty"` // Description: An optional description of this resource. Provide this @@ -5878,8 +5791,8 @@ type Project struct { // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` - // UsageExportLocation: The naming prefix for daily usage reports and - // the Google Cloud Storage bucket where they are stored. + // UsageExportLocation: The location in Cloud Storage and naming method + // of the daily usage report. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -5930,7 +5843,6 @@ type Quota struct { // "SSD_TOTAL_GB" // "SSL_CERTIFICATES" // "STATIC_ADDRESSES" - // "SUBNETWORKS" // "TARGET_HTTPS_PROXIES" // "TARGET_HTTP_PROXIES" // "TARGET_INSTANCES" @@ -6083,7 +5995,7 @@ func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) { // Route: The route resource. A Route is a rule that specifies how // certain packets should be handled by the virtual network. Routes are -// associated with instances by tags and the set of Routes for a +// associated with instances by tag and the set of Routes for a // particular instance is called its routing table. For each packet // leaving a instance, the system searches that instance's routing table // for a single best matching Route. Routes match packets by destination @@ -6131,13 +6043,12 @@ type Route struct { Network string `json:"network,omitempty"` // NextHopGateway: The URL to a gateway that should handle matching - // packets. You can only specify the internet gateway using a full or - // partial valid URL: + // packets. Currently, this is only the internet gateway: // projects//global/gateways/default-internet-gateway NextHopGateway string `json:"nextHopGateway,omitempty"` - // NextHopInstance: The URL to an instance that should handle matching - // packets. You can specify this as a full or partial URL. For + // NextHopInstance: The fully-qualified URL to an instance that should + // handle matching packets. For // example: // https://www.googleapis.com/compute/v1/projects/project/zones/ // zone/instances/ @@ -6155,11 +6066,9 @@ type Route struct { // packets. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"` - // Priority: The priority of this route. Priority is used to break ties - // in cases where there is more than one matching route of equal prefix - // length. In the case of two routes with equal prefix length, the one - // with the lowest-numbered priority value wins. Default value is 1000. - // Valid range is 0 through 65535. + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + // Default value is 1000. A valid range is between 0 and 65535. Priority int64 `json:"priority,omitempty"` // SelfLink: [Output Only] Server-defined fully-qualified URL for this @@ -6273,7 +6182,7 @@ type RouteList struct { // server. Id string `json:"id,omitempty"` - // Items: [Output Only] A list of Route resources. + // Items: A list of Route resources. Items []*Route `json:"items,omitempty"` // Kind: Type of resource. @@ -6355,7 +6264,7 @@ type SerialPortOutput struct { // compute#serialPortOutput for serial port output. Kind string `json:"kind,omitempty"` - // SelfLink: [Output Only] Server-defined URL for the resource. + // SelfLink: [Output Only] Server defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -6437,8 +6346,7 @@ type Snapshot struct { // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` - // SourceDisk: [Output Only] The source disk used to create this - // snapshot. + // SourceDisk: The source disk used to create this snapshot. SourceDisk string `json:"sourceDisk,omitempty"` // SourceDiskId: [Output Only] The ID value of the disk used to create @@ -6496,7 +6404,7 @@ type SnapshotList struct { // identifier is defined by the server. Id string `json:"id,omitempty"` - // Items: [Output Only] A list of Snapshot resources. + // Items: A list of Snapshot resources. Items []*Snapshot `json:"items,omitempty"` // Kind: Type of resource. @@ -6533,8 +6441,8 @@ func (s *SnapshotList) MarshalJSON() ([]byte, error) { } // SslCertificate: An SslCertificate resource. This resource provides a -// mechanism to upload an SSL key and certificate to the load balancer -// to serve secure connections from the user. +// mechanism to upload an SSL key and certificate to global HTTPS +// loadbalancer to serve secure connections. type SslCertificate struct { // Certificate: A local certificate file. The certificate must be in PEM // format. The certificate chain must be no greater than 5 certs long. @@ -6634,258 +6542,6 @@ func (s *SslCertificateList) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields) } -// Subnetwork: A Subnetwork resource. -type Subnetwork struct { - // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text - // format. - CreationTimestamp string `json:"creationTimestamp,omitempty"` - - // Description: An optional description of this resource. Provide this - // property when you create the resource. - Description string `json:"description,omitempty"` - - // GatewayAddress: [Output Only] The gateway address for default routes - // to reach destination addresses outside this subnetwork. - GatewayAddress string `json:"gatewayAddress,omitempty"` - - // Id: [Output Only] The unique identifier for the resource. This - // identifier is defined by the server. - Id uint64 `json:"id,omitempty,string"` - - // IpCidrRange: The range of internal addresses that are owned by this - // subnetwork. Provide this property when you create the subnetwork. For - // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and - // non-overlapping within a network. - IpCidrRange string `json:"ipCidrRange,omitempty"` - - // Kind: [Output Only] Type of the resource. Always compute#subnetwork - // for Subnetwork resources. - Kind string `json:"kind,omitempty"` - - // Name: The name of the resource, provided by the client when initially - // creating the resource. The name must be 1-63 characters long, and - // comply with RFC1035. Specifically, the name must be 1-63 characters - // long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? - // which means the first character must be a lowercase letter, and all - // following characters must be a dash, lowercase letter, or digit, - // except the last character, which cannot be a dash. - Name string `json:"name,omitempty"` - - // Network: The URL of the network to which this subnetwork belongs, - // provided by the client when initially creating the subnetwork. Only - // networks that are in the distributed mode can have subnetworks. - Network string `json:"network,omitempty"` - - // Region: [Output Only] URL of the region where the Subnetwork resides. - Region string `json:"region,omitempty"` - - // SelfLink: [Output Only] Server-defined URL for the resource. - SelfLink string `json:"selfLink,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "CreationTimestamp") - // to unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *Subnetwork) MarshalJSON() ([]byte, error) { - type noMethod Subnetwork - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -type SubnetworkAggregatedList struct { - // Id: [Output Only] The unique identifier for the resource. This - // identifier is defined by the server. - Id string `json:"id,omitempty"` - - // Items: [Output] A map of scoped Subnetwork lists. - Items map[string]SubnetworksScopedList `json:"items,omitempty"` - - // Kind: [Output Only] Type of resource. Always - // compute#subnetworkAggregatedList for aggregated lists of subnetworks. - Kind string `json:"kind,omitempty"` - - // NextPageToken: [Output Only] This token allows you to get the next - // page of results for list requests. If the number of results is larger - // than maxResults, use the nextPageToken as a value for the query - // parameter pageToken in the next list request. Subsequent list - // requests will have their own nextPageToken to continue paging through - // the results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // SelfLink: [Output Only] Server-defined URL for this resource. - SelfLink string `json:"selfLink,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Id") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) { - type noMethod SubnetworkAggregatedList - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// SubnetworkList: Contains a list of Subnetwork resources. -type SubnetworkList struct { - // Id: [Output Only] The unique identifier for the resource. This - // identifier is defined by the server. - Id string `json:"id,omitempty"` - - // Items: The Subnetwork resources. - Items []*Subnetwork `json:"items,omitempty"` - - // Kind: [Output Only] Type of resource. Always compute#subnetworkList - // for lists of subnetworks. - Kind string `json:"kind,omitempty"` - - // NextPageToken: [Output Only] This token allows you to get the next - // page of results for list requests. If the number of results is larger - // than maxResults, use the nextPageToken as a value for the query - // parameter pageToken in the next list request. Subsequent list - // requests will have their own nextPageToken to continue paging through - // the results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // SelfLink: [Output Only] Server-defined URL for this resource. - SelfLink string `json:"selfLink,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Id") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SubnetworkList) MarshalJSON() ([]byte, error) { - type noMethod SubnetworkList - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -type SubnetworksScopedList struct { - // Subnetworks: List of subnetworks contained in this scope. - Subnetworks []*Subnetwork `json:"subnetworks,omitempty"` - - // Warning: An informational warning that appears when the list of - // addresses is empty. - Warning *SubnetworksScopedListWarning `json:"warning,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Subnetworks") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) { - type noMethod SubnetworksScopedList - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// SubnetworksScopedListWarning: An informational warning that appears -// when the list of addresses is empty. -type SubnetworksScopedListWarning struct { - // Code: [Output Only] A warning code, if applicable. For example, - // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in - // the response. - // - // Possible values: - // "DEPRECATED_RESOURCE_USED" - // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - // "INJECTED_KERNELS_DEPRECATED" - // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - // "NEXT_HOP_CANNOT_IP_FORWARD" - // "NEXT_HOP_INSTANCE_NOT_FOUND" - // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - // "NEXT_HOP_NOT_RUNNING" - // "NOT_CRITICAL_ERROR" - // "NO_RESULTS_ON_PAGE" - // "REQUIRED_TOS_AGREEMENT" - // "RESOURCE_NOT_DELETED" - // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - // "UNREACHABLE" - Code string `json:"code,omitempty"` - - // Data: [Output Only] Metadata about this warning in key: value format. - // For example: - // "data": [ { "key": "scope", "value": "zones/us-east1-d" } - Data []*SubnetworksScopedListWarningData `json:"data,omitempty"` - - // Message: [Output Only] A human-readable description of the warning - // code. - Message string `json:"message,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Code") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) { - type noMethod SubnetworksScopedListWarning - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -type SubnetworksScopedListWarningData struct { - // Key: [Output Only] A key that provides more detail on the warning - // being returned. For example, for warnings where there are no results - // in a list request for a particular zone, this key might be scope and - // the key value might be the zone name. Other examples might be a key - // indicating a deprecated resource, and a suggested replacement, or a - // warning about invalid network settings (for example, if an instance - // attempts to perform IP forwarding but is not enabled for IP - // forwarding). - Key string `json:"key,omitempty"` - - // Value: [Output Only] A warning data value corresponding to the key. - Value string `json:"value,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Key") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) { - type noMethod SubnetworksScopedListWarningData - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - // Tags: A set of instance tags. type Tags struct { // Fingerprint: Specifies a fingerprint for this request, which is @@ -7067,8 +6723,8 @@ type TargetHttpsProxy struct { SelfLink string `json:"selfLink,omitempty"` // SslCertificates: URLs to SslCertificate resources that are used to - // authenticate connections between users and the load balancer. - // Currently exactly one SSL certificate must be specified. + // authenticate connections to Backends. Currently exactly one SSL + // certificate must be specified. SslCertificates []string `json:"sslCertificates,omitempty"` // UrlMap: URL to the UrlMap resource that defines the mapping from URL @@ -8328,10 +7984,8 @@ func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) { type UsageExportLocation struct { // BucketName: The name of an existing bucket in Cloud Storage where the // usage report object is stored. The Google Service Account is granted - // write access to this bucket. This can either be the bucket name by - // itself, such as example-bucket, or the bucket name with gs:// or - // https://storage.googleapis.com/ in front of it, such as - // gs://example-bucket. + // write access to this bucket. This is just the bucket name, with no + // gs:// or https://storage.googleapis.com/ in front of it. BucketName string `json:"bucketName,omitempty"` // ReportNamePrefix: An optional prefix for the name of the usage report @@ -8383,12 +8037,6 @@ type VpnTunnel struct { // VPN tunnels. Kind string `json:"kind,omitempty"` - // LocalTrafficSelector: Local traffic selector to use when establishing - // the VPN tunnel with peer VPN gateway. The value should be a CIDR - // formatted string, for example: 192.168.0.0/16. The ranges should be - // disjoint. - LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"` - // Name: Name of the resource; provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with // RFC1035. Specifically, the name must be 1-63 characters long and @@ -8408,7 +8056,7 @@ type VpnTunnel struct { SelfLink string `json:"selfLink,omitempty"` // SharedSecret: Shared secret used to set the secure session between - // the Cloud VPN gateway and the peer VPN gateway. + // the GCE VPN gateway and the peer VPN gateway. SharedSecret string `json:"sharedSecret,omitempty"` // SharedSecretHash: Hash of the shared secret. @@ -8784,7 +8432,7 @@ type AddressesAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of addresses. +// AggregatedList: Retrieves the list of addresses grouped by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall { c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -8925,7 +8573,7 @@ func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Address } return ret, nil // { - // "description": "Retrieves an aggregated list of addresses.", + // "description": "Retrieves the list of addresses grouped by scope.", // "httpMethod": "GET", // "id": "compute.addresses.aggregatedList", // "parameterOrder": [ @@ -8972,27 +8620,6 @@ func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Address } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.addresses.delete": type AddressesDeleteCall struct { @@ -9425,7 +9052,7 @@ type AddressesListCall struct { ctx_ context.Context } -// List: Retrieves a list of address resources contained within the +// List: Retrieves the list of address resources contained within the // specified region. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list func (r *AddressesService) List(project string, region string) *AddressesListCall { @@ -9569,7 +9196,7 @@ func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, erro } return ret, nil // { - // "description": "Retrieves a list of address resources contained within the specified region.", + // "description": "Retrieves the list of address resources contained within the specified region.", // "httpMethod": "GET", // "id": "compute.addresses.list", // "parameterOrder": [ @@ -9624,27 +9251,6 @@ func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, erro } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.autoscalers.aggregatedList": type AutoscalersAggregatedListCall struct { @@ -9655,7 +9261,7 @@ type AutoscalersAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of autoscalers. +// AggregatedList: Retrieves the list of autoscalers grouped by scope. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall { c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -9795,7 +9401,7 @@ func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*Autos } return ret, nil // { - // "description": "Retrieves an aggregated list of autoscalers.", + // "description": "Retrieves the list of autoscalers grouped by scope.", // "httpMethod": "GET", // "id": "compute.autoscalers.aggregatedList", // "parameterOrder": [ @@ -9842,27 +9448,6 @@ func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*Autos } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.autoscalers.delete": type AutoscalersDeleteCall struct { @@ -10292,7 +9877,7 @@ type AutoscalersListCall struct { ctx_ context.Context } -// List: Retrieves a list of autoscaler resources contained within the +// List: Retrieves the list of autoscaler resources contained within the // specified zone. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall { c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -10435,7 +10020,7 @@ func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, } return ret, nil // { - // "description": "Retrieves a list of autoscaler resources contained within the specified zone.", + // "description": "Retrieves the list of autoscaler resources contained within the specified zone.", // "httpMethod": "GET", // "id": "compute.autoscalers.list", // "parameterOrder": [ @@ -10490,27 +10075,6 @@ func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.autoscalers.patch": type AutoscalersPatchCall struct { @@ -11214,9 +10778,7 @@ type BackendServicesInsertCall struct { } // Insert: Creates a BackendService resource in the specified project -// using the data included in the request. There are several -// restrictions and guidelines to keep in mind when creating a backend -// service. Read Restrictions and Guidelines for more information. +// using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall { c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -11300,7 +10862,7 @@ func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation } return ret, nil // { - // "description": "Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.", + // "description": "Creates a BackendService resource in the specified project using the data included in the request.", // "httpMethod": "POST", // "id": "compute.backendServices.insert", // "parameterOrder": [ @@ -11529,27 +11091,6 @@ func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServ } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.backendServices.patch": type BackendServicesPatchCall struct { @@ -11561,10 +11102,8 @@ type BackendServicesPatchCall struct { ctx_ context.Context } -// Patch: Updates the entire content of the BackendService resource. -// There are several restrictions and guidelines to keep in mind when -// updating a backend service. Read Restrictions and Guidelines for -// more information. This method supports patch semantics. +// Patch: Update the entire content of the BackendService resource. This +// method supports patch semantics. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall { c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -11650,7 +11189,7 @@ func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, } return ret, nil // { - // "description": "Updates the entire content of the BackendService resource. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports patch semantics.", + // "description": "Update the entire content of the BackendService resource. This method supports patch semantics.", // "httpMethod": "PATCH", // "id": "compute.backendServices.patch", // "parameterOrder": [ @@ -11699,10 +11238,7 @@ type BackendServicesUpdateCall struct { ctx_ context.Context } -// Update: Updates the entire content of the BackendService resource. -// There are several restrictions and guidelines to keep in mind when -// updating a backend service. Read Restrictions and Guidelines for -// more information. +// Update: Update the entire content of the BackendService resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall { c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -11788,7 +11324,7 @@ func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation } return ret, nil // { - // "description": "Updates the entire content of the BackendService resource. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.", + // "description": "Update the entire content of the BackendService resource.", // "httpMethod": "PUT", // "id": "compute.backendServices.update", // "parameterOrder": [ @@ -11836,7 +11372,8 @@ type DiskTypesAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of disk type resources. +// AggregatedList: Retrieves the list of disk type resources grouped by +// scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall { c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -11977,7 +11514,7 @@ func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTyp } return ret, nil // { - // "description": "Retrieves an aggregated list of disk type resources.", + // "description": "Retrieves the list of disk type resources grouped by scope.", // "httpMethod": "GET", // "id": "compute.diskTypes.aggregatedList", // "parameterOrder": [ @@ -12024,27 +11561,6 @@ func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTyp } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.diskTypes.get": type DiskTypesGetCall struct { @@ -12206,7 +11722,7 @@ type DiskTypesListCall struct { ctx_ context.Context } -// List: Retrieves a list of disk type resources available to the +// List: Retrieves the list of disk type resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall { @@ -12350,7 +11866,7 @@ func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, err } return ret, nil // { - // "description": "Retrieves a list of disk type resources available to the specified project.", + // "description": "Retrieves the list of disk type resources available to the specified project.", // "httpMethod": "GET", // "id": "compute.diskTypes.list", // "parameterOrder": [ @@ -12405,27 +11921,6 @@ func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, err } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.disks.aggregatedList": type DisksAggregatedListCall struct { @@ -12436,7 +11931,8 @@ type DisksAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of persistent disks. +// AggregatedList: Retrieves the list of persistent disks grouped by +// scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall { c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -12577,7 +12073,7 @@ func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggrega } return ret, nil // { - // "description": "Retrieves an aggregated list of persistent disks.", + // "description": "Retrieves the list of persistent disks grouped by scope.", // "httpMethod": "GET", // "id": "compute.disks.aggregatedList", // "parameterOrder": [ @@ -12624,27 +12120,6 @@ func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggrega } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.disks.createSnapshot": type DisksCreateSnapshotCall struct { @@ -13238,7 +12713,7 @@ type DisksListCall struct { ctx_ context.Context } -// List: Retrieves a list of persistent disks contained within the +// List: Retrieves the list of persistent disks contained within the // specified zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list func (r *DisksService) List(project string, zone string) *DisksListCall { @@ -13382,7 +12857,7 @@ func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) { } return ret, nil // { - // "description": "Retrieves a list of persistent disks contained within the specified zone.", + // "description": "Retrieves the list of persistent disks contained within the specified zone.", // "httpMethod": "GET", // "id": "compute.disks.list", // "parameterOrder": [ @@ -13437,27 +12912,6 @@ func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) { } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.firewalls.delete": type FirewallsDeleteCall struct { @@ -14045,27 +13499,6 @@ func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, err } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.firewalls.patch": type FirewallsPatchCall struct { @@ -14348,7 +13781,8 @@ type ForwardingRulesAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of forwarding rules. +// AggregatedList: Retrieves the list of forwarding rules grouped by +// scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall { c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -14489,7 +13923,7 @@ func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Retrieves an aggregated list of forwarding rules.", + // "description": "Retrieves the list of forwarding rules grouped by scope.", // "httpMethod": "GET", // "id": "compute.forwardingRules.aggregatedList", // "parameterOrder": [ @@ -14536,27 +13970,6 @@ func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*F } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.forwardingRules.delete": type ForwardingRulesDeleteCall struct { @@ -14989,7 +14402,7 @@ type ForwardingRulesListCall struct { ctx_ context.Context } -// List: Retrieves a list of ForwardingRule resources available to the +// List: Retrieves the list of ForwardingRule resources available to the // specified project and region. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall { @@ -15133,7 +14546,7 @@ func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingR } return ret, nil // { - // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.", + // "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", // "httpMethod": "GET", // "id": "compute.forwardingRules.list", // "parameterOrder": [ @@ -15188,27 +14601,6 @@ func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingR } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.forwardingRules.setTarget": type ForwardingRulesSetTargetCall struct { @@ -15754,7 +15146,7 @@ type GlobalAddressesListCall struct { ctx_ context.Context } -// List: Retrieves a list of global address resources. +// List: Retrieves the list of global address resources. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall { c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -15895,7 +15287,7 @@ func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList } return ret, nil // { - // "description": "Retrieves a list of global address resources.", + // "description": "Retrieves the list of global address resources.", // "httpMethod": "GET", // "id": "compute.globalAddresses.list", // "parameterOrder": [ @@ -15942,27 +15334,6 @@ func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.globalForwardingRules.delete": type GlobalForwardingRulesDeleteCall struct { @@ -16361,7 +15732,7 @@ type GlobalForwardingRulesListCall struct { ctx_ context.Context } -// List: Retrieves a list of ForwardingRule resources available to the +// List: Retrieves the list of ForwardingRule resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall { @@ -16503,7 +15874,7 @@ func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*Forwa } return ret, nil // { - // "description": "Retrieves a list of ForwardingRule resources available to the specified project.", + // "description": "Retrieves the list of ForwardingRule resources available to the specified project.", // "httpMethod": "GET", // "id": "compute.globalForwardingRules.list", // "parameterOrder": [ @@ -16550,27 +15921,6 @@ func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*Forwa } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.globalForwardingRules.setTarget": type GlobalForwardingRulesSetTargetCall struct { @@ -16717,7 +16067,8 @@ type GlobalOperationsAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of all operations. +// AggregatedList: Retrieves the list of all operations grouped by +// scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall { c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -16858,7 +16209,7 @@ func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Retrieves an aggregated list of all operations.", + // "description": "Retrieves the list of all operations grouped by scope.", // "httpMethod": "GET", // "id": "compute.globalOperations.aggregatedList", // "parameterOrder": [ @@ -16905,27 +16256,6 @@ func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (* } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.globalOperations.delete": type GlobalOperationsDeleteCall struct { @@ -17172,7 +16502,7 @@ type GlobalOperationsListCall struct { ctx_ context.Context } -// List: Retrieves a list of Operation resources contained within the +// List: Retrieves the list of Operation resources contained within the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall { @@ -17314,7 +16644,7 @@ func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationL } return ret, nil // { - // "description": "Retrieves a list of Operation resources contained within the specified project.", + // "description": "Retrieves the list of Operation resources contained within the specified project.", // "httpMethod": "GET", // "id": "compute.globalOperations.list", // "parameterOrder": [ @@ -17361,27 +16691,6 @@ func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationL } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.httpHealthChecks.delete": type HttpHealthChecksDeleteCall struct { @@ -17969,27 +17278,6 @@ func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealth } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.httpHealthChecks.patch": type HttpHealthChecksPatchCall struct { @@ -18846,27 +18134,6 @@ func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHeal } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.httpsHealthChecks.patch": type HttpsHealthChecksPatchCall struct { @@ -19873,27 +19140,6 @@ func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) { } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instanceGroupManagers.abandonInstances": type InstanceGroupManagersAbandonInstancesCall struct { @@ -20244,27 +19490,6 @@ func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOptio } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instanceGroupManagers.delete": type InstanceGroupManagersDeleteCall struct { @@ -20277,9 +19502,7 @@ type InstanceGroupManagersDeleteCall struct { } // Delete: Deletes the specified managed instance group and all of the -// instances in that group. Note that the instance group must not belong -// to a backend service. Read Deleting an instance group for more -// information. +// instances in that group. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall { c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -20359,7 +19582,7 @@ func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Ope } return ret, nil // { - // "description": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.", + // "description": "Deletes the specified managed instance group and all of the instances in that group.", // "httpMethod": "DELETE", // "id": "compute.instanceGroupManagers.delete", // "parameterOrder": [ @@ -21045,27 +20268,6 @@ func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*Insta } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instanceGroupManagers.listManagedInstances": type InstanceGroupManagersListManagedInstancesCall struct { @@ -21809,7 +21011,8 @@ type InstanceGroupsAddInstancesCall struct { } // AddInstances: Adds a list of instances to the specified instance -// group. Read Adding instances for more information. +// group. All of the instances in the instance group must be in the same +// network/subnetwork. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall { c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -21896,7 +21099,7 @@ func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Oper } return ret, nil // { - // "description": "Adds a list of instances to the specified instance group. Read Adding instances for more information.", + // "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork.", // "httpMethod": "POST", // "id": "compute.instanceGroups.addInstances", // "parameterOrder": [ @@ -22138,27 +21341,6 @@ func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*In } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instanceGroups.delete": type InstanceGroupsDeleteCall struct { @@ -22171,9 +21353,7 @@ type InstanceGroupsDeleteCall struct { } // Delete: Deletes the specified instance group. The instances in the -// group are not deleted. Note that instance group must not belong to a -// backend service. Read Deleting an instance group for more -// information. +// group are not deleted. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall { c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -22253,7 +21433,7 @@ func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, } return ret, nil // { - // "description": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.", + // "description": "Deletes the specified instance group. The instances in the group are not deleted.", // "httpMethod": "DELETE", // "id": "compute.instanceGroups.delete", // "parameterOrder": [ @@ -22783,27 +21963,6 @@ func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGrou } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instanceGroups.listInstances": type InstanceGroupsListInstancesCall struct { @@ -23579,10 +22738,7 @@ type InstanceTemplatesInsertCall struct { } // Insert: Creates an instance template in the specified project using -// the data that is included in the request. If you are creating a new -// template to update an existing instance group, your new instance -// template must use the same network or, if applicable, the same -// subnetwork as the original template. +// the data that is included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall { c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -23666,7 +22822,7 @@ func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operati } return ret, nil // { - // "description": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.", + // "description": "Creates an instance template in the specified project using the data that is included in the request.", // "httpMethod": "POST", // "id": "compute.instanceTemplates.insert", // "parameterOrder": [ @@ -23895,27 +23051,6 @@ func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceT } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instances.addAccessConfig": type InstancesAddAccessConfigCall struct { @@ -24269,27 +23404,6 @@ func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Instanc } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instances.attachDisk": type InstancesAttachDiskCall struct { @@ -25531,27 +24645,6 @@ func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, err } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.instances.reset": type InstancesResetCall struct { @@ -25840,152 +24933,6 @@ func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Oper } -// method id "compute.instances.setMachineType": - -type InstancesSetMachineTypeCall struct { - s *Service - project string - zone string - instance string - instancessetmachinetyperequest *InstancesSetMachineTypeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// SetMachineType: Changes the machine type for a stopped instance to -// the machine type specified in the request. -func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall { - c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.zone = zone - c.instance = instance - c.instancessetmachinetyperequest = instancessetmachinetyperequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall { - c.ctx_ = ctx - return c -} - -func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "compute.instances.setMachineType" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.", - // "httpMethod": "POST", - // "id": "compute.instances.setMachineType", - // "parameterOrder": [ - // "project", - // "zone", - // "instance" - // ], - // "parameters": { - // "instance": { - // "description": "Name of the instance scoping this request.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // }, - // "project": { - // "description": "Project ID for this request.", - // "location": "path", - // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - // "required": true, - // "type": "string" - // }, - // "zone": { - // "description": "The name of the zone for this request.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // } - // }, - // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType", - // "request": { - // "$ref": "InstancesSetMachineTypeRequest" - // }, - // "response": { - // "$ref": "Operation" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/compute" - // ] - // } - -} - // method id "compute.instances.setMetadata": type InstancesSetMetadataCall struct { @@ -26437,9 +25384,9 @@ type InstancesStartCall struct { ctx_ context.Context } -// Start: Starts an instance that was stopped using the using the -// instances().stop method. For more information, see Restart an -// instance. +// Start: This method starts an instance that was stopped using the +// using the instances().stop method. For more information, see Restart +// an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall { c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -26520,7 +25467,7 @@ func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error } return ret, nil // { - // "description": "Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", + // "description": "This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", // "httpMethod": "POST", // "id": "compute.instances.start", // "parameterOrder": [ @@ -26574,13 +25521,13 @@ type InstancesStopCall struct { ctx_ context.Context } -// Stop: Stops a running instance, shutting it down cleanly, and allows -// you to restart the instance at a later time. Stopped instances do not -// incur per-minute, virtual machine usage charges while they are -// stopped, but any resources that the virtual machine is using, such as -// persistent disks and static IP addresses, will continue to be charged -// until they are deleted. For more information, see Stopping an -// instance. +// Stop: This method stops a running instance, shutting it down cleanly, +// and allows you to restart the instance at a later time. Stopped +// instances do not incur per-minute, virtual machine usage charges +// while they are stopped, but any resources that the virtual machine is +// using, such as persistent disks and static IP addresses,will continue +// to be charged until they are deleted. For more information, see +// Stopping an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall { c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -26661,7 +25608,7 @@ func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) } return ret, nil // { - // "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", + // "description": "This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance.", // "httpMethod": "POST", // "id": "compute.instances.stop", // "parameterOrder": [ @@ -26853,8 +25800,8 @@ type MachineTypesAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of machine type -// resources. +// AggregatedList: Retrieves the list of machine type resources grouped +// by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -26995,7 +25942,7 @@ func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Mach } return ret, nil // { - // "description": "Retrieves an aggregated list of machine type resources.", + // "description": "Retrieves the list of machine type resources grouped by scope.", // "httpMethod": "GET", // "id": "compute.machineTypes.aggregatedList", // "parameterOrder": [ @@ -27042,27 +25989,6 @@ func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Mach } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.machineTypes.get": type MachineTypesGetCall struct { @@ -27224,7 +26150,7 @@ type MachineTypesListCall struct { ctx_ context.Context } -// List: Retrieves a list of machine type resources available to the +// List: Retrieves the list of machine type resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { @@ -27368,7 +26294,7 @@ func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeLis } return ret, nil // { - // "description": "Retrieves a list of machine type resources available to the specified project.", + // "description": "Retrieves the list of machine type resources available to the specified project.", // "httpMethod": "GET", // "id": "compute.machineTypes.list", // "parameterOrder": [ @@ -27423,27 +26349,6 @@ func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeLis } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.networks.delete": type NetworksDeleteCall struct { @@ -28031,27 +26936,6 @@ func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.projects.get": type ProjectsGetCall struct { @@ -28920,7 +27804,7 @@ func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, // "type": "string" // }, // "region": { - // "description": "Name of the region scoping this request.", + // "description": "Name of the zone scoping this request.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -28951,7 +27835,7 @@ type RegionOperationsListCall struct { ctx_ context.Context } -// List: Retrieves a list of Operation resources contained within the +// List: Retrieves the list of Operation resources contained within the // specified region. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall { @@ -29095,7 +27979,7 @@ func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationL } return ret, nil // { - // "description": "Retrieves a list of Operation resources contained within the specified region.", + // "description": "Retrieves the list of Operation resources contained within the specified region.", // "httpMethod": "GET", // "id": "compute.regionOperations.list", // "parameterOrder": [ @@ -29150,27 +28034,6 @@ func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationL } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.regions.get": type RegionsGetCall struct { @@ -29509,27 +28372,6 @@ func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.routes.delete": type RoutesDeleteCall struct { @@ -30117,27 +28959,6 @@ func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) { } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.snapshots.delete": type SnapshotsDeleteCall struct { @@ -30606,27 +29427,6 @@ func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, err } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.sslCertificates.delete": type SslCertificatesDeleteCall struct { @@ -31210,893 +30010,6 @@ func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertific } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "compute.subnetworks.aggregatedList": - -type SubnetworksAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// AggregatedList: Retrieves an aggregated list of subnetworks. -func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall { - c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - return c -} - -// Filter sets the optional parameter "filter": Sets a filter expression -// for filtering listed resources, in the form filter={expression}. Your -// {expression} must be in the format: field_name comparison_string -// literal_string. -// -// The field_name is the name of the field you want to compare. Only -// atomic field types are supported (string, number, boolean). The -// comparison_string must be either eq (equals) or ne (not equals). The -// literal_string is the string value to filter to. The literal value -// must be valid for the type of field you are filtering by (string, -// number, boolean). For string fields, the literal value is interpreted -// as a regular expression using RE2 syntax. The literal value must -// match the entire field. -// -// For example, filter=name ne example-instance. -// -// Compute Engine Beta API Only: If you use filtering in the Beta API, -// you can also filter on nested fields. For example, you could filter -// on instances that have set the scheduling.automaticRestart field to -// true. In particular, use filtering on nested fields to take advantage -// of instance labels to organize and filter results based on label -// values. -// -// The Beta API also supports filtering on multiple expressions by -// providing each separate expression within parentheses. For example, -// (scheduling.automaticRestart eq true) (zone eq us-central1-f). -// Multiple expressions are treated as AND expressions meaning that -// resources must match all expressions to pass the filters. -func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum -// number of results per page that Compute Engine should return. If the -// number of available results is larger than maxResults, Compute Engine -// returns a nextPageToken that can be used to get the next page of -// results in subsequent list requests. -func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page -// token to use. Set pageToken to the nextPageToken returned by a -// previous list request to get the next page of results. -func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall { - c.ctx_ = ctx - return c -} - -func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "compute.subnetworks.aggregatedList" call. -// Exactly one of *SubnetworkAggregatedList or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *SubnetworkAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &SubnetworkAggregatedList{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves an aggregated list of subnetworks.", - // "httpMethod": "GET", - // "id": "compute.subnetworks.aggregatedList", - // "parameterOrder": [ - // "project" - // ], - // "parameters": { - // "filter": { - // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions meaning that resources must match all expressions to pass the filters.", - // "location": "query", - // "type": "string" - // }, - // "maxResults": { - // "default": "500", - // "description": "The maximum number of results per page that Compute Engine should return. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.", - // "format": "uint32", - // "location": "query", - // "maximum": "500", - // "minimum": "0", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", - // "location": "query", - // "type": "string" - // }, - // "project": { - // "description": "Project ID for this request.", - // "location": "path", - // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - // "required": true, - // "type": "string" - // } - // }, - // "path": "{project}/aggregated/subnetworks", - // "response": { - // "$ref": "SubnetworkAggregatedList" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/compute", - // "https://www.googleapis.com/auth/compute.readonly" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "compute.subnetworks.delete": - -type SubnetworksDeleteCall struct { - s *Service - project string - region string - subnetwork string - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Delete: Deletes the specified subnetwork. -func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall { - c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.subnetwork = subnetwork - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall { - c.ctx_ = ctx - return c -} - -func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("DELETE", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "subnetwork": c.subnetwork, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "compute.subnetworks.delete" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes the specified subnetwork.", - // "httpMethod": "DELETE", - // "id": "compute.subnetworks.delete", - // "parameterOrder": [ - // "project", - // "region", - // "subnetwork" - // ], - // "parameters": { - // "project": { - // "description": "Project ID for this request.", - // "location": "path", - // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - // "required": true, - // "type": "string" - // }, - // "region": { - // "description": "Name of the region scoping this request.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // }, - // "subnetwork": { - // "description": "Name of the Subnetwork resource to delete.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // } - // }, - // "path": "{project}/regions/{region}/subnetworks/{subnetwork}", - // "response": { - // "$ref": "Operation" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/compute" - // ] - // } - -} - -// method id "compute.subnetworks.get": - -type SubnetworksGetCall struct { - s *Service - project string - region string - subnetwork string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// Get: Returns the specified subnetwork. -func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall { - c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.subnetwork = subnetwork - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall { - c.ctx_ = ctx - return c -} - -func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "subnetwork": c.subnetwork, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "compute.subnetworks.get" call. -// Exactly one of *Subnetwork or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Subnetwork.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Subnetwork{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Returns the specified subnetwork.", - // "httpMethod": "GET", - // "id": "compute.subnetworks.get", - // "parameterOrder": [ - // "project", - // "region", - // "subnetwork" - // ], - // "parameters": { - // "project": { - // "description": "Project ID for this request.", - // "location": "path", - // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - // "required": true, - // "type": "string" - // }, - // "region": { - // "description": "Name of the region scoping this request.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // }, - // "subnetwork": { - // "description": "Name of the Subnetwork resource to return.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // } - // }, - // "path": "{project}/regions/{region}/subnetworks/{subnetwork}", - // "response": { - // "$ref": "Subnetwork" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/compute", - // "https://www.googleapis.com/auth/compute.readonly" - // ] - // } - -} - -// method id "compute.subnetworks.insert": - -type SubnetworksInsertCall struct { - s *Service - project string - region string - subnetwork *Subnetwork - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Insert: Creates a subnetwork in the specified project using the data -// included in the request. -func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall { - c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.subnetwork = subnetwork - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall { - c.ctx_ = ctx - return c -} - -func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "compute.subnetworks.insert" call. -// Exactly one of *Operation or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a subnetwork in the specified project using the data included in the request.", - // "httpMethod": "POST", - // "id": "compute.subnetworks.insert", - // "parameterOrder": [ - // "project", - // "region" - // ], - // "parameters": { - // "project": { - // "description": "Project ID for this request.", - // "location": "path", - // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - // "required": true, - // "type": "string" - // }, - // "region": { - // "description": "Name of the region scoping this request.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // } - // }, - // "path": "{project}/regions/{region}/subnetworks", - // "request": { - // "$ref": "Subnetwork" - // }, - // "response": { - // "$ref": "Operation" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/compute" - // ] - // } - -} - -// method id "compute.subnetworks.list": - -type SubnetworksListCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Retrieves a list of subnetworks available to the specified -// project. -func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall { - c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - return c -} - -// Filter sets the optional parameter "filter": Sets a filter expression -// for filtering listed resources, in the form filter={expression}. Your -// {expression} must be in the format: field_name comparison_string -// literal_string. -// -// The field_name is the name of the field you want to compare. Only -// atomic field types are supported (string, number, boolean). The -// comparison_string must be either eq (equals) or ne (not equals). The -// literal_string is the string value to filter to. The literal value -// must be valid for the type of field you are filtering by (string, -// number, boolean). For string fields, the literal value is interpreted -// as a regular expression using RE2 syntax. The literal value must -// match the entire field. -// -// For example, filter=name ne example-instance. -// -// Compute Engine Beta API Only: If you use filtering in the Beta API, -// you can also filter on nested fields. For example, you could filter -// on instances that have set the scheduling.automaticRestart field to -// true. In particular, use filtering on nested fields to take advantage -// of instance labels to organize and filter results based on label -// values. -// -// The Beta API also supports filtering on multiple expressions by -// providing each separate expression within parentheses. For example, -// (scheduling.automaticRestart eq true) (zone eq us-central1-f). -// Multiple expressions are treated as AND expressions meaning that -// resources must match all expressions to pass the filters. -func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum -// number of results per page that Compute Engine should return. If the -// number of available results is larger than maxResults, Compute Engine -// returns a nextPageToken that can be used to get the next page of -// results in subsequent list requests. -func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page -// token to use. Set pageToken to the nextPageToken returned by a -// previous list request to get the next page of results. -func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall { - c.ctx_ = ctx - return c -} - -func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "compute.subnetworks.list" call. -// Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *SubnetworkList.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &SubnetworkList{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Retrieves a list of subnetworks available to the specified project.", - // "httpMethod": "GET", - // "id": "compute.subnetworks.list", - // "parameterOrder": [ - // "project", - // "region" - // ], - // "parameters": { - // "filter": { - // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions meaning that resources must match all expressions to pass the filters.", - // "location": "query", - // "type": "string" - // }, - // "maxResults": { - // "default": "500", - // "description": "The maximum number of results per page that Compute Engine should return. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.", - // "format": "uint32", - // "location": "query", - // "maximum": "500", - // "minimum": "0", - // "type": "integer" - // }, - // "pageToken": { - // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.", - // "location": "query", - // "type": "string" - // }, - // "project": { - // "description": "Project ID for this request.", - // "location": "path", - // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", - // "required": true, - // "type": "string" - // }, - // "region": { - // "description": "Name of the region scoping this request.", - // "location": "path", - // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - // "required": true, - // "type": "string" - // } - // }, - // "path": "{project}/regions/{region}/subnetworks", - // "response": { - // "$ref": "SubnetworkList" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/compute", - // "https://www.googleapis.com/auth/compute.readonly" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetHttpProxies.delete": type TargetHttpProxiesDeleteCall struct { @@ -32684,27 +30597,6 @@ func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHtt } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetHttpProxies.setUrlMap": type TargetHttpProxiesSetUrlMapCall struct { @@ -33423,27 +31315,6 @@ func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHt } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetHttpsProxies.setSslCertificates": type TargetHttpsProxiesSetSslCertificatesCall struct { @@ -33722,7 +31593,8 @@ type TargetInstancesAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of target instances. +// AggregatedList: Retrieves the list of target instances grouped by +// scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall { c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -33863,7 +31735,7 @@ func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*T } return ret, nil // { - // "description": "Retrieves an aggregated list of target instances.", + // "description": "Retrieves the list of target instances grouped by scope.", // "httpMethod": "GET", // "id": "compute.targetInstances.aggregatedList", // "parameterOrder": [ @@ -33910,27 +31782,6 @@ func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*T } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetInstances.delete": type TargetInstancesDeleteCall struct { @@ -34363,7 +32214,7 @@ type TargetInstancesListCall struct { ctx_ context.Context } -// List: Retrieves a list of TargetInstance resources available to the +// List: Retrieves the list of TargetInstance resources available to the // specified project and zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall { @@ -34507,7 +32358,7 @@ func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInsta } return ret, nil // { - // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.", + // "description": "Retrieves the list of TargetInstance resources available to the specified project and zone.", // "httpMethod": "GET", // "id": "compute.targetInstances.list", // "parameterOrder": [ @@ -34562,27 +32413,6 @@ func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInsta } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetPools.addHealthCheck": type TargetPoolsAddHealthCheckCall struct { @@ -34883,7 +32713,7 @@ type TargetPoolsAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of target pools. +// AggregatedList: Retrieves the list of target pools grouped by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall { c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -35024,7 +32854,7 @@ func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*Targe } return ret, nil // { - // "description": "Retrieves an aggregated list of target pools.", + // "description": "Retrieves the list of target pools grouped by scope.", // "httpMethod": "GET", // "id": "compute.targetPools.aggregatedList", // "parameterOrder": [ @@ -35071,27 +32901,6 @@ func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*Targe } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetPools.delete": type TargetPoolsDeleteCall struct { @@ -35390,7 +33199,7 @@ type TargetPoolsGetHealthCall struct { } // GetHealth: Gets the most recent health check results for each IP for -// the given instance that is referenced by the given TargetPool. +// the given instance that is referenced by given TargetPool. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall { c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -35478,7 +33287,7 @@ func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPool } return ret, nil // { - // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by the given TargetPool.", + // "description": "Gets the most recent health check results for each IP for the given instance that is referenced by given TargetPool.", // "httpMethod": "POST", // "id": "compute.targetPools.getHealth", // "parameterOrder": [ @@ -35671,7 +33480,7 @@ type TargetPoolsListCall struct { ctx_ context.Context } -// List: Retrieves a list of TargetPool resources available to the +// List: Retrieves the list of TargetPool resources available to the // specified project and region. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall { @@ -35815,7 +33624,7 @@ func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, } return ret, nil // { - // "description": "Retrieves a list of TargetPool resources available to the specified project and region.", + // "description": "Retrieves the list of TargetPool resources available to the specified project and region.", // "httpMethod": "GET", // "id": "compute.targetPools.list", // "parameterOrder": [ @@ -35870,27 +33679,6 @@ func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetPools.removeHealthCheck": type TargetPoolsRemoveHealthCheckCall struct { @@ -36350,7 +34138,8 @@ type TargetVpnGatewaysAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of target VPN gateways . +// AggregatedList: Retrieves the list of target VPN gateways grouped by +// scope. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall { c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -36490,7 +34279,7 @@ func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Retrieves an aggregated list of target VPN gateways .", + // "description": "Retrieves the list of target VPN gateways grouped by scope.", // "httpMethod": "GET", // "id": "compute.targetVpnGateways.aggregatedList", // "parameterOrder": [ @@ -36537,27 +34326,6 @@ func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) ( } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.targetVpnGateways.delete": type TargetVpnGatewaysDeleteCall struct { @@ -36987,8 +34755,8 @@ type TargetVpnGatewaysListCall struct { ctx_ context.Context } -// List: Retrieves a list of TargetVpnGateway resources available to the -// specified project and region. +// List: Retrieves the list of TargetVpnGateway resources available to +// the specified project and region. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall { c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -37130,7 +34898,7 @@ func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpn } return ret, nil // { - // "description": "Retrieves a list of TargetVpnGateway resources available to the specified project and region.", + // "description": "Retrieves the list of TargetVpnGateway resources available to the specified project and region.", // "httpMethod": "GET", // "id": "compute.targetVpnGateways.list", // "parameterOrder": [ @@ -37185,27 +34953,6 @@ func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpn } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.urlMaps.delete": type UrlMapsDeleteCall struct { @@ -37793,27 +35540,6 @@ func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.urlMaps.patch": type UrlMapsPatchCall struct { @@ -37825,7 +35551,7 @@ type UrlMapsPatchCall struct { ctx_ context.Context } -// Patch: Updates the entire content of the UrlMap resource. This method +// Patch: Update the entire content of the UrlMap resource. This method // supports patch semantics. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall { @@ -37912,7 +35638,7 @@ func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) } return ret, nil // { - // "description": "Updates the entire content of the UrlMap resource. This method supports patch semantics.", + // "description": "Update the entire content of the UrlMap resource. This method supports patch semantics.", // "httpMethod": "PATCH", // "id": "compute.urlMaps.patch", // "parameterOrder": [ @@ -37961,7 +35687,7 @@ type UrlMapsUpdateCall struct { ctx_ context.Context } -// Update: Updates the entire content of the UrlMap resource. +// Update: Update the entire content of the UrlMap resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall { c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -38047,7 +35773,7 @@ func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) } return ret, nil // { - // "description": "Updates the entire content of the UrlMap resource.", + // "description": "Update the entire content of the UrlMap resource.", // "httpMethod": "PUT", // "id": "compute.urlMaps.update", // "parameterOrder": [ @@ -38096,7 +35822,7 @@ type UrlMapsValidateCall struct { ctx_ context.Context } -// Validate: Runs static validation for the UrlMap. In particular, the +// Validate: Run static validation for the UrlMap. In particular, the // tests of the provided UrlMap will be run. Calling this method does // NOT create the UrlMap. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate @@ -38184,7 +35910,7 @@ func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidate } return ret, nil // { - // "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.", + // "description": "Run static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.", // "httpMethod": "POST", // "id": "compute.urlMaps.validate", // "parameterOrder": [ @@ -38232,7 +35958,7 @@ type VpnTunnelsAggregatedListCall struct { ctx_ context.Context } -// AggregatedList: Retrieves an aggregated list of VPN tunnels. +// AggregatedList: Retrieves the list of VPN tunnels grouped by scope. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall { c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -38372,7 +36098,7 @@ func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTun } return ret, nil // { - // "description": "Retrieves an aggregated list of VPN tunnels.", + // "description": "Retrieves the list of VPN tunnels grouped by scope.", // "httpMethod": "GET", // "id": "compute.vpnTunnels.aggregatedList", // "parameterOrder": [ @@ -38419,27 +36145,6 @@ func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTun } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.vpnTunnels.delete": type VpnTunnelsDeleteCall struct { @@ -38869,7 +36574,7 @@ type VpnTunnelsListCall struct { ctx_ context.Context } -// List: Retrieves a list of VpnTunnel resources contained in the +// List: Retrieves the list of VpnTunnel resources contained in the // specified project and region. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall { c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -39012,7 +36717,7 @@ func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, e } return ret, nil // { - // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.", + // "description": "Retrieves the list of VpnTunnel resources contained in the specified project and region.", // "httpMethod": "GET", // "id": "compute.vpnTunnels.list", // "parameterOrder": [ @@ -39067,27 +36772,6 @@ func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, e } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.zoneOperations.delete": type ZoneOperationsDeleteCall struct { @@ -39357,7 +37041,7 @@ type ZoneOperationsListCall struct { ctx_ context.Context } -// List: Retrieves a list of Operation resources contained within the +// List: Retrieves the list of Operation resources contained within the // specified zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall { @@ -39501,7 +37185,7 @@ func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationLis } return ret, nil // { - // "description": "Retrieves a list of Operation resources contained within the specified zone.", + // "description": "Retrieves the list of Operation resources contained within the specified zone.", // "httpMethod": "GET", // "id": "compute.zoneOperations.list", // "parameterOrder": [ @@ -39556,27 +37240,6 @@ func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationLis } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - // method id "compute.zones.get": type ZonesGetCall struct { @@ -39914,24 +37577,3 @@ func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) { // } } - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} diff --git a/vendor/google.golang.org/api/gensupport/params.go b/vendor/google.golang.org/api/gensupport/params.go index 3b3c74396..1dd747921 100644 --- a/vendor/google.golang.org/api/gensupport/params.go +++ b/vendor/google.golang.org/api/gensupport/params.go @@ -14,15 +14,6 @@ import ( // that safely builds up URL parameters for encoding. type URLParams map[string][]string -// Get returns the first value for the given key, or "". -func (u URLParams) Get(key string) string { - vs := u[key] - if len(vs) == 0 { - return "" - } - return vs[0] -} - // Set sets the key to value. // It replaces any existing values. func (u URLParams) Set(key, value string) { diff --git a/vendor/google.golang.org/api/googleapi/googleapi.go b/vendor/google.golang.org/api/googleapi/googleapi.go index de07c2b97..8796e3e09 100644 --- a/vendor/google.golang.org/api/googleapi/googleapi.go +++ b/vendor/google.golang.org/api/googleapi/googleapi.go @@ -4,7 +4,7 @@ // Package googleapi contains the common code shared by all Google API // libraries. -package googleapi // import "google.golang.org/api/googleapi" +package googleapi import ( "bytes" diff --git a/vendor/google.golang.org/api/googleapi/transport/apikey.go b/vendor/google.golang.org/api/googleapi/transport/apikey.go deleted file mode 100644 index eca1ea250..000000000 --- a/vendor/google.golang.org/api/googleapi/transport/apikey.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2012 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package transport contains HTTP transports used to make -// authenticated API requests. -package transport - -import ( - "errors" - "net/http" -) - -// APIKey is an HTTP Transport which wraps an underlying transport and -// appends an API Key "key" parameter to the URL of outgoing requests. -type APIKey struct { - // Key is the API Key to set on requests. - Key string - - // Transport is the underlying HTTP transport. - // If nil, http.DefaultTransport is used. - Transport http.RoundTripper -} - -func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) { - rt := t.Transport - if rt == nil { - rt = http.DefaultTransport - if rt == nil { - return nil, errors.New("googleapi/transport: no Transport specified or available") - } - } - newReq := *req - args := newReq.URL.Query() - args.Set("key", t.Key) - newReq.URL.RawQuery = args.Encode() - return rt.RoundTrip(&newReq) -} diff --git a/vendor/google.golang.org/appengine/channel/channel.go b/vendor/google.golang.org/appengine/channel/channel.go deleted file mode 100644 index 004f5ddc8..000000000 --- a/vendor/google.golang.org/appengine/channel/channel.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package channel implements the server side of App Engine's Channel API. - -Create creates a new channel associated with the given clientID, -which must be unique to the client that will use the returned token. - - token, err := channel.Create(c, "player1") - if err != nil { - // handle error - } - // return token to the client in an HTTP response - -Send sends a message to the client over the channel identified by clientID. - - channel.Send(c, "player1", "Game over!") -*/ -package channel - -import ( - "encoding/json" - - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - basepb "google.golang.org/appengine/internal/base" - pb "google.golang.org/appengine/internal/channel" -) - -// Create creates a channel and returns a token for use by the client. -// The clientID is an application-provided string used to identify the client. -func Create(c context.Context, clientID string) (token string, err error) { - req := &pb.CreateChannelRequest{ - ApplicationKey: &clientID, - } - resp := &pb.CreateChannelResponse{} - err = internal.Call(c, service, "CreateChannel", req, resp) - token = resp.GetToken() - return token, remapError(err) -} - -// Send sends a message on the channel associated with clientID. -func Send(c context.Context, clientID, message string) error { - req := &pb.SendMessageRequest{ - ApplicationKey: &clientID, - Message: &message, - } - resp := &basepb.VoidProto{} - return remapError(internal.Call(c, service, "SendChannelMessage", req, resp)) -} - -// SendJSON is a helper function that sends a JSON-encoded value -// on the channel associated with clientID. -func SendJSON(c context.Context, clientID string, value interface{}) error { - m, err := json.Marshal(value) - if err != nil { - return err - } - return Send(c, clientID, string(m)) -} - -// remapError fixes any APIError referencing "xmpp" into one referencing "channel". -func remapError(err error) error { - if e, ok := err.(*internal.APIError); ok { - if e.Service == "xmpp" { - e.Service = "channel" - } - } - return err -} - -var service = "xmpp" // prod - -func init() { - if appengine.IsDevAppServer() { - service = "channel" // dev - } - internal.RegisterErrorCodeMap("channel", pb.ChannelServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/appengine/cmd/aebundler/aebundler.go b/vendor/google.golang.org/appengine/cmd/aebundler/aebundler.go deleted file mode 100644 index 11d5fb571..000000000 --- a/vendor/google.golang.org/appengine/cmd/aebundler/aebundler.go +++ /dev/null @@ -1,338 +0,0 @@ -// Program aebundler turns a Go app into a fully self-contained tar file. -// The app and its subdirectories (if any) are placed under "." -// and the dependencies from $GOPATH are placed under ./_gopath/src. -// A main func is synthesized if one does not exist. -// -// A sample Dockerfile to be used with this bundler could look like this: -// FROM gcr.io/google_appengine/go-compat -// ADD . /app -// RUN GOPATH=/app/_gopath go build -tags appenginevm -o /app/_ah/exe -package main - -import ( - "archive/tar" - "flag" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" -) - -var ( - output = flag.String("o", "", "name of output tar file or '-' for stdout") - rootDir = flag.String("root", ".", "directory name of application root") - vm = flag.Bool("vm", true, "bundle a Managed VM app") - - skipFiles = map[string]bool{ - ".git": true, - ".gitconfig": true, - ".hg": true, - ".travis.yml": true, - } -) - -const ( - newMain = `package main -import "google.golang.org/appengine" -func main() { - appengine.Main() -} -` -) - -func usage() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - fmt.Fprintf(os.Stderr, "\t%s -o \tBundle app to named tar file or stdout\n", os.Args[0]) - fmt.Fprintf(os.Stderr, "\noptional arguments:\n") - flag.PrintDefaults() -} - -func main() { - flag.Usage = usage - flag.Parse() - - var tags []string - if *vm { - tags = append(tags, "appenginevm") - } else { - tags = append(tags, "appengine") - } - - tarFile := *output - if tarFile == "" { - usage() - errorf("Required -o flag not specified.") - } - - app, err := analyze(tags) - if err != nil { - errorf("Error analyzing app: %v", err) - } - if err := app.bundle(tarFile); err != nil { - errorf("Unable to bundle app: %v", err) - } -} - -// errorf prints the error message and exits. -func errorf(format string, a ...interface{}) { - fmt.Fprintf(os.Stderr, "aebundler: "+format+"\n", a...) - os.Exit(1) -} - -type app struct { - hasMain bool - appFiles []string - imports map[string]string -} - -// analyze checks the app for building with the given build tags and returns hasMain, -// app files, and a map of full directory import names to original import names. -func analyze(tags []string) (*app, error) { - ctxt := buildContext(tags) - hasMain, appFiles, err := checkMain(ctxt) - if err != nil { - return nil, err - } - gopath := filepath.SplitList(ctxt.GOPATH) - im, err := imports(ctxt, *rootDir, gopath) - return &app{ - hasMain: hasMain, - appFiles: appFiles, - imports: im, - }, err -} - -// buildContext returns the context for building the source. -func buildContext(tags []string) *build.Context { - return &build.Context{ - GOARCH: build.Default.GOARCH, - GOOS: build.Default.GOOS, - GOROOT: build.Default.GOROOT, - GOPATH: build.Default.GOPATH, - Compiler: build.Default.Compiler, - BuildTags: append(build.Default.BuildTags, tags...), - } -} - -// bundle bundles the app into the named tarFile ("-"==stdout). -func (s *app) bundle(tarFile string) (err error) { - var out io.Writer - if tarFile == "-" { - out = os.Stdout - } else { - f, err := os.Create(tarFile) - if err != nil { - return err - } - defer func() { - if cerr := f.Close(); err == nil { - err = cerr - } - }() - out = f - } - tw := tar.NewWriter(out) - - for srcDir, importName := range s.imports { - dstDir := "_gopath/src/" + importName - if err = copyTree(tw, dstDir, srcDir); err != nil { - return fmt.Errorf("unable to copy directory %v to %v: %v", srcDir, dstDir, err) - } - } - if err := copyTree(tw, ".", *rootDir); err != nil { - return fmt.Errorf("unable to copy root directory to /app: %v", err) - } - if !s.hasMain { - if err := synthesizeMain(tw, s.appFiles); err != nil { - return fmt.Errorf("unable to synthesize new main func: %v", err) - } - } - - if err := tw.Close(); err != nil { - return fmt.Errorf("unable to close tar file %v: %v", tarFile, err) - } - return nil -} - -// synthesizeMain generates a new main func and writes it to the tarball. -func synthesizeMain(tw *tar.Writer, appFiles []string) error { - appMap := make(map[string]bool) - for _, f := range appFiles { - appMap[f] = true - } - var f string - for i := 0; i < 100; i++ { - f = fmt.Sprintf("app_main%d.go", i) - if !appMap[filepath.Join(*rootDir, f)] { - break - } - } - if appMap[filepath.Join(*rootDir, f)] { - return fmt.Errorf("unable to find unique name for %v", f) - } - hdr := &tar.Header{ - Name: f, - Mode: 0644, - Size: int64(len(newMain)), - } - if err := tw.WriteHeader(hdr); err != nil { - return fmt.Errorf("unable to write header for %v: %v", f, err) - } - if _, err := tw.Write([]byte(newMain)); err != nil { - return fmt.Errorf("unable to write %v to tar file: %v", f, err) - } - return nil -} - -// imports returns a map of all import directories (recursively) used by the app. -// The return value maps full directory names to original import names. -func imports(ctxt *build.Context, srcDir string, gopath []string) (map[string]string, error) { - pkg, err := ctxt.ImportDir(srcDir, 0) - if err != nil { - return nil, fmt.Errorf("unable to analyze source: %v", err) - } - - // Resolve all non-standard-library imports - result := make(map[string]string) - for _, v := range pkg.Imports { - if !strings.Contains(v, ".") { - continue - } - src, err := findInGopath(v, gopath) - if err != nil { - return nil, fmt.Errorf("unable to find import %v in gopath %v: %v", v, gopath, err) - } - result[src] = v - im, err := imports(ctxt, src, gopath) - if err != nil { - return nil, fmt.Errorf("unable to parse package %v: %v", src, err) - } - for k, v := range im { - result[k] = v - } - } - return result, nil -} - -// findInGopath searches the gopath for the named import directory. -func findInGopath(dir string, gopath []string) (string, error) { - for _, v := range gopath { - dst := filepath.Join(v, "src", dir) - if _, err := os.Stat(dst); err == nil { - return dst, nil - } - } - return "", fmt.Errorf("unable to find package %v in gopath %v", dir, gopath) -} - -// copyTree copies srcDir to tar file dstDir, ignoring skipFiles. -func copyTree(tw *tar.Writer, dstDir, srcDir string) error { - entries, err := ioutil.ReadDir(srcDir) - if err != nil { - return fmt.Errorf("unable to read dir %v: %v", srcDir, err) - } - for _, entry := range entries { - n := entry.Name() - if skipFiles[n] { - continue - } - s := filepath.Join(srcDir, n) - d := filepath.Join(dstDir, n) - if entry.IsDir() { - if err := copyTree(tw, d, s); err != nil { - return fmt.Errorf("unable to copy dir %v to %v: %v", s, d, err) - } - continue - } - if err := copyFile(tw, d, s); err != nil { - return fmt.Errorf("unable to copy dir %v to %v: %v", s, d, err) - } - } - return nil -} - -// copyFile copies src to tar file dst. -func copyFile(tw *tar.Writer, dst, src string) error { - s, err := os.Open(src) - if err != nil { - return fmt.Errorf("unable to open %v: %v", src, err) - } - defer s.Close() - fi, err := s.Stat() - if err != nil { - return fmt.Errorf("unable to stat %v: %v", src, err) - } - - hdr, err := tar.FileInfoHeader(fi, dst) - if err != nil { - return fmt.Errorf("unable to create tar header for %v: %v", dst, err) - } - hdr.Name = dst - if err := tw.WriteHeader(hdr); err != nil { - return fmt.Errorf("unable to write header for %v: %v", dst, err) - } - _, err = io.Copy(tw, s) - if err != nil { - return fmt.Errorf("unable to copy %v to %v: %v", src, dst, err) - } - return nil -} - -// checkMain verifies that there is a single "main" function. -// It also returns a list of all Go source files in the app. -func checkMain(ctxt *build.Context) (bool, []string, error) { - pkg, err := ctxt.ImportDir(*rootDir, 0) - if err != nil { - return false, nil, fmt.Errorf("unable to analyze source: %v", err) - } - if !pkg.IsCommand() { - errorf("Your app's package needs to be changed from %q to \"main\".\n", pkg.Name) - } - // Search for a "func main" - var hasMain bool - var appFiles []string - for _, f := range pkg.GoFiles { - n := filepath.Join(*rootDir, f) - appFiles = append(appFiles, n) - if hasMain, err = readFile(n); err != nil { - return false, nil, fmt.Errorf("error parsing %q: %v", n, err) - } - } - return hasMain, appFiles, nil -} - -// isMain returns whether the given function declaration is a main function. -// Such a function must be called "main", not have a receiver, and have no arguments or return types. -func isMain(f *ast.FuncDecl) bool { - ft := f.Type - return f.Name.Name == "main" && f.Recv == nil && ft.Params.NumFields() == 0 && ft.Results.NumFields() == 0 -} - -// readFile reads and parses the Go source code file and returns whether it has a main function. -func readFile(filename string) (hasMain bool, err error) { - var src []byte - src, err = ioutil.ReadFile(filename) - if err != nil { - return - } - fset := token.NewFileSet() - file, err := parser.ParseFile(fset, filename, src, 0) - for _, decl := range file.Decls { - funcDecl, ok := decl.(*ast.FuncDecl) - if !ok { - continue - } - if !isMain(funcDecl) { - continue - } - hasMain = true - break - } - return -} diff --git a/vendor/google.golang.org/appengine/cmd/aedeploy/aedeploy.go b/vendor/google.golang.org/appengine/cmd/aedeploy/aedeploy.go deleted file mode 100644 index 65c4d7b7b..000000000 --- a/vendor/google.golang.org/appengine/cmd/aedeploy/aedeploy.go +++ /dev/null @@ -1,260 +0,0 @@ -// Program aedeploy assists with deploying Go Managed VM apps to production. -// A temporary directory is created; the app, its subdirectories, and all its -// dependencies from $GOPATH are copied into the directory; then the app -// is deployed to production with the provided command. -// -// The app must be in "package main". -// -// This command must be issued from within the root directory of the app -// (where the app.yaml file is located). -// -// A sample Dockerfile to be used with this tool could look like this: -// FROM gcr.io/google_appengine/go-compat -// ADD . /app -// RUN GOPATH=/app/_gopath go build -tags appenginevm -o /app/_ah/exe -package main - -import ( - "flag" - "fmt" - "go/build" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" -) - -var ( - skipFiles = map[string]bool{ - ".git": true, - ".gitconfig": true, - ".hg": true, - ".travis.yml": true, - } - - gopathCache = map[string]string{} -) - -func usage() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - fmt.Fprintf(os.Stderr, "\t%s gcloud --verbosity debug preview app deploy --version myversion ./app.yaml\tDeploy app to production\n", os.Args[0]) -} - -func main() { - flag.Usage = usage - flag.Parse() - if flag.NArg() < 1 { - usage() - os.Exit(1) - } - - if err := aedeploy(); err != nil { - fmt.Fprintf(os.Stderr, os.Args[0]+": Error: %v\n", err) - os.Exit(1) - } -} - -func aedeploy() error { - tags := []string{"appenginevm"} - app, err := analyze(tags) - if err != nil { - return err - } - - tmpDir, err := app.bundle() - if tmpDir != "" { - defer os.RemoveAll(tmpDir) - } - if err != nil { - return err - } - - if err := os.Chdir(tmpDir); err != nil { - return fmt.Errorf("unable to chdir to %v: %v", tmpDir, err) - } - return deploy() -} - -// deploy calls the provided command to deploy the app from the temporary directory. -func deploy() error { - cmd := exec.Command(flag.Arg(0), flag.Args()[1:]...) - cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr - if err := cmd.Run(); err != nil { - return fmt.Errorf("unable to run %q: %v", strings.Join(flag.Args(), " "), err) - } - return nil -} - -type app struct { - appFiles []string - imports map[string]string -} - -// analyze checks the app for building with the given build tags and returns -// app files, and a map of full directory import names to original import names. -func analyze(tags []string) (*app, error) { - ctxt := buildContext(tags) - appFiles, err := appFiles(ctxt) - if err != nil { - return nil, err - } - gopath := filepath.SplitList(ctxt.GOPATH) - im, err := imports(ctxt, ".", gopath) - return &app{ - appFiles: appFiles, - imports: im, - }, err -} - -// buildContext returns the context for building the source. -func buildContext(tags []string) *build.Context { - return &build.Context{ - GOARCH: "amd64", - GOOS: "linux", - GOROOT: build.Default.GOROOT, - GOPATH: build.Default.GOPATH, - Compiler: build.Default.Compiler, - BuildTags: append(build.Default.BuildTags, tags...), - } -} - -// bundle bundles the app into a temporary directory. -func (s *app) bundle() (tmpdir string, err error) { - workDir, err := ioutil.TempDir("", os.Args[0]) - if err != nil { - return "", fmt.Errorf("unable to create tmpdir: %v", err) - } - - for srcDir, importName := range s.imports { - dstDir := "_gopath/src/" + importName - if err := copyTree(workDir, dstDir, srcDir); err != nil { - return workDir, fmt.Errorf("unable to copy directory %v to %v: %v", srcDir, dstDir, err) - } - } - if err := copyTree(workDir, ".", "."); err != nil { - return workDir, fmt.Errorf("unable to copy root directory to /app: %v", err) - } - return workDir, nil -} - -// imports returns a map of all import directories (recursively) used by the app. -// The return value maps full directory names to original import names. -func imports(ctxt *build.Context, srcDir string, gopath []string) (map[string]string, error) { - pkg, err := ctxt.ImportDir(srcDir, 0) - if err != nil { - return nil, err - } - - // Resolve all non-standard-library imports - result := make(map[string]string) - for _, v := range pkg.Imports { - if !strings.Contains(v, ".") { - continue - } - src, err := findInGopath(v, gopath) - if err != nil { - return nil, fmt.Errorf("unable to find import %v in gopath %v: %v", v, gopath, err) - } - if _, ok := result[src]; ok { // Already processed - continue - } - result[src] = v - im, err := imports(ctxt, src, gopath) - if err != nil { - return nil, fmt.Errorf("unable to parse package %v: %v", src, err) - } - for k, v := range im { - result[k] = v - } - } - return result, nil -} - -// findInGopath searches the gopath for the named import directory. -func findInGopath(dir string, gopath []string) (string, error) { - if v, ok := gopathCache[dir]; ok { - return v, nil - } - for _, v := range gopath { - dst := filepath.Join(v, "src", dir) - if _, err := os.Stat(dst); err == nil { - gopathCache[dir] = dst - return dst, nil - } - } - return "", fmt.Errorf("unable to find package %v in gopath %v", dir, gopath) -} - -// copyTree copies srcDir to dstDir relative to dstRoot, ignoring skipFiles. -func copyTree(dstRoot, dstDir, srcDir string) error { - d := filepath.Join(dstRoot, dstDir) - if err := os.MkdirAll(d, 0755); err != nil { - return fmt.Errorf("unable to create directory %v: %v", d, err) - } - - entries, err := ioutil.ReadDir(srcDir) - if err != nil { - return fmt.Errorf("unable to read dir %v: %v", srcDir, err) - } - for _, entry := range entries { - n := entry.Name() - if skipFiles[n] { - continue - } - s := filepath.Join(srcDir, n) - d := filepath.Join(dstDir, n) - if entry.IsDir() { - if err := copyTree(dstRoot, d, s); err != nil { - return fmt.Errorf("unable to copy dir %v to %v: %v", s, d, err) - } - continue - } - if err := copyFile(dstRoot, d, s); err != nil { - return fmt.Errorf("unable to copy dir %v to %v: %v", s, d, err) - } - } - return nil -} - -// copyFile copies src to dst relative to dstRoot. -func copyFile(dstRoot, dst, src string) error { - s, err := os.Open(src) - if err != nil { - return fmt.Errorf("unable to open %v: %v", src, err) - } - defer s.Close() - - dst = filepath.Join(dstRoot, dst) - d, err := os.Create(dst) - if err != nil { - return fmt.Errorf("unable to create %v: %v", dst) - } - _, err = io.Copy(d, s) - if err != nil { - d.Close() // ignore error, copy already failed. - return fmt.Errorf("unable to copy %v to %v: %v", src, dst, err) - } - if err := d.Close(); err != nil { - return fmt.Errorf("unable to close %v: %v", dst, err) - } - return nil -} - -// appFiles returns a list of all Go source files in the app. -func appFiles(ctxt *build.Context) ([]string, error) { - pkg, err := ctxt.ImportDir(".", 0) - if err != nil { - return nil, err - } - if !pkg.IsCommand() { - return nil, fmt.Errorf(`the root of your app needs to be package "main" (currently %q). Please see https://cloud.google.com/appengine/docs/go/managed-vms for more details on structuring your app.`, pkg.Name) - } - var appFiles []string - for _, f := range pkg.GoFiles { - n := filepath.Join(".", f) - appFiles = append(appFiles, n) - } - return appFiles, nil -} diff --git a/vendor/google.golang.org/appengine/datastore/datastore.go b/vendor/google.golang.org/appengine/datastore/datastore.go deleted file mode 100644 index 9422e4174..000000000 --- a/vendor/google.golang.org/appengine/datastore/datastore.go +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "errors" - "fmt" - "reflect" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/datastore" -) - -var ( - // ErrInvalidEntityType is returned when functions like Get or Next are - // passed a dst or src argument of invalid type. - ErrInvalidEntityType = errors.New("datastore: invalid entity type") - // ErrInvalidKey is returned when an invalid key is presented. - ErrInvalidKey = errors.New("datastore: invalid key") - // ErrNoSuchEntity is returned when no entity was found for a given key. - ErrNoSuchEntity = errors.New("datastore: no such entity") -) - -// ErrFieldMismatch is returned when a field is to be loaded into a different -// type than the one it was stored from, or when a field is missing or -// unexported in the destination struct. -// StructType is the type of the struct pointed to by the destination argument -// passed to Get or to Iterator.Next. -type ErrFieldMismatch struct { - StructType reflect.Type - FieldName string - Reason string -} - -func (e *ErrFieldMismatch) Error() string { - return fmt.Sprintf("datastore: cannot load field %q into a %q: %s", - e.FieldName, e.StructType, e.Reason) -} - -// protoToKey converts a Reference proto to a *Key. -func protoToKey(r *pb.Reference) (k *Key, err error) { - appID := r.GetApp() - namespace := r.GetNameSpace() - for _, e := range r.Path.Element { - k = &Key{ - kind: e.GetType(), - stringID: e.GetName(), - intID: e.GetId(), - parent: k, - appID: appID, - namespace: namespace, - } - if !k.valid() { - return nil, ErrInvalidKey - } - } - return -} - -// keyToProto converts a *Key to a Reference proto. -func keyToProto(defaultAppID string, k *Key) *pb.Reference { - appID := k.appID - if appID == "" { - appID = defaultAppID - } - n := 0 - for i := k; i != nil; i = i.parent { - n++ - } - e := make([]*pb.Path_Element, n) - for i := k; i != nil; i = i.parent { - n-- - e[n] = &pb.Path_Element{ - Type: &i.kind, - } - // At most one of {Name,Id} should be set. - // Neither will be set for incomplete keys. - if i.stringID != "" { - e[n].Name = &i.stringID - } else if i.intID != 0 { - e[n].Id = &i.intID - } - } - var namespace *string - if k.namespace != "" { - namespace = proto.String(k.namespace) - } - return &pb.Reference{ - App: proto.String(appID), - NameSpace: namespace, - Path: &pb.Path{ - Element: e, - }, - } -} - -// multiKeyToProto is a batch version of keyToProto. -func multiKeyToProto(appID string, key []*Key) []*pb.Reference { - ret := make([]*pb.Reference, len(key)) - for i, k := range key { - ret[i] = keyToProto(appID, k) - } - return ret -} - -// multiValid is a batch version of Key.valid. It returns an error, not a -// []bool. -func multiValid(key []*Key) error { - invalid := false - for _, k := range key { - if !k.valid() { - invalid = true - break - } - } - if !invalid { - return nil - } - err := make(appengine.MultiError, len(key)) - for i, k := range key { - if !k.valid() { - err[i] = ErrInvalidKey - } - } - return err -} - -// It's unfortunate that the two semantically equivalent concepts pb.Reference -// and pb.PropertyValue_ReferenceValue aren't the same type. For example, the -// two have different protobuf field numbers. - -// referenceValueToKey is the same as protoToKey except the input is a -// PropertyValue_ReferenceValue instead of a Reference. -func referenceValueToKey(r *pb.PropertyValue_ReferenceValue) (k *Key, err error) { - appID := r.GetApp() - namespace := r.GetNameSpace() - for _, e := range r.Pathelement { - k = &Key{ - kind: e.GetType(), - stringID: e.GetName(), - intID: e.GetId(), - parent: k, - appID: appID, - namespace: namespace, - } - if !k.valid() { - return nil, ErrInvalidKey - } - } - return -} - -// keyToReferenceValue is the same as keyToProto except the output is a -// PropertyValue_ReferenceValue instead of a Reference. -func keyToReferenceValue(defaultAppID string, k *Key) *pb.PropertyValue_ReferenceValue { - ref := keyToProto(defaultAppID, k) - pe := make([]*pb.PropertyValue_ReferenceValue_PathElement, len(ref.Path.Element)) - for i, e := range ref.Path.Element { - pe[i] = &pb.PropertyValue_ReferenceValue_PathElement{ - Type: e.Type, - Id: e.Id, - Name: e.Name, - } - } - return &pb.PropertyValue_ReferenceValue{ - App: ref.App, - NameSpace: ref.NameSpace, - Pathelement: pe, - } -} - -type multiArgType int - -const ( - multiArgTypeInvalid multiArgType = iota - multiArgTypePropertyLoadSaver - multiArgTypeStruct - multiArgTypeStructPtr - multiArgTypeInterface -) - -// checkMultiArg checks that v has type []S, []*S, []I, or []P, for some struct -// type S, for some interface type I, or some non-interface non-pointer type P -// such that P or *P implements PropertyLoadSaver. -// -// It returns what category the slice's elements are, and the reflect.Type -// that represents S, I or P. -// -// As a special case, PropertyList is an invalid type for v. -func checkMultiArg(v reflect.Value) (m multiArgType, elemType reflect.Type) { - if v.Kind() != reflect.Slice { - return multiArgTypeInvalid, nil - } - if v.Type() == typeOfPropertyList { - return multiArgTypeInvalid, nil - } - elemType = v.Type().Elem() - if reflect.PtrTo(elemType).Implements(typeOfPropertyLoadSaver) { - return multiArgTypePropertyLoadSaver, elemType - } - switch elemType.Kind() { - case reflect.Struct: - return multiArgTypeStruct, elemType - case reflect.Interface: - return multiArgTypeInterface, elemType - case reflect.Ptr: - elemType = elemType.Elem() - if elemType.Kind() == reflect.Struct { - return multiArgTypeStructPtr, elemType - } - } - return multiArgTypeInvalid, nil -} - -// Get loads the entity stored for k into dst, which must be a struct pointer -// or implement PropertyLoadSaver. If there is no such entity for the key, Get -// returns ErrNoSuchEntity. -// -// The values of dst's unmatched struct fields are not modified, and matching -// slice-typed fields are not reset before appending to them. In particular, it -// is recommended to pass a pointer to a zero valued struct on each Get call. -// -// ErrFieldMismatch is returned when a field is to be loaded into a different -// type than the one it was stored from, or when a field is missing or -// unexported in the destination struct. ErrFieldMismatch is only returned if -// dst is a struct pointer. -func Get(c context.Context, key *Key, dst interface{}) error { - if dst == nil { // GetMulti catches nil interface; we need to catch nil ptr here - return ErrInvalidEntityType - } - err := GetMulti(c, []*Key{key}, []interface{}{dst}) - if me, ok := err.(appengine.MultiError); ok { - return me[0] - } - return err -} - -// GetMulti is a batch version of Get. -// -// dst must be a []S, []*S, []I or []P, for some struct type S, some interface -// type I, or some non-interface non-pointer type P such that P or *P -// implements PropertyLoadSaver. If an []I, each element must be a valid dst -// for Get: it must be a struct pointer or implement PropertyLoadSaver. -// -// As a special case, PropertyList is an invalid type for dst, even though a -// PropertyList is a slice of structs. It is treated as invalid to avoid being -// mistakenly passed when []PropertyList was intended. -func GetMulti(c context.Context, key []*Key, dst interface{}) error { - v := reflect.ValueOf(dst) - multiArgType, _ := checkMultiArg(v) - if multiArgType == multiArgTypeInvalid { - return errors.New("datastore: dst has invalid type") - } - if len(key) != v.Len() { - return errors.New("datastore: key and dst slices have different length") - } - if len(key) == 0 { - return nil - } - if err := multiValid(key); err != nil { - return err - } - req := &pb.GetRequest{ - Key: multiKeyToProto(internal.FullyQualifiedAppID(c), key), - } - res := &pb.GetResponse{} - if err := internal.Call(c, "datastore_v3", "Get", req, res); err != nil { - return err - } - if len(key) != len(res.Entity) { - return errors.New("datastore: internal error: server returned the wrong number of entities") - } - multiErr, any := make(appengine.MultiError, len(key)), false - for i, e := range res.Entity { - if e.Entity == nil { - multiErr[i] = ErrNoSuchEntity - } else { - elem := v.Index(i) - if multiArgType == multiArgTypePropertyLoadSaver || multiArgType == multiArgTypeStruct { - elem = elem.Addr() - } - if multiArgType == multiArgTypeStructPtr && elem.IsNil() { - elem.Set(reflect.New(elem.Type().Elem())) - } - multiErr[i] = loadEntity(elem.Interface(), e.Entity) - } - if multiErr[i] != nil { - any = true - } - } - if any { - return multiErr - } - return nil -} - -// Put saves the entity src into the datastore with key k. src must be a struct -// pointer or implement PropertyLoadSaver; if a struct pointer then any -// unexported fields of that struct will be skipped. If k is an incomplete key, -// the returned key will be a unique key generated by the datastore. -func Put(c context.Context, key *Key, src interface{}) (*Key, error) { - k, err := PutMulti(c, []*Key{key}, []interface{}{src}) - if err != nil { - if me, ok := err.(appengine.MultiError); ok { - return nil, me[0] - } - return nil, err - } - return k[0], nil -} - -// PutMulti is a batch version of Put. -// -// src must satisfy the same conditions as the dst argument to GetMulti. -func PutMulti(c context.Context, key []*Key, src interface{}) ([]*Key, error) { - v := reflect.ValueOf(src) - multiArgType, _ := checkMultiArg(v) - if multiArgType == multiArgTypeInvalid { - return nil, errors.New("datastore: src has invalid type") - } - if len(key) != v.Len() { - return nil, errors.New("datastore: key and src slices have different length") - } - if len(key) == 0 { - return nil, nil - } - appID := internal.FullyQualifiedAppID(c) - if err := multiValid(key); err != nil { - return nil, err - } - req := &pb.PutRequest{} - for i := range key { - elem := v.Index(i) - if multiArgType == multiArgTypePropertyLoadSaver || multiArgType == multiArgTypeStruct { - elem = elem.Addr() - } - sProto, err := saveEntity(appID, key[i], elem.Interface()) - if err != nil { - return nil, err - } - req.Entity = append(req.Entity, sProto) - } - res := &pb.PutResponse{} - if err := internal.Call(c, "datastore_v3", "Put", req, res); err != nil { - return nil, err - } - if len(key) != len(res.Key) { - return nil, errors.New("datastore: internal error: server returned the wrong number of keys") - } - ret := make([]*Key, len(key)) - for i := range ret { - var err error - ret[i], err = protoToKey(res.Key[i]) - if err != nil || ret[i].Incomplete() { - return nil, errors.New("datastore: internal error: server returned an invalid key") - } - } - return ret, nil -} - -// Delete deletes the entity for the given key. -func Delete(c context.Context, key *Key) error { - err := DeleteMulti(c, []*Key{key}) - if me, ok := err.(appengine.MultiError); ok { - return me[0] - } - return err -} - -// DeleteMulti is a batch version of Delete. -func DeleteMulti(c context.Context, key []*Key) error { - if len(key) == 0 { - return nil - } - if err := multiValid(key); err != nil { - return err - } - req := &pb.DeleteRequest{ - Key: multiKeyToProto(internal.FullyQualifiedAppID(c), key), - } - res := &pb.DeleteResponse{} - return internal.Call(c, "datastore_v3", "Delete", req, res) -} - -func namespaceMod(m proto.Message, namespace string) { - // pb.Query is the only type that has a name_space field. - // All other namespace support in datastore is in the keys. - switch m := m.(type) { - case *pb.Query: - if m.NameSpace == nil { - m.NameSpace = &namespace - } - } -} - -func init() { - internal.NamespaceMods["datastore_v3"] = namespaceMod - internal.RegisterErrorCodeMap("datastore_v3", pb.Error_ErrorCode_name) - internal.RegisterTimeoutErrorCode("datastore_v3", int32(pb.Error_TIMEOUT)) -} diff --git a/vendor/google.golang.org/appengine/datastore/doc.go b/vendor/google.golang.org/appengine/datastore/doc.go deleted file mode 100644 index 4ee7d477c..000000000 --- a/vendor/google.golang.org/appengine/datastore/doc.go +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package datastore provides a client for App Engine's datastore service. - - -Basic Operations - -Entities are the unit of storage and are associated with a key. A key -consists of an optional parent key, a string application ID, a string kind -(also known as an entity type), and either a StringID or an IntID. A -StringID is also known as an entity name or key name. - -It is valid to create a key with a zero StringID and a zero IntID; this is -called an incomplete key, and does not refer to any saved entity. Putting an -entity into the datastore under an incomplete key will cause a unique key -to be generated for that entity, with a non-zero IntID. - -An entity's contents are a mapping from case-sensitive field names to values. -Valid value types are: - - signed integers (int, int8, int16, int32 and int64), - - bool, - - string, - - float32 and float64, - - []byte (up to 1 megabyte in length), - - any type whose underlying type is one of the above predeclared types, - - ByteString, - - *Key, - - time.Time (stored with microsecond precision), - - appengine.BlobKey, - - appengine.GeoPoint, - - structs whose fields are all valid value types, - - slices of any of the above. - -Slices of structs are valid, as are structs that contain slices. However, if -one struct contains another, then at most one of those can be repeated. This -disqualifies recursively defined struct types: any struct T that (directly or -indirectly) contains a []T. - -The Get and Put functions load and save an entity's contents. An entity's -contents are typically represented by a struct pointer. - -Example code: - - type Entity struct { - Value string - } - - func handle(w http.ResponseWriter, r *http.Request) { - c := appengine.NewContext(r) - - k := datastore.NewKey(c, "Entity", "stringID", 0, nil) - e := new(Entity) - if err := datastore.Get(c, k, e); err != nil { - http.Error(w, err.Error(), 500) - return - } - - old := e.Value - e.Value = r.URL.Path - - if _, err := datastore.Put(c, k, e); err != nil { - http.Error(w, err.Error(), 500) - return - } - - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - fmt.Fprintf(w, "old=%q\nnew=%q\n", old, e.Value) - } - -GetMulti, PutMulti and DeleteMulti are batch versions of the Get, Put and -Delete functions. They take a []*Key instead of a *Key, and may return an -appengine.MultiError when encountering partial failure. - - -Properties - -An entity's contents can be represented by a variety of types. These are -typically struct pointers, but can also be any type that implements the -PropertyLoadSaver interface. If using a struct pointer, you do not have to -explicitly implement the PropertyLoadSaver interface; the datastore will -automatically convert via reflection. If a struct pointer does implement that -interface then those methods will be used in preference to the default -behavior for struct pointers. Struct pointers are more strongly typed and are -easier to use; PropertyLoadSavers are more flexible. - -The actual types passed do not have to match between Get and Put calls or even -across different App Engine requests. It is valid to put a *PropertyList and -get that same entity as a *myStruct, or put a *myStruct0 and get a *myStruct1. -Conceptually, any entity is saved as a sequence of properties, and is loaded -into the destination value on a property-by-property basis. When loading into -a struct pointer, an entity that cannot be completely represented (such as a -missing field) will result in an ErrFieldMismatch error but it is up to the -caller whether this error is fatal, recoverable or ignorable. - -By default, for struct pointers, all properties are potentially indexed, and -the property name is the same as the field name (and hence must start with an -upper case letter). Fields may have a `datastore:"name,options"` tag. The tag -name is the property name, which must be one or more valid Go identifiers -joined by ".", but may start with a lower case letter. An empty tag name means -to just use the field name. A "-" tag name means that the datastore will -ignore that field. If options is "noindex" then the field will not be indexed. -If the options is "" then the comma may be omitted. There are no other -recognized options. - -Fields (except for []byte) are indexed by default. Strings longer than 1500 -bytes cannot be indexed; fields used to store long strings should be -tagged with "noindex". Similarly, ByteStrings longer than 1500 bytes cannot be -indexed. - -Example code: - - // A and B are renamed to a and b. - // A, C and J are not indexed. - // D's tag is equivalent to having no tag at all (E). - // I is ignored entirely by the datastore. - // J has tag information for both the datastore and json packages. - type TaggedStruct struct { - A int `datastore:"a,noindex"` - B int `datastore:"b"` - C int `datastore:",noindex"` - D int `datastore:""` - E int - I int `datastore:"-"` - J int `datastore:",noindex" json:"j"` - } - - -Structured Properties - -If the struct pointed to contains other structs, then the nested or embedded -structs are flattened. For example, given these definitions: - - type Inner1 struct { - W int32 - X string - } - - type Inner2 struct { - Y float64 - } - - type Inner3 struct { - Z bool - } - - type Outer struct { - A int16 - I []Inner1 - J Inner2 - Inner3 - } - -then an Outer's properties would be equivalent to those of: - - type OuterEquivalent struct { - A int16 - IDotW []int32 `datastore:"I.W"` - IDotX []string `datastore:"I.X"` - JDotY float64 `datastore:"J.Y"` - Z bool - } - -If Outer's embedded Inner3 field was tagged as `datastore:"Foo"` then the -equivalent field would instead be: FooDotZ bool `datastore:"Foo.Z"`. - -If an outer struct is tagged "noindex" then all of its implicit flattened -fields are effectively "noindex". - - -The PropertyLoadSaver Interface - -An entity's contents can also be represented by any type that implements the -PropertyLoadSaver interface. This type may be a struct pointer, but it does -not have to be. The datastore package will call Load when getting the entity's -contents, and Save when putting the entity's contents. -Possible uses include deriving non-stored fields, verifying fields, or indexing -a field only if its value is positive. - -Example code: - - type CustomPropsExample struct { - I, J int - // Sum is not stored, but should always be equal to I + J. - Sum int `datastore:"-"` - } - - func (x *CustomPropsExample) Load(c <-chan Property) error { - // Load I and J as usual. - if err := datastore.LoadStruct(x, c); err != nil { - return err - } - // Derive the Sum field. - x.Sum = x.I + x.J - return nil - } - - func (x *CustomPropsExample) Save(c chan<- Property) error { - defer close(c) - // Validate the Sum field. - if x.Sum != x.I + x.J { - return errors.New("CustomPropsExample has inconsistent sum") - } - // Save I and J as usual. The code below is equivalent to calling - // "return datastore.SaveStruct(x, c)", but is done manually for - // demonstration purposes. - c <- datastore.Property{ - Name: "I", - Value: int64(x.I), - } - c <- datastore.Property{ - Name: "J", - Value: int64(x.J), - } - return nil - } - -The *PropertyList type implements PropertyLoadSaver, and can therefore hold an -arbitrary entity's contents. - - -Queries - -Queries retrieve entities based on their properties or key's ancestry. Running -a query yields an iterator of results: either keys or (key, entity) pairs. -Queries are re-usable and it is safe to call Query.Run from concurrent -goroutines. Iterators are not safe for concurrent use. - -Queries are immutable, and are either created by calling NewQuery, or derived -from an existing query by calling a method like Filter or Order that returns a -new query value. A query is typically constructed by calling NewQuery followed -by a chain of zero or more such methods. These methods are: - - Ancestor and Filter constrain the entities returned by running a query. - - Order affects the order in which they are returned. - - Project constrains the fields returned. - - Distinct de-duplicates projected entities. - - KeysOnly makes the iterator return only keys, not (key, entity) pairs. - - Start, End, Offset and Limit define which sub-sequence of matching entities - to return. Start and End take cursors, Offset and Limit take integers. Start - and Offset affect the first result, End and Limit affect the last result. - If both Start and Offset are set, then the offset is relative to Start. - If both End and Limit are set, then the earliest constraint wins. Limit is - relative to Start+Offset, not relative to End. As a special case, a - negative limit means unlimited. - -Example code: - - type Widget struct { - Description string - Price int - } - - func handle(w http.ResponseWriter, r *http.Request) { - c := appengine.NewContext(r) - q := datastore.NewQuery("Widget"). - Filter("Price <", 1000). - Order("-Price") - b := new(bytes.Buffer) - for t := q.Run(c); ; { - var x Widget - key, err := t.Next(&x) - if err == datastore.Done { - break - } - if err != nil { - serveError(c, w, err) - return - } - fmt.Fprintf(b, "Key=%v\nWidget=%#v\n\n", key, x) - } - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - io.Copy(w, b) - } - - -Transactions - -RunInTransaction runs a function in a transaction. - -Example code: - - type Counter struct { - Count int - } - - func inc(c appengine.Context, key *datastore.Key) (int, error) { - var x Counter - if err := datastore.Get(c, key, &x); err != nil && err != datastore.ErrNoSuchEntity { - return 0, err - } - x.Count++ - if _, err := datastore.Put(c, key, &x); err != nil { - return 0, err - } - return x.Count, nil - } - - func handle(w http.ResponseWriter, r *http.Request) { - c := appengine.NewContext(r) - var count int - err := datastore.RunInTransaction(c, func(c appengine.Context) error { - var err1 error - count, err1 = inc(c, datastore.NewKey(c, "Counter", "singleton", 0, nil)) - return err1 - }, nil) - if err != nil { - serveError(c, w, err) - return - } - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - fmt.Fprintf(w, "Count=%d", count) - } -*/ -package datastore diff --git a/vendor/google.golang.org/appengine/datastore/key.go b/vendor/google.golang.org/appengine/datastore/key.go deleted file mode 100644 index ac1f00250..000000000 --- a/vendor/google.golang.org/appengine/datastore/key.go +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "bytes" - "encoding/base64" - "encoding/gob" - "errors" - "fmt" - "strconv" - "strings" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/datastore" -) - -// Key represents the datastore key for a stored entity, and is immutable. -type Key struct { - kind string - stringID string - intID int64 - parent *Key - appID string - namespace string -} - -// Kind returns the key's kind (also known as entity type). -func (k *Key) Kind() string { - return k.kind -} - -// StringID returns the key's string ID (also known as an entity name or key -// name), which may be "". -func (k *Key) StringID() string { - return k.stringID -} - -// IntID returns the key's integer ID, which may be 0. -func (k *Key) IntID() int64 { - return k.intID -} - -// Parent returns the key's parent key, which may be nil. -func (k *Key) Parent() *Key { - return k.parent -} - -// AppID returns the key's application ID. -func (k *Key) AppID() string { - return k.appID -} - -// Namespace returns the key's namespace. -func (k *Key) Namespace() string { - return k.namespace -} - -// Incomplete returns whether the key does not refer to a stored entity. -// In particular, whether the key has a zero StringID and a zero IntID. -func (k *Key) Incomplete() bool { - return k.stringID == "" && k.intID == 0 -} - -// valid returns whether the key is valid. -func (k *Key) valid() bool { - if k == nil { - return false - } - for ; k != nil; k = k.parent { - if k.kind == "" || k.appID == "" { - return false - } - if k.stringID != "" && k.intID != 0 { - return false - } - if k.parent != nil { - if k.parent.Incomplete() { - return false - } - if k.parent.appID != k.appID || k.parent.namespace != k.namespace { - return false - } - } - } - return true -} - -// Equal returns whether two keys are equal. -func (k *Key) Equal(o *Key) bool { - for k != nil && o != nil { - if k.kind != o.kind || k.stringID != o.stringID || k.intID != o.intID || k.appID != o.appID || k.namespace != o.namespace { - return false - } - k, o = k.parent, o.parent - } - return k == o -} - -// root returns the furthest ancestor of a key, which may be itself. -func (k *Key) root() *Key { - for k.parent != nil { - k = k.parent - } - return k -} - -// marshal marshals the key's string representation to the buffer. -func (k *Key) marshal(b *bytes.Buffer) { - if k.parent != nil { - k.parent.marshal(b) - } - b.WriteByte('/') - b.WriteString(k.kind) - b.WriteByte(',') - if k.stringID != "" { - b.WriteString(k.stringID) - } else { - b.WriteString(strconv.FormatInt(k.intID, 10)) - } -} - -// String returns a string representation of the key. -func (k *Key) String() string { - if k == nil { - return "" - } - b := bytes.NewBuffer(make([]byte, 0, 512)) - k.marshal(b) - return b.String() -} - -type gobKey struct { - Kind string - StringID string - IntID int64 - Parent *gobKey - AppID string - Namespace string -} - -func keyToGobKey(k *Key) *gobKey { - if k == nil { - return nil - } - return &gobKey{ - Kind: k.kind, - StringID: k.stringID, - IntID: k.intID, - Parent: keyToGobKey(k.parent), - AppID: k.appID, - Namespace: k.namespace, - } -} - -func gobKeyToKey(gk *gobKey) *Key { - if gk == nil { - return nil - } - return &Key{ - kind: gk.Kind, - stringID: gk.StringID, - intID: gk.IntID, - parent: gobKeyToKey(gk.Parent), - appID: gk.AppID, - namespace: gk.Namespace, - } -} - -func (k *Key) GobEncode() ([]byte, error) { - buf := new(bytes.Buffer) - if err := gob.NewEncoder(buf).Encode(keyToGobKey(k)); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -func (k *Key) GobDecode(buf []byte) error { - gk := new(gobKey) - if err := gob.NewDecoder(bytes.NewBuffer(buf)).Decode(gk); err != nil { - return err - } - *k = *gobKeyToKey(gk) - return nil -} - -func (k *Key) MarshalJSON() ([]byte, error) { - return []byte(`"` + k.Encode() + `"`), nil -} - -func (k *Key) UnmarshalJSON(buf []byte) error { - if len(buf) < 2 || buf[0] != '"' || buf[len(buf)-1] != '"' { - return errors.New("datastore: bad JSON key") - } - k2, err := DecodeKey(string(buf[1 : len(buf)-1])) - if err != nil { - return err - } - *k = *k2 - return nil -} - -// Encode returns an opaque representation of the key -// suitable for use in HTML and URLs. -// This is compatible with the Python and Java runtimes. -func (k *Key) Encode() string { - ref := keyToProto("", k) - - b, err := proto.Marshal(ref) - if err != nil { - panic(err) - } - - // Trailing padding is stripped. - return strings.TrimRight(base64.URLEncoding.EncodeToString(b), "=") -} - -// DecodeKey decodes a key from the opaque representation returned by Encode. -func DecodeKey(encoded string) (*Key, error) { - // Re-add padding. - if m := len(encoded) % 4; m != 0 { - encoded += strings.Repeat("=", 4-m) - } - - b, err := base64.URLEncoding.DecodeString(encoded) - if err != nil { - return nil, err - } - - ref := new(pb.Reference) - if err := proto.Unmarshal(b, ref); err != nil { - return nil, err - } - - return protoToKey(ref) -} - -// NewIncompleteKey creates a new incomplete key. -// kind cannot be empty. -func NewIncompleteKey(c context.Context, kind string, parent *Key) *Key { - return NewKey(c, kind, "", 0, parent) -} - -// NewKey creates a new key. -// kind cannot be empty. -// Either one or both of stringID and intID must be zero. If both are zero, -// the key returned is incomplete. -// parent must either be a complete key or nil. -func NewKey(c context.Context, kind, stringID string, intID int64, parent *Key) *Key { - // If there's a parent key, use its namespace. - // Otherwise, use any namespace attached to the context. - var namespace string - if parent != nil { - namespace = parent.namespace - } else { - namespace = internal.NamespaceFromContext(c) - } - - return &Key{ - kind: kind, - stringID: stringID, - intID: intID, - parent: parent, - appID: internal.FullyQualifiedAppID(c), - namespace: namespace, - } -} - -// AllocateIDs returns a range of n integer IDs with the given kind and parent -// combination. kind cannot be empty; parent may be nil. The IDs in the range -// returned will not be used by the datastore's automatic ID sequence generator -// and may be used with NewKey without conflict. -// -// The range is inclusive at the low end and exclusive at the high end. In -// other words, valid intIDs x satisfy low <= x && x < high. -// -// If no error is returned, low + n == high. -func AllocateIDs(c context.Context, kind string, parent *Key, n int) (low, high int64, err error) { - if kind == "" { - return 0, 0, errors.New("datastore: AllocateIDs given an empty kind") - } - if n < 0 { - return 0, 0, fmt.Errorf("datastore: AllocateIDs given a negative count: %d", n) - } - if n == 0 { - return 0, 0, nil - } - req := &pb.AllocateIdsRequest{ - ModelKey: keyToProto("", NewIncompleteKey(c, kind, parent)), - Size: proto.Int64(int64(n)), - } - res := &pb.AllocateIdsResponse{} - if err := internal.Call(c, "datastore_v3", "AllocateIds", req, res); err != nil { - return 0, 0, err - } - // The protobuf is inclusive at both ends. Idiomatic Go (e.g. slices, for loops) - // is inclusive at the low end and exclusive at the high end, so we add 1. - low = res.GetStart() - high = res.GetEnd() + 1 - if low+int64(n) != high { - return 0, 0, fmt.Errorf("datastore: internal error: could not allocate %d IDs", n) - } - return low, high, nil -} diff --git a/vendor/google.golang.org/appengine/datastore/load.go b/vendor/google.golang.org/appengine/datastore/load.go deleted file mode 100644 index 3f3c80c36..000000000 --- a/vendor/google.golang.org/appengine/datastore/load.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "fmt" - "reflect" - "time" - - "google.golang.org/appengine" - pb "google.golang.org/appengine/internal/datastore" -) - -var ( - typeOfBlobKey = reflect.TypeOf(appengine.BlobKey("")) - typeOfByteSlice = reflect.TypeOf([]byte(nil)) - typeOfByteString = reflect.TypeOf(ByteString(nil)) - typeOfGeoPoint = reflect.TypeOf(appengine.GeoPoint{}) - typeOfTime = reflect.TypeOf(time.Time{}) -) - -// typeMismatchReason returns a string explaining why the property p could not -// be stored in an entity field of type v.Type(). -func typeMismatchReason(p Property, v reflect.Value) string { - entityType := "empty" - switch p.Value.(type) { - case int64: - entityType = "int" - case bool: - entityType = "bool" - case string: - entityType = "string" - case float64: - entityType = "float" - case *Key: - entityType = "*datastore.Key" - case time.Time: - entityType = "time.Time" - case appengine.BlobKey: - entityType = "appengine.BlobKey" - case appengine.GeoPoint: - entityType = "appengine.GeoPoint" - case ByteString: - entityType = "datastore.ByteString" - case []byte: - entityType = "[]byte" - } - return fmt.Sprintf("type mismatch: %s versus %v", entityType, v.Type()) -} - -type propertyLoader struct { - // m holds the number of times a substruct field like "Foo.Bar.Baz" has - // been seen so far. The map is constructed lazily. - m map[string]int -} - -func (l *propertyLoader) load(codec *structCodec, structValue reflect.Value, p Property, requireSlice bool) string { - var v reflect.Value - // Traverse a struct's struct-typed fields. - for name := p.Name; ; { - decoder, ok := codec.byName[name] - if !ok { - return "no such struct field" - } - v = structValue.Field(decoder.index) - if !v.IsValid() { - return "no such struct field" - } - if !v.CanSet() { - return "cannot set struct field" - } - - if decoder.substructCodec == nil { - break - } - - if v.Kind() == reflect.Slice { - if l.m == nil { - l.m = make(map[string]int) - } - index := l.m[p.Name] - l.m[p.Name] = index + 1 - for v.Len() <= index { - v.Set(reflect.Append(v, reflect.New(v.Type().Elem()).Elem())) - } - structValue = v.Index(index) - requireSlice = false - } else { - structValue = v - } - // Strip the "I." from "I.X". - name = name[len(codec.byIndex[decoder.index].name):] - codec = decoder.substructCodec - } - - var slice reflect.Value - if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 { - slice = v - v = reflect.New(v.Type().Elem()).Elem() - } else if requireSlice { - return "multiple-valued property requires a slice field type" - } - - // Convert indexValues to a Go value with a meaning derived from the - // destination type. - pValue := p.Value - if iv, ok := pValue.(indexValue); ok { - meaning := pb.Property_NO_MEANING - switch v.Type() { - case typeOfBlobKey: - meaning = pb.Property_BLOBKEY - case typeOfByteSlice: - meaning = pb.Property_BLOB - case typeOfByteString: - meaning = pb.Property_BYTESTRING - case typeOfGeoPoint: - meaning = pb.Property_GEORSS_POINT - case typeOfTime: - meaning = pb.Property_GD_WHEN - } - var err error - pValue, err = propValue(iv.value, meaning) - if err != nil { - return err.Error() - } - } - - switch v.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - x, ok := pValue.(int64) - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - if v.OverflowInt(x) { - return fmt.Sprintf("value %v overflows struct field of type %v", x, v.Type()) - } - v.SetInt(x) - case reflect.Bool: - x, ok := pValue.(bool) - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - v.SetBool(x) - case reflect.String: - switch x := pValue.(type) { - case appengine.BlobKey: - v.SetString(string(x)) - case ByteString: - v.SetString(string(x)) - case string: - v.SetString(x) - default: - if pValue != nil { - return typeMismatchReason(p, v) - } - } - case reflect.Float32, reflect.Float64: - x, ok := pValue.(float64) - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - if v.OverflowFloat(x) { - return fmt.Sprintf("value %v overflows struct field of type %v", x, v.Type()) - } - v.SetFloat(x) - case reflect.Ptr: - x, ok := pValue.(*Key) - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - if _, ok := v.Interface().(*Key); !ok { - return typeMismatchReason(p, v) - } - v.Set(reflect.ValueOf(x)) - case reflect.Struct: - switch v.Type() { - case typeOfTime: - x, ok := pValue.(time.Time) - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - v.Set(reflect.ValueOf(x)) - case typeOfGeoPoint: - x, ok := pValue.(appengine.GeoPoint) - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - v.Set(reflect.ValueOf(x)) - default: - return typeMismatchReason(p, v) - } - case reflect.Slice: - x, ok := pValue.([]byte) - if !ok { - if y, yok := pValue.(ByteString); yok { - x, ok = []byte(y), true - } - } - if !ok && pValue != nil { - return typeMismatchReason(p, v) - } - if v.Type().Elem().Kind() != reflect.Uint8 { - return typeMismatchReason(p, v) - } - v.SetBytes(x) - default: - return typeMismatchReason(p, v) - } - if slice.IsValid() { - slice.Set(reflect.Append(slice, v)) - } - return "" -} - -// loadEntity loads an EntityProto into PropertyLoadSaver or struct pointer. -func loadEntity(dst interface{}, src *pb.EntityProto) (err error) { - props, err := protoToProperties(src) - if err != nil { - return err - } - if e, ok := dst.(PropertyLoadSaver); ok { - return e.Load(props) - } - return LoadStruct(dst, props) -} - -func (s structPLS) Load(props []Property) error { - var fieldName, reason string - var l propertyLoader - for _, p := range props { - if errStr := l.load(s.codec, s.v, p, p.Multiple); errStr != "" { - // We don't return early, as we try to load as many properties as possible. - // It is valid to load an entity into a struct that cannot fully represent it. - // That case returns an error, but the caller is free to ignore it. - fieldName, reason = p.Name, errStr - } - } - if reason != "" { - return &ErrFieldMismatch{ - StructType: s.v.Type(), - FieldName: fieldName, - Reason: reason, - } - } - return nil -} - -func protoToProperties(src *pb.EntityProto) ([]Property, error) { - props, rawProps := src.Property, src.RawProperty - out := make([]Property, 0, len(props)+len(rawProps)) - for { - var ( - x *pb.Property - noIndex bool - ) - if len(props) > 0 { - x, props = props[0], props[1:] - } else if len(rawProps) > 0 { - x, rawProps = rawProps[0], rawProps[1:] - noIndex = true - } else { - break - } - - var value interface{} - if x.Meaning != nil && *x.Meaning == pb.Property_INDEX_VALUE { - value = indexValue{x.Value} - } else { - var err error - value, err = propValue(x.Value, x.GetMeaning()) - if err != nil { - return nil, err - } - } - out = append(out, Property{ - Name: x.GetName(), - Value: value, - NoIndex: noIndex, - Multiple: x.GetMultiple(), - }) - } - return out, nil -} - -// propValue returns a Go value that combines the raw PropertyValue with a -// meaning. For example, an Int64Value with GD_WHEN becomes a time.Time. -func propValue(v *pb.PropertyValue, m pb.Property_Meaning) (interface{}, error) { - switch { - case v.Int64Value != nil: - if m == pb.Property_GD_WHEN { - return fromUnixMicro(*v.Int64Value), nil - } else { - return *v.Int64Value, nil - } - case v.BooleanValue != nil: - return *v.BooleanValue, nil - case v.StringValue != nil: - if m == pb.Property_BLOB { - return []byte(*v.StringValue), nil - } else if m == pb.Property_BLOBKEY { - return appengine.BlobKey(*v.StringValue), nil - } else if m == pb.Property_BYTESTRING { - return ByteString(*v.StringValue), nil - } else { - return *v.StringValue, nil - } - case v.DoubleValue != nil: - return *v.DoubleValue, nil - case v.Referencevalue != nil: - key, err := referenceValueToKey(v.Referencevalue) - if err != nil { - return nil, err - } - return key, nil - case v.Pointvalue != nil: - // NOTE: Strangely, latitude maps to X, longitude to Y. - return appengine.GeoPoint{Lat: v.Pointvalue.GetX(), Lng: v.Pointvalue.GetY()}, nil - } - return nil, nil -} - -// indexValue is a Property value that is created when entities are loaded from -// an index, such as from a projection query. -// -// Such Property values do not contain all of the metadata required to be -// faithfully represented as a Go value, and are instead represented as an -// opaque indexValue. Load the properties into a concrete struct type (e.g. by -// passing a struct pointer to Iterator.Next) to reconstruct actual Go values -// of type int, string, time.Time, etc. -type indexValue struct { - value *pb.PropertyValue -} diff --git a/vendor/google.golang.org/appengine/datastore/prop.go b/vendor/google.golang.org/appengine/datastore/prop.go deleted file mode 100644 index 3caef9a3b..000000000 --- a/vendor/google.golang.org/appengine/datastore/prop.go +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "fmt" - "reflect" - "strings" - "sync" - "unicode" -) - -// Entities with more than this many indexed properties will not be saved. -const maxIndexedProperties = 20000 - -// []byte fields more than 1 megabyte long will not be loaded or saved. -const maxBlobLen = 1 << 20 - -// Property is a name/value pair plus some metadata. A datastore entity's -// contents are loaded and saved as a sequence of Properties. An entity can -// have multiple Properties with the same name, provided that p.Multiple is -// true on all of that entity's Properties with that name. -type Property struct { - // Name is the property name. - Name string - // Value is the property value. The valid types are: - // - int64 - // - bool - // - string - // - float64 - // - ByteString - // - *Key - // - time.Time - // - appengine.BlobKey - // - appengine.GeoPoint - // - []byte (up to 1 megabyte in length) - // This set is smaller than the set of valid struct field types that the - // datastore can load and save. A Property Value cannot be a slice (apart - // from []byte); use multiple Properties instead. Also, a Value's type - // must be explicitly on the list above; it is not sufficient for the - // underlying type to be on that list. For example, a Value of "type - // myInt64 int64" is invalid. Smaller-width integers and floats are also - // invalid. Again, this is more restrictive than the set of valid struct - // field types. - // - // A Value will have an opaque type when loading entities from an index, - // such as via a projection query. Load entities into a struct instead - // of a PropertyLoadSaver when using a projection query. - // - // A Value may also be the nil interface value; this is equivalent to - // Python's None but not directly representable by a Go struct. Loading - // a nil-valued property into a struct will set that field to the zero - // value. - Value interface{} - // NoIndex is whether the datastore cannot index this property. - NoIndex bool - // Multiple is whether the entity can have multiple properties with - // the same name. Even if a particular instance only has one property with - // a certain name, Multiple should be true if a struct would best represent - // it as a field of type []T instead of type T. - Multiple bool -} - -// ByteString is a short byte slice (up to 1500 bytes) that can be indexed. -type ByteString []byte - -// PropertyLoadSaver can be converted from and to a slice of Properties. -type PropertyLoadSaver interface { - Load([]Property) error - Save() ([]Property, error) -} - -// PropertyList converts a []Property to implement PropertyLoadSaver. -type PropertyList []Property - -var ( - typeOfPropertyLoadSaver = reflect.TypeOf((*PropertyLoadSaver)(nil)).Elem() - typeOfPropertyList = reflect.TypeOf(PropertyList(nil)) -) - -// Load loads all of the provided properties into l. -// It does not first reset *l to an empty slice. -func (l *PropertyList) Load(p []Property) error { - *l = append(*l, p...) - return nil -} - -// Save saves all of l's properties as a slice or Properties. -func (l *PropertyList) Save() ([]Property, error) { - return *l, nil -} - -// validPropertyName returns whether name consists of one or more valid Go -// identifiers joined by ".". -func validPropertyName(name string) bool { - if name == "" { - return false - } - for _, s := range strings.Split(name, ".") { - if s == "" { - return false - } - first := true - for _, c := range s { - if first { - first = false - if c != '_' && !unicode.IsLetter(c) { - return false - } - } else { - if c != '_' && !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - } - return true -} - -// structTag is the parsed `datastore:"name,options"` tag of a struct field. -// If a field has no tag, or the tag has an empty name, then the structTag's -// name is just the field name. A "-" name means that the datastore ignores -// that field. -type structTag struct { - name string - noIndex bool -} - -// structCodec describes how to convert a struct to and from a sequence of -// properties. -type structCodec struct { - // byIndex gives the structTag for the i'th field. - byIndex []structTag - // byName gives the field codec for the structTag with the given name. - byName map[string]fieldCodec - // hasSlice is whether a struct or any of its nested or embedded structs - // has a slice-typed field (other than []byte). - hasSlice bool - // complete is whether the structCodec is complete. An incomplete - // structCodec may be encountered when walking a recursive struct. - complete bool -} - -// fieldCodec is a struct field's index and, if that struct field's type is -// itself a struct, that substruct's structCodec. -type fieldCodec struct { - index int - substructCodec *structCodec -} - -// structCodecs collects the structCodecs that have already been calculated. -var ( - structCodecsMutex sync.Mutex - structCodecs = make(map[reflect.Type]*structCodec) -) - -// getStructCodec returns the structCodec for the given struct type. -func getStructCodec(t reflect.Type) (*structCodec, error) { - structCodecsMutex.Lock() - defer structCodecsMutex.Unlock() - return getStructCodecLocked(t) -} - -// getStructCodecLocked implements getStructCodec. The structCodecsMutex must -// be held when calling this function. -func getStructCodecLocked(t reflect.Type) (ret *structCodec, retErr error) { - c, ok := structCodecs[t] - if ok { - return c, nil - } - c = &structCodec{ - byIndex: make([]structTag, t.NumField()), - byName: make(map[string]fieldCodec), - } - - // Add c to the structCodecs map before we are sure it is good. If t is - // a recursive type, it needs to find the incomplete entry for itself in - // the map. - structCodecs[t] = c - defer func() { - if retErr != nil { - delete(structCodecs, t) - } - }() - - for i := range c.byIndex { - f := t.Field(i) - name, opts := f.Tag.Get("datastore"), "" - if i := strings.Index(name, ","); i != -1 { - name, opts = name[:i], name[i+1:] - } - if name == "" { - if !f.Anonymous { - name = f.Name - } - } else if name == "-" { - c.byIndex[i] = structTag{name: name} - continue - } else if !validPropertyName(name) { - return nil, fmt.Errorf("datastore: struct tag has invalid property name: %q", name) - } - - substructType, fIsSlice := reflect.Type(nil), false - switch f.Type.Kind() { - case reflect.Struct: - substructType = f.Type - case reflect.Slice: - if f.Type.Elem().Kind() == reflect.Struct { - substructType = f.Type.Elem() - } - fIsSlice = f.Type != typeOfByteSlice - c.hasSlice = c.hasSlice || fIsSlice - } - - if substructType != nil && substructType != typeOfTime && substructType != typeOfGeoPoint { - if name != "" { - name = name + "." - } - sub, err := getStructCodecLocked(substructType) - if err != nil { - return nil, err - } - if !sub.complete { - return nil, fmt.Errorf("datastore: recursive struct: field %q", f.Name) - } - if fIsSlice && sub.hasSlice { - return nil, fmt.Errorf( - "datastore: flattening nested structs leads to a slice of slices: field %q", f.Name) - } - c.hasSlice = c.hasSlice || sub.hasSlice - for relName := range sub.byName { - absName := name + relName - if _, ok := c.byName[absName]; ok { - return nil, fmt.Errorf("datastore: struct tag has repeated property name: %q", absName) - } - c.byName[absName] = fieldCodec{index: i, substructCodec: sub} - } - } else { - if _, ok := c.byName[name]; ok { - return nil, fmt.Errorf("datastore: struct tag has repeated property name: %q", name) - } - c.byName[name] = fieldCodec{index: i} - } - - c.byIndex[i] = structTag{ - name: name, - noIndex: opts == "noindex", - } - } - c.complete = true - return c, nil -} - -// structPLS adapts a struct to be a PropertyLoadSaver. -type structPLS struct { - v reflect.Value - codec *structCodec -} - -// newStructPLS returns a PropertyLoadSaver for the struct pointer p. -func newStructPLS(p interface{}) (PropertyLoadSaver, error) { - v := reflect.ValueOf(p) - if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct { - return nil, ErrInvalidEntityType - } - v = v.Elem() - codec, err := getStructCodec(v.Type()) - if err != nil { - return nil, err - } - return structPLS{v, codec}, nil -} - -// LoadStruct loads the properties from p to dst. -// dst must be a struct pointer. -func LoadStruct(dst interface{}, p []Property) error { - x, err := newStructPLS(dst) - if err != nil { - return err - } - return x.Load(p) -} - -// SaveStruct returns the properties from src as a slice of Properties. -// src must be a struct pointer. -func SaveStruct(src interface{}) ([]Property, error) { - x, err := newStructPLS(src) - if err != nil { - return nil, err - } - return x.Save() -} diff --git a/vendor/google.golang.org/appengine/datastore/query.go b/vendor/google.golang.org/appengine/datastore/query.go deleted file mode 100644 index 696a5d3e2..000000000 --- a/vendor/google.golang.org/appengine/datastore/query.go +++ /dev/null @@ -1,713 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "encoding/base64" - "errors" - "fmt" - "math" - "reflect" - "strings" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/datastore" -) - -type operator int - -const ( - lessThan operator = iota - lessEq - equal - greaterEq - greaterThan -) - -var operatorToProto = map[operator]*pb.Query_Filter_Operator{ - lessThan: pb.Query_Filter_LESS_THAN.Enum(), - lessEq: pb.Query_Filter_LESS_THAN_OR_EQUAL.Enum(), - equal: pb.Query_Filter_EQUAL.Enum(), - greaterEq: pb.Query_Filter_GREATER_THAN_OR_EQUAL.Enum(), - greaterThan: pb.Query_Filter_GREATER_THAN.Enum(), -} - -// filter is a conditional filter on query results. -type filter struct { - FieldName string - Op operator - Value interface{} -} - -type sortDirection int - -const ( - ascending sortDirection = iota - descending -) - -var sortDirectionToProto = map[sortDirection]*pb.Query_Order_Direction{ - ascending: pb.Query_Order_ASCENDING.Enum(), - descending: pb.Query_Order_DESCENDING.Enum(), -} - -// order is a sort order on query results. -type order struct { - FieldName string - Direction sortDirection -} - -// NewQuery creates a new Query for a specific entity kind. -// -// An empty kind means to return all entities, including entities created and -// managed by other App Engine features, and is called a kindless query. -// Kindless queries cannot include filters or sort orders on property values. -func NewQuery(kind string) *Query { - return &Query{ - kind: kind, - limit: -1, - } -} - -// Query represents a datastore query. -type Query struct { - kind string - ancestor *Key - filter []filter - order []order - projection []string - - distinct bool - keysOnly bool - eventual bool - limit int32 - offset int32 - start *pb.CompiledCursor - end *pb.CompiledCursor - - err error -} - -func (q *Query) clone() *Query { - x := *q - // Copy the contents of the slice-typed fields to a new backing store. - if len(q.filter) > 0 { - x.filter = make([]filter, len(q.filter)) - copy(x.filter, q.filter) - } - if len(q.order) > 0 { - x.order = make([]order, len(q.order)) - copy(x.order, q.order) - } - return &x -} - -// Ancestor returns a derivative query with an ancestor filter. -// The ancestor should not be nil. -func (q *Query) Ancestor(ancestor *Key) *Query { - q = q.clone() - if ancestor == nil { - q.err = errors.New("datastore: nil query ancestor") - return q - } - q.ancestor = ancestor - return q -} - -// EventualConsistency returns a derivative query that returns eventually -// consistent results. -// It only has an effect on ancestor queries. -func (q *Query) EventualConsistency() *Query { - q = q.clone() - q.eventual = true - return q -} - -// Filter returns a derivative query with a field-based filter. -// The filterStr argument must be a field name followed by optional space, -// followed by an operator, one of ">", "<", ">=", "<=", or "=". -// Fields are compared against the provided value using the operator. -// Multiple filters are AND'ed together. -func (q *Query) Filter(filterStr string, value interface{}) *Query { - q = q.clone() - filterStr = strings.TrimSpace(filterStr) - if len(filterStr) < 1 { - q.err = errors.New("datastore: invalid filter: " + filterStr) - return q - } - f := filter{ - FieldName: strings.TrimRight(filterStr, " ><=!"), - Value: value, - } - switch op := strings.TrimSpace(filterStr[len(f.FieldName):]); op { - case "<=": - f.Op = lessEq - case ">=": - f.Op = greaterEq - case "<": - f.Op = lessThan - case ">": - f.Op = greaterThan - case "=": - f.Op = equal - default: - q.err = fmt.Errorf("datastore: invalid operator %q in filter %q", op, filterStr) - return q - } - q.filter = append(q.filter, f) - return q -} - -// Order returns a derivative query with a field-based sort order. Orders are -// applied in the order they are added. The default order is ascending; to sort -// in descending order prefix the fieldName with a minus sign (-). -func (q *Query) Order(fieldName string) *Query { - q = q.clone() - fieldName = strings.TrimSpace(fieldName) - o := order{ - Direction: ascending, - FieldName: fieldName, - } - if strings.HasPrefix(fieldName, "-") { - o.Direction = descending - o.FieldName = strings.TrimSpace(fieldName[1:]) - } else if strings.HasPrefix(fieldName, "+") { - q.err = fmt.Errorf("datastore: invalid order: %q", fieldName) - return q - } - if len(o.FieldName) == 0 { - q.err = errors.New("datastore: empty order") - return q - } - q.order = append(q.order, o) - return q -} - -// Project returns a derivative query that yields only the given fields. It -// cannot be used with KeysOnly. -func (q *Query) Project(fieldNames ...string) *Query { - q = q.clone() - q.projection = append([]string(nil), fieldNames...) - return q -} - -// Distinct returns a derivative query that yields de-duplicated entities with -// respect to the set of projected fields. It is only used for projection -// queries. -func (q *Query) Distinct() *Query { - q = q.clone() - q.distinct = true - return q -} - -// KeysOnly returns a derivative query that yields only keys, not keys and -// entities. It cannot be used with projection queries. -func (q *Query) KeysOnly() *Query { - q = q.clone() - q.keysOnly = true - return q -} - -// Limit returns a derivative query that has a limit on the number of results -// returned. A negative value means unlimited. -func (q *Query) Limit(limit int) *Query { - q = q.clone() - if limit < math.MinInt32 || limit > math.MaxInt32 { - q.err = errors.New("datastore: query limit overflow") - return q - } - q.limit = int32(limit) - return q -} - -// Offset returns a derivative query that has an offset of how many keys to -// skip over before returning results. A negative value is invalid. -func (q *Query) Offset(offset int) *Query { - q = q.clone() - if offset < 0 { - q.err = errors.New("datastore: negative query offset") - return q - } - if offset > math.MaxInt32 { - q.err = errors.New("datastore: query offset overflow") - return q - } - q.offset = int32(offset) - return q -} - -// Start returns a derivative query with the given start point. -func (q *Query) Start(c Cursor) *Query { - q = q.clone() - if c.cc == nil { - q.err = errors.New("datastore: invalid cursor") - return q - } - q.start = c.cc - return q -} - -// End returns a derivative query with the given end point. -func (q *Query) End(c Cursor) *Query { - q = q.clone() - if c.cc == nil { - q.err = errors.New("datastore: invalid cursor") - return q - } - q.end = c.cc - return q -} - -// toProto converts the query to a protocol buffer. -func (q *Query) toProto(dst *pb.Query, appID string) error { - if len(q.projection) != 0 && q.keysOnly { - return errors.New("datastore: query cannot both project and be keys-only") - } - dst.Reset() - dst.App = proto.String(appID) - if q.kind != "" { - dst.Kind = proto.String(q.kind) - } - if q.ancestor != nil { - dst.Ancestor = keyToProto(appID, q.ancestor) - if q.eventual { - dst.Strong = proto.Bool(false) - } - } - if q.projection != nil { - dst.PropertyName = q.projection - if q.distinct { - dst.GroupByPropertyName = q.projection - } - } - if q.keysOnly { - dst.KeysOnly = proto.Bool(true) - dst.RequirePerfectPlan = proto.Bool(true) - } - for _, qf := range q.filter { - if qf.FieldName == "" { - return errors.New("datastore: empty query filter field name") - } - p, errStr := valueToProto(appID, qf.FieldName, reflect.ValueOf(qf.Value), false) - if errStr != "" { - return errors.New("datastore: bad query filter value type: " + errStr) - } - xf := &pb.Query_Filter{ - Op: operatorToProto[qf.Op], - Property: []*pb.Property{p}, - } - if xf.Op == nil { - return errors.New("datastore: unknown query filter operator") - } - dst.Filter = append(dst.Filter, xf) - } - for _, qo := range q.order { - if qo.FieldName == "" { - return errors.New("datastore: empty query order field name") - } - xo := &pb.Query_Order{ - Property: proto.String(qo.FieldName), - Direction: sortDirectionToProto[qo.Direction], - } - if xo.Direction == nil { - return errors.New("datastore: unknown query order direction") - } - dst.Order = append(dst.Order, xo) - } - if q.limit >= 0 { - dst.Limit = proto.Int32(q.limit) - } - if q.offset != 0 { - dst.Offset = proto.Int32(q.offset) - } - dst.CompiledCursor = q.start - dst.EndCompiledCursor = q.end - dst.Compile = proto.Bool(true) - return nil -} - -// Count returns the number of results for the query. -func (q *Query) Count(c context.Context) (int, error) { - // Check that the query is well-formed. - if q.err != nil { - return 0, q.err - } - - // Run a copy of the query, with keysOnly true (if we're not a projection, - // since the two are incompatible), and an adjusted offset. We also set the - // limit to zero, as we don't want any actual entity data, just the number - // of skipped results. - newQ := q.clone() - newQ.keysOnly = len(newQ.projection) == 0 - newQ.limit = 0 - if q.limit < 0 { - // If the original query was unlimited, set the new query's offset to maximum. - newQ.offset = math.MaxInt32 - } else { - newQ.offset = q.offset + q.limit - if newQ.offset < 0 { - // Do the best we can, in the presence of overflow. - newQ.offset = math.MaxInt32 - } - } - req := &pb.Query{} - if err := newQ.toProto(req, internal.FullyQualifiedAppID(c)); err != nil { - return 0, err - } - res := &pb.QueryResult{} - if err := internal.Call(c, "datastore_v3", "RunQuery", req, res); err != nil { - return 0, err - } - - // n is the count we will return. For example, suppose that our original - // query had an offset of 4 and a limit of 2008: the count will be 2008, - // provided that there are at least 2012 matching entities. However, the - // RPCs will only skip 1000 results at a time. The RPC sequence is: - // call RunQuery with (offset, limit) = (2012, 0) // 2012 == newQ.offset - // response has (skippedResults, moreResults) = (1000, true) - // n += 1000 // n == 1000 - // call Next with (offset, limit) = (1012, 0) // 1012 == newQ.offset - n - // response has (skippedResults, moreResults) = (1000, true) - // n += 1000 // n == 2000 - // call Next with (offset, limit) = (12, 0) // 12 == newQ.offset - n - // response has (skippedResults, moreResults) = (12, false) - // n += 12 // n == 2012 - // // exit the loop - // n -= 4 // n == 2008 - var n int32 - for { - // The QueryResult should have no actual entity data, just skipped results. - if len(res.Result) != 0 { - return 0, errors.New("datastore: internal error: Count request returned too much data") - } - n += res.GetSkippedResults() - if !res.GetMoreResults() { - break - } - if err := callNext(c, res, newQ.offset-n, 0); err != nil { - return 0, err - } - } - n -= q.offset - if n < 0 { - // If the offset was greater than the number of matching entities, - // return 0 instead of negative. - n = 0 - } - return int(n), nil -} - -// callNext issues a datastore_v3/Next RPC to advance a cursor, such as that -// returned by a query with more results. -func callNext(c context.Context, res *pb.QueryResult, offset, limit int32) error { - if res.Cursor == nil { - return errors.New("datastore: internal error: server did not return a cursor") - } - req := &pb.NextRequest{ - Cursor: res.Cursor, - } - if limit >= 0 { - req.Count = proto.Int32(limit) - } - if offset != 0 { - req.Offset = proto.Int32(offset) - } - if res.CompiledCursor != nil { - req.Compile = proto.Bool(true) - } - res.Reset() - return internal.Call(c, "datastore_v3", "Next", req, res) -} - -// GetAll runs the query in the given context and returns all keys that match -// that query, as well as appending the values to dst. -// -// dst must have type *[]S or *[]*S or *[]P, for some struct type S or some non- -// interface, non-pointer type P such that P or *P implements PropertyLoadSaver. -// -// As a special case, *PropertyList is an invalid type for dst, even though a -// PropertyList is a slice of structs. It is treated as invalid to avoid being -// mistakenly passed when *[]PropertyList was intended. -// -// The keys returned by GetAll will be in a 1-1 correspondence with the entities -// added to dst. -// -// If q is a ``keys-only'' query, GetAll ignores dst and only returns the keys. -func (q *Query) GetAll(c context.Context, dst interface{}) ([]*Key, error) { - var ( - dv reflect.Value - mat multiArgType - elemType reflect.Type - errFieldMismatch error - ) - if !q.keysOnly { - dv = reflect.ValueOf(dst) - if dv.Kind() != reflect.Ptr || dv.IsNil() { - return nil, ErrInvalidEntityType - } - dv = dv.Elem() - mat, elemType = checkMultiArg(dv) - if mat == multiArgTypeInvalid || mat == multiArgTypeInterface { - return nil, ErrInvalidEntityType - } - } - - var keys []*Key - for t := q.Run(c); ; { - k, e, err := t.next() - if err == Done { - break - } - if err != nil { - return keys, err - } - if !q.keysOnly { - ev := reflect.New(elemType) - if elemType.Kind() == reflect.Map { - // This is a special case. The zero values of a map type are - // not immediately useful; they have to be make'd. - // - // Funcs and channels are similar, in that a zero value is not useful, - // but even a freshly make'd channel isn't useful: there's no fixed - // channel buffer size that is always going to be large enough, and - // there's no goroutine to drain the other end. Theoretically, these - // types could be supported, for example by sniffing for a constructor - // method or requiring prior registration, but for now it's not a - // frequent enough concern to be worth it. Programmers can work around - // it by explicitly using Iterator.Next instead of the Query.GetAll - // convenience method. - x := reflect.MakeMap(elemType) - ev.Elem().Set(x) - } - if err = loadEntity(ev.Interface(), e); err != nil { - if _, ok := err.(*ErrFieldMismatch); ok { - // We continue loading entities even in the face of field mismatch errors. - // If we encounter any other error, that other error is returned. Otherwise, - // an ErrFieldMismatch is returned. - errFieldMismatch = err - } else { - return keys, err - } - } - if mat != multiArgTypeStructPtr { - ev = ev.Elem() - } - dv.Set(reflect.Append(dv, ev)) - } - keys = append(keys, k) - } - return keys, errFieldMismatch -} - -// Run runs the query in the given context. -func (q *Query) Run(c context.Context) *Iterator { - if q.err != nil { - return &Iterator{err: q.err} - } - t := &Iterator{ - c: c, - limit: q.limit, - q: q, - prevCC: q.start, - } - var req pb.Query - if err := q.toProto(&req, internal.FullyQualifiedAppID(c)); err != nil { - t.err = err - return t - } - if err := internal.Call(c, "datastore_v3", "RunQuery", &req, &t.res); err != nil { - t.err = err - return t - } - offset := q.offset - t.res.GetSkippedResults() - for offset > 0 && t.res.GetMoreResults() { - t.prevCC = t.res.CompiledCursor - if err := callNext(t.c, &t.res, offset, t.limit); err != nil { - t.err = err - break - } - skip := t.res.GetSkippedResults() - if skip < 0 { - t.err = errors.New("datastore: internal error: negative number of skipped_results") - break - } - offset -= skip - } - if offset < 0 { - t.err = errors.New("datastore: internal error: query offset was overshot") - } - return t -} - -// Iterator is the result of running a query. -type Iterator struct { - c context.Context - err error - // res is the result of the most recent RunQuery or Next API call. - res pb.QueryResult - // i is how many elements of res.Result we have iterated over. - i int - // limit is the limit on the number of results this iterator should return. - // A negative value means unlimited. - limit int32 - // q is the original query which yielded this iterator. - q *Query - // prevCC is the compiled cursor that marks the end of the previous batch - // of results. - prevCC *pb.CompiledCursor -} - -// Done is returned when a query iteration has completed. -var Done = errors.New("datastore: query has no more results") - -// Next returns the key of the next result. When there are no more results, -// Done is returned as the error. -// -// If the query is not keys only and dst is non-nil, it also loads the entity -// stored for that key into the struct pointer or PropertyLoadSaver dst, with -// the same semantics and possible errors as for the Get function. -func (t *Iterator) Next(dst interface{}) (*Key, error) { - k, e, err := t.next() - if err != nil { - return nil, err - } - if dst != nil && !t.q.keysOnly { - err = loadEntity(dst, e) - } - return k, err -} - -func (t *Iterator) next() (*Key, *pb.EntityProto, error) { - if t.err != nil { - return nil, nil, t.err - } - - // Issue datastore_v3/Next RPCs as necessary. - for t.i == len(t.res.Result) { - if !t.res.GetMoreResults() { - t.err = Done - return nil, nil, t.err - } - t.prevCC = t.res.CompiledCursor - if err := callNext(t.c, &t.res, 0, t.limit); err != nil { - t.err = err - return nil, nil, t.err - } - if t.res.GetSkippedResults() != 0 { - t.err = errors.New("datastore: internal error: iterator has skipped results") - return nil, nil, t.err - } - t.i = 0 - if t.limit >= 0 { - t.limit -= int32(len(t.res.Result)) - if t.limit < 0 { - t.err = errors.New("datastore: internal error: query returned more results than the limit") - return nil, nil, t.err - } - } - } - - // Extract the key from the t.i'th element of t.res.Result. - e := t.res.Result[t.i] - t.i++ - if e.Key == nil { - return nil, nil, errors.New("datastore: internal error: server did not return a key") - } - k, err := protoToKey(e.Key) - if err != nil || k.Incomplete() { - return nil, nil, errors.New("datastore: internal error: server returned an invalid key") - } - return k, e, nil -} - -// Cursor returns a cursor for the iterator's current location. -func (t *Iterator) Cursor() (Cursor, error) { - if t.err != nil && t.err != Done { - return Cursor{}, t.err - } - // If we are at either end of the current batch of results, - // return the compiled cursor at that end. - skipped := t.res.GetSkippedResults() - if t.i == 0 && skipped == 0 { - if t.prevCC == nil { - // A nil pointer (of type *pb.CompiledCursor) means no constraint: - // passing it as the end cursor of a new query means unlimited results - // (glossing over the integer limit parameter for now). - // A non-nil pointer to an empty pb.CompiledCursor means the start: - // passing it as the end cursor of a new query means 0 results. - // If prevCC was nil, then the original query had no start cursor, but - // Iterator.Cursor should return "the start" instead of unlimited. - return Cursor{&zeroCC}, nil - } - return Cursor{t.prevCC}, nil - } - if t.i == len(t.res.Result) { - return Cursor{t.res.CompiledCursor}, nil - } - // Otherwise, re-run the query offset to this iterator's position, starting from - // the most recent compiled cursor. This is done on a best-effort basis, as it - // is racy; if a concurrent process has added or removed entities, then the - // cursor returned may be inconsistent. - q := t.q.clone() - q.start = t.prevCC - q.offset = skipped + int32(t.i) - q.limit = 0 - q.keysOnly = len(q.projection) == 0 - t1 := q.Run(t.c) - _, _, err := t1.next() - if err != Done { - if err == nil { - err = fmt.Errorf("datastore: internal error: zero-limit query did not have zero results") - } - return Cursor{}, err - } - return Cursor{t1.res.CompiledCursor}, nil -} - -var zeroCC pb.CompiledCursor - -// Cursor is an iterator's position. It can be converted to and from an opaque -// string. A cursor can be used from different HTTP requests, but only with a -// query with the same kind, ancestor, filter and order constraints. -type Cursor struct { - cc *pb.CompiledCursor -} - -// String returns a base-64 string representation of a cursor. -func (c Cursor) String() string { - if c.cc == nil { - return "" - } - b, err := proto.Marshal(c.cc) - if err != nil { - // The only way to construct a Cursor with a non-nil cc field is to - // unmarshal from the byte representation. We panic if the unmarshal - // succeeds but the marshaling of the unchanged protobuf value fails. - panic(fmt.Sprintf("datastore: internal error: malformed cursor: %v", err)) - } - return strings.TrimRight(base64.URLEncoding.EncodeToString(b), "=") -} - -// Decode decodes a cursor from its base-64 string representation. -func DecodeCursor(s string) (Cursor, error) { - if s == "" { - return Cursor{&zeroCC}, nil - } - if n := len(s) % 4; n != 0 { - s += strings.Repeat("=", 4-n) - } - b, err := base64.URLEncoding.DecodeString(s) - if err != nil { - return Cursor{}, err - } - cc := &pb.CompiledCursor{} - if err := proto.Unmarshal(b, cc); err != nil { - return Cursor{}, err - } - return Cursor{cc}, nil -} diff --git a/vendor/google.golang.org/appengine/datastore/save.go b/vendor/google.golang.org/appengine/datastore/save.go deleted file mode 100644 index 6aeffb631..000000000 --- a/vendor/google.golang.org/appengine/datastore/save.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "errors" - "fmt" - "math" - "reflect" - "time" - - "github.com/golang/protobuf/proto" - - "google.golang.org/appengine" - pb "google.golang.org/appengine/internal/datastore" -) - -func toUnixMicro(t time.Time) int64 { - // We cannot use t.UnixNano() / 1e3 because we want to handle times more than - // 2^63 nanoseconds (which is about 292 years) away from 1970, and those cannot - // be represented in the numerator of a single int64 divide. - return t.Unix()*1e6 + int64(t.Nanosecond()/1e3) -} - -func fromUnixMicro(t int64) time.Time { - return time.Unix(t/1e6, (t%1e6)*1e3) -} - -var ( - minTime = time.Unix(int64(math.MinInt64)/1e6, (int64(math.MinInt64)%1e6)*1e3) - maxTime = time.Unix(int64(math.MaxInt64)/1e6, (int64(math.MaxInt64)%1e6)*1e3) -) - -// valueToProto converts a named value to a newly allocated Property. -// The returned error string is empty on success. -func valueToProto(defaultAppID, name string, v reflect.Value, multiple bool) (p *pb.Property, errStr string) { - var ( - pv pb.PropertyValue - unsupported bool - ) - switch v.Kind() { - case reflect.Invalid: - // No-op. - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - pv.Int64Value = proto.Int64(v.Int()) - case reflect.Bool: - pv.BooleanValue = proto.Bool(v.Bool()) - case reflect.String: - pv.StringValue = proto.String(v.String()) - case reflect.Float32, reflect.Float64: - pv.DoubleValue = proto.Float64(v.Float()) - case reflect.Ptr: - if k, ok := v.Interface().(*Key); ok { - if k != nil { - pv.Referencevalue = keyToReferenceValue(defaultAppID, k) - } - } else { - unsupported = true - } - case reflect.Struct: - switch t := v.Interface().(type) { - case time.Time: - if t.Before(minTime) || t.After(maxTime) { - return nil, "time value out of range" - } - pv.Int64Value = proto.Int64(toUnixMicro(t)) - case appengine.GeoPoint: - if !t.Valid() { - return nil, "invalid GeoPoint value" - } - // NOTE: Strangely, latitude maps to X, longitude to Y. - pv.Pointvalue = &pb.PropertyValue_PointValue{X: &t.Lat, Y: &t.Lng} - default: - unsupported = true - } - case reflect.Slice: - if b, ok := v.Interface().([]byte); ok { - pv.StringValue = proto.String(string(b)) - } else { - // nvToProto should already catch slice values. - // If we get here, we have a slice of slice values. - unsupported = true - } - default: - unsupported = true - } - if unsupported { - return nil, "unsupported datastore value type: " + v.Type().String() - } - p = &pb.Property{ - Name: proto.String(name), - Value: &pv, - Multiple: proto.Bool(multiple), - } - if v.IsValid() { - switch v.Interface().(type) { - case []byte: - p.Meaning = pb.Property_BLOB.Enum() - case ByteString: - p.Meaning = pb.Property_BYTESTRING.Enum() - case appengine.BlobKey: - p.Meaning = pb.Property_BLOBKEY.Enum() - case time.Time: - p.Meaning = pb.Property_GD_WHEN.Enum() - case appengine.GeoPoint: - p.Meaning = pb.Property_GEORSS_POINT.Enum() - } - } - return p, "" -} - -// saveEntity saves an EntityProto into a PropertyLoadSaver or struct pointer. -func saveEntity(defaultAppID string, key *Key, src interface{}) (*pb.EntityProto, error) { - var err error - var props []Property - if e, ok := src.(PropertyLoadSaver); ok { - props, err = e.Save() - } else { - props, err = SaveStruct(src) - } - if err != nil { - return nil, err - } - return propertiesToProto(defaultAppID, key, props) -} - -func saveStructProperty(props *[]Property, name string, noIndex, multiple bool, v reflect.Value) error { - p := Property{ - Name: name, - NoIndex: noIndex, - Multiple: multiple, - } - switch x := v.Interface().(type) { - case *Key: - p.Value = x - case time.Time: - p.Value = x - case appengine.BlobKey: - p.Value = x - case appengine.GeoPoint: - p.Value = x - case ByteString: - p.Value = x - default: - switch v.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - p.Value = v.Int() - case reflect.Bool: - p.Value = v.Bool() - case reflect.String: - p.Value = v.String() - case reflect.Float32, reflect.Float64: - p.Value = v.Float() - case reflect.Slice: - if v.Type().Elem().Kind() == reflect.Uint8 { - p.NoIndex = true - p.Value = v.Bytes() - } - case reflect.Struct: - if !v.CanAddr() { - return fmt.Errorf("datastore: unsupported struct field: value is unaddressable") - } - sub, err := newStructPLS(v.Addr().Interface()) - if err != nil { - return fmt.Errorf("datastore: unsupported struct field: %v", err) - } - return sub.(structPLS).save(props, name, noIndex, multiple) - } - } - if p.Value == nil { - return fmt.Errorf("datastore: unsupported struct field type: %v", v.Type()) - } - *props = append(*props, p) - return nil -} - -func (s structPLS) Save() ([]Property, error) { - var props []Property - if err := s.save(&props, "", false, false); err != nil { - return nil, err - } - return props, nil -} - -func (s structPLS) save(props *[]Property, prefix string, noIndex, multiple bool) error { - for i, t := range s.codec.byIndex { - if t.name == "-" { - continue - } - name := t.name - if prefix != "" { - name = prefix + name - } - v := s.v.Field(i) - if !v.IsValid() || !v.CanSet() { - continue - } - noIndex1 := noIndex || t.noIndex - // For slice fields that aren't []byte, save each element. - if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 { - for j := 0; j < v.Len(); j++ { - if err := saveStructProperty(props, name, noIndex1, true, v.Index(j)); err != nil { - return err - } - } - continue - } - // Otherwise, save the field itself. - if err := saveStructProperty(props, name, noIndex1, multiple, v); err != nil { - return err - } - } - return nil -} - -func propertiesToProto(defaultAppID string, key *Key, props []Property) (*pb.EntityProto, error) { - e := &pb.EntityProto{ - Key: keyToProto(defaultAppID, key), - } - if key.parent == nil { - e.EntityGroup = &pb.Path{} - } else { - e.EntityGroup = keyToProto(defaultAppID, key.root()).Path - } - prevMultiple := make(map[string]bool) - - for _, p := range props { - if pm, ok := prevMultiple[p.Name]; ok { - if !pm || !p.Multiple { - return nil, fmt.Errorf("datastore: multiple Properties with Name %q, but Multiple is false", p.Name) - } - } else { - prevMultiple[p.Name] = p.Multiple - } - - x := &pb.Property{ - Name: proto.String(p.Name), - Value: new(pb.PropertyValue), - Multiple: proto.Bool(p.Multiple), - } - switch v := p.Value.(type) { - case int64: - x.Value.Int64Value = proto.Int64(v) - case bool: - x.Value.BooleanValue = proto.Bool(v) - case string: - x.Value.StringValue = proto.String(v) - if p.NoIndex { - x.Meaning = pb.Property_TEXT.Enum() - } - case float64: - x.Value.DoubleValue = proto.Float64(v) - case *Key: - if v != nil { - x.Value.Referencevalue = keyToReferenceValue(defaultAppID, v) - } - case time.Time: - if v.Before(minTime) || v.After(maxTime) { - return nil, fmt.Errorf("datastore: time value out of range") - } - x.Value.Int64Value = proto.Int64(toUnixMicro(v)) - x.Meaning = pb.Property_GD_WHEN.Enum() - case appengine.BlobKey: - x.Value.StringValue = proto.String(string(v)) - x.Meaning = pb.Property_BLOBKEY.Enum() - case appengine.GeoPoint: - if !v.Valid() { - return nil, fmt.Errorf("datastore: invalid GeoPoint value") - } - // NOTE: Strangely, latitude maps to X, longitude to Y. - x.Value.Pointvalue = &pb.PropertyValue_PointValue{X: &v.Lat, Y: &v.Lng} - x.Meaning = pb.Property_GEORSS_POINT.Enum() - case []byte: - x.Value.StringValue = proto.String(string(v)) - x.Meaning = pb.Property_BLOB.Enum() - if !p.NoIndex { - return nil, fmt.Errorf("datastore: cannot index a []byte valued Property with Name %q", p.Name) - } - case ByteString: - x.Value.StringValue = proto.String(string(v)) - x.Meaning = pb.Property_BYTESTRING.Enum() - default: - if p.Value != nil { - return nil, fmt.Errorf("datastore: invalid Value type for a Property with Name %q", p.Name) - } - } - - if p.NoIndex { - e.RawProperty = append(e.RawProperty, x) - } else { - e.Property = append(e.Property, x) - if len(e.Property) > maxIndexedProperties { - return nil, errors.New("datastore: too many indexed properties") - } - } - } - return e, nil -} diff --git a/vendor/google.golang.org/appengine/datastore/transaction.go b/vendor/google.golang.org/appengine/datastore/transaction.go deleted file mode 100644 index bb4f2562f..000000000 --- a/vendor/google.golang.org/appengine/datastore/transaction.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package datastore - -import ( - "errors" - - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/datastore" -) - -func init() { - internal.RegisterTransactionSetter(func(x *pb.Query, t *pb.Transaction) { - x.Transaction = t - }) - internal.RegisterTransactionSetter(func(x *pb.GetRequest, t *pb.Transaction) { - x.Transaction = t - }) - internal.RegisterTransactionSetter(func(x *pb.PutRequest, t *pb.Transaction) { - x.Transaction = t - }) - internal.RegisterTransactionSetter(func(x *pb.DeleteRequest, t *pb.Transaction) { - x.Transaction = t - }) -} - -// ErrConcurrentTransaction is returned when a transaction is rolled back due -// to a conflict with a concurrent transaction. -var ErrConcurrentTransaction = errors.New("datastore: concurrent transaction") - -// RunInTransaction runs f in a transaction. It calls f with a transaction -// context tc that f should use for all App Engine operations. -// -// If f returns nil, RunInTransaction attempts to commit the transaction, -// returning nil if it succeeds. If the commit fails due to a conflicting -// transaction, RunInTransaction retries f, each time with a new transaction -// context. It gives up and returns ErrConcurrentTransaction after three -// failed attempts. -// -// If f returns non-nil, then any datastore changes will not be applied and -// RunInTransaction returns that same error. The function f is not retried. -// -// Note that when f returns, the transaction is not yet committed. Calling code -// must be careful not to assume that any of f's changes have been committed -// until RunInTransaction returns nil. -// -// Since f may be called multiple times, f should usually be idempotent. -// datastore.Get is not idempotent when unmarshaling slice fields. -// -// Nested transactions are not supported; c may not be a transaction context. -func RunInTransaction(c context.Context, f func(tc context.Context) error, opts *TransactionOptions) error { - xg := false - if opts != nil { - xg = opts.XG - } - for i := 0; i < 3; i++ { - if err := internal.RunTransactionOnce(c, f, xg); err != internal.ErrConcurrentTransaction { - return err - } - } - return ErrConcurrentTransaction -} - -// TransactionOptions are the options for running a transaction. -type TransactionOptions struct { - // XG is whether the transaction can cross multiple entity groups. In - // comparison, a single group transaction is one where all datastore keys - // used have the same root key. Note that cross group transactions do not - // have the same behavior as single group transactions. In particular, it - // is much more likely to see partially applied transactions in different - // entity groups, in global queries. - // It is valid to set XG to true even if the transaction is within a - // single entity group. - XG bool -} diff --git a/vendor/google.golang.org/appengine/delay/delay.go b/vendor/google.golang.org/appengine/delay/delay.go deleted file mode 100644 index 6ef8937f6..000000000 --- a/vendor/google.golang.org/appengine/delay/delay.go +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package delay provides a way to execute code outside the scope of a -user request by using the taskqueue API. - -To declare a function that may be executed later, call Func -in a top-level assignment context, passing it an arbitrary string key -and a function whose first argument is of type context.Context. - var laterFunc = delay.Func("key", myFunc) -It is also possible to use a function literal. - var laterFunc = delay.Func("key", func(c context.Context, x string) { - // ... - }) - -To call a function, invoke its Call method. - laterFunc.Call(c, "something") -A function may be called any number of times. If the function has any -return arguments, and the last one is of type error, the function may -return a non-nil error to signal that the function should be retried. - -The arguments to functions may be of any type that is encodable by the gob -package. If an argument is of interface type, it is the client's responsibility -to register with the gob package whatever concrete type may be passed for that -argument; see http://golang.org/pkg/gob/#Register for details. - -Any errors during initialization or execution of a function will be -logged to the application logs. Error logs that occur during initialization will -be associated with the request that invoked the Call method. - -The state of a function invocation that has not yet successfully -executed is preserved by combining the file name in which it is declared -with the string key that was passed to the Func function. Updating an app -with pending function invocations is safe as long as the relevant -functions have the (filename, key) combination preserved. - -The delay package uses the Task Queue API to create tasks that call the -reserved application path "/_ah/queue/go/delay". -This path must not be marked as "login: required" in app.yaml; -it must be marked as "login: admin" or have no access restriction. -*/ -package delay - -import ( - "bytes" - "encoding/gob" - "errors" - "fmt" - "net/http" - "reflect" - "runtime" - - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/log" - "google.golang.org/appengine/taskqueue" -) - -// Function represents a function that may have a delayed invocation. -type Function struct { - fv reflect.Value // Kind() == reflect.Func - key string - err error // any error during initialization -} - -const ( - // The HTTP path for invocations. - path = "/_ah/queue/go/delay" - // Use the default queue. - queue = "" -) - -var ( - // registry of all delayed functions - funcs = make(map[string]*Function) - - // precomputed types - contextType = reflect.TypeOf((*context.Context)(nil)).Elem() - errorType = reflect.TypeOf((*error)(nil)).Elem() - - // errors - errFirstArg = errors.New("first argument must be context.Context") -) - -// Func declares a new Function. The second argument must be a function with a -// first argument of type context.Context. -// This function must be called at program initialization time. That means it -// must be called in a global variable declaration or from an init function. -// This restriction is necessary because the instance that delays a function -// call may not be the one that executes it. Only the code executed at program -// initialization time is guaranteed to have been run by an instance before it -// receives a request. -func Func(key string, i interface{}) *Function { - f := &Function{fv: reflect.ValueOf(i)} - - // Derive unique, somewhat stable key for this func. - _, file, _, _ := runtime.Caller(1) - f.key = file + ":" + key - - t := f.fv.Type() - if t.Kind() != reflect.Func { - f.err = errors.New("not a function") - return f - } - if t.NumIn() == 0 || t.In(0) != contextType { - f.err = errFirstArg - return f - } - - // Register the function's arguments with the gob package. - // This is required because they are marshaled inside a []interface{}. - // gob.Register only expects to be called during initialization; - // that's fine because this function expects the same. - for i := 0; i < t.NumIn(); i++ { - // Only concrete types may be registered. If the argument has - // interface type, the client is resposible for registering the - // concrete types it will hold. - if t.In(i).Kind() == reflect.Interface { - continue - } - gob.Register(reflect.Zero(t.In(i)).Interface()) - } - - funcs[f.key] = f - return f -} - -type invocation struct { - Key string - Args []interface{} -} - -// Call invokes a delayed function. -// f.Call(c, ...) -// is equivalent to -// t, _ := f.Task(...) -// taskqueue.Add(c, t, "") -func (f *Function) Call(c context.Context, args ...interface{}) { - t, err := f.Task(args...) - if err != nil { - log.Errorf(c, "%v", err) - return - } - if _, err := taskqueueAdder(c, t, queue); err != nil { - log.Errorf(c, "delay: taskqueue.Add failed: %v", err) - return - } -} - -// Task creates a Task that will invoke the function. -// Its parameters may be tweaked before adding it to a queue. -// Users should not modify the Path or Payload fields of the returned Task. -func (f *Function) Task(args ...interface{}) (*taskqueue.Task, error) { - if f.err != nil { - return nil, fmt.Errorf("delay: func is invalid: %v", f.err) - } - - nArgs := len(args) + 1 // +1 for the context.Context - ft := f.fv.Type() - minArgs := ft.NumIn() - if ft.IsVariadic() { - minArgs-- - } - if nArgs < minArgs { - return nil, fmt.Errorf("delay: too few arguments to func: %d < %d", nArgs, minArgs) - } - if !ft.IsVariadic() && nArgs > minArgs { - return nil, fmt.Errorf("delay: too many arguments to func: %d > %d", nArgs, minArgs) - } - - // Check arg types. - for i := 1; i < nArgs; i++ { - at := reflect.TypeOf(args[i-1]) - var dt reflect.Type - if i < minArgs { - // not a variadic arg - dt = ft.In(i) - } else { - // a variadic arg - dt = ft.In(minArgs).Elem() - } - // nil arguments won't have a type, so they need special handling. - if at == nil { - // nil interface - switch dt.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - continue // may be nil - } - return nil, fmt.Errorf("delay: argument %d has wrong type: %v is not nilable", i, dt) - } - switch at.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - av := reflect.ValueOf(args[i-1]) - if av.IsNil() { - // nil value in interface; not supported by gob, so we replace it - // with a nil interface value - args[i-1] = nil - } - } - if !at.AssignableTo(dt) { - return nil, fmt.Errorf("delay: argument %d has wrong type: %v is not assignable to %v", i, at, dt) - } - } - - inv := invocation{ - Key: f.key, - Args: args, - } - - buf := new(bytes.Buffer) - if err := gob.NewEncoder(buf).Encode(inv); err != nil { - return nil, fmt.Errorf("delay: gob encoding failed: %v", err) - } - - return &taskqueue.Task{ - Path: path, - Payload: buf.Bytes(), - }, nil -} - -var taskqueueAdder = taskqueue.Add // for testing - -func init() { - http.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - runFunc(appengine.NewContext(req), w, req) - }) -} - -func runFunc(c context.Context, w http.ResponseWriter, req *http.Request) { - defer req.Body.Close() - - var inv invocation - if err := gob.NewDecoder(req.Body).Decode(&inv); err != nil { - log.Errorf(c, "delay: failed decoding task payload: %v", err) - log.Warningf(c, "delay: dropping task") - return - } - - f := funcs[inv.Key] - if f == nil { - log.Errorf(c, "delay: no func with key %q found", inv.Key) - log.Warningf(c, "delay: dropping task") - return - } - - ft := f.fv.Type() - in := []reflect.Value{reflect.ValueOf(c)} - for _, arg := range inv.Args { - var v reflect.Value - if arg != nil { - v = reflect.ValueOf(arg) - } else { - // Task was passed a nil argument, so we must construct - // the zero value for the argument here. - n := len(in) // we're constructing the nth argument - var at reflect.Type - if !ft.IsVariadic() || n < ft.NumIn()-1 { - at = ft.In(n) - } else { - at = ft.In(ft.NumIn() - 1).Elem() - } - v = reflect.Zero(at) - } - in = append(in, v) - } - out := f.fv.Call(in) - - if n := ft.NumOut(); n > 0 && ft.Out(n-1) == errorType { - if errv := out[n-1]; !errv.IsNil() { - log.Errorf(c, "delay: func failed (will retry): %v", errv.Interface()) - w.WriteHeader(http.StatusInternalServerError) - return - } - } -} diff --git a/vendor/google.golang.org/appengine/demos/guestbook/app.yaml b/vendor/google.golang.org/appengine/demos/guestbook/app.yaml deleted file mode 100644 index 783713951..000000000 --- a/vendor/google.golang.org/appengine/demos/guestbook/app.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Demo application for Managed VMs. -application: vm-guestbook -version: 1 -runtime: go -vm: true -api_version: go1 - -manual_scaling: - instances: 1 - -handlers: -# Favicon. Without this, the browser hits this once per page view. -- url: /favicon.ico - static_files: favicon.ico - upload: favicon.ico - -# Main app. All the real work is here. -- url: /.* - script: _go_app diff --git a/vendor/google.golang.org/appengine/demos/guestbook/favicon.ico b/vendor/google.golang.org/appengine/demos/guestbook/favicon.ico deleted file mode 100644 index 1a71ea772..000000000 Binary files a/vendor/google.golang.org/appengine/demos/guestbook/favicon.ico and /dev/null differ diff --git a/vendor/google.golang.org/appengine/demos/guestbook/guestbook.go b/vendor/google.golang.org/appengine/demos/guestbook/guestbook.go deleted file mode 100644 index 906948457..000000000 --- a/vendor/google.golang.org/appengine/demos/guestbook/guestbook.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package guestbook - -import ( - "html/template" - "net/http" - "time" - - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/datastore" - "google.golang.org/appengine/log" - "google.golang.org/appengine/user" -) - -var initTime time.Time - -type Greeting struct { - Author string - Content string - Date time.Time -} - -func init() { - http.HandleFunc("/", handleMainPage) - http.HandleFunc("/sign", handleSign) -} - -// guestbookKey returns the key used for all guestbook entries. -func guestbookKey(c context.Context) *datastore.Key { - // The string "default_guestbook" here could be varied to have multiple guestbooks. - return datastore.NewKey(c, "Guestbook", "default_guestbook", 0, nil) -} - -var tpl = template.Must(template.ParseGlob("templates/*.html")) - -func handleMainPage(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { - http.Error(w, "GET requests only", http.StatusMethodNotAllowed) - return - } - if r.URL.Path != "/" { - http.NotFound(w, r) - return - } - - c := appengine.NewContext(r) - tic := time.Now() - q := datastore.NewQuery("Greeting").Ancestor(guestbookKey(c)).Order("-Date").Limit(10) - var gg []*Greeting - if _, err := q.GetAll(c, &gg); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - log.Errorf(c, "GetAll: %v", err) - return - } - log.Infof(c, "Datastore lookup took %s", time.Since(tic).String()) - log.Infof(c, "Rendering %d greetings", len(gg)) - - var email, logout, login string - if u := user.Current(c); u != nil { - logout, _ = user.LogoutURL(c, "/") - email = u.Email - } else { - login, _ = user.LoginURL(c, "/") - } - data := struct { - Greetings []*Greeting - Login, Logout, Email string - }{ - Greetings: gg, - Login: login, - Logout: logout, - Email: email, - } - w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := tpl.ExecuteTemplate(w, "guestbook.html", data); err != nil { - log.Errorf(c, "%v", err) - } -} - -func handleSign(w http.ResponseWriter, r *http.Request) { - if r.Method != "POST" { - http.Error(w, "POST requests only", http.StatusMethodNotAllowed) - return - } - c := appengine.NewContext(r) - g := &Greeting{ - Content: r.FormValue("content"), - Date: time.Now(), - } - if u := user.Current(c); u != nil { - g.Author = u.String() - } - key := datastore.NewIncompleteKey(c, "Greeting", guestbookKey(c)) - if _, err := datastore.Put(c, key, g); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - // Redirect with 303 which causes the subsequent request to use GET. - http.Redirect(w, r, "/", http.StatusSeeOther) -} diff --git a/vendor/google.golang.org/appengine/demos/guestbook/index.yaml b/vendor/google.golang.org/appengine/demos/guestbook/index.yaml deleted file mode 100644 index 315ffeb0e..000000000 --- a/vendor/google.golang.org/appengine/demos/guestbook/index.yaml +++ /dev/null @@ -1,7 +0,0 @@ -indexes: - -- kind: Greeting - ancestor: yes - properties: - - name: Date - direction: desc diff --git a/vendor/google.golang.org/appengine/demos/guestbook/templates/guestbook.html b/vendor/google.golang.org/appengine/demos/guestbook/templates/guestbook.html deleted file mode 100644 index 322b7cf63..000000000 --- a/vendor/google.golang.org/appengine/demos/guestbook/templates/guestbook.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Guestbook Demo - - -

- {{with .Email}}You are currently logged in as {{.}}.{{end}} - {{with .Login}}Sign in{{end}} - {{with .Logout}}Sign out{{end}} -

- - {{range .Greetings }} -

- {{with .Author}}{{.}}{{else}}An anonymous person{{end}} - on {{.Date.Format "3:04pm, Mon 2 Jan"}} - wrote

{{.Content}}
-

- {{end}} - -
-
-
-
- - diff --git a/vendor/google.golang.org/appengine/demos/helloworld/app.yaml b/vendor/google.golang.org/appengine/demos/helloworld/app.yaml deleted file mode 100644 index bac034b77..000000000 --- a/vendor/google.golang.org/appengine/demos/helloworld/app.yaml +++ /dev/null @@ -1,15 +0,0 @@ -application: helloworld -version: 1 -runtime: go -api_version: go1 -vm: true - -manual_scaling: - instances: 1 - -handlers: -- url: /favicon.ico - static_files: favicon.ico - upload: favicon.ico -- url: /.* - script: _go_app diff --git a/vendor/google.golang.org/appengine/demos/helloworld/favicon.ico b/vendor/google.golang.org/appengine/demos/helloworld/favicon.ico deleted file mode 100644 index f19c04d27..000000000 Binary files a/vendor/google.golang.org/appengine/demos/helloworld/favicon.ico and /dev/null differ diff --git a/vendor/google.golang.org/appengine/demos/helloworld/helloworld.go b/vendor/google.golang.org/appengine/demos/helloworld/helloworld.go deleted file mode 100644 index 232492948..000000000 --- a/vendor/google.golang.org/appengine/demos/helloworld/helloworld.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2014 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package helloworld - -import ( - "html/template" - "net/http" - "time" - - "google.golang.org/appengine" - "google.golang.org/appengine/log" -) - -var initTime = time.Now() - -func init() { - http.HandleFunc("/", handle) -} - -func handle(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/" { - http.NotFound(w, r) - return - } - - c := appengine.NewContext(r) - log.Infof(c, "Serving the front page.") - - tmpl.Execute(w, time.Since(initTime)) -} - -var tmpl = template.Must(template.New("front").Parse(` - - -

-Hello, World! 세ìƒì•„ 안녕! -

- -

-This instance has been running for {{.}}. -

- - -`)) diff --git a/vendor/google.golang.org/appengine/file/file.go b/vendor/google.golang.org/appengine/file/file.go deleted file mode 100644 index c3cd58baf..000000000 --- a/vendor/google.golang.org/appengine/file/file.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package file provides helper functions for using Google Cloud Storage. -package file - -import ( - "fmt" - - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - aipb "google.golang.org/appengine/internal/app_identity" -) - -// DefaultBucketName returns the name of this application's -// default Google Cloud Storage bucket. -func DefaultBucketName(c context.Context) (string, error) { - req := &aipb.GetDefaultGcsBucketNameRequest{} - res := &aipb.GetDefaultGcsBucketNameResponse{} - - err := internal.Call(c, "app_identity_service", "GetDefaultGcsBucketName", req, res) - if err != nil { - return "", fmt.Errorf("file: no default bucket name returned in RPC response: %v", res) - } - return res.GetDefaultGcsBucketName(), nil -} diff --git a/vendor/google.golang.org/appengine/image/image.go b/vendor/google.golang.org/appengine/image/image.go deleted file mode 100644 index 780d53e17..000000000 --- a/vendor/google.golang.org/appengine/image/image.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2012 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package image provides image services. -package image - -import ( - "fmt" - "net/url" - - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/image" -) - -type ServingURLOptions struct { - Secure bool // whether the URL should use HTTPS - - // Size must be between zero and 1600. - // If Size is non-zero, a resized version of the image is served, - // and Size is the served image's longest dimension. The aspect ratio is preserved. - // If Crop is true the image is cropped from the center instead of being resized. - Size int - Crop bool -} - -// ServingURL returns a URL that will serve an image from Blobstore. -func ServingURL(c context.Context, key appengine.BlobKey, opts *ServingURLOptions) (*url.URL, error) { - req := &pb.ImagesGetUrlBaseRequest{ - BlobKey: (*string)(&key), - } - if opts != nil && opts.Secure { - req.CreateSecureUrl = &opts.Secure - } - res := &pb.ImagesGetUrlBaseResponse{} - if err := internal.Call(c, "images", "GetUrlBase", req, res); err != nil { - return nil, err - } - - // The URL may have suffixes added to dynamically resize or crop: - // - adding "=s32" will serve the image resized to 32 pixels, preserving the aspect ratio. - // - adding "=s32-c" is the same as "=s32" except it will be cropped. - u := *res.Url - if opts != nil && opts.Size > 0 { - u += fmt.Sprintf("=s%d", opts.Size) - if opts.Crop { - u += "-c" - } - } - return url.Parse(u) -} - -// DeleteServingURL deletes the serving URL for an image. -func DeleteServingURL(c context.Context, key appengine.BlobKey) error { - req := &pb.ImagesDeleteUrlBaseRequest{ - BlobKey: (*string)(&key), - } - res := &pb.ImagesDeleteUrlBaseResponse{} - return internal.Call(c, "images", "DeleteUrlBase", req, res) -} - -func init() { - internal.RegisterErrorCodeMap("images", pb.ImagesServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/appengine/internal/aetesting/fake.go b/vendor/google.golang.org/appengine/internal/aetesting/fake.go deleted file mode 100644 index 6f5c1977f..000000000 --- a/vendor/google.golang.org/appengine/internal/aetesting/fake.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package aetesting provides utilities for testing App Engine packages. -// This is not for testing user applications. -package aetesting - -import ( - "fmt" - "reflect" - "testing" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -// FakeSingleContext returns a context whose Call invocations will be serviced -// by f, which should be a function that has two arguments of the input and output -// protocol buffer type, and one error return. -func FakeSingleContext(t *testing.T, service, method string, f interface{}) context.Context { - fv := reflect.ValueOf(f) - if fv.Kind() != reflect.Func { - t.Fatal("not a function") - } - ft := fv.Type() - if ft.NumIn() != 2 || ft.NumOut() != 1 { - t.Fatalf("f has %d in and %d out, want 2 in and 1 out", ft.NumIn(), ft.NumOut()) - } - for i := 0; i < 2; i++ { - at := ft.In(i) - if !at.Implements(protoMessageType) { - t.Fatalf("arg %d does not implement proto.Message", i) - } - } - if ft.Out(0) != errorType { - t.Fatalf("f's return is %v, want error", ft.Out(0)) - } - s := &single{ - t: t, - service: service, - method: method, - f: fv, - } - return internal.WithCallOverride(context.Background(), s.call) -} - -var ( - protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() - errorType = reflect.TypeOf((*error)(nil)).Elem() -) - -type single struct { - t *testing.T - service, method string - f reflect.Value -} - -func (s *single) call(ctx context.Context, service, method string, in, out proto.Message) error { - if service == "__go__" { - if method == "GetNamespace" { - return nil // always yield an empty namespace - } - return fmt.Errorf("Unknown API call /%s.%s", service, method) - } - if service != s.service || method != s.method { - s.t.Fatalf("Unexpected call to /%s.%s", service, method) - } - ins := []reflect.Value{ - reflect.ValueOf(in), - reflect.ValueOf(out), - } - outs := s.f.Call(ins) - if outs[0].IsNil() { - return nil - } - return outs[0].Interface().(error) -} diff --git a/vendor/google.golang.org/appengine/internal/channel/channel_service.pb.go b/vendor/google.golang.org/appengine/internal/channel/channel_service.pb.go deleted file mode 100644 index f2334eb70..000000000 --- a/vendor/google.golang.org/appengine/internal/channel/channel_service.pb.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/channel/channel_service.proto -// DO NOT EDIT! - -/* -Package channel is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/channel/channel_service.proto - -It has these top-level messages: - ChannelServiceError - CreateChannelRequest - CreateChannelResponse - SendMessageRequest -*/ -package channel - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type ChannelServiceError_ErrorCode int32 - -const ( - ChannelServiceError_OK ChannelServiceError_ErrorCode = 0 - ChannelServiceError_INTERNAL_ERROR ChannelServiceError_ErrorCode = 1 - ChannelServiceError_INVALID_CHANNEL_KEY ChannelServiceError_ErrorCode = 2 - ChannelServiceError_BAD_MESSAGE ChannelServiceError_ErrorCode = 3 - ChannelServiceError_INVALID_CHANNEL_TOKEN_DURATION ChannelServiceError_ErrorCode = 4 - ChannelServiceError_APPID_ALIAS_REQUIRED ChannelServiceError_ErrorCode = 5 -) - -var ChannelServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "INTERNAL_ERROR", - 2: "INVALID_CHANNEL_KEY", - 3: "BAD_MESSAGE", - 4: "INVALID_CHANNEL_TOKEN_DURATION", - 5: "APPID_ALIAS_REQUIRED", -} -var ChannelServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "INTERNAL_ERROR": 1, - "INVALID_CHANNEL_KEY": 2, - "BAD_MESSAGE": 3, - "INVALID_CHANNEL_TOKEN_DURATION": 4, - "APPID_ALIAS_REQUIRED": 5, -} - -func (x ChannelServiceError_ErrorCode) Enum() *ChannelServiceError_ErrorCode { - p := new(ChannelServiceError_ErrorCode) - *p = x - return p -} -func (x ChannelServiceError_ErrorCode) String() string { - return proto.EnumName(ChannelServiceError_ErrorCode_name, int32(x)) -} -func (x *ChannelServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ChannelServiceError_ErrorCode_value, data, "ChannelServiceError_ErrorCode") - if err != nil { - return err - } - *x = ChannelServiceError_ErrorCode(value) - return nil -} - -type ChannelServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *ChannelServiceError) Reset() { *m = ChannelServiceError{} } -func (m *ChannelServiceError) String() string { return proto.CompactTextString(m) } -func (*ChannelServiceError) ProtoMessage() {} - -type CreateChannelRequest struct { - ApplicationKey *string `protobuf:"bytes,1,req,name=application_key" json:"application_key,omitempty"` - DurationMinutes *int32 `protobuf:"varint,2,opt,name=duration_minutes" json:"duration_minutes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CreateChannelRequest) Reset() { *m = CreateChannelRequest{} } -func (m *CreateChannelRequest) String() string { return proto.CompactTextString(m) } -func (*CreateChannelRequest) ProtoMessage() {} - -func (m *CreateChannelRequest) GetApplicationKey() string { - if m != nil && m.ApplicationKey != nil { - return *m.ApplicationKey - } - return "" -} - -func (m *CreateChannelRequest) GetDurationMinutes() int32 { - if m != nil && m.DurationMinutes != nil { - return *m.DurationMinutes - } - return 0 -} - -type CreateChannelResponse struct { - Token *string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - DurationMinutes *int32 `protobuf:"varint,3,opt,name=duration_minutes" json:"duration_minutes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CreateChannelResponse) Reset() { *m = CreateChannelResponse{} } -func (m *CreateChannelResponse) String() string { return proto.CompactTextString(m) } -func (*CreateChannelResponse) ProtoMessage() {} - -func (m *CreateChannelResponse) GetToken() string { - if m != nil && m.Token != nil { - return *m.Token - } - return "" -} - -func (m *CreateChannelResponse) GetDurationMinutes() int32 { - if m != nil && m.DurationMinutes != nil { - return *m.DurationMinutes - } - return 0 -} - -type SendMessageRequest struct { - ApplicationKey *string `protobuf:"bytes,1,req,name=application_key" json:"application_key,omitempty"` - Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SendMessageRequest) Reset() { *m = SendMessageRequest{} } -func (m *SendMessageRequest) String() string { return proto.CompactTextString(m) } -func (*SendMessageRequest) ProtoMessage() {} - -func (m *SendMessageRequest) GetApplicationKey() string { - if m != nil && m.ApplicationKey != nil { - return *m.ApplicationKey - } - return "" -} - -func (m *SendMessageRequest) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/channel/channel_service.proto b/vendor/google.golang.org/appengine/internal/channel/channel_service.proto deleted file mode 100644 index 2b5a918ca..000000000 --- a/vendor/google.golang.org/appengine/internal/channel/channel_service.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto2"; -option go_package = "channel"; - -package appengine; - -message ChannelServiceError { - enum ErrorCode { - OK = 0; - INTERNAL_ERROR = 1; - INVALID_CHANNEL_KEY = 2; - BAD_MESSAGE = 3; - INVALID_CHANNEL_TOKEN_DURATION = 4; - APPID_ALIAS_REQUIRED = 5; - } -} - -message CreateChannelRequest { - required string application_key = 1; - optional int32 duration_minutes = 2; -} - -message CreateChannelResponse { - optional string token = 2; - optional int32 duration_minutes = 3; -} - -message SendMessageRequest { - required string application_key = 1; - required string message = 2; -} diff --git a/vendor/google.golang.org/appengine/internal/image/images_service.pb.go b/vendor/google.golang.org/appengine/internal/image/images_service.pb.go deleted file mode 100644 index 27cf17d0c..000000000 --- a/vendor/google.golang.org/appengine/internal/image/images_service.pb.go +++ /dev/null @@ -1,843 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/image/images_service.proto -// DO NOT EDIT! - -/* -Package image is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/image/images_service.proto - -It has these top-level messages: - ImagesServiceError - ImagesServiceTransform - Transform - ImageData - InputSettings - OutputSettings - ImagesTransformRequest - ImagesTransformResponse - CompositeImageOptions - ImagesCanvas - ImagesCompositeRequest - ImagesCompositeResponse - ImagesHistogramRequest - ImagesHistogram - ImagesHistogramResponse - ImagesGetUrlBaseRequest - ImagesGetUrlBaseResponse - ImagesDeleteUrlBaseRequest - ImagesDeleteUrlBaseResponse -*/ -package image - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type ImagesServiceError_ErrorCode int32 - -const ( - ImagesServiceError_UNSPECIFIED_ERROR ImagesServiceError_ErrorCode = 1 - ImagesServiceError_BAD_TRANSFORM_DATA ImagesServiceError_ErrorCode = 2 - ImagesServiceError_NOT_IMAGE ImagesServiceError_ErrorCode = 3 - ImagesServiceError_BAD_IMAGE_DATA ImagesServiceError_ErrorCode = 4 - ImagesServiceError_IMAGE_TOO_LARGE ImagesServiceError_ErrorCode = 5 - ImagesServiceError_INVALID_BLOB_KEY ImagesServiceError_ErrorCode = 6 - ImagesServiceError_ACCESS_DENIED ImagesServiceError_ErrorCode = 7 - ImagesServiceError_OBJECT_NOT_FOUND ImagesServiceError_ErrorCode = 8 -) - -var ImagesServiceError_ErrorCode_name = map[int32]string{ - 1: "UNSPECIFIED_ERROR", - 2: "BAD_TRANSFORM_DATA", - 3: "NOT_IMAGE", - 4: "BAD_IMAGE_DATA", - 5: "IMAGE_TOO_LARGE", - 6: "INVALID_BLOB_KEY", - 7: "ACCESS_DENIED", - 8: "OBJECT_NOT_FOUND", -} -var ImagesServiceError_ErrorCode_value = map[string]int32{ - "UNSPECIFIED_ERROR": 1, - "BAD_TRANSFORM_DATA": 2, - "NOT_IMAGE": 3, - "BAD_IMAGE_DATA": 4, - "IMAGE_TOO_LARGE": 5, - "INVALID_BLOB_KEY": 6, - "ACCESS_DENIED": 7, - "OBJECT_NOT_FOUND": 8, -} - -func (x ImagesServiceError_ErrorCode) Enum() *ImagesServiceError_ErrorCode { - p := new(ImagesServiceError_ErrorCode) - *p = x - return p -} -func (x ImagesServiceError_ErrorCode) String() string { - return proto.EnumName(ImagesServiceError_ErrorCode_name, int32(x)) -} -func (x *ImagesServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ImagesServiceError_ErrorCode_value, data, "ImagesServiceError_ErrorCode") - if err != nil { - return err - } - *x = ImagesServiceError_ErrorCode(value) - return nil -} - -type ImagesServiceTransform_Type int32 - -const ( - ImagesServiceTransform_RESIZE ImagesServiceTransform_Type = 1 - ImagesServiceTransform_ROTATE ImagesServiceTransform_Type = 2 - ImagesServiceTransform_HORIZONTAL_FLIP ImagesServiceTransform_Type = 3 - ImagesServiceTransform_VERTICAL_FLIP ImagesServiceTransform_Type = 4 - ImagesServiceTransform_CROP ImagesServiceTransform_Type = 5 - ImagesServiceTransform_IM_FEELING_LUCKY ImagesServiceTransform_Type = 6 -) - -var ImagesServiceTransform_Type_name = map[int32]string{ - 1: "RESIZE", - 2: "ROTATE", - 3: "HORIZONTAL_FLIP", - 4: "VERTICAL_FLIP", - 5: "CROP", - 6: "IM_FEELING_LUCKY", -} -var ImagesServiceTransform_Type_value = map[string]int32{ - "RESIZE": 1, - "ROTATE": 2, - "HORIZONTAL_FLIP": 3, - "VERTICAL_FLIP": 4, - "CROP": 5, - "IM_FEELING_LUCKY": 6, -} - -func (x ImagesServiceTransform_Type) Enum() *ImagesServiceTransform_Type { - p := new(ImagesServiceTransform_Type) - *p = x - return p -} -func (x ImagesServiceTransform_Type) String() string { - return proto.EnumName(ImagesServiceTransform_Type_name, int32(x)) -} -func (x *ImagesServiceTransform_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ImagesServiceTransform_Type_value, data, "ImagesServiceTransform_Type") - if err != nil { - return err - } - *x = ImagesServiceTransform_Type(value) - return nil -} - -type InputSettings_ORIENTATION_CORRECTION_TYPE int32 - -const ( - InputSettings_UNCHANGED_ORIENTATION InputSettings_ORIENTATION_CORRECTION_TYPE = 0 - InputSettings_CORRECT_ORIENTATION InputSettings_ORIENTATION_CORRECTION_TYPE = 1 -) - -var InputSettings_ORIENTATION_CORRECTION_TYPE_name = map[int32]string{ - 0: "UNCHANGED_ORIENTATION", - 1: "CORRECT_ORIENTATION", -} -var InputSettings_ORIENTATION_CORRECTION_TYPE_value = map[string]int32{ - "UNCHANGED_ORIENTATION": 0, - "CORRECT_ORIENTATION": 1, -} - -func (x InputSettings_ORIENTATION_CORRECTION_TYPE) Enum() *InputSettings_ORIENTATION_CORRECTION_TYPE { - p := new(InputSettings_ORIENTATION_CORRECTION_TYPE) - *p = x - return p -} -func (x InputSettings_ORIENTATION_CORRECTION_TYPE) String() string { - return proto.EnumName(InputSettings_ORIENTATION_CORRECTION_TYPE_name, int32(x)) -} -func (x *InputSettings_ORIENTATION_CORRECTION_TYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(InputSettings_ORIENTATION_CORRECTION_TYPE_value, data, "InputSettings_ORIENTATION_CORRECTION_TYPE") - if err != nil { - return err - } - *x = InputSettings_ORIENTATION_CORRECTION_TYPE(value) - return nil -} - -type OutputSettings_MIME_TYPE int32 - -const ( - OutputSettings_PNG OutputSettings_MIME_TYPE = 0 - OutputSettings_JPEG OutputSettings_MIME_TYPE = 1 - OutputSettings_WEBP OutputSettings_MIME_TYPE = 2 -) - -var OutputSettings_MIME_TYPE_name = map[int32]string{ - 0: "PNG", - 1: "JPEG", - 2: "WEBP", -} -var OutputSettings_MIME_TYPE_value = map[string]int32{ - "PNG": 0, - "JPEG": 1, - "WEBP": 2, -} - -func (x OutputSettings_MIME_TYPE) Enum() *OutputSettings_MIME_TYPE { - p := new(OutputSettings_MIME_TYPE) - *p = x - return p -} -func (x OutputSettings_MIME_TYPE) String() string { - return proto.EnumName(OutputSettings_MIME_TYPE_name, int32(x)) -} -func (x *OutputSettings_MIME_TYPE) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(OutputSettings_MIME_TYPE_value, data, "OutputSettings_MIME_TYPE") - if err != nil { - return err - } - *x = OutputSettings_MIME_TYPE(value) - return nil -} - -type CompositeImageOptions_ANCHOR int32 - -const ( - CompositeImageOptions_TOP_LEFT CompositeImageOptions_ANCHOR = 0 - CompositeImageOptions_TOP CompositeImageOptions_ANCHOR = 1 - CompositeImageOptions_TOP_RIGHT CompositeImageOptions_ANCHOR = 2 - CompositeImageOptions_LEFT CompositeImageOptions_ANCHOR = 3 - CompositeImageOptions_CENTER CompositeImageOptions_ANCHOR = 4 - CompositeImageOptions_RIGHT CompositeImageOptions_ANCHOR = 5 - CompositeImageOptions_BOTTOM_LEFT CompositeImageOptions_ANCHOR = 6 - CompositeImageOptions_BOTTOM CompositeImageOptions_ANCHOR = 7 - CompositeImageOptions_BOTTOM_RIGHT CompositeImageOptions_ANCHOR = 8 -) - -var CompositeImageOptions_ANCHOR_name = map[int32]string{ - 0: "TOP_LEFT", - 1: "TOP", - 2: "TOP_RIGHT", - 3: "LEFT", - 4: "CENTER", - 5: "RIGHT", - 6: "BOTTOM_LEFT", - 7: "BOTTOM", - 8: "BOTTOM_RIGHT", -} -var CompositeImageOptions_ANCHOR_value = map[string]int32{ - "TOP_LEFT": 0, - "TOP": 1, - "TOP_RIGHT": 2, - "LEFT": 3, - "CENTER": 4, - "RIGHT": 5, - "BOTTOM_LEFT": 6, - "BOTTOM": 7, - "BOTTOM_RIGHT": 8, -} - -func (x CompositeImageOptions_ANCHOR) Enum() *CompositeImageOptions_ANCHOR { - p := new(CompositeImageOptions_ANCHOR) - *p = x - return p -} -func (x CompositeImageOptions_ANCHOR) String() string { - return proto.EnumName(CompositeImageOptions_ANCHOR_name, int32(x)) -} -func (x *CompositeImageOptions_ANCHOR) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CompositeImageOptions_ANCHOR_value, data, "CompositeImageOptions_ANCHOR") - if err != nil { - return err - } - *x = CompositeImageOptions_ANCHOR(value) - return nil -} - -type ImagesServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesServiceError) Reset() { *m = ImagesServiceError{} } -func (m *ImagesServiceError) String() string { return proto.CompactTextString(m) } -func (*ImagesServiceError) ProtoMessage() {} - -type ImagesServiceTransform struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesServiceTransform) Reset() { *m = ImagesServiceTransform{} } -func (m *ImagesServiceTransform) String() string { return proto.CompactTextString(m) } -func (*ImagesServiceTransform) ProtoMessage() {} - -type Transform struct { - Width *int32 `protobuf:"varint,1,opt,name=width" json:"width,omitempty"` - Height *int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - CropToFit *bool `protobuf:"varint,11,opt,name=crop_to_fit,def=0" json:"crop_to_fit,omitempty"` - CropOffsetX *float32 `protobuf:"fixed32,12,opt,name=crop_offset_x,def=0.5" json:"crop_offset_x,omitempty"` - CropOffsetY *float32 `protobuf:"fixed32,13,opt,name=crop_offset_y,def=0.5" json:"crop_offset_y,omitempty"` - Rotate *int32 `protobuf:"varint,3,opt,name=rotate,def=0" json:"rotate,omitempty"` - HorizontalFlip *bool `protobuf:"varint,4,opt,name=horizontal_flip,def=0" json:"horizontal_flip,omitempty"` - VerticalFlip *bool `protobuf:"varint,5,opt,name=vertical_flip,def=0" json:"vertical_flip,omitempty"` - CropLeftX *float32 `protobuf:"fixed32,6,opt,name=crop_left_x,def=0" json:"crop_left_x,omitempty"` - CropTopY *float32 `protobuf:"fixed32,7,opt,name=crop_top_y,def=0" json:"crop_top_y,omitempty"` - CropRightX *float32 `protobuf:"fixed32,8,opt,name=crop_right_x,def=1" json:"crop_right_x,omitempty"` - CropBottomY *float32 `protobuf:"fixed32,9,opt,name=crop_bottom_y,def=1" json:"crop_bottom_y,omitempty"` - Autolevels *bool `protobuf:"varint,10,opt,name=autolevels,def=0" json:"autolevels,omitempty"` - AllowStretch *bool `protobuf:"varint,14,opt,name=allow_stretch,def=0" json:"allow_stretch,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Transform) Reset() { *m = Transform{} } -func (m *Transform) String() string { return proto.CompactTextString(m) } -func (*Transform) ProtoMessage() {} - -const Default_Transform_CropToFit bool = false -const Default_Transform_CropOffsetX float32 = 0.5 -const Default_Transform_CropOffsetY float32 = 0.5 -const Default_Transform_Rotate int32 = 0 -const Default_Transform_HorizontalFlip bool = false -const Default_Transform_VerticalFlip bool = false -const Default_Transform_CropLeftX float32 = 0 -const Default_Transform_CropTopY float32 = 0 -const Default_Transform_CropRightX float32 = 1 -const Default_Transform_CropBottomY float32 = 1 -const Default_Transform_Autolevels bool = false -const Default_Transform_AllowStretch bool = false - -func (m *Transform) GetWidth() int32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func (m *Transform) GetHeight() int32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -func (m *Transform) GetCropToFit() bool { - if m != nil && m.CropToFit != nil { - return *m.CropToFit - } - return Default_Transform_CropToFit -} - -func (m *Transform) GetCropOffsetX() float32 { - if m != nil && m.CropOffsetX != nil { - return *m.CropOffsetX - } - return Default_Transform_CropOffsetX -} - -func (m *Transform) GetCropOffsetY() float32 { - if m != nil && m.CropOffsetY != nil { - return *m.CropOffsetY - } - return Default_Transform_CropOffsetY -} - -func (m *Transform) GetRotate() int32 { - if m != nil && m.Rotate != nil { - return *m.Rotate - } - return Default_Transform_Rotate -} - -func (m *Transform) GetHorizontalFlip() bool { - if m != nil && m.HorizontalFlip != nil { - return *m.HorizontalFlip - } - return Default_Transform_HorizontalFlip -} - -func (m *Transform) GetVerticalFlip() bool { - if m != nil && m.VerticalFlip != nil { - return *m.VerticalFlip - } - return Default_Transform_VerticalFlip -} - -func (m *Transform) GetCropLeftX() float32 { - if m != nil && m.CropLeftX != nil { - return *m.CropLeftX - } - return Default_Transform_CropLeftX -} - -func (m *Transform) GetCropTopY() float32 { - if m != nil && m.CropTopY != nil { - return *m.CropTopY - } - return Default_Transform_CropTopY -} - -func (m *Transform) GetCropRightX() float32 { - if m != nil && m.CropRightX != nil { - return *m.CropRightX - } - return Default_Transform_CropRightX -} - -func (m *Transform) GetCropBottomY() float32 { - if m != nil && m.CropBottomY != nil { - return *m.CropBottomY - } - return Default_Transform_CropBottomY -} - -func (m *Transform) GetAutolevels() bool { - if m != nil && m.Autolevels != nil { - return *m.Autolevels - } - return Default_Transform_Autolevels -} - -func (m *Transform) GetAllowStretch() bool { - if m != nil && m.AllowStretch != nil { - return *m.AllowStretch - } - return Default_Transform_AllowStretch -} - -type ImageData struct { - Content []byte `protobuf:"bytes,1,req,name=content" json:"content,omitempty"` - BlobKey *string `protobuf:"bytes,2,opt,name=blob_key" json:"blob_key,omitempty"` - Width *int32 `protobuf:"varint,3,opt,name=width" json:"width,omitempty"` - Height *int32 `protobuf:"varint,4,opt,name=height" json:"height,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImageData) Reset() { *m = ImageData{} } -func (m *ImageData) String() string { return proto.CompactTextString(m) } -func (*ImageData) ProtoMessage() {} - -func (m *ImageData) GetContent() []byte { - if m != nil { - return m.Content - } - return nil -} - -func (m *ImageData) GetBlobKey() string { - if m != nil && m.BlobKey != nil { - return *m.BlobKey - } - return "" -} - -func (m *ImageData) GetWidth() int32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func (m *ImageData) GetHeight() int32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -type InputSettings struct { - CorrectExifOrientation *InputSettings_ORIENTATION_CORRECTION_TYPE `protobuf:"varint,1,opt,name=correct_exif_orientation,enum=appengine.InputSettings_ORIENTATION_CORRECTION_TYPE,def=0" json:"correct_exif_orientation,omitempty"` - ParseMetadata *bool `protobuf:"varint,2,opt,name=parse_metadata,def=0" json:"parse_metadata,omitempty"` - TransparentSubstitutionRgb *int32 `protobuf:"varint,3,opt,name=transparent_substitution_rgb" json:"transparent_substitution_rgb,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *InputSettings) Reset() { *m = InputSettings{} } -func (m *InputSettings) String() string { return proto.CompactTextString(m) } -func (*InputSettings) ProtoMessage() {} - -const Default_InputSettings_CorrectExifOrientation InputSettings_ORIENTATION_CORRECTION_TYPE = InputSettings_UNCHANGED_ORIENTATION -const Default_InputSettings_ParseMetadata bool = false - -func (m *InputSettings) GetCorrectExifOrientation() InputSettings_ORIENTATION_CORRECTION_TYPE { - if m != nil && m.CorrectExifOrientation != nil { - return *m.CorrectExifOrientation - } - return Default_InputSettings_CorrectExifOrientation -} - -func (m *InputSettings) GetParseMetadata() bool { - if m != nil && m.ParseMetadata != nil { - return *m.ParseMetadata - } - return Default_InputSettings_ParseMetadata -} - -func (m *InputSettings) GetTransparentSubstitutionRgb() int32 { - if m != nil && m.TransparentSubstitutionRgb != nil { - return *m.TransparentSubstitutionRgb - } - return 0 -} - -type OutputSettings struct { - MimeType *OutputSettings_MIME_TYPE `protobuf:"varint,1,opt,name=mime_type,enum=appengine.OutputSettings_MIME_TYPE,def=0" json:"mime_type,omitempty"` - Quality *int32 `protobuf:"varint,2,opt,name=quality" json:"quality,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *OutputSettings) Reset() { *m = OutputSettings{} } -func (m *OutputSettings) String() string { return proto.CompactTextString(m) } -func (*OutputSettings) ProtoMessage() {} - -const Default_OutputSettings_MimeType OutputSettings_MIME_TYPE = OutputSettings_PNG - -func (m *OutputSettings) GetMimeType() OutputSettings_MIME_TYPE { - if m != nil && m.MimeType != nil { - return *m.MimeType - } - return Default_OutputSettings_MimeType -} - -func (m *OutputSettings) GetQuality() int32 { - if m != nil && m.Quality != nil { - return *m.Quality - } - return 0 -} - -type ImagesTransformRequest struct { - Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"` - Transform []*Transform `protobuf:"bytes,2,rep,name=transform" json:"transform,omitempty"` - Output *OutputSettings `protobuf:"bytes,3,req,name=output" json:"output,omitempty"` - Input *InputSettings `protobuf:"bytes,4,opt,name=input" json:"input,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesTransformRequest) Reset() { *m = ImagesTransformRequest{} } -func (m *ImagesTransformRequest) String() string { return proto.CompactTextString(m) } -func (*ImagesTransformRequest) ProtoMessage() {} - -func (m *ImagesTransformRequest) GetImage() *ImageData { - if m != nil { - return m.Image - } - return nil -} - -func (m *ImagesTransformRequest) GetTransform() []*Transform { - if m != nil { - return m.Transform - } - return nil -} - -func (m *ImagesTransformRequest) GetOutput() *OutputSettings { - if m != nil { - return m.Output - } - return nil -} - -func (m *ImagesTransformRequest) GetInput() *InputSettings { - if m != nil { - return m.Input - } - return nil -} - -type ImagesTransformResponse struct { - Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"` - SourceMetadata *string `protobuf:"bytes,2,opt,name=source_metadata" json:"source_metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesTransformResponse) Reset() { *m = ImagesTransformResponse{} } -func (m *ImagesTransformResponse) String() string { return proto.CompactTextString(m) } -func (*ImagesTransformResponse) ProtoMessage() {} - -func (m *ImagesTransformResponse) GetImage() *ImageData { - if m != nil { - return m.Image - } - return nil -} - -func (m *ImagesTransformResponse) GetSourceMetadata() string { - if m != nil && m.SourceMetadata != nil { - return *m.SourceMetadata - } - return "" -} - -type CompositeImageOptions struct { - SourceIndex *int32 `protobuf:"varint,1,req,name=source_index" json:"source_index,omitempty"` - XOffset *int32 `protobuf:"varint,2,req,name=x_offset" json:"x_offset,omitempty"` - YOffset *int32 `protobuf:"varint,3,req,name=y_offset" json:"y_offset,omitempty"` - Opacity *float32 `protobuf:"fixed32,4,req,name=opacity" json:"opacity,omitempty"` - Anchor *CompositeImageOptions_ANCHOR `protobuf:"varint,5,req,name=anchor,enum=appengine.CompositeImageOptions_ANCHOR" json:"anchor,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CompositeImageOptions) Reset() { *m = CompositeImageOptions{} } -func (m *CompositeImageOptions) String() string { return proto.CompactTextString(m) } -func (*CompositeImageOptions) ProtoMessage() {} - -func (m *CompositeImageOptions) GetSourceIndex() int32 { - if m != nil && m.SourceIndex != nil { - return *m.SourceIndex - } - return 0 -} - -func (m *CompositeImageOptions) GetXOffset() int32 { - if m != nil && m.XOffset != nil { - return *m.XOffset - } - return 0 -} - -func (m *CompositeImageOptions) GetYOffset() int32 { - if m != nil && m.YOffset != nil { - return *m.YOffset - } - return 0 -} - -func (m *CompositeImageOptions) GetOpacity() float32 { - if m != nil && m.Opacity != nil { - return *m.Opacity - } - return 0 -} - -func (m *CompositeImageOptions) GetAnchor() CompositeImageOptions_ANCHOR { - if m != nil && m.Anchor != nil { - return *m.Anchor - } - return CompositeImageOptions_TOP_LEFT -} - -type ImagesCanvas struct { - Width *int32 `protobuf:"varint,1,req,name=width" json:"width,omitempty"` - Height *int32 `protobuf:"varint,2,req,name=height" json:"height,omitempty"` - Output *OutputSettings `protobuf:"bytes,3,req,name=output" json:"output,omitempty"` - Color *int32 `protobuf:"varint,4,opt,name=color,def=-1" json:"color,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesCanvas) Reset() { *m = ImagesCanvas{} } -func (m *ImagesCanvas) String() string { return proto.CompactTextString(m) } -func (*ImagesCanvas) ProtoMessage() {} - -const Default_ImagesCanvas_Color int32 = -1 - -func (m *ImagesCanvas) GetWidth() int32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func (m *ImagesCanvas) GetHeight() int32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -func (m *ImagesCanvas) GetOutput() *OutputSettings { - if m != nil { - return m.Output - } - return nil -} - -func (m *ImagesCanvas) GetColor() int32 { - if m != nil && m.Color != nil { - return *m.Color - } - return Default_ImagesCanvas_Color -} - -type ImagesCompositeRequest struct { - Image []*ImageData `protobuf:"bytes,1,rep,name=image" json:"image,omitempty"` - Options []*CompositeImageOptions `protobuf:"bytes,2,rep,name=options" json:"options,omitempty"` - Canvas *ImagesCanvas `protobuf:"bytes,3,req,name=canvas" json:"canvas,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesCompositeRequest) Reset() { *m = ImagesCompositeRequest{} } -func (m *ImagesCompositeRequest) String() string { return proto.CompactTextString(m) } -func (*ImagesCompositeRequest) ProtoMessage() {} - -func (m *ImagesCompositeRequest) GetImage() []*ImageData { - if m != nil { - return m.Image - } - return nil -} - -func (m *ImagesCompositeRequest) GetOptions() []*CompositeImageOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *ImagesCompositeRequest) GetCanvas() *ImagesCanvas { - if m != nil { - return m.Canvas - } - return nil -} - -type ImagesCompositeResponse struct { - Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesCompositeResponse) Reset() { *m = ImagesCompositeResponse{} } -func (m *ImagesCompositeResponse) String() string { return proto.CompactTextString(m) } -func (*ImagesCompositeResponse) ProtoMessage() {} - -func (m *ImagesCompositeResponse) GetImage() *ImageData { - if m != nil { - return m.Image - } - return nil -} - -type ImagesHistogramRequest struct { - Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesHistogramRequest) Reset() { *m = ImagesHistogramRequest{} } -func (m *ImagesHistogramRequest) String() string { return proto.CompactTextString(m) } -func (*ImagesHistogramRequest) ProtoMessage() {} - -func (m *ImagesHistogramRequest) GetImage() *ImageData { - if m != nil { - return m.Image - } - return nil -} - -type ImagesHistogram struct { - Red []int32 `protobuf:"varint,1,rep,name=red" json:"red,omitempty"` - Green []int32 `protobuf:"varint,2,rep,name=green" json:"green,omitempty"` - Blue []int32 `protobuf:"varint,3,rep,name=blue" json:"blue,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesHistogram) Reset() { *m = ImagesHistogram{} } -func (m *ImagesHistogram) String() string { return proto.CompactTextString(m) } -func (*ImagesHistogram) ProtoMessage() {} - -func (m *ImagesHistogram) GetRed() []int32 { - if m != nil { - return m.Red - } - return nil -} - -func (m *ImagesHistogram) GetGreen() []int32 { - if m != nil { - return m.Green - } - return nil -} - -func (m *ImagesHistogram) GetBlue() []int32 { - if m != nil { - return m.Blue - } - return nil -} - -type ImagesHistogramResponse struct { - Histogram *ImagesHistogram `protobuf:"bytes,1,req,name=histogram" json:"histogram,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesHistogramResponse) Reset() { *m = ImagesHistogramResponse{} } -func (m *ImagesHistogramResponse) String() string { return proto.CompactTextString(m) } -func (*ImagesHistogramResponse) ProtoMessage() {} - -func (m *ImagesHistogramResponse) GetHistogram() *ImagesHistogram { - if m != nil { - return m.Histogram - } - return nil -} - -type ImagesGetUrlBaseRequest struct { - BlobKey *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"` - CreateSecureUrl *bool `protobuf:"varint,2,opt,name=create_secure_url,def=0" json:"create_secure_url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesGetUrlBaseRequest) Reset() { *m = ImagesGetUrlBaseRequest{} } -func (m *ImagesGetUrlBaseRequest) String() string { return proto.CompactTextString(m) } -func (*ImagesGetUrlBaseRequest) ProtoMessage() {} - -const Default_ImagesGetUrlBaseRequest_CreateSecureUrl bool = false - -func (m *ImagesGetUrlBaseRequest) GetBlobKey() string { - if m != nil && m.BlobKey != nil { - return *m.BlobKey - } - return "" -} - -func (m *ImagesGetUrlBaseRequest) GetCreateSecureUrl() bool { - if m != nil && m.CreateSecureUrl != nil { - return *m.CreateSecureUrl - } - return Default_ImagesGetUrlBaseRequest_CreateSecureUrl -} - -type ImagesGetUrlBaseResponse struct { - Url *string `protobuf:"bytes,1,req,name=url" json:"url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesGetUrlBaseResponse) Reset() { *m = ImagesGetUrlBaseResponse{} } -func (m *ImagesGetUrlBaseResponse) String() string { return proto.CompactTextString(m) } -func (*ImagesGetUrlBaseResponse) ProtoMessage() {} - -func (m *ImagesGetUrlBaseResponse) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -type ImagesDeleteUrlBaseRequest struct { - BlobKey *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesDeleteUrlBaseRequest) Reset() { *m = ImagesDeleteUrlBaseRequest{} } -func (m *ImagesDeleteUrlBaseRequest) String() string { return proto.CompactTextString(m) } -func (*ImagesDeleteUrlBaseRequest) ProtoMessage() {} - -func (m *ImagesDeleteUrlBaseRequest) GetBlobKey() string { - if m != nil && m.BlobKey != nil { - return *m.BlobKey - } - return "" -} - -type ImagesDeleteUrlBaseResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *ImagesDeleteUrlBaseResponse) Reset() { *m = ImagesDeleteUrlBaseResponse{} } -func (m *ImagesDeleteUrlBaseResponse) String() string { return proto.CompactTextString(m) } -func (*ImagesDeleteUrlBaseResponse) ProtoMessage() {} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/image/images_service.proto b/vendor/google.golang.org/appengine/internal/image/images_service.proto deleted file mode 100644 index f0d2ed5d3..000000000 --- a/vendor/google.golang.org/appengine/internal/image/images_service.proto +++ /dev/null @@ -1,162 +0,0 @@ -syntax = "proto2"; -option go_package = "image"; - -package appengine; - -message ImagesServiceError { - enum ErrorCode { - UNSPECIFIED_ERROR = 1; - BAD_TRANSFORM_DATA = 2; - NOT_IMAGE = 3; - BAD_IMAGE_DATA = 4; - IMAGE_TOO_LARGE = 5; - INVALID_BLOB_KEY = 6; - ACCESS_DENIED = 7; - OBJECT_NOT_FOUND = 8; - } -} - -message ImagesServiceTransform { - enum Type { - RESIZE = 1; - ROTATE = 2; - HORIZONTAL_FLIP = 3; - VERTICAL_FLIP = 4; - CROP = 5; - IM_FEELING_LUCKY = 6; - } -} - -message Transform { - optional int32 width = 1; - optional int32 height = 2; - optional bool crop_to_fit = 11 [default = false]; - optional float crop_offset_x = 12 [default = 0.5]; - optional float crop_offset_y = 13 [default = 0.5]; - - optional int32 rotate = 3 [default = 0]; - - optional bool horizontal_flip = 4 [default = false]; - - optional bool vertical_flip = 5 [default = false]; - - optional float crop_left_x = 6 [default = 0.0]; - optional float crop_top_y = 7 [default = 0.0]; - optional float crop_right_x = 8 [default = 1.0]; - optional float crop_bottom_y = 9 [default = 1.0]; - - optional bool autolevels = 10 [default = false]; - - optional bool allow_stretch = 14 [default = false]; -} - -message ImageData { - required bytes content = 1 [ctype=CORD]; - optional string blob_key = 2; - - optional int32 width = 3; - optional int32 height = 4; -} - -message InputSettings { - enum ORIENTATION_CORRECTION_TYPE { - UNCHANGED_ORIENTATION = 0; - CORRECT_ORIENTATION = 1; - } - optional ORIENTATION_CORRECTION_TYPE correct_exif_orientation = 1 - [default=UNCHANGED_ORIENTATION]; - optional bool parse_metadata = 2 [default=false]; - optional int32 transparent_substitution_rgb = 3; -} - -message OutputSettings { - enum MIME_TYPE { - PNG = 0; - JPEG = 1; - WEBP = 2; - } - - optional MIME_TYPE mime_type = 1 [default=PNG]; - optional int32 quality = 2; -} - -message ImagesTransformRequest { - required ImageData image = 1; - repeated Transform transform = 2; - required OutputSettings output = 3; - optional InputSettings input = 4; -} - -message ImagesTransformResponse { - required ImageData image = 1; - optional string source_metadata = 2; -} - -message CompositeImageOptions { - required int32 source_index = 1; - required int32 x_offset = 2; - required int32 y_offset = 3; - required float opacity = 4; - - enum ANCHOR { - TOP_LEFT = 0; - TOP = 1; - TOP_RIGHT = 2; - LEFT = 3; - CENTER = 4; - RIGHT = 5; - BOTTOM_LEFT = 6; - BOTTOM = 7; - BOTTOM_RIGHT = 8; - } - - required ANCHOR anchor = 5; -} - -message ImagesCanvas { - required int32 width = 1; - required int32 height = 2; - required OutputSettings output = 3; - optional int32 color = 4 [default=-1]; -} - -message ImagesCompositeRequest { - repeated ImageData image = 1; - repeated CompositeImageOptions options = 2; - required ImagesCanvas canvas = 3; -} - -message ImagesCompositeResponse { - required ImageData image = 1; -} - -message ImagesHistogramRequest { - required ImageData image = 1; -} - -message ImagesHistogram { - repeated int32 red = 1; - repeated int32 green = 2; - repeated int32 blue = 3; -} - -message ImagesHistogramResponse { - required ImagesHistogram histogram = 1; -} - -message ImagesGetUrlBaseRequest { - required string blob_key = 1; - - optional bool create_secure_url = 2 [default = false]; -} - -message ImagesGetUrlBaseResponse { - required string url = 1; -} - -message ImagesDeleteUrlBaseRequest { - required string blob_key = 1; -} - -message ImagesDeleteUrlBaseResponse { -} diff --git a/vendor/google.golang.org/appengine/internal/mail/mail_service.pb.go b/vendor/google.golang.org/appengine/internal/mail/mail_service.pb.go deleted file mode 100644 index 06a5d51ee..000000000 --- a/vendor/google.golang.org/appengine/internal/mail/mail_service.pb.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/mail/mail_service.proto -// DO NOT EDIT! - -/* -Package mail is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/mail/mail_service.proto - -It has these top-level messages: - MailServiceError - MailAttachment - MailHeader - MailMessage -*/ -package mail - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type MailServiceError_ErrorCode int32 - -const ( - MailServiceError_OK MailServiceError_ErrorCode = 0 - MailServiceError_INTERNAL_ERROR MailServiceError_ErrorCode = 1 - MailServiceError_BAD_REQUEST MailServiceError_ErrorCode = 2 - MailServiceError_UNAUTHORIZED_SENDER MailServiceError_ErrorCode = 3 - MailServiceError_INVALID_ATTACHMENT_TYPE MailServiceError_ErrorCode = 4 - MailServiceError_INVALID_HEADER_NAME MailServiceError_ErrorCode = 5 - MailServiceError_INVALID_CONTENT_ID MailServiceError_ErrorCode = 6 -) - -var MailServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "INTERNAL_ERROR", - 2: "BAD_REQUEST", - 3: "UNAUTHORIZED_SENDER", - 4: "INVALID_ATTACHMENT_TYPE", - 5: "INVALID_HEADER_NAME", - 6: "INVALID_CONTENT_ID", -} -var MailServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "INTERNAL_ERROR": 1, - "BAD_REQUEST": 2, - "UNAUTHORIZED_SENDER": 3, - "INVALID_ATTACHMENT_TYPE": 4, - "INVALID_HEADER_NAME": 5, - "INVALID_CONTENT_ID": 6, -} - -func (x MailServiceError_ErrorCode) Enum() *MailServiceError_ErrorCode { - p := new(MailServiceError_ErrorCode) - *p = x - return p -} -func (x MailServiceError_ErrorCode) String() string { - return proto.EnumName(MailServiceError_ErrorCode_name, int32(x)) -} -func (x *MailServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MailServiceError_ErrorCode_value, data, "MailServiceError_ErrorCode") - if err != nil { - return err - } - *x = MailServiceError_ErrorCode(value) - return nil -} - -type MailServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *MailServiceError) Reset() { *m = MailServiceError{} } -func (m *MailServiceError) String() string { return proto.CompactTextString(m) } -func (*MailServiceError) ProtoMessage() {} - -type MailAttachment struct { - FileName *string `protobuf:"bytes,1,req" json:"FileName,omitempty"` - Data []byte `protobuf:"bytes,2,req" json:"Data,omitempty"` - ContentID *string `protobuf:"bytes,3,opt" json:"ContentID,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MailAttachment) Reset() { *m = MailAttachment{} } -func (m *MailAttachment) String() string { return proto.CompactTextString(m) } -func (*MailAttachment) ProtoMessage() {} - -func (m *MailAttachment) GetFileName() string { - if m != nil && m.FileName != nil { - return *m.FileName - } - return "" -} - -func (m *MailAttachment) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *MailAttachment) GetContentID() string { - if m != nil && m.ContentID != nil { - return *m.ContentID - } - return "" -} - -type MailHeader struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MailHeader) Reset() { *m = MailHeader{} } -func (m *MailHeader) String() string { return proto.CompactTextString(m) } -func (*MailHeader) ProtoMessage() {} - -func (m *MailHeader) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *MailHeader) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type MailMessage struct { - Sender *string `protobuf:"bytes,1,req" json:"Sender,omitempty"` - ReplyTo *string `protobuf:"bytes,2,opt" json:"ReplyTo,omitempty"` - To []string `protobuf:"bytes,3,rep" json:"To,omitempty"` - Cc []string `protobuf:"bytes,4,rep" json:"Cc,omitempty"` - Bcc []string `protobuf:"bytes,5,rep" json:"Bcc,omitempty"` - Subject *string `protobuf:"bytes,6,req" json:"Subject,omitempty"` - TextBody *string `protobuf:"bytes,7,opt" json:"TextBody,omitempty"` - HtmlBody *string `protobuf:"bytes,8,opt" json:"HtmlBody,omitempty"` - Attachment []*MailAttachment `protobuf:"bytes,9,rep" json:"Attachment,omitempty"` - Header []*MailHeader `protobuf:"bytes,10,rep" json:"Header,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MailMessage) Reset() { *m = MailMessage{} } -func (m *MailMessage) String() string { return proto.CompactTextString(m) } -func (*MailMessage) ProtoMessage() {} - -func (m *MailMessage) GetSender() string { - if m != nil && m.Sender != nil { - return *m.Sender - } - return "" -} - -func (m *MailMessage) GetReplyTo() string { - if m != nil && m.ReplyTo != nil { - return *m.ReplyTo - } - return "" -} - -func (m *MailMessage) GetTo() []string { - if m != nil { - return m.To - } - return nil -} - -func (m *MailMessage) GetCc() []string { - if m != nil { - return m.Cc - } - return nil -} - -func (m *MailMessage) GetBcc() []string { - if m != nil { - return m.Bcc - } - return nil -} - -func (m *MailMessage) GetSubject() string { - if m != nil && m.Subject != nil { - return *m.Subject - } - return "" -} - -func (m *MailMessage) GetTextBody() string { - if m != nil && m.TextBody != nil { - return *m.TextBody - } - return "" -} - -func (m *MailMessage) GetHtmlBody() string { - if m != nil && m.HtmlBody != nil { - return *m.HtmlBody - } - return "" -} - -func (m *MailMessage) GetAttachment() []*MailAttachment { - if m != nil { - return m.Attachment - } - return nil -} - -func (m *MailMessage) GetHeader() []*MailHeader { - if m != nil { - return m.Header - } - return nil -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/mail/mail_service.proto b/vendor/google.golang.org/appengine/internal/mail/mail_service.proto deleted file mode 100644 index 4e57b7aa5..000000000 --- a/vendor/google.golang.org/appengine/internal/mail/mail_service.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto2"; -option go_package = "mail"; - -package appengine; - -message MailServiceError { - enum ErrorCode { - OK = 0; - INTERNAL_ERROR = 1; - BAD_REQUEST = 2; - UNAUTHORIZED_SENDER = 3; - INVALID_ATTACHMENT_TYPE = 4; - INVALID_HEADER_NAME = 5; - INVALID_CONTENT_ID = 6; - } -} - -message MailAttachment { - required string FileName = 1; - required bytes Data = 2; - optional string ContentID = 3; -} - -message MailHeader { - required string name = 1; - required string value = 2; -} - -message MailMessage { - required string Sender = 1; - optional string ReplyTo = 2; - - repeated string To = 3; - repeated string Cc = 4; - repeated string Bcc = 5; - - required string Subject = 6; - - optional string TextBody = 7; - optional string HtmlBody = 8; - - repeated MailAttachment Attachment = 9; - - repeated MailHeader Header = 10; -} diff --git a/vendor/google.golang.org/appengine/internal/memcache/memcache_service.pb.go b/vendor/google.golang.org/appengine/internal/memcache/memcache_service.pb.go deleted file mode 100644 index d0d1f5f5c..000000000 --- a/vendor/google.golang.org/appengine/internal/memcache/memcache_service.pb.go +++ /dev/null @@ -1,936 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/memcache/memcache_service.proto -// DO NOT EDIT! - -/* -Package memcache is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/memcache/memcache_service.proto - -It has these top-level messages: - MemcacheServiceError - AppOverride - MemcacheGetRequest - MemcacheGetResponse - MemcacheSetRequest - MemcacheSetResponse - MemcacheDeleteRequest - MemcacheDeleteResponse - MemcacheIncrementRequest - MemcacheIncrementResponse - MemcacheBatchIncrementRequest - MemcacheBatchIncrementResponse - MemcacheFlushRequest - MemcacheFlushResponse - MemcacheStatsRequest - MergedNamespaceStats - MemcacheStatsResponse - MemcacheGrabTailRequest - MemcacheGrabTailResponse -*/ -package memcache - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type MemcacheServiceError_ErrorCode int32 - -const ( - MemcacheServiceError_OK MemcacheServiceError_ErrorCode = 0 - MemcacheServiceError_UNSPECIFIED_ERROR MemcacheServiceError_ErrorCode = 1 - MemcacheServiceError_NAMESPACE_NOT_SET MemcacheServiceError_ErrorCode = 2 - MemcacheServiceError_PERMISSION_DENIED MemcacheServiceError_ErrorCode = 3 - MemcacheServiceError_INVALID_VALUE MemcacheServiceError_ErrorCode = 6 -) - -var MemcacheServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "UNSPECIFIED_ERROR", - 2: "NAMESPACE_NOT_SET", - 3: "PERMISSION_DENIED", - 6: "INVALID_VALUE", -} -var MemcacheServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "UNSPECIFIED_ERROR": 1, - "NAMESPACE_NOT_SET": 2, - "PERMISSION_DENIED": 3, - "INVALID_VALUE": 6, -} - -func (x MemcacheServiceError_ErrorCode) Enum() *MemcacheServiceError_ErrorCode { - p := new(MemcacheServiceError_ErrorCode) - *p = x - return p -} -func (x MemcacheServiceError_ErrorCode) String() string { - return proto.EnumName(MemcacheServiceError_ErrorCode_name, int32(x)) -} -func (x *MemcacheServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MemcacheServiceError_ErrorCode_value, data, "MemcacheServiceError_ErrorCode") - if err != nil { - return err - } - *x = MemcacheServiceError_ErrorCode(value) - return nil -} - -type MemcacheSetRequest_SetPolicy int32 - -const ( - MemcacheSetRequest_SET MemcacheSetRequest_SetPolicy = 1 - MemcacheSetRequest_ADD MemcacheSetRequest_SetPolicy = 2 - MemcacheSetRequest_REPLACE MemcacheSetRequest_SetPolicy = 3 - MemcacheSetRequest_CAS MemcacheSetRequest_SetPolicy = 4 -) - -var MemcacheSetRequest_SetPolicy_name = map[int32]string{ - 1: "SET", - 2: "ADD", - 3: "REPLACE", - 4: "CAS", -} -var MemcacheSetRequest_SetPolicy_value = map[string]int32{ - "SET": 1, - "ADD": 2, - "REPLACE": 3, - "CAS": 4, -} - -func (x MemcacheSetRequest_SetPolicy) Enum() *MemcacheSetRequest_SetPolicy { - p := new(MemcacheSetRequest_SetPolicy) - *p = x - return p -} -func (x MemcacheSetRequest_SetPolicy) String() string { - return proto.EnumName(MemcacheSetRequest_SetPolicy_name, int32(x)) -} -func (x *MemcacheSetRequest_SetPolicy) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MemcacheSetRequest_SetPolicy_value, data, "MemcacheSetRequest_SetPolicy") - if err != nil { - return err - } - *x = MemcacheSetRequest_SetPolicy(value) - return nil -} - -type MemcacheSetResponse_SetStatusCode int32 - -const ( - MemcacheSetResponse_STORED MemcacheSetResponse_SetStatusCode = 1 - MemcacheSetResponse_NOT_STORED MemcacheSetResponse_SetStatusCode = 2 - MemcacheSetResponse_ERROR MemcacheSetResponse_SetStatusCode = 3 - MemcacheSetResponse_EXISTS MemcacheSetResponse_SetStatusCode = 4 -) - -var MemcacheSetResponse_SetStatusCode_name = map[int32]string{ - 1: "STORED", - 2: "NOT_STORED", - 3: "ERROR", - 4: "EXISTS", -} -var MemcacheSetResponse_SetStatusCode_value = map[string]int32{ - "STORED": 1, - "NOT_STORED": 2, - "ERROR": 3, - "EXISTS": 4, -} - -func (x MemcacheSetResponse_SetStatusCode) Enum() *MemcacheSetResponse_SetStatusCode { - p := new(MemcacheSetResponse_SetStatusCode) - *p = x - return p -} -func (x MemcacheSetResponse_SetStatusCode) String() string { - return proto.EnumName(MemcacheSetResponse_SetStatusCode_name, int32(x)) -} -func (x *MemcacheSetResponse_SetStatusCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MemcacheSetResponse_SetStatusCode_value, data, "MemcacheSetResponse_SetStatusCode") - if err != nil { - return err - } - *x = MemcacheSetResponse_SetStatusCode(value) - return nil -} - -type MemcacheDeleteResponse_DeleteStatusCode int32 - -const ( - MemcacheDeleteResponse_DELETED MemcacheDeleteResponse_DeleteStatusCode = 1 - MemcacheDeleteResponse_NOT_FOUND MemcacheDeleteResponse_DeleteStatusCode = 2 -) - -var MemcacheDeleteResponse_DeleteStatusCode_name = map[int32]string{ - 1: "DELETED", - 2: "NOT_FOUND", -} -var MemcacheDeleteResponse_DeleteStatusCode_value = map[string]int32{ - "DELETED": 1, - "NOT_FOUND": 2, -} - -func (x MemcacheDeleteResponse_DeleteStatusCode) Enum() *MemcacheDeleteResponse_DeleteStatusCode { - p := new(MemcacheDeleteResponse_DeleteStatusCode) - *p = x - return p -} -func (x MemcacheDeleteResponse_DeleteStatusCode) String() string { - return proto.EnumName(MemcacheDeleteResponse_DeleteStatusCode_name, int32(x)) -} -func (x *MemcacheDeleteResponse_DeleteStatusCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MemcacheDeleteResponse_DeleteStatusCode_value, data, "MemcacheDeleteResponse_DeleteStatusCode") - if err != nil { - return err - } - *x = MemcacheDeleteResponse_DeleteStatusCode(value) - return nil -} - -type MemcacheIncrementRequest_Direction int32 - -const ( - MemcacheIncrementRequest_INCREMENT MemcacheIncrementRequest_Direction = 1 - MemcacheIncrementRequest_DECREMENT MemcacheIncrementRequest_Direction = 2 -) - -var MemcacheIncrementRequest_Direction_name = map[int32]string{ - 1: "INCREMENT", - 2: "DECREMENT", -} -var MemcacheIncrementRequest_Direction_value = map[string]int32{ - "INCREMENT": 1, - "DECREMENT": 2, -} - -func (x MemcacheIncrementRequest_Direction) Enum() *MemcacheIncrementRequest_Direction { - p := new(MemcacheIncrementRequest_Direction) - *p = x - return p -} -func (x MemcacheIncrementRequest_Direction) String() string { - return proto.EnumName(MemcacheIncrementRequest_Direction_name, int32(x)) -} -func (x *MemcacheIncrementRequest_Direction) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MemcacheIncrementRequest_Direction_value, data, "MemcacheIncrementRequest_Direction") - if err != nil { - return err - } - *x = MemcacheIncrementRequest_Direction(value) - return nil -} - -type MemcacheIncrementResponse_IncrementStatusCode int32 - -const ( - MemcacheIncrementResponse_OK MemcacheIncrementResponse_IncrementStatusCode = 1 - MemcacheIncrementResponse_NOT_CHANGED MemcacheIncrementResponse_IncrementStatusCode = 2 - MemcacheIncrementResponse_ERROR MemcacheIncrementResponse_IncrementStatusCode = 3 -) - -var MemcacheIncrementResponse_IncrementStatusCode_name = map[int32]string{ - 1: "OK", - 2: "NOT_CHANGED", - 3: "ERROR", -} -var MemcacheIncrementResponse_IncrementStatusCode_value = map[string]int32{ - "OK": 1, - "NOT_CHANGED": 2, - "ERROR": 3, -} - -func (x MemcacheIncrementResponse_IncrementStatusCode) Enum() *MemcacheIncrementResponse_IncrementStatusCode { - p := new(MemcacheIncrementResponse_IncrementStatusCode) - *p = x - return p -} -func (x MemcacheIncrementResponse_IncrementStatusCode) String() string { - return proto.EnumName(MemcacheIncrementResponse_IncrementStatusCode_name, int32(x)) -} -func (x *MemcacheIncrementResponse_IncrementStatusCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MemcacheIncrementResponse_IncrementStatusCode_value, data, "MemcacheIncrementResponse_IncrementStatusCode") - if err != nil { - return err - } - *x = MemcacheIncrementResponse_IncrementStatusCode(value) - return nil -} - -type MemcacheServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheServiceError) Reset() { *m = MemcacheServiceError{} } -func (m *MemcacheServiceError) String() string { return proto.CompactTextString(m) } -func (*MemcacheServiceError) ProtoMessage() {} - -type AppOverride struct { - AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - NumMemcachegBackends *int32 `protobuf:"varint,2,opt,name=num_memcacheg_backends" json:"num_memcacheg_backends,omitempty"` - IgnoreShardlock *bool `protobuf:"varint,3,opt,name=ignore_shardlock" json:"ignore_shardlock,omitempty"` - MemcachePoolHint *string `protobuf:"bytes,4,opt,name=memcache_pool_hint" json:"memcache_pool_hint,omitempty"` - MemcacheShardingStrategy []byte `protobuf:"bytes,5,opt,name=memcache_sharding_strategy" json:"memcache_sharding_strategy,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AppOverride) Reset() { *m = AppOverride{} } -func (m *AppOverride) String() string { return proto.CompactTextString(m) } -func (*AppOverride) ProtoMessage() {} - -func (m *AppOverride) GetAppId() string { - if m != nil && m.AppId != nil { - return *m.AppId - } - return "" -} - -func (m *AppOverride) GetNumMemcachegBackends() int32 { - if m != nil && m.NumMemcachegBackends != nil { - return *m.NumMemcachegBackends - } - return 0 -} - -func (m *AppOverride) GetIgnoreShardlock() bool { - if m != nil && m.IgnoreShardlock != nil { - return *m.IgnoreShardlock - } - return false -} - -func (m *AppOverride) GetMemcachePoolHint() string { - if m != nil && m.MemcachePoolHint != nil { - return *m.MemcachePoolHint - } - return "" -} - -func (m *AppOverride) GetMemcacheShardingStrategy() []byte { - if m != nil { - return m.MemcacheShardingStrategy - } - return nil -} - -type MemcacheGetRequest struct { - Key [][]byte `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` - NameSpace *string `protobuf:"bytes,2,opt,name=name_space,def=" json:"name_space,omitempty"` - ForCas *bool `protobuf:"varint,4,opt,name=for_cas" json:"for_cas,omitempty"` - Override *AppOverride `protobuf:"bytes,5,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheGetRequest) Reset() { *m = MemcacheGetRequest{} } -func (m *MemcacheGetRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheGetRequest) ProtoMessage() {} - -func (m *MemcacheGetRequest) GetKey() [][]byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *MemcacheGetRequest) GetNameSpace() string { - if m != nil && m.NameSpace != nil { - return *m.NameSpace - } - return "" -} - -func (m *MemcacheGetRequest) GetForCas() bool { - if m != nil && m.ForCas != nil { - return *m.ForCas - } - return false -} - -func (m *MemcacheGetRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheGetResponse struct { - Item []*MemcacheGetResponse_Item `protobuf:"group,1,rep" json:"item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheGetResponse) Reset() { *m = MemcacheGetResponse{} } -func (m *MemcacheGetResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheGetResponse) ProtoMessage() {} - -func (m *MemcacheGetResponse) GetItem() []*MemcacheGetResponse_Item { - if m != nil { - return m.Item - } - return nil -} - -type MemcacheGetResponse_Item struct { - Key []byte `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,3,req,name=value" json:"value,omitempty"` - Flags *uint32 `protobuf:"fixed32,4,opt,name=flags" json:"flags,omitempty"` - CasId *uint64 `protobuf:"fixed64,5,opt,name=cas_id" json:"cas_id,omitempty"` - ExpiresInSeconds *int32 `protobuf:"varint,6,opt,name=expires_in_seconds" json:"expires_in_seconds,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheGetResponse_Item) Reset() { *m = MemcacheGetResponse_Item{} } -func (m *MemcacheGetResponse_Item) String() string { return proto.CompactTextString(m) } -func (*MemcacheGetResponse_Item) ProtoMessage() {} - -func (m *MemcacheGetResponse_Item) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *MemcacheGetResponse_Item) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *MemcacheGetResponse_Item) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *MemcacheGetResponse_Item) GetCasId() uint64 { - if m != nil && m.CasId != nil { - return *m.CasId - } - return 0 -} - -func (m *MemcacheGetResponse_Item) GetExpiresInSeconds() int32 { - if m != nil && m.ExpiresInSeconds != nil { - return *m.ExpiresInSeconds - } - return 0 -} - -type MemcacheSetRequest struct { - Item []*MemcacheSetRequest_Item `protobuf:"group,1,rep" json:"item,omitempty"` - NameSpace *string `protobuf:"bytes,7,opt,name=name_space,def=" json:"name_space,omitempty"` - Override *AppOverride `protobuf:"bytes,10,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheSetRequest) Reset() { *m = MemcacheSetRequest{} } -func (m *MemcacheSetRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheSetRequest) ProtoMessage() {} - -func (m *MemcacheSetRequest) GetItem() []*MemcacheSetRequest_Item { - if m != nil { - return m.Item - } - return nil -} - -func (m *MemcacheSetRequest) GetNameSpace() string { - if m != nil && m.NameSpace != nil { - return *m.NameSpace - } - return "" -} - -func (m *MemcacheSetRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheSetRequest_Item struct { - Key []byte `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,3,req,name=value" json:"value,omitempty"` - Flags *uint32 `protobuf:"fixed32,4,opt,name=flags" json:"flags,omitempty"` - SetPolicy *MemcacheSetRequest_SetPolicy `protobuf:"varint,5,opt,name=set_policy,enum=appengine.MemcacheSetRequest_SetPolicy,def=1" json:"set_policy,omitempty"` - ExpirationTime *uint32 `protobuf:"fixed32,6,opt,name=expiration_time,def=0" json:"expiration_time,omitempty"` - CasId *uint64 `protobuf:"fixed64,8,opt,name=cas_id" json:"cas_id,omitempty"` - ForCas *bool `protobuf:"varint,9,opt,name=for_cas" json:"for_cas,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheSetRequest_Item) Reset() { *m = MemcacheSetRequest_Item{} } -func (m *MemcacheSetRequest_Item) String() string { return proto.CompactTextString(m) } -func (*MemcacheSetRequest_Item) ProtoMessage() {} - -const Default_MemcacheSetRequest_Item_SetPolicy MemcacheSetRequest_SetPolicy = MemcacheSetRequest_SET -const Default_MemcacheSetRequest_Item_ExpirationTime uint32 = 0 - -func (m *MemcacheSetRequest_Item) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *MemcacheSetRequest_Item) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *MemcacheSetRequest_Item) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *MemcacheSetRequest_Item) GetSetPolicy() MemcacheSetRequest_SetPolicy { - if m != nil && m.SetPolicy != nil { - return *m.SetPolicy - } - return Default_MemcacheSetRequest_Item_SetPolicy -} - -func (m *MemcacheSetRequest_Item) GetExpirationTime() uint32 { - if m != nil && m.ExpirationTime != nil { - return *m.ExpirationTime - } - return Default_MemcacheSetRequest_Item_ExpirationTime -} - -func (m *MemcacheSetRequest_Item) GetCasId() uint64 { - if m != nil && m.CasId != nil { - return *m.CasId - } - return 0 -} - -func (m *MemcacheSetRequest_Item) GetForCas() bool { - if m != nil && m.ForCas != nil { - return *m.ForCas - } - return false -} - -type MemcacheSetResponse struct { - SetStatus []MemcacheSetResponse_SetStatusCode `protobuf:"varint,1,rep,name=set_status,enum=appengine.MemcacheSetResponse_SetStatusCode" json:"set_status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheSetResponse) Reset() { *m = MemcacheSetResponse{} } -func (m *MemcacheSetResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheSetResponse) ProtoMessage() {} - -func (m *MemcacheSetResponse) GetSetStatus() []MemcacheSetResponse_SetStatusCode { - if m != nil { - return m.SetStatus - } - return nil -} - -type MemcacheDeleteRequest struct { - Item []*MemcacheDeleteRequest_Item `protobuf:"group,1,rep" json:"item,omitempty"` - NameSpace *string `protobuf:"bytes,4,opt,name=name_space,def=" json:"name_space,omitempty"` - Override *AppOverride `protobuf:"bytes,5,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheDeleteRequest) Reset() { *m = MemcacheDeleteRequest{} } -func (m *MemcacheDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheDeleteRequest) ProtoMessage() {} - -func (m *MemcacheDeleteRequest) GetItem() []*MemcacheDeleteRequest_Item { - if m != nil { - return m.Item - } - return nil -} - -func (m *MemcacheDeleteRequest) GetNameSpace() string { - if m != nil && m.NameSpace != nil { - return *m.NameSpace - } - return "" -} - -func (m *MemcacheDeleteRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheDeleteRequest_Item struct { - Key []byte `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` - DeleteTime *uint32 `protobuf:"fixed32,3,opt,name=delete_time,def=0" json:"delete_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheDeleteRequest_Item) Reset() { *m = MemcacheDeleteRequest_Item{} } -func (m *MemcacheDeleteRequest_Item) String() string { return proto.CompactTextString(m) } -func (*MemcacheDeleteRequest_Item) ProtoMessage() {} - -const Default_MemcacheDeleteRequest_Item_DeleteTime uint32 = 0 - -func (m *MemcacheDeleteRequest_Item) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *MemcacheDeleteRequest_Item) GetDeleteTime() uint32 { - if m != nil && m.DeleteTime != nil { - return *m.DeleteTime - } - return Default_MemcacheDeleteRequest_Item_DeleteTime -} - -type MemcacheDeleteResponse struct { - DeleteStatus []MemcacheDeleteResponse_DeleteStatusCode `protobuf:"varint,1,rep,name=delete_status,enum=appengine.MemcacheDeleteResponse_DeleteStatusCode" json:"delete_status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheDeleteResponse) Reset() { *m = MemcacheDeleteResponse{} } -func (m *MemcacheDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheDeleteResponse) ProtoMessage() {} - -func (m *MemcacheDeleteResponse) GetDeleteStatus() []MemcacheDeleteResponse_DeleteStatusCode { - if m != nil { - return m.DeleteStatus - } - return nil -} - -type MemcacheIncrementRequest struct { - Key []byte `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - NameSpace *string `protobuf:"bytes,4,opt,name=name_space,def=" json:"name_space,omitempty"` - Delta *uint64 `protobuf:"varint,2,opt,name=delta,def=1" json:"delta,omitempty"` - Direction *MemcacheIncrementRequest_Direction `protobuf:"varint,3,opt,name=direction,enum=appengine.MemcacheIncrementRequest_Direction,def=1" json:"direction,omitempty"` - InitialValue *uint64 `protobuf:"varint,5,opt,name=initial_value" json:"initial_value,omitempty"` - InitialFlags *uint32 `protobuf:"fixed32,6,opt,name=initial_flags" json:"initial_flags,omitempty"` - Override *AppOverride `protobuf:"bytes,7,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheIncrementRequest) Reset() { *m = MemcacheIncrementRequest{} } -func (m *MemcacheIncrementRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheIncrementRequest) ProtoMessage() {} - -const Default_MemcacheIncrementRequest_Delta uint64 = 1 -const Default_MemcacheIncrementRequest_Direction MemcacheIncrementRequest_Direction = MemcacheIncrementRequest_INCREMENT - -func (m *MemcacheIncrementRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *MemcacheIncrementRequest) GetNameSpace() string { - if m != nil && m.NameSpace != nil { - return *m.NameSpace - } - return "" -} - -func (m *MemcacheIncrementRequest) GetDelta() uint64 { - if m != nil && m.Delta != nil { - return *m.Delta - } - return Default_MemcacheIncrementRequest_Delta -} - -func (m *MemcacheIncrementRequest) GetDirection() MemcacheIncrementRequest_Direction { - if m != nil && m.Direction != nil { - return *m.Direction - } - return Default_MemcacheIncrementRequest_Direction -} - -func (m *MemcacheIncrementRequest) GetInitialValue() uint64 { - if m != nil && m.InitialValue != nil { - return *m.InitialValue - } - return 0 -} - -func (m *MemcacheIncrementRequest) GetInitialFlags() uint32 { - if m != nil && m.InitialFlags != nil { - return *m.InitialFlags - } - return 0 -} - -func (m *MemcacheIncrementRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheIncrementResponse struct { - NewValue *uint64 `protobuf:"varint,1,opt,name=new_value" json:"new_value,omitempty"` - IncrementStatus *MemcacheIncrementResponse_IncrementStatusCode `protobuf:"varint,2,opt,name=increment_status,enum=appengine.MemcacheIncrementResponse_IncrementStatusCode" json:"increment_status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheIncrementResponse) Reset() { *m = MemcacheIncrementResponse{} } -func (m *MemcacheIncrementResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheIncrementResponse) ProtoMessage() {} - -func (m *MemcacheIncrementResponse) GetNewValue() uint64 { - if m != nil && m.NewValue != nil { - return *m.NewValue - } - return 0 -} - -func (m *MemcacheIncrementResponse) GetIncrementStatus() MemcacheIncrementResponse_IncrementStatusCode { - if m != nil && m.IncrementStatus != nil { - return *m.IncrementStatus - } - return MemcacheIncrementResponse_OK -} - -type MemcacheBatchIncrementRequest struct { - NameSpace *string `protobuf:"bytes,1,opt,name=name_space,def=" json:"name_space,omitempty"` - Item []*MemcacheIncrementRequest `protobuf:"bytes,2,rep,name=item" json:"item,omitempty"` - Override *AppOverride `protobuf:"bytes,3,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheBatchIncrementRequest) Reset() { *m = MemcacheBatchIncrementRequest{} } -func (m *MemcacheBatchIncrementRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheBatchIncrementRequest) ProtoMessage() {} - -func (m *MemcacheBatchIncrementRequest) GetNameSpace() string { - if m != nil && m.NameSpace != nil { - return *m.NameSpace - } - return "" -} - -func (m *MemcacheBatchIncrementRequest) GetItem() []*MemcacheIncrementRequest { - if m != nil { - return m.Item - } - return nil -} - -func (m *MemcacheBatchIncrementRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheBatchIncrementResponse struct { - Item []*MemcacheIncrementResponse `protobuf:"bytes,1,rep,name=item" json:"item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheBatchIncrementResponse) Reset() { *m = MemcacheBatchIncrementResponse{} } -func (m *MemcacheBatchIncrementResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheBatchIncrementResponse) ProtoMessage() {} - -func (m *MemcacheBatchIncrementResponse) GetItem() []*MemcacheIncrementResponse { - if m != nil { - return m.Item - } - return nil -} - -type MemcacheFlushRequest struct { - Override *AppOverride `protobuf:"bytes,1,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheFlushRequest) Reset() { *m = MemcacheFlushRequest{} } -func (m *MemcacheFlushRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheFlushRequest) ProtoMessage() {} - -func (m *MemcacheFlushRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheFlushResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheFlushResponse) Reset() { *m = MemcacheFlushResponse{} } -func (m *MemcacheFlushResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheFlushResponse) ProtoMessage() {} - -type MemcacheStatsRequest struct { - Override *AppOverride `protobuf:"bytes,1,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheStatsRequest) Reset() { *m = MemcacheStatsRequest{} } -func (m *MemcacheStatsRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheStatsRequest) ProtoMessage() {} - -func (m *MemcacheStatsRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MergedNamespaceStats struct { - Hits *uint64 `protobuf:"varint,1,req,name=hits" json:"hits,omitempty"` - Misses *uint64 `protobuf:"varint,2,req,name=misses" json:"misses,omitempty"` - ByteHits *uint64 `protobuf:"varint,3,req,name=byte_hits" json:"byte_hits,omitempty"` - Items *uint64 `protobuf:"varint,4,req,name=items" json:"items,omitempty"` - Bytes *uint64 `protobuf:"varint,5,req,name=bytes" json:"bytes,omitempty"` - OldestItemAge *uint32 `protobuf:"fixed32,6,req,name=oldest_item_age" json:"oldest_item_age,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MergedNamespaceStats) Reset() { *m = MergedNamespaceStats{} } -func (m *MergedNamespaceStats) String() string { return proto.CompactTextString(m) } -func (*MergedNamespaceStats) ProtoMessage() {} - -func (m *MergedNamespaceStats) GetHits() uint64 { - if m != nil && m.Hits != nil { - return *m.Hits - } - return 0 -} - -func (m *MergedNamespaceStats) GetMisses() uint64 { - if m != nil && m.Misses != nil { - return *m.Misses - } - return 0 -} - -func (m *MergedNamespaceStats) GetByteHits() uint64 { - if m != nil && m.ByteHits != nil { - return *m.ByteHits - } - return 0 -} - -func (m *MergedNamespaceStats) GetItems() uint64 { - if m != nil && m.Items != nil { - return *m.Items - } - return 0 -} - -func (m *MergedNamespaceStats) GetBytes() uint64 { - if m != nil && m.Bytes != nil { - return *m.Bytes - } - return 0 -} - -func (m *MergedNamespaceStats) GetOldestItemAge() uint32 { - if m != nil && m.OldestItemAge != nil { - return *m.OldestItemAge - } - return 0 -} - -type MemcacheStatsResponse struct { - Stats *MergedNamespaceStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheStatsResponse) Reset() { *m = MemcacheStatsResponse{} } -func (m *MemcacheStatsResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheStatsResponse) ProtoMessage() {} - -func (m *MemcacheStatsResponse) GetStats() *MergedNamespaceStats { - if m != nil { - return m.Stats - } - return nil -} - -type MemcacheGrabTailRequest struct { - ItemCount *int32 `protobuf:"varint,1,req,name=item_count" json:"item_count,omitempty"` - NameSpace *string `protobuf:"bytes,2,opt,name=name_space,def=" json:"name_space,omitempty"` - Override *AppOverride `protobuf:"bytes,3,opt,name=override" json:"override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheGrabTailRequest) Reset() { *m = MemcacheGrabTailRequest{} } -func (m *MemcacheGrabTailRequest) String() string { return proto.CompactTextString(m) } -func (*MemcacheGrabTailRequest) ProtoMessage() {} - -func (m *MemcacheGrabTailRequest) GetItemCount() int32 { - if m != nil && m.ItemCount != nil { - return *m.ItemCount - } - return 0 -} - -func (m *MemcacheGrabTailRequest) GetNameSpace() string { - if m != nil && m.NameSpace != nil { - return *m.NameSpace - } - return "" -} - -func (m *MemcacheGrabTailRequest) GetOverride() *AppOverride { - if m != nil { - return m.Override - } - return nil -} - -type MemcacheGrabTailResponse struct { - Item []*MemcacheGrabTailResponse_Item `protobuf:"group,1,rep" json:"item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheGrabTailResponse) Reset() { *m = MemcacheGrabTailResponse{} } -func (m *MemcacheGrabTailResponse) String() string { return proto.CompactTextString(m) } -func (*MemcacheGrabTailResponse) ProtoMessage() {} - -func (m *MemcacheGrabTailResponse) GetItem() []*MemcacheGrabTailResponse_Item { - if m != nil { - return m.Item - } - return nil -} - -type MemcacheGrabTailResponse_Item struct { - Value []byte `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - Flags *uint32 `protobuf:"fixed32,3,opt,name=flags" json:"flags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MemcacheGrabTailResponse_Item) Reset() { *m = MemcacheGrabTailResponse_Item{} } -func (m *MemcacheGrabTailResponse_Item) String() string { return proto.CompactTextString(m) } -func (*MemcacheGrabTailResponse_Item) ProtoMessage() {} - -func (m *MemcacheGrabTailResponse_Item) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *MemcacheGrabTailResponse_Item) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/memcache/memcache_service.proto b/vendor/google.golang.org/appengine/internal/memcache/memcache_service.proto deleted file mode 100644 index 5f0edcdc7..000000000 --- a/vendor/google.golang.org/appengine/internal/memcache/memcache_service.proto +++ /dev/null @@ -1,165 +0,0 @@ -syntax = "proto2"; -option go_package = "memcache"; - -package appengine; - -message MemcacheServiceError { - enum ErrorCode { - OK = 0; - UNSPECIFIED_ERROR = 1; - NAMESPACE_NOT_SET = 2; - PERMISSION_DENIED = 3; - INVALID_VALUE = 6; - } -} - -message AppOverride { - required string app_id = 1; - - optional int32 num_memcacheg_backends = 2 [deprecated=true]; - optional bool ignore_shardlock = 3 [deprecated=true]; - optional string memcache_pool_hint = 4 [deprecated=true]; - optional bytes memcache_sharding_strategy = 5 [deprecated=true]; -} - -message MemcacheGetRequest { - repeated bytes key = 1; - optional string name_space = 2 [default = ""]; - optional bool for_cas = 4; - optional AppOverride override = 5; -} - -message MemcacheGetResponse { - repeated group Item = 1 { - required bytes key = 2; - required bytes value = 3; - optional fixed32 flags = 4; - optional fixed64 cas_id = 5; - optional int32 expires_in_seconds = 6; - } -} - -message MemcacheSetRequest { - enum SetPolicy { - SET = 1; - ADD = 2; - REPLACE = 3; - CAS = 4; - } - repeated group Item = 1 { - required bytes key = 2; - required bytes value = 3; - - optional fixed32 flags = 4; - optional SetPolicy set_policy = 5 [default = SET]; - optional fixed32 expiration_time = 6 [default = 0]; - - optional fixed64 cas_id = 8; - optional bool for_cas = 9; - } - optional string name_space = 7 [default = ""]; - optional AppOverride override = 10; -} - -message MemcacheSetResponse { - enum SetStatusCode { - STORED = 1; - NOT_STORED = 2; - ERROR = 3; - EXISTS = 4; - } - repeated SetStatusCode set_status = 1; -} - -message MemcacheDeleteRequest { - repeated group Item = 1 { - required bytes key = 2; - optional fixed32 delete_time = 3 [default = 0]; - } - optional string name_space = 4 [default = ""]; - optional AppOverride override = 5; -} - -message MemcacheDeleteResponse { - enum DeleteStatusCode { - DELETED = 1; - NOT_FOUND = 2; - } - repeated DeleteStatusCode delete_status = 1; -} - -message MemcacheIncrementRequest { - enum Direction { - INCREMENT = 1; - DECREMENT = 2; - } - required bytes key = 1; - optional string name_space = 4 [default = ""]; - - optional uint64 delta = 2 [default = 1]; - optional Direction direction = 3 [default = INCREMENT]; - - optional uint64 initial_value = 5; - optional fixed32 initial_flags = 6; - optional AppOverride override = 7; -} - -message MemcacheIncrementResponse { - enum IncrementStatusCode { - OK = 1; - NOT_CHANGED = 2; - ERROR = 3; - } - - optional uint64 new_value = 1; - optional IncrementStatusCode increment_status = 2; -} - -message MemcacheBatchIncrementRequest { - optional string name_space = 1 [default = ""]; - repeated MemcacheIncrementRequest item = 2; - optional AppOverride override = 3; -} - -message MemcacheBatchIncrementResponse { - repeated MemcacheIncrementResponse item = 1; -} - -message MemcacheFlushRequest { - optional AppOverride override = 1; -} - -message MemcacheFlushResponse { -} - -message MemcacheStatsRequest { - optional AppOverride override = 1; -} - -message MergedNamespaceStats { - required uint64 hits = 1; - required uint64 misses = 2; - required uint64 byte_hits = 3; - - required uint64 items = 4; - required uint64 bytes = 5; - - required fixed32 oldest_item_age = 6; -} - -message MemcacheStatsResponse { - optional MergedNamespaceStats stats = 1; -} - -message MemcacheGrabTailRequest { - required int32 item_count = 1; - optional string name_space = 2 [default = ""]; - optional AppOverride override = 3; -} - -message MemcacheGrabTailResponse { - repeated group Item = 1 { - required bytes value = 2; - optional fixed32 flags = 3; - } -} diff --git a/vendor/google.golang.org/appengine/internal/search/search.pb.go b/vendor/google.golang.org/appengine/internal/search/search.pb.go deleted file mode 100644 index 16cd51eee..000000000 --- a/vendor/google.golang.org/appengine/internal/search/search.pb.go +++ /dev/null @@ -1,2059 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/search/search.proto -// DO NOT EDIT! - -/* -Package search is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/search/search.proto - -It has these top-level messages: - Scope - Entry - AccessControlList - FieldValue - Field - FieldTypes - FacetValue - Facet - Document - SearchServiceError - RequestStatus - IndexSpec - IndexMetadata - IndexDocumentParams - IndexDocumentRequest - IndexDocumentResponse - DeleteDocumentParams - DeleteDocumentRequest - DeleteDocumentResponse - ListDocumentsParams - ListDocumentsRequest - ListDocumentsResponse - ListIndexesParams - ListIndexesRequest - ListIndexesResponse - DeleteSchemaParams - DeleteSchemaRequest - DeleteSchemaResponse - SortSpec - ScorerSpec - FieldSpec - FacetRange - FacetRequestParam - FacetAutoDetectParam - FacetRequest - FacetRefine - SearchParams - SearchRequest - FacetResultValue - FacetResult - SearchResult - SearchResponse -*/ -package search - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type Scope_Type int32 - -const ( - Scope_USER_BY_CANONICAL_ID Scope_Type = 1 - Scope_USER_BY_EMAIL Scope_Type = 2 - Scope_GROUP_BY_CANONICAL_ID Scope_Type = 3 - Scope_GROUP_BY_EMAIL Scope_Type = 4 - Scope_GROUP_BY_DOMAIN Scope_Type = 5 - Scope_ALL_USERS Scope_Type = 6 - Scope_ALL_AUTHENTICATED_USERS Scope_Type = 7 -) - -var Scope_Type_name = map[int32]string{ - 1: "USER_BY_CANONICAL_ID", - 2: "USER_BY_EMAIL", - 3: "GROUP_BY_CANONICAL_ID", - 4: "GROUP_BY_EMAIL", - 5: "GROUP_BY_DOMAIN", - 6: "ALL_USERS", - 7: "ALL_AUTHENTICATED_USERS", -} -var Scope_Type_value = map[string]int32{ - "USER_BY_CANONICAL_ID": 1, - "USER_BY_EMAIL": 2, - "GROUP_BY_CANONICAL_ID": 3, - "GROUP_BY_EMAIL": 4, - "GROUP_BY_DOMAIN": 5, - "ALL_USERS": 6, - "ALL_AUTHENTICATED_USERS": 7, -} - -func (x Scope_Type) Enum() *Scope_Type { - p := new(Scope_Type) - *p = x - return p -} -func (x Scope_Type) String() string { - return proto.EnumName(Scope_Type_name, int32(x)) -} -func (x *Scope_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Scope_Type_value, data, "Scope_Type") - if err != nil { - return err - } - *x = Scope_Type(value) - return nil -} - -type Entry_Permission int32 - -const ( - Entry_READ Entry_Permission = 1 - Entry_WRITE Entry_Permission = 2 - Entry_FULL_CONTROL Entry_Permission = 3 -) - -var Entry_Permission_name = map[int32]string{ - 1: "READ", - 2: "WRITE", - 3: "FULL_CONTROL", -} -var Entry_Permission_value = map[string]int32{ - "READ": 1, - "WRITE": 2, - "FULL_CONTROL": 3, -} - -func (x Entry_Permission) Enum() *Entry_Permission { - p := new(Entry_Permission) - *p = x - return p -} -func (x Entry_Permission) String() string { - return proto.EnumName(Entry_Permission_name, int32(x)) -} -func (x *Entry_Permission) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Entry_Permission_value, data, "Entry_Permission") - if err != nil { - return err - } - *x = Entry_Permission(value) - return nil -} - -type FieldValue_ContentType int32 - -const ( - FieldValue_TEXT FieldValue_ContentType = 0 - FieldValue_HTML FieldValue_ContentType = 1 - FieldValue_ATOM FieldValue_ContentType = 2 - FieldValue_DATE FieldValue_ContentType = 3 - FieldValue_NUMBER FieldValue_ContentType = 4 - FieldValue_GEO FieldValue_ContentType = 5 -) - -var FieldValue_ContentType_name = map[int32]string{ - 0: "TEXT", - 1: "HTML", - 2: "ATOM", - 3: "DATE", - 4: "NUMBER", - 5: "GEO", -} -var FieldValue_ContentType_value = map[string]int32{ - "TEXT": 0, - "HTML": 1, - "ATOM": 2, - "DATE": 3, - "NUMBER": 4, - "GEO": 5, -} - -func (x FieldValue_ContentType) Enum() *FieldValue_ContentType { - p := new(FieldValue_ContentType) - *p = x - return p -} -func (x FieldValue_ContentType) String() string { - return proto.EnumName(FieldValue_ContentType_name, int32(x)) -} -func (x *FieldValue_ContentType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldValue_ContentType_value, data, "FieldValue_ContentType") - if err != nil { - return err - } - *x = FieldValue_ContentType(value) - return nil -} - -type FacetValue_ContentType int32 - -const ( - FacetValue_ATOM FacetValue_ContentType = 2 - FacetValue_DATE FacetValue_ContentType = 3 - FacetValue_NUMBER FacetValue_ContentType = 4 -) - -var FacetValue_ContentType_name = map[int32]string{ - 2: "ATOM", - 3: "DATE", - 4: "NUMBER", -} -var FacetValue_ContentType_value = map[string]int32{ - "ATOM": 2, - "DATE": 3, - "NUMBER": 4, -} - -func (x FacetValue_ContentType) Enum() *FacetValue_ContentType { - p := new(FacetValue_ContentType) - *p = x - return p -} -func (x FacetValue_ContentType) String() string { - return proto.EnumName(FacetValue_ContentType_name, int32(x)) -} -func (x *FacetValue_ContentType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FacetValue_ContentType_value, data, "FacetValue_ContentType") - if err != nil { - return err - } - *x = FacetValue_ContentType(value) - return nil -} - -type Document_Storage int32 - -const ( - Document_DISK Document_Storage = 0 -) - -var Document_Storage_name = map[int32]string{ - 0: "DISK", -} -var Document_Storage_value = map[string]int32{ - "DISK": 0, -} - -func (x Document_Storage) Enum() *Document_Storage { - p := new(Document_Storage) - *p = x - return p -} -func (x Document_Storage) String() string { - return proto.EnumName(Document_Storage_name, int32(x)) -} -func (x *Document_Storage) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Document_Storage_value, data, "Document_Storage") - if err != nil { - return err - } - *x = Document_Storage(value) - return nil -} - -type SearchServiceError_ErrorCode int32 - -const ( - SearchServiceError_OK SearchServiceError_ErrorCode = 0 - SearchServiceError_INVALID_REQUEST SearchServiceError_ErrorCode = 1 - SearchServiceError_TRANSIENT_ERROR SearchServiceError_ErrorCode = 2 - SearchServiceError_INTERNAL_ERROR SearchServiceError_ErrorCode = 3 - SearchServiceError_PERMISSION_DENIED SearchServiceError_ErrorCode = 4 - SearchServiceError_TIMEOUT SearchServiceError_ErrorCode = 5 - SearchServiceError_CONCURRENT_TRANSACTION SearchServiceError_ErrorCode = 6 -) - -var SearchServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "INVALID_REQUEST", - 2: "TRANSIENT_ERROR", - 3: "INTERNAL_ERROR", - 4: "PERMISSION_DENIED", - 5: "TIMEOUT", - 6: "CONCURRENT_TRANSACTION", -} -var SearchServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "INVALID_REQUEST": 1, - "TRANSIENT_ERROR": 2, - "INTERNAL_ERROR": 3, - "PERMISSION_DENIED": 4, - "TIMEOUT": 5, - "CONCURRENT_TRANSACTION": 6, -} - -func (x SearchServiceError_ErrorCode) Enum() *SearchServiceError_ErrorCode { - p := new(SearchServiceError_ErrorCode) - *p = x - return p -} -func (x SearchServiceError_ErrorCode) String() string { - return proto.EnumName(SearchServiceError_ErrorCode_name, int32(x)) -} -func (x *SearchServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(SearchServiceError_ErrorCode_value, data, "SearchServiceError_ErrorCode") - if err != nil { - return err - } - *x = SearchServiceError_ErrorCode(value) - return nil -} - -type IndexSpec_Consistency int32 - -const ( - IndexSpec_GLOBAL IndexSpec_Consistency = 0 - IndexSpec_PER_DOCUMENT IndexSpec_Consistency = 1 -) - -var IndexSpec_Consistency_name = map[int32]string{ - 0: "GLOBAL", - 1: "PER_DOCUMENT", -} -var IndexSpec_Consistency_value = map[string]int32{ - "GLOBAL": 0, - "PER_DOCUMENT": 1, -} - -func (x IndexSpec_Consistency) Enum() *IndexSpec_Consistency { - p := new(IndexSpec_Consistency) - *p = x - return p -} -func (x IndexSpec_Consistency) String() string { - return proto.EnumName(IndexSpec_Consistency_name, int32(x)) -} -func (x *IndexSpec_Consistency) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(IndexSpec_Consistency_value, data, "IndexSpec_Consistency") - if err != nil { - return err - } - *x = IndexSpec_Consistency(value) - return nil -} - -type IndexSpec_Source int32 - -const ( - IndexSpec_SEARCH IndexSpec_Source = 0 - IndexSpec_DATASTORE IndexSpec_Source = 1 - IndexSpec_CLOUD_STORAGE IndexSpec_Source = 2 -) - -var IndexSpec_Source_name = map[int32]string{ - 0: "SEARCH", - 1: "DATASTORE", - 2: "CLOUD_STORAGE", -} -var IndexSpec_Source_value = map[string]int32{ - "SEARCH": 0, - "DATASTORE": 1, - "CLOUD_STORAGE": 2, -} - -func (x IndexSpec_Source) Enum() *IndexSpec_Source { - p := new(IndexSpec_Source) - *p = x - return p -} -func (x IndexSpec_Source) String() string { - return proto.EnumName(IndexSpec_Source_name, int32(x)) -} -func (x *IndexSpec_Source) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(IndexSpec_Source_value, data, "IndexSpec_Source") - if err != nil { - return err - } - *x = IndexSpec_Source(value) - return nil -} - -type IndexSpec_Mode int32 - -const ( - IndexSpec_PRIORITY IndexSpec_Mode = 0 - IndexSpec_BACKGROUND IndexSpec_Mode = 1 -) - -var IndexSpec_Mode_name = map[int32]string{ - 0: "PRIORITY", - 1: "BACKGROUND", -} -var IndexSpec_Mode_value = map[string]int32{ - "PRIORITY": 0, - "BACKGROUND": 1, -} - -func (x IndexSpec_Mode) Enum() *IndexSpec_Mode { - p := new(IndexSpec_Mode) - *p = x - return p -} -func (x IndexSpec_Mode) String() string { - return proto.EnumName(IndexSpec_Mode_name, int32(x)) -} -func (x *IndexSpec_Mode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(IndexSpec_Mode_value, data, "IndexSpec_Mode") - if err != nil { - return err - } - *x = IndexSpec_Mode(value) - return nil -} - -type IndexDocumentParams_Freshness int32 - -const ( - IndexDocumentParams_SYNCHRONOUSLY IndexDocumentParams_Freshness = 0 - IndexDocumentParams_WHEN_CONVENIENT IndexDocumentParams_Freshness = 1 -) - -var IndexDocumentParams_Freshness_name = map[int32]string{ - 0: "SYNCHRONOUSLY", - 1: "WHEN_CONVENIENT", -} -var IndexDocumentParams_Freshness_value = map[string]int32{ - "SYNCHRONOUSLY": 0, - "WHEN_CONVENIENT": 1, -} - -func (x IndexDocumentParams_Freshness) Enum() *IndexDocumentParams_Freshness { - p := new(IndexDocumentParams_Freshness) - *p = x - return p -} -func (x IndexDocumentParams_Freshness) String() string { - return proto.EnumName(IndexDocumentParams_Freshness_name, int32(x)) -} -func (x *IndexDocumentParams_Freshness) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(IndexDocumentParams_Freshness_value, data, "IndexDocumentParams_Freshness") - if err != nil { - return err - } - *x = IndexDocumentParams_Freshness(value) - return nil -} - -type ScorerSpec_Scorer int32 - -const ( - ScorerSpec_RESCORING_MATCH_SCORER ScorerSpec_Scorer = 0 - ScorerSpec_MATCH_SCORER ScorerSpec_Scorer = 2 -) - -var ScorerSpec_Scorer_name = map[int32]string{ - 0: "RESCORING_MATCH_SCORER", - 2: "MATCH_SCORER", -} -var ScorerSpec_Scorer_value = map[string]int32{ - "RESCORING_MATCH_SCORER": 0, - "MATCH_SCORER": 2, -} - -func (x ScorerSpec_Scorer) Enum() *ScorerSpec_Scorer { - p := new(ScorerSpec_Scorer) - *p = x - return p -} -func (x ScorerSpec_Scorer) String() string { - return proto.EnumName(ScorerSpec_Scorer_name, int32(x)) -} -func (x *ScorerSpec_Scorer) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ScorerSpec_Scorer_value, data, "ScorerSpec_Scorer") - if err != nil { - return err - } - *x = ScorerSpec_Scorer(value) - return nil -} - -type SearchParams_CursorType int32 - -const ( - SearchParams_NONE SearchParams_CursorType = 0 - SearchParams_SINGLE SearchParams_CursorType = 1 - SearchParams_PER_RESULT SearchParams_CursorType = 2 -) - -var SearchParams_CursorType_name = map[int32]string{ - 0: "NONE", - 1: "SINGLE", - 2: "PER_RESULT", -} -var SearchParams_CursorType_value = map[string]int32{ - "NONE": 0, - "SINGLE": 1, - "PER_RESULT": 2, -} - -func (x SearchParams_CursorType) Enum() *SearchParams_CursorType { - p := new(SearchParams_CursorType) - *p = x - return p -} -func (x SearchParams_CursorType) String() string { - return proto.EnumName(SearchParams_CursorType_name, int32(x)) -} -func (x *SearchParams_CursorType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(SearchParams_CursorType_value, data, "SearchParams_CursorType") - if err != nil { - return err - } - *x = SearchParams_CursorType(value) - return nil -} - -type SearchParams_ParsingMode int32 - -const ( - SearchParams_STRICT SearchParams_ParsingMode = 0 - SearchParams_RELAXED SearchParams_ParsingMode = 1 -) - -var SearchParams_ParsingMode_name = map[int32]string{ - 0: "STRICT", - 1: "RELAXED", -} -var SearchParams_ParsingMode_value = map[string]int32{ - "STRICT": 0, - "RELAXED": 1, -} - -func (x SearchParams_ParsingMode) Enum() *SearchParams_ParsingMode { - p := new(SearchParams_ParsingMode) - *p = x - return p -} -func (x SearchParams_ParsingMode) String() string { - return proto.EnumName(SearchParams_ParsingMode_name, int32(x)) -} -func (x *SearchParams_ParsingMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(SearchParams_ParsingMode_value, data, "SearchParams_ParsingMode") - if err != nil { - return err - } - *x = SearchParams_ParsingMode(value) - return nil -} - -type Scope struct { - Type *Scope_Type `protobuf:"varint,1,opt,name=type,enum=search.Scope_Type" json:"type,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Scope) Reset() { *m = Scope{} } -func (m *Scope) String() string { return proto.CompactTextString(m) } -func (*Scope) ProtoMessage() {} - -func (m *Scope) GetType() Scope_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Scope_USER_BY_CANONICAL_ID -} - -func (m *Scope) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type Entry struct { - Scope *Scope `protobuf:"bytes,1,opt,name=scope" json:"scope,omitempty"` - Permission *Entry_Permission `protobuf:"varint,2,opt,name=permission,enum=search.Entry_Permission" json:"permission,omitempty"` - DisplayName *string `protobuf:"bytes,3,opt,name=display_name" json:"display_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Entry) Reset() { *m = Entry{} } -func (m *Entry) String() string { return proto.CompactTextString(m) } -func (*Entry) ProtoMessage() {} - -func (m *Entry) GetScope() *Scope { - if m != nil { - return m.Scope - } - return nil -} - -func (m *Entry) GetPermission() Entry_Permission { - if m != nil && m.Permission != nil { - return *m.Permission - } - return Entry_READ -} - -func (m *Entry) GetDisplayName() string { - if m != nil && m.DisplayName != nil { - return *m.DisplayName - } - return "" -} - -type AccessControlList struct { - Owner *string `protobuf:"bytes,1,opt,name=owner" json:"owner,omitempty"` - Entries []*Entry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AccessControlList) Reset() { *m = AccessControlList{} } -func (m *AccessControlList) String() string { return proto.CompactTextString(m) } -func (*AccessControlList) ProtoMessage() {} - -func (m *AccessControlList) GetOwner() string { - if m != nil && m.Owner != nil { - return *m.Owner - } - return "" -} - -func (m *AccessControlList) GetEntries() []*Entry { - if m != nil { - return m.Entries - } - return nil -} - -type FieldValue struct { - Type *FieldValue_ContentType `protobuf:"varint,1,opt,name=type,enum=search.FieldValue_ContentType,def=0" json:"type,omitempty"` - Language *string `protobuf:"bytes,2,opt,name=language,def=en" json:"language,omitempty"` - StringValue *string `protobuf:"bytes,3,opt,name=string_value" json:"string_value,omitempty"` - Geo *FieldValue_Geo `protobuf:"group,4,opt" json:"geo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldValue) Reset() { *m = FieldValue{} } -func (m *FieldValue) String() string { return proto.CompactTextString(m) } -func (*FieldValue) ProtoMessage() {} - -const Default_FieldValue_Type FieldValue_ContentType = FieldValue_TEXT -const Default_FieldValue_Language string = "en" - -func (m *FieldValue) GetType() FieldValue_ContentType { - if m != nil && m.Type != nil { - return *m.Type - } - return Default_FieldValue_Type -} - -func (m *FieldValue) GetLanguage() string { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_FieldValue_Language -} - -func (m *FieldValue) GetStringValue() string { - if m != nil && m.StringValue != nil { - return *m.StringValue - } - return "" -} - -func (m *FieldValue) GetGeo() *FieldValue_Geo { - if m != nil { - return m.Geo - } - return nil -} - -type FieldValue_Geo struct { - Lat *float64 `protobuf:"fixed64,5,req,name=lat" json:"lat,omitempty"` - Lng *float64 `protobuf:"fixed64,6,req,name=lng" json:"lng,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldValue_Geo) Reset() { *m = FieldValue_Geo{} } -func (m *FieldValue_Geo) String() string { return proto.CompactTextString(m) } -func (*FieldValue_Geo) ProtoMessage() {} - -func (m *FieldValue_Geo) GetLat() float64 { - if m != nil && m.Lat != nil { - return *m.Lat - } - return 0 -} - -func (m *FieldValue_Geo) GetLng() float64 { - if m != nil && m.Lng != nil { - return *m.Lng - } - return 0 -} - -type Field struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Value *FieldValue `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Field) Reset() { *m = Field{} } -func (m *Field) String() string { return proto.CompactTextString(m) } -func (*Field) ProtoMessage() {} - -func (m *Field) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Field) GetValue() *FieldValue { - if m != nil { - return m.Value - } - return nil -} - -type FieldTypes struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type []FieldValue_ContentType `protobuf:"varint,2,rep,name=type,enum=search.FieldValue_ContentType" json:"type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldTypes) Reset() { *m = FieldTypes{} } -func (m *FieldTypes) String() string { return proto.CompactTextString(m) } -func (*FieldTypes) ProtoMessage() {} - -func (m *FieldTypes) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FieldTypes) GetType() []FieldValue_ContentType { - if m != nil { - return m.Type - } - return nil -} - -type FacetValue struct { - Type *FacetValue_ContentType `protobuf:"varint,1,opt,name=type,enum=search.FacetValue_ContentType,def=2" json:"type,omitempty"` - StringValue *string `protobuf:"bytes,3,opt,name=string_value" json:"string_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetValue) Reset() { *m = FacetValue{} } -func (m *FacetValue) String() string { return proto.CompactTextString(m) } -func (*FacetValue) ProtoMessage() {} - -const Default_FacetValue_Type FacetValue_ContentType = FacetValue_ATOM - -func (m *FacetValue) GetType() FacetValue_ContentType { - if m != nil && m.Type != nil { - return *m.Type - } - return Default_FacetValue_Type -} - -func (m *FacetValue) GetStringValue() string { - if m != nil && m.StringValue != nil { - return *m.StringValue - } - return "" -} - -type Facet struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Value *FacetValue `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Facet) Reset() { *m = Facet{} } -func (m *Facet) String() string { return proto.CompactTextString(m) } -func (*Facet) ProtoMessage() {} - -func (m *Facet) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Facet) GetValue() *FacetValue { - if m != nil { - return m.Value - } - return nil -} - -type Document struct { - Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Language *string `protobuf:"bytes,2,opt,name=language,def=en" json:"language,omitempty"` - Field []*Field `protobuf:"bytes,3,rep,name=field" json:"field,omitempty"` - OrderId *int32 `protobuf:"varint,4,opt,name=order_id" json:"order_id,omitempty"` - Storage *Document_Storage `protobuf:"varint,5,opt,name=storage,enum=search.Document_Storage,def=0" json:"storage,omitempty"` - Acl *AccessControlList `protobuf:"bytes,6,opt,name=acl" json:"acl,omitempty"` - Version *int64 `protobuf:"varint,7,opt,name=version" json:"version,omitempty"` - Facet []*Facet `protobuf:"bytes,8,rep,name=facet" json:"facet,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Document) Reset() { *m = Document{} } -func (m *Document) String() string { return proto.CompactTextString(m) } -func (*Document) ProtoMessage() {} - -const Default_Document_Language string = "en" -const Default_Document_Storage Document_Storage = Document_DISK - -func (m *Document) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -func (m *Document) GetLanguage() string { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_Document_Language -} - -func (m *Document) GetField() []*Field { - if m != nil { - return m.Field - } - return nil -} - -func (m *Document) GetOrderId() int32 { - if m != nil && m.OrderId != nil { - return *m.OrderId - } - return 0 -} - -func (m *Document) GetStorage() Document_Storage { - if m != nil && m.Storage != nil { - return *m.Storage - } - return Default_Document_Storage -} - -func (m *Document) GetAcl() *AccessControlList { - if m != nil { - return m.Acl - } - return nil -} - -func (m *Document) GetVersion() int64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *Document) GetFacet() []*Facet { - if m != nil { - return m.Facet - } - return nil -} - -type SearchServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *SearchServiceError) Reset() { *m = SearchServiceError{} } -func (m *SearchServiceError) String() string { return proto.CompactTextString(m) } -func (*SearchServiceError) ProtoMessage() {} - -type RequestStatus struct { - Code *SearchServiceError_ErrorCode `protobuf:"varint,1,req,name=code,enum=search.SearchServiceError_ErrorCode" json:"code,omitempty"` - ErrorDetail *string `protobuf:"bytes,2,opt,name=error_detail" json:"error_detail,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RequestStatus) Reset() { *m = RequestStatus{} } -func (m *RequestStatus) String() string { return proto.CompactTextString(m) } -func (*RequestStatus) ProtoMessage() {} - -func (m *RequestStatus) GetCode() SearchServiceError_ErrorCode { - if m != nil && m.Code != nil { - return *m.Code - } - return SearchServiceError_OK -} - -func (m *RequestStatus) GetErrorDetail() string { - if m != nil && m.ErrorDetail != nil { - return *m.ErrorDetail - } - return "" -} - -type IndexSpec struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Consistency *IndexSpec_Consistency `protobuf:"varint,2,opt,name=consistency,enum=search.IndexSpec_Consistency,def=1" json:"consistency,omitempty"` - Namespace *string `protobuf:"bytes,3,opt,name=namespace" json:"namespace,omitempty"` - Version *int32 `protobuf:"varint,4,opt,name=version" json:"version,omitempty"` - Source *IndexSpec_Source `protobuf:"varint,5,opt,name=source,enum=search.IndexSpec_Source,def=0" json:"source,omitempty"` - Mode *IndexSpec_Mode `protobuf:"varint,6,opt,name=mode,enum=search.IndexSpec_Mode,def=0" json:"mode,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *IndexSpec) Reset() { *m = IndexSpec{} } -func (m *IndexSpec) String() string { return proto.CompactTextString(m) } -func (*IndexSpec) ProtoMessage() {} - -const Default_IndexSpec_Consistency IndexSpec_Consistency = IndexSpec_PER_DOCUMENT -const Default_IndexSpec_Source IndexSpec_Source = IndexSpec_SEARCH -const Default_IndexSpec_Mode IndexSpec_Mode = IndexSpec_PRIORITY - -func (m *IndexSpec) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *IndexSpec) GetConsistency() IndexSpec_Consistency { - if m != nil && m.Consistency != nil { - return *m.Consistency - } - return Default_IndexSpec_Consistency -} - -func (m *IndexSpec) GetNamespace() string { - if m != nil && m.Namespace != nil { - return *m.Namespace - } - return "" -} - -func (m *IndexSpec) GetVersion() int32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *IndexSpec) GetSource() IndexSpec_Source { - if m != nil && m.Source != nil { - return *m.Source - } - return Default_IndexSpec_Source -} - -func (m *IndexSpec) GetMode() IndexSpec_Mode { - if m != nil && m.Mode != nil { - return *m.Mode - } - return Default_IndexSpec_Mode -} - -type IndexMetadata struct { - IndexSpec *IndexSpec `protobuf:"bytes,1,req,name=index_spec" json:"index_spec,omitempty"` - Field []*FieldTypes `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` - Storage *IndexMetadata_Storage `protobuf:"bytes,3,opt,name=storage" json:"storage,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *IndexMetadata) Reset() { *m = IndexMetadata{} } -func (m *IndexMetadata) String() string { return proto.CompactTextString(m) } -func (*IndexMetadata) ProtoMessage() {} - -func (m *IndexMetadata) GetIndexSpec() *IndexSpec { - if m != nil { - return m.IndexSpec - } - return nil -} - -func (m *IndexMetadata) GetField() []*FieldTypes { - if m != nil { - return m.Field - } - return nil -} - -func (m *IndexMetadata) GetStorage() *IndexMetadata_Storage { - if m != nil { - return m.Storage - } - return nil -} - -type IndexMetadata_Storage struct { - AmountUsed *int64 `protobuf:"varint,1,opt,name=amount_used" json:"amount_used,omitempty"` - Limit *int64 `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *IndexMetadata_Storage) Reset() { *m = IndexMetadata_Storage{} } -func (m *IndexMetadata_Storage) String() string { return proto.CompactTextString(m) } -func (*IndexMetadata_Storage) ProtoMessage() {} - -func (m *IndexMetadata_Storage) GetAmountUsed() int64 { - if m != nil && m.AmountUsed != nil { - return *m.AmountUsed - } - return 0 -} - -func (m *IndexMetadata_Storage) GetLimit() int64 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return 0 -} - -type IndexDocumentParams struct { - Document []*Document `protobuf:"bytes,1,rep,name=document" json:"document,omitempty"` - Freshness *IndexDocumentParams_Freshness `protobuf:"varint,2,opt,name=freshness,enum=search.IndexDocumentParams_Freshness,def=0" json:"freshness,omitempty"` - IndexSpec *IndexSpec `protobuf:"bytes,3,req,name=index_spec" json:"index_spec,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *IndexDocumentParams) Reset() { *m = IndexDocumentParams{} } -func (m *IndexDocumentParams) String() string { return proto.CompactTextString(m) } -func (*IndexDocumentParams) ProtoMessage() {} - -const Default_IndexDocumentParams_Freshness IndexDocumentParams_Freshness = IndexDocumentParams_SYNCHRONOUSLY - -func (m *IndexDocumentParams) GetDocument() []*Document { - if m != nil { - return m.Document - } - return nil -} - -func (m *IndexDocumentParams) GetFreshness() IndexDocumentParams_Freshness { - if m != nil && m.Freshness != nil { - return *m.Freshness - } - return Default_IndexDocumentParams_Freshness -} - -func (m *IndexDocumentParams) GetIndexSpec() *IndexSpec { - if m != nil { - return m.IndexSpec - } - return nil -} - -type IndexDocumentRequest struct { - Params *IndexDocumentParams `protobuf:"bytes,1,req,name=params" json:"params,omitempty"` - AppId []byte `protobuf:"bytes,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *IndexDocumentRequest) Reset() { *m = IndexDocumentRequest{} } -func (m *IndexDocumentRequest) String() string { return proto.CompactTextString(m) } -func (*IndexDocumentRequest) ProtoMessage() {} - -func (m *IndexDocumentRequest) GetParams() *IndexDocumentParams { - if m != nil { - return m.Params - } - return nil -} - -func (m *IndexDocumentRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type IndexDocumentResponse struct { - Status []*RequestStatus `protobuf:"bytes,1,rep,name=status" json:"status,omitempty"` - DocId []string `protobuf:"bytes,2,rep,name=doc_id" json:"doc_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *IndexDocumentResponse) Reset() { *m = IndexDocumentResponse{} } -func (m *IndexDocumentResponse) String() string { return proto.CompactTextString(m) } -func (*IndexDocumentResponse) ProtoMessage() {} - -func (m *IndexDocumentResponse) GetStatus() []*RequestStatus { - if m != nil { - return m.Status - } - return nil -} - -func (m *IndexDocumentResponse) GetDocId() []string { - if m != nil { - return m.DocId - } - return nil -} - -type DeleteDocumentParams struct { - DocId []string `protobuf:"bytes,1,rep,name=doc_id" json:"doc_id,omitempty"` - IndexSpec *IndexSpec `protobuf:"bytes,2,req,name=index_spec" json:"index_spec,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeleteDocumentParams) Reset() { *m = DeleteDocumentParams{} } -func (m *DeleteDocumentParams) String() string { return proto.CompactTextString(m) } -func (*DeleteDocumentParams) ProtoMessage() {} - -func (m *DeleteDocumentParams) GetDocId() []string { - if m != nil { - return m.DocId - } - return nil -} - -func (m *DeleteDocumentParams) GetIndexSpec() *IndexSpec { - if m != nil { - return m.IndexSpec - } - return nil -} - -type DeleteDocumentRequest struct { - Params *DeleteDocumentParams `protobuf:"bytes,1,req,name=params" json:"params,omitempty"` - AppId []byte `protobuf:"bytes,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeleteDocumentRequest) Reset() { *m = DeleteDocumentRequest{} } -func (m *DeleteDocumentRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteDocumentRequest) ProtoMessage() {} - -func (m *DeleteDocumentRequest) GetParams() *DeleteDocumentParams { - if m != nil { - return m.Params - } - return nil -} - -func (m *DeleteDocumentRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type DeleteDocumentResponse struct { - Status []*RequestStatus `protobuf:"bytes,1,rep,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeleteDocumentResponse) Reset() { *m = DeleteDocumentResponse{} } -func (m *DeleteDocumentResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteDocumentResponse) ProtoMessage() {} - -func (m *DeleteDocumentResponse) GetStatus() []*RequestStatus { - if m != nil { - return m.Status - } - return nil -} - -type ListDocumentsParams struct { - IndexSpec *IndexSpec `protobuf:"bytes,1,req,name=index_spec" json:"index_spec,omitempty"` - StartDocId *string `protobuf:"bytes,2,opt,name=start_doc_id" json:"start_doc_id,omitempty"` - IncludeStartDoc *bool `protobuf:"varint,3,opt,name=include_start_doc,def=1" json:"include_start_doc,omitempty"` - Limit *int32 `protobuf:"varint,4,opt,name=limit,def=100" json:"limit,omitempty"` - KeysOnly *bool `protobuf:"varint,5,opt,name=keys_only" json:"keys_only,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ListDocumentsParams) Reset() { *m = ListDocumentsParams{} } -func (m *ListDocumentsParams) String() string { return proto.CompactTextString(m) } -func (*ListDocumentsParams) ProtoMessage() {} - -const Default_ListDocumentsParams_IncludeStartDoc bool = true -const Default_ListDocumentsParams_Limit int32 = 100 - -func (m *ListDocumentsParams) GetIndexSpec() *IndexSpec { - if m != nil { - return m.IndexSpec - } - return nil -} - -func (m *ListDocumentsParams) GetStartDocId() string { - if m != nil && m.StartDocId != nil { - return *m.StartDocId - } - return "" -} - -func (m *ListDocumentsParams) GetIncludeStartDoc() bool { - if m != nil && m.IncludeStartDoc != nil { - return *m.IncludeStartDoc - } - return Default_ListDocumentsParams_IncludeStartDoc -} - -func (m *ListDocumentsParams) GetLimit() int32 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return Default_ListDocumentsParams_Limit -} - -func (m *ListDocumentsParams) GetKeysOnly() bool { - if m != nil && m.KeysOnly != nil { - return *m.KeysOnly - } - return false -} - -type ListDocumentsRequest struct { - Params *ListDocumentsParams `protobuf:"bytes,1,req,name=params" json:"params,omitempty"` - AppId []byte `protobuf:"bytes,2,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ListDocumentsRequest) Reset() { *m = ListDocumentsRequest{} } -func (m *ListDocumentsRequest) String() string { return proto.CompactTextString(m) } -func (*ListDocumentsRequest) ProtoMessage() {} - -func (m *ListDocumentsRequest) GetParams() *ListDocumentsParams { - if m != nil { - return m.Params - } - return nil -} - -func (m *ListDocumentsRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type ListDocumentsResponse struct { - Status *RequestStatus `protobuf:"bytes,1,req,name=status" json:"status,omitempty"` - Document []*Document `protobuf:"bytes,2,rep,name=document" json:"document,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ListDocumentsResponse) Reset() { *m = ListDocumentsResponse{} } -func (m *ListDocumentsResponse) String() string { return proto.CompactTextString(m) } -func (*ListDocumentsResponse) ProtoMessage() {} - -func (m *ListDocumentsResponse) GetStatus() *RequestStatus { - if m != nil { - return m.Status - } - return nil -} - -func (m *ListDocumentsResponse) GetDocument() []*Document { - if m != nil { - return m.Document - } - return nil -} - -type ListIndexesParams struct { - FetchSchema *bool `protobuf:"varint,1,opt,name=fetch_schema" json:"fetch_schema,omitempty"` - Limit *int32 `protobuf:"varint,2,opt,name=limit,def=20" json:"limit,omitempty"` - Namespace *string `protobuf:"bytes,3,opt,name=namespace" json:"namespace,omitempty"` - StartIndexName *string `protobuf:"bytes,4,opt,name=start_index_name" json:"start_index_name,omitempty"` - IncludeStartIndex *bool `protobuf:"varint,5,opt,name=include_start_index,def=1" json:"include_start_index,omitempty"` - IndexNamePrefix *string `protobuf:"bytes,6,opt,name=index_name_prefix" json:"index_name_prefix,omitempty"` - Offset *int32 `protobuf:"varint,7,opt,name=offset" json:"offset,omitempty"` - Source *IndexSpec_Source `protobuf:"varint,8,opt,name=source,enum=search.IndexSpec_Source,def=0" json:"source,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ListIndexesParams) Reset() { *m = ListIndexesParams{} } -func (m *ListIndexesParams) String() string { return proto.CompactTextString(m) } -func (*ListIndexesParams) ProtoMessage() {} - -const Default_ListIndexesParams_Limit int32 = 20 -const Default_ListIndexesParams_IncludeStartIndex bool = true -const Default_ListIndexesParams_Source IndexSpec_Source = IndexSpec_SEARCH - -func (m *ListIndexesParams) GetFetchSchema() bool { - if m != nil && m.FetchSchema != nil { - return *m.FetchSchema - } - return false -} - -func (m *ListIndexesParams) GetLimit() int32 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return Default_ListIndexesParams_Limit -} - -func (m *ListIndexesParams) GetNamespace() string { - if m != nil && m.Namespace != nil { - return *m.Namespace - } - return "" -} - -func (m *ListIndexesParams) GetStartIndexName() string { - if m != nil && m.StartIndexName != nil { - return *m.StartIndexName - } - return "" -} - -func (m *ListIndexesParams) GetIncludeStartIndex() bool { - if m != nil && m.IncludeStartIndex != nil { - return *m.IncludeStartIndex - } - return Default_ListIndexesParams_IncludeStartIndex -} - -func (m *ListIndexesParams) GetIndexNamePrefix() string { - if m != nil && m.IndexNamePrefix != nil { - return *m.IndexNamePrefix - } - return "" -} - -func (m *ListIndexesParams) GetOffset() int32 { - if m != nil && m.Offset != nil { - return *m.Offset - } - return 0 -} - -func (m *ListIndexesParams) GetSource() IndexSpec_Source { - if m != nil && m.Source != nil { - return *m.Source - } - return Default_ListIndexesParams_Source -} - -type ListIndexesRequest struct { - Params *ListIndexesParams `protobuf:"bytes,1,req,name=params" json:"params,omitempty"` - AppId []byte `protobuf:"bytes,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ListIndexesRequest) Reset() { *m = ListIndexesRequest{} } -func (m *ListIndexesRequest) String() string { return proto.CompactTextString(m) } -func (*ListIndexesRequest) ProtoMessage() {} - -func (m *ListIndexesRequest) GetParams() *ListIndexesParams { - if m != nil { - return m.Params - } - return nil -} - -func (m *ListIndexesRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type ListIndexesResponse struct { - Status *RequestStatus `protobuf:"bytes,1,req,name=status" json:"status,omitempty"` - IndexMetadata []*IndexMetadata `protobuf:"bytes,2,rep,name=index_metadata" json:"index_metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ListIndexesResponse) Reset() { *m = ListIndexesResponse{} } -func (m *ListIndexesResponse) String() string { return proto.CompactTextString(m) } -func (*ListIndexesResponse) ProtoMessage() {} - -func (m *ListIndexesResponse) GetStatus() *RequestStatus { - if m != nil { - return m.Status - } - return nil -} - -func (m *ListIndexesResponse) GetIndexMetadata() []*IndexMetadata { - if m != nil { - return m.IndexMetadata - } - return nil -} - -type DeleteSchemaParams struct { - Source *IndexSpec_Source `protobuf:"varint,1,opt,name=source,enum=search.IndexSpec_Source,def=0" json:"source,omitempty"` - IndexSpec []*IndexSpec `protobuf:"bytes,2,rep,name=index_spec" json:"index_spec,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeleteSchemaParams) Reset() { *m = DeleteSchemaParams{} } -func (m *DeleteSchemaParams) String() string { return proto.CompactTextString(m) } -func (*DeleteSchemaParams) ProtoMessage() {} - -const Default_DeleteSchemaParams_Source IndexSpec_Source = IndexSpec_SEARCH - -func (m *DeleteSchemaParams) GetSource() IndexSpec_Source { - if m != nil && m.Source != nil { - return *m.Source - } - return Default_DeleteSchemaParams_Source -} - -func (m *DeleteSchemaParams) GetIndexSpec() []*IndexSpec { - if m != nil { - return m.IndexSpec - } - return nil -} - -type DeleteSchemaRequest struct { - Params *DeleteSchemaParams `protobuf:"bytes,1,req,name=params" json:"params,omitempty"` - AppId []byte `protobuf:"bytes,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeleteSchemaRequest) Reset() { *m = DeleteSchemaRequest{} } -func (m *DeleteSchemaRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteSchemaRequest) ProtoMessage() {} - -func (m *DeleteSchemaRequest) GetParams() *DeleteSchemaParams { - if m != nil { - return m.Params - } - return nil -} - -func (m *DeleteSchemaRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type DeleteSchemaResponse struct { - Status []*RequestStatus `protobuf:"bytes,1,rep,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeleteSchemaResponse) Reset() { *m = DeleteSchemaResponse{} } -func (m *DeleteSchemaResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteSchemaResponse) ProtoMessage() {} - -func (m *DeleteSchemaResponse) GetStatus() []*RequestStatus { - if m != nil { - return m.Status - } - return nil -} - -type SortSpec struct { - SortExpression *string `protobuf:"bytes,1,req,name=sort_expression" json:"sort_expression,omitempty"` - SortDescending *bool `protobuf:"varint,2,opt,name=sort_descending,def=1" json:"sort_descending,omitempty"` - DefaultValueText *string `protobuf:"bytes,4,opt,name=default_value_text" json:"default_value_text,omitempty"` - DefaultValueNumeric *float64 `protobuf:"fixed64,5,opt,name=default_value_numeric" json:"default_value_numeric,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SortSpec) Reset() { *m = SortSpec{} } -func (m *SortSpec) String() string { return proto.CompactTextString(m) } -func (*SortSpec) ProtoMessage() {} - -const Default_SortSpec_SortDescending bool = true - -func (m *SortSpec) GetSortExpression() string { - if m != nil && m.SortExpression != nil { - return *m.SortExpression - } - return "" -} - -func (m *SortSpec) GetSortDescending() bool { - if m != nil && m.SortDescending != nil { - return *m.SortDescending - } - return Default_SortSpec_SortDescending -} - -func (m *SortSpec) GetDefaultValueText() string { - if m != nil && m.DefaultValueText != nil { - return *m.DefaultValueText - } - return "" -} - -func (m *SortSpec) GetDefaultValueNumeric() float64 { - if m != nil && m.DefaultValueNumeric != nil { - return *m.DefaultValueNumeric - } - return 0 -} - -type ScorerSpec struct { - Scorer *ScorerSpec_Scorer `protobuf:"varint,1,opt,name=scorer,enum=search.ScorerSpec_Scorer,def=2" json:"scorer,omitempty"` - Limit *int32 `protobuf:"varint,2,opt,name=limit,def=1000" json:"limit,omitempty"` - MatchScorerParameters *string `protobuf:"bytes,9,opt,name=match_scorer_parameters" json:"match_scorer_parameters,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ScorerSpec) Reset() { *m = ScorerSpec{} } -func (m *ScorerSpec) String() string { return proto.CompactTextString(m) } -func (*ScorerSpec) ProtoMessage() {} - -const Default_ScorerSpec_Scorer ScorerSpec_Scorer = ScorerSpec_MATCH_SCORER -const Default_ScorerSpec_Limit int32 = 1000 - -func (m *ScorerSpec) GetScorer() ScorerSpec_Scorer { - if m != nil && m.Scorer != nil { - return *m.Scorer - } - return Default_ScorerSpec_Scorer -} - -func (m *ScorerSpec) GetLimit() int32 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return Default_ScorerSpec_Limit -} - -func (m *ScorerSpec) GetMatchScorerParameters() string { - if m != nil && m.MatchScorerParameters != nil { - return *m.MatchScorerParameters - } - return "" -} - -type FieldSpec struct { - Name []string `protobuf:"bytes,1,rep,name=name" json:"name,omitempty"` - Expression []*FieldSpec_Expression `protobuf:"group,2,rep" json:"expression,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldSpec) Reset() { *m = FieldSpec{} } -func (m *FieldSpec) String() string { return proto.CompactTextString(m) } -func (*FieldSpec) ProtoMessage() {} - -func (m *FieldSpec) GetName() []string { - if m != nil { - return m.Name - } - return nil -} - -func (m *FieldSpec) GetExpression() []*FieldSpec_Expression { - if m != nil { - return m.Expression - } - return nil -} - -type FieldSpec_Expression struct { - Name *string `protobuf:"bytes,3,req,name=name" json:"name,omitempty"` - Expression *string `protobuf:"bytes,4,req,name=expression" json:"expression,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldSpec_Expression) Reset() { *m = FieldSpec_Expression{} } -func (m *FieldSpec_Expression) String() string { return proto.CompactTextString(m) } -func (*FieldSpec_Expression) ProtoMessage() {} - -func (m *FieldSpec_Expression) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FieldSpec_Expression) GetExpression() string { - if m != nil && m.Expression != nil { - return *m.Expression - } - return "" -} - -type FacetRange struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Start *string `protobuf:"bytes,2,opt,name=start" json:"start,omitempty"` - End *string `protobuf:"bytes,3,opt,name=end" json:"end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetRange) Reset() { *m = FacetRange{} } -func (m *FacetRange) String() string { return proto.CompactTextString(m) } -func (*FacetRange) ProtoMessage() {} - -func (m *FacetRange) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FacetRange) GetStart() string { - if m != nil && m.Start != nil { - return *m.Start - } - return "" -} - -func (m *FacetRange) GetEnd() string { - if m != nil && m.End != nil { - return *m.End - } - return "" -} - -type FacetRequestParam struct { - ValueLimit *int32 `protobuf:"varint,1,opt,name=value_limit" json:"value_limit,omitempty"` - Range []*FacetRange `protobuf:"bytes,2,rep,name=range" json:"range,omitempty"` - ValueConstraint []string `protobuf:"bytes,3,rep,name=value_constraint" json:"value_constraint,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetRequestParam) Reset() { *m = FacetRequestParam{} } -func (m *FacetRequestParam) String() string { return proto.CompactTextString(m) } -func (*FacetRequestParam) ProtoMessage() {} - -func (m *FacetRequestParam) GetValueLimit() int32 { - if m != nil && m.ValueLimit != nil { - return *m.ValueLimit - } - return 0 -} - -func (m *FacetRequestParam) GetRange() []*FacetRange { - if m != nil { - return m.Range - } - return nil -} - -func (m *FacetRequestParam) GetValueConstraint() []string { - if m != nil { - return m.ValueConstraint - } - return nil -} - -type FacetAutoDetectParam struct { - ValueLimit *int32 `protobuf:"varint,1,opt,name=value_limit,def=10" json:"value_limit,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetAutoDetectParam) Reset() { *m = FacetAutoDetectParam{} } -func (m *FacetAutoDetectParam) String() string { return proto.CompactTextString(m) } -func (*FacetAutoDetectParam) ProtoMessage() {} - -const Default_FacetAutoDetectParam_ValueLimit int32 = 10 - -func (m *FacetAutoDetectParam) GetValueLimit() int32 { - if m != nil && m.ValueLimit != nil { - return *m.ValueLimit - } - return Default_FacetAutoDetectParam_ValueLimit -} - -type FacetRequest struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *FacetValue_ContentType `protobuf:"varint,2,req,name=type,enum=search.FacetValue_ContentType" json:"type,omitempty"` - Params *FacetRequestParam `protobuf:"bytes,3,opt,name=params" json:"params,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetRequest) Reset() { *m = FacetRequest{} } -func (m *FacetRequest) String() string { return proto.CompactTextString(m) } -func (*FacetRequest) ProtoMessage() {} - -func (m *FacetRequest) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FacetRequest) GetType() FacetValue_ContentType { - if m != nil && m.Type != nil { - return *m.Type - } - return FacetValue_ATOM -} - -func (m *FacetRequest) GetParams() *FacetRequestParam { - if m != nil { - return m.Params - } - return nil -} - -type FacetRefine struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *FacetValue_ContentType `protobuf:"varint,2,req,name=type,enum=search.FacetValue_ContentType" json:"type,omitempty"` - Value *string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` - Start *string `protobuf:"bytes,4,opt,name=start" json:"start,omitempty"` - End *string `protobuf:"bytes,5,opt,name=end" json:"end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetRefine) Reset() { *m = FacetRefine{} } -func (m *FacetRefine) String() string { return proto.CompactTextString(m) } -func (*FacetRefine) ProtoMessage() {} - -func (m *FacetRefine) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FacetRefine) GetType() FacetValue_ContentType { - if m != nil && m.Type != nil { - return *m.Type - } - return FacetValue_ATOM -} - -func (m *FacetRefine) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -func (m *FacetRefine) GetStart() string { - if m != nil && m.Start != nil { - return *m.Start - } - return "" -} - -func (m *FacetRefine) GetEnd() string { - if m != nil && m.End != nil { - return *m.End - } - return "" -} - -type SearchParams struct { - IndexSpec *IndexSpec `protobuf:"bytes,1,req,name=index_spec" json:"index_spec,omitempty"` - Query *string `protobuf:"bytes,2,req,name=query" json:"query,omitempty"` - Cursor *string `protobuf:"bytes,4,opt,name=cursor" json:"cursor,omitempty"` - Offset *int32 `protobuf:"varint,11,opt,name=offset" json:"offset,omitempty"` - CursorType *SearchParams_CursorType `protobuf:"varint,5,opt,name=cursor_type,enum=search.SearchParams_CursorType,def=0" json:"cursor_type,omitempty"` - Limit *int32 `protobuf:"varint,6,opt,name=limit,def=20" json:"limit,omitempty"` - MatchedCountAccuracy *int32 `protobuf:"varint,7,opt,name=matched_count_accuracy" json:"matched_count_accuracy,omitempty"` - SortSpec []*SortSpec `protobuf:"bytes,8,rep,name=sort_spec" json:"sort_spec,omitempty"` - ScorerSpec *ScorerSpec `protobuf:"bytes,9,opt,name=scorer_spec" json:"scorer_spec,omitempty"` - FieldSpec *FieldSpec `protobuf:"bytes,10,opt,name=field_spec" json:"field_spec,omitempty"` - KeysOnly *bool `protobuf:"varint,12,opt,name=keys_only" json:"keys_only,omitempty"` - ParsingMode *SearchParams_ParsingMode `protobuf:"varint,13,opt,name=parsing_mode,enum=search.SearchParams_ParsingMode,def=0" json:"parsing_mode,omitempty"` - AutoDiscoverFacetCount *int32 `protobuf:"varint,15,opt,name=auto_discover_facet_count,def=0" json:"auto_discover_facet_count,omitempty"` - IncludeFacet []*FacetRequest `protobuf:"bytes,16,rep,name=include_facet" json:"include_facet,omitempty"` - FacetRefine []*FacetRefine `protobuf:"bytes,17,rep,name=facet_refine" json:"facet_refine,omitempty"` - FacetAutoDetectParam *FacetAutoDetectParam `protobuf:"bytes,18,opt,name=facet_auto_detect_param" json:"facet_auto_detect_param,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SearchParams) Reset() { *m = SearchParams{} } -func (m *SearchParams) String() string { return proto.CompactTextString(m) } -func (*SearchParams) ProtoMessage() {} - -const Default_SearchParams_CursorType SearchParams_CursorType = SearchParams_NONE -const Default_SearchParams_Limit int32 = 20 -const Default_SearchParams_ParsingMode SearchParams_ParsingMode = SearchParams_STRICT -const Default_SearchParams_AutoDiscoverFacetCount int32 = 0 - -func (m *SearchParams) GetIndexSpec() *IndexSpec { - if m != nil { - return m.IndexSpec - } - return nil -} - -func (m *SearchParams) GetQuery() string { - if m != nil && m.Query != nil { - return *m.Query - } - return "" -} - -func (m *SearchParams) GetCursor() string { - if m != nil && m.Cursor != nil { - return *m.Cursor - } - return "" -} - -func (m *SearchParams) GetOffset() int32 { - if m != nil && m.Offset != nil { - return *m.Offset - } - return 0 -} - -func (m *SearchParams) GetCursorType() SearchParams_CursorType { - if m != nil && m.CursorType != nil { - return *m.CursorType - } - return Default_SearchParams_CursorType -} - -func (m *SearchParams) GetLimit() int32 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return Default_SearchParams_Limit -} - -func (m *SearchParams) GetMatchedCountAccuracy() int32 { - if m != nil && m.MatchedCountAccuracy != nil { - return *m.MatchedCountAccuracy - } - return 0 -} - -func (m *SearchParams) GetSortSpec() []*SortSpec { - if m != nil { - return m.SortSpec - } - return nil -} - -func (m *SearchParams) GetScorerSpec() *ScorerSpec { - if m != nil { - return m.ScorerSpec - } - return nil -} - -func (m *SearchParams) GetFieldSpec() *FieldSpec { - if m != nil { - return m.FieldSpec - } - return nil -} - -func (m *SearchParams) GetKeysOnly() bool { - if m != nil && m.KeysOnly != nil { - return *m.KeysOnly - } - return false -} - -func (m *SearchParams) GetParsingMode() SearchParams_ParsingMode { - if m != nil && m.ParsingMode != nil { - return *m.ParsingMode - } - return Default_SearchParams_ParsingMode -} - -func (m *SearchParams) GetAutoDiscoverFacetCount() int32 { - if m != nil && m.AutoDiscoverFacetCount != nil { - return *m.AutoDiscoverFacetCount - } - return Default_SearchParams_AutoDiscoverFacetCount -} - -func (m *SearchParams) GetIncludeFacet() []*FacetRequest { - if m != nil { - return m.IncludeFacet - } - return nil -} - -func (m *SearchParams) GetFacetRefine() []*FacetRefine { - if m != nil { - return m.FacetRefine - } - return nil -} - -func (m *SearchParams) GetFacetAutoDetectParam() *FacetAutoDetectParam { - if m != nil { - return m.FacetAutoDetectParam - } - return nil -} - -type SearchRequest struct { - Params *SearchParams `protobuf:"bytes,1,req,name=params" json:"params,omitempty"` - AppId []byte `protobuf:"bytes,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SearchRequest) Reset() { *m = SearchRequest{} } -func (m *SearchRequest) String() string { return proto.CompactTextString(m) } -func (*SearchRequest) ProtoMessage() {} - -func (m *SearchRequest) GetParams() *SearchParams { - if m != nil { - return m.Params - } - return nil -} - -func (m *SearchRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type FacetResultValue struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Count *int32 `protobuf:"varint,2,req,name=count" json:"count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetResultValue) Reset() { *m = FacetResultValue{} } -func (m *FacetResultValue) String() string { return proto.CompactTextString(m) } -func (*FacetResultValue) ProtoMessage() {} - -func (m *FacetResultValue) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FacetResultValue) GetCount() int32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -type FacetResult struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *FacetValue_ContentType `protobuf:"varint,2,req,name=type,enum=search.FacetValue_ContentType" json:"type,omitempty"` - Value []*FacetResultValue `protobuf:"bytes,3,rep,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FacetResult) Reset() { *m = FacetResult{} } -func (m *FacetResult) String() string { return proto.CompactTextString(m) } -func (*FacetResult) ProtoMessage() {} - -func (m *FacetResult) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FacetResult) GetType() FacetValue_ContentType { - if m != nil && m.Type != nil { - return *m.Type - } - return FacetValue_ATOM -} - -func (m *FacetResult) GetValue() []*FacetResultValue { - if m != nil { - return m.Value - } - return nil -} - -type SearchResult struct { - Document *Document `protobuf:"bytes,1,req,name=document" json:"document,omitempty"` - Expression []*Field `protobuf:"bytes,4,rep,name=expression" json:"expression,omitempty"` - Score []float64 `protobuf:"fixed64,2,rep,name=score" json:"score,omitempty"` - Cursor *string `protobuf:"bytes,3,opt,name=cursor" json:"cursor,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SearchResult) Reset() { *m = SearchResult{} } -func (m *SearchResult) String() string { return proto.CompactTextString(m) } -func (*SearchResult) ProtoMessage() {} - -func (m *SearchResult) GetDocument() *Document { - if m != nil { - return m.Document - } - return nil -} - -func (m *SearchResult) GetExpression() []*Field { - if m != nil { - return m.Expression - } - return nil -} - -func (m *SearchResult) GetScore() []float64 { - if m != nil { - return m.Score - } - return nil -} - -func (m *SearchResult) GetCursor() string { - if m != nil && m.Cursor != nil { - return *m.Cursor - } - return "" -} - -type SearchResponse struct { - Result []*SearchResult `protobuf:"bytes,1,rep,name=result" json:"result,omitempty"` - MatchedCount *int64 `protobuf:"varint,2,req,name=matched_count" json:"matched_count,omitempty"` - Status *RequestStatus `protobuf:"bytes,3,req,name=status" json:"status,omitempty"` - Cursor *string `protobuf:"bytes,4,opt,name=cursor" json:"cursor,omitempty"` - FacetResult []*FacetResult `protobuf:"bytes,5,rep,name=facet_result" json:"facet_result,omitempty"` - XXX_extensions map[int32]proto.Extension `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SearchResponse) Reset() { *m = SearchResponse{} } -func (m *SearchResponse) String() string { return proto.CompactTextString(m) } -func (*SearchResponse) ProtoMessage() {} - -var extRange_SearchResponse = []proto.ExtensionRange{ - {1000, 9999}, -} - -func (*SearchResponse) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_SearchResponse -} -func (m *SearchResponse) ExtensionMap() map[int32]proto.Extension { - if m.XXX_extensions == nil { - m.XXX_extensions = make(map[int32]proto.Extension) - } - return m.XXX_extensions -} - -func (m *SearchResponse) GetResult() []*SearchResult { - if m != nil { - return m.Result - } - return nil -} - -func (m *SearchResponse) GetMatchedCount() int64 { - if m != nil && m.MatchedCount != nil { - return *m.MatchedCount - } - return 0 -} - -func (m *SearchResponse) GetStatus() *RequestStatus { - if m != nil { - return m.Status - } - return nil -} - -func (m *SearchResponse) GetCursor() string { - if m != nil && m.Cursor != nil { - return *m.Cursor - } - return "" -} - -func (m *SearchResponse) GetFacetResult() []*FacetResult { - if m != nil { - return m.FacetResult - } - return nil -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/search/search.proto b/vendor/google.golang.org/appengine/internal/search/search.proto deleted file mode 100644 index 629984137..000000000 --- a/vendor/google.golang.org/appengine/internal/search/search.proto +++ /dev/null @@ -1,376 +0,0 @@ -syntax = "proto2"; -option go_package = "search"; - -package search; - -message Scope { - enum Type { - USER_BY_CANONICAL_ID = 1; - USER_BY_EMAIL = 2; - GROUP_BY_CANONICAL_ID = 3; - GROUP_BY_EMAIL = 4; - GROUP_BY_DOMAIN = 5; - ALL_USERS = 6; - ALL_AUTHENTICATED_USERS = 7; - } - - optional Type type = 1; - optional string value = 2; -} - -message Entry { - enum Permission { - READ = 1; - WRITE = 2; - FULL_CONTROL = 3; - } - - optional Scope scope = 1; - optional Permission permission = 2; - optional string display_name = 3; -} - -message AccessControlList { - optional string owner = 1; - repeated Entry entries = 2; -} - -message FieldValue { - enum ContentType { - TEXT = 0; - HTML = 1; - ATOM = 2; - DATE = 3; - NUMBER = 4; - GEO = 5; - } - - optional ContentType type = 1 [default = TEXT]; - - optional string language = 2 [default = "en"]; - - optional string string_value = 3; - - optional group Geo = 4 { - required double lat = 5; - required double lng = 6; - } -} - -message Field { - required string name = 1; - required FieldValue value = 2; -} - -message FieldTypes { - required string name = 1; - repeated FieldValue.ContentType type = 2; -} - -message FacetValue { - enum ContentType { - ATOM = 2; - DATE = 3; - NUMBER = 4; - } - - optional ContentType type = 1 [default = ATOM]; - optional string string_value = 3; -} - -message Facet { - required string name = 1; - required FacetValue value = 2; -} - - -message Document { - optional string id = 1; - optional string language = 2 [default = "en"]; - repeated Field field = 3; - optional int32 order_id = 4; - - enum Storage { - DISK = 0; - } - - optional Storage storage = 5 [default = DISK]; - optional AccessControlList acl = 6; - optional int64 version = 7; - repeated Facet facet = 8; -} - -message SearchServiceError { - enum ErrorCode { - OK = 0; - INVALID_REQUEST = 1; - TRANSIENT_ERROR = 2; - INTERNAL_ERROR = 3; - PERMISSION_DENIED = 4; - TIMEOUT = 5; - CONCURRENT_TRANSACTION = 6; - } -} - -message RequestStatus { - required SearchServiceError.ErrorCode code = 1; - optional string error_detail = 2; -} - -message IndexSpec { - required string name = 1; - - enum Consistency { - GLOBAL = 0; - PER_DOCUMENT = 1; - } - optional Consistency consistency = 2 [default = PER_DOCUMENT]; - - optional string namespace = 3; - optional int32 version = 4; - - enum Source { - SEARCH = 0; - DATASTORE = 1; - CLOUD_STORAGE = 2; - } - optional Source source = 5 [default = SEARCH]; - - enum Mode { - PRIORITY = 0; - BACKGROUND = 1; - } - optional Mode mode = 6 [default = PRIORITY]; -} - -message IndexMetadata { - required IndexSpec index_spec = 1; - - repeated FieldTypes field = 2; - - message Storage { - optional int64 amount_used = 1; - optional int64 limit = 2; - } - optional Storage storage = 3; -} - -message IndexDocumentParams { - repeated Document document = 1; - - enum Freshness { - SYNCHRONOUSLY = 0; - WHEN_CONVENIENT = 1; - } - optional Freshness freshness = 2 [default = SYNCHRONOUSLY, deprecated=true]; - - required IndexSpec index_spec = 3; -} - -message IndexDocumentRequest { - required IndexDocumentParams params = 1; - - optional bytes app_id = 3; -} - -message IndexDocumentResponse { - repeated RequestStatus status = 1; - - repeated string doc_id = 2; -} - -message DeleteDocumentParams { - repeated string doc_id = 1; - - required IndexSpec index_spec = 2; -} - -message DeleteDocumentRequest { - required DeleteDocumentParams params = 1; - - optional bytes app_id = 3; -} - -message DeleteDocumentResponse { - repeated RequestStatus status = 1; -} - -message ListDocumentsParams { - required IndexSpec index_spec = 1; - optional string start_doc_id = 2; - optional bool include_start_doc = 3 [default = true]; - optional int32 limit = 4 [default = 100]; - optional bool keys_only = 5; -} - -message ListDocumentsRequest { - required ListDocumentsParams params = 1; - - optional bytes app_id = 2; -} - -message ListDocumentsResponse { - required RequestStatus status = 1; - - repeated Document document = 2; -} - -message ListIndexesParams { - optional bool fetch_schema = 1; - optional int32 limit = 2 [default = 20]; - optional string namespace = 3; - optional string start_index_name = 4; - optional bool include_start_index = 5 [default = true]; - optional string index_name_prefix = 6; - optional int32 offset = 7; - optional IndexSpec.Source source = 8 [default = SEARCH]; -} - -message ListIndexesRequest { - required ListIndexesParams params = 1; - - optional bytes app_id = 3; -} - -message ListIndexesResponse { - required RequestStatus status = 1; - repeated IndexMetadata index_metadata = 2; -} - -message DeleteSchemaParams { - optional IndexSpec.Source source = 1 [default = SEARCH]; - repeated IndexSpec index_spec = 2; -} - -message DeleteSchemaRequest { - required DeleteSchemaParams params = 1; - - optional bytes app_id = 3; -} - -message DeleteSchemaResponse { - repeated RequestStatus status = 1; -} - -message SortSpec { - required string sort_expression = 1; - optional bool sort_descending = 2 [default = true]; - optional string default_value_text = 4; - optional double default_value_numeric = 5; -} - -message ScorerSpec { - enum Scorer { - RESCORING_MATCH_SCORER = 0; - MATCH_SCORER = 2; - } - optional Scorer scorer = 1 [default = MATCH_SCORER]; - - optional int32 limit = 2 [default = 1000]; - optional string match_scorer_parameters = 9; -} - -message FieldSpec { - repeated string name = 1; - - repeated group Expression = 2 { - required string name = 3; - required string expression = 4; - } -} - -message FacetRange { - optional string name = 1; - optional string start = 2; - optional string end = 3; -} - -message FacetRequestParam { - optional int32 value_limit = 1; - repeated FacetRange range = 2; - repeated string value_constraint = 3; -} - -message FacetAutoDetectParam { - optional int32 value_limit = 1 [default = 10]; -} - -message FacetRequest { - required string name = 1; - required FacetValue.ContentType type = 2; - optional FacetRequestParam params = 3; -} - -message FacetRefine { - required string name = 1; - required FacetValue.ContentType type = 2; - optional string value = 3; - optional string start = 4; - optional string end = 5; -} - -message SearchParams { - required IndexSpec index_spec = 1; - required string query = 2; - optional string cursor = 4; - optional int32 offset = 11; - - enum CursorType { - NONE = 0; - SINGLE = 1; - PER_RESULT = 2; - } - optional CursorType cursor_type = 5 [default = NONE]; - - optional int32 limit = 6 [default = 20]; - optional int32 matched_count_accuracy = 7; - repeated SortSpec sort_spec = 8; - optional ScorerSpec scorer_spec = 9; - optional FieldSpec field_spec = 10; - optional bool keys_only = 12; - - enum ParsingMode { - STRICT = 0; - RELAXED = 1; - } - optional ParsingMode parsing_mode = 13 [default = STRICT]; - - optional int32 auto_discover_facet_count = 15 [default = 0]; - repeated FacetRequest include_facet = 16; - repeated FacetRefine facet_refine = 17; - optional FacetAutoDetectParam facet_auto_detect_param = 18; -} - -message SearchRequest { - required SearchParams params = 1; - - optional bytes app_id = 3; -} - -message FacetResultValue { - required string name = 1; - required int32 count = 2; -} - -message FacetResult { - required string name = 1; - required FacetValue.ContentType type = 2; - repeated FacetResultValue value = 3; -} - -message SearchResult { - required Document document = 1; - repeated Field expression = 4; - repeated double score = 2; - optional string cursor = 3; -} - -message SearchResponse { - repeated SearchResult result = 1; - required int64 matched_count = 2; - required RequestStatus status = 3; - optional string cursor = 4; - repeated FacetResult facet_result = 5; - - extensions 1000 to 9999; -} diff --git a/vendor/google.golang.org/appengine/internal/taskqueue/taskqueue_service.pb.go b/vendor/google.golang.org/appengine/internal/taskqueue/taskqueue_service.pb.go deleted file mode 100644 index 9180ba625..000000000 --- a/vendor/google.golang.org/appengine/internal/taskqueue/taskqueue_service.pb.go +++ /dev/null @@ -1,1886 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/taskqueue/taskqueue_service.proto -// DO NOT EDIT! - -/* -Package taskqueue is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/taskqueue/taskqueue_service.proto - -It has these top-level messages: - TaskQueueServiceError - TaskPayload - TaskQueueRetryParameters - TaskQueueAcl - TaskQueueHttpHeader - TaskQueueMode - TaskQueueAddRequest - TaskQueueAddResponse - TaskQueueBulkAddRequest - TaskQueueBulkAddResponse - TaskQueueDeleteRequest - TaskQueueDeleteResponse - TaskQueueForceRunRequest - TaskQueueForceRunResponse - TaskQueueUpdateQueueRequest - TaskQueueUpdateQueueResponse - TaskQueueFetchQueuesRequest - TaskQueueFetchQueuesResponse - TaskQueueFetchQueueStatsRequest - TaskQueueScannerQueueInfo - TaskQueueFetchQueueStatsResponse - TaskQueuePauseQueueRequest - TaskQueuePauseQueueResponse - TaskQueuePurgeQueueRequest - TaskQueuePurgeQueueResponse - TaskQueueDeleteQueueRequest - TaskQueueDeleteQueueResponse - TaskQueueDeleteGroupRequest - TaskQueueDeleteGroupResponse - TaskQueueQueryTasksRequest - TaskQueueQueryTasksResponse - TaskQueueFetchTaskRequest - TaskQueueFetchTaskResponse - TaskQueueUpdateStorageLimitRequest - TaskQueueUpdateStorageLimitResponse - TaskQueueQueryAndOwnTasksRequest - TaskQueueQueryAndOwnTasksResponse - TaskQueueModifyTaskLeaseRequest - TaskQueueModifyTaskLeaseResponse -*/ -package taskqueue - -import proto "github.com/golang/protobuf/proto" -import math "math" -import appengine "google.golang.org/appengine/internal/datastore" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type TaskQueueServiceError_ErrorCode int32 - -const ( - TaskQueueServiceError_OK TaskQueueServiceError_ErrorCode = 0 - TaskQueueServiceError_UNKNOWN_QUEUE TaskQueueServiceError_ErrorCode = 1 - TaskQueueServiceError_TRANSIENT_ERROR TaskQueueServiceError_ErrorCode = 2 - TaskQueueServiceError_INTERNAL_ERROR TaskQueueServiceError_ErrorCode = 3 - TaskQueueServiceError_TASK_TOO_LARGE TaskQueueServiceError_ErrorCode = 4 - TaskQueueServiceError_INVALID_TASK_NAME TaskQueueServiceError_ErrorCode = 5 - TaskQueueServiceError_INVALID_QUEUE_NAME TaskQueueServiceError_ErrorCode = 6 - TaskQueueServiceError_INVALID_URL TaskQueueServiceError_ErrorCode = 7 - TaskQueueServiceError_INVALID_QUEUE_RATE TaskQueueServiceError_ErrorCode = 8 - TaskQueueServiceError_PERMISSION_DENIED TaskQueueServiceError_ErrorCode = 9 - TaskQueueServiceError_TASK_ALREADY_EXISTS TaskQueueServiceError_ErrorCode = 10 - TaskQueueServiceError_TOMBSTONED_TASK TaskQueueServiceError_ErrorCode = 11 - TaskQueueServiceError_INVALID_ETA TaskQueueServiceError_ErrorCode = 12 - TaskQueueServiceError_INVALID_REQUEST TaskQueueServiceError_ErrorCode = 13 - TaskQueueServiceError_UNKNOWN_TASK TaskQueueServiceError_ErrorCode = 14 - TaskQueueServiceError_TOMBSTONED_QUEUE TaskQueueServiceError_ErrorCode = 15 - TaskQueueServiceError_DUPLICATE_TASK_NAME TaskQueueServiceError_ErrorCode = 16 - TaskQueueServiceError_SKIPPED TaskQueueServiceError_ErrorCode = 17 - TaskQueueServiceError_TOO_MANY_TASKS TaskQueueServiceError_ErrorCode = 18 - TaskQueueServiceError_INVALID_PAYLOAD TaskQueueServiceError_ErrorCode = 19 - TaskQueueServiceError_INVALID_RETRY_PARAMETERS TaskQueueServiceError_ErrorCode = 20 - TaskQueueServiceError_INVALID_QUEUE_MODE TaskQueueServiceError_ErrorCode = 21 - TaskQueueServiceError_ACL_LOOKUP_ERROR TaskQueueServiceError_ErrorCode = 22 - TaskQueueServiceError_TRANSACTIONAL_REQUEST_TOO_LARGE TaskQueueServiceError_ErrorCode = 23 - TaskQueueServiceError_INCORRECT_CREATOR_NAME TaskQueueServiceError_ErrorCode = 24 - TaskQueueServiceError_TASK_LEASE_EXPIRED TaskQueueServiceError_ErrorCode = 25 - TaskQueueServiceError_QUEUE_PAUSED TaskQueueServiceError_ErrorCode = 26 - TaskQueueServiceError_INVALID_TAG TaskQueueServiceError_ErrorCode = 27 - // Reserved range for the Datastore error codes. - // Original Datastore error code is shifted by DATASTORE_ERROR offset. - TaskQueueServiceError_DATASTORE_ERROR TaskQueueServiceError_ErrorCode = 10000 -) - -var TaskQueueServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "UNKNOWN_QUEUE", - 2: "TRANSIENT_ERROR", - 3: "INTERNAL_ERROR", - 4: "TASK_TOO_LARGE", - 5: "INVALID_TASK_NAME", - 6: "INVALID_QUEUE_NAME", - 7: "INVALID_URL", - 8: "INVALID_QUEUE_RATE", - 9: "PERMISSION_DENIED", - 10: "TASK_ALREADY_EXISTS", - 11: "TOMBSTONED_TASK", - 12: "INVALID_ETA", - 13: "INVALID_REQUEST", - 14: "UNKNOWN_TASK", - 15: "TOMBSTONED_QUEUE", - 16: "DUPLICATE_TASK_NAME", - 17: "SKIPPED", - 18: "TOO_MANY_TASKS", - 19: "INVALID_PAYLOAD", - 20: "INVALID_RETRY_PARAMETERS", - 21: "INVALID_QUEUE_MODE", - 22: "ACL_LOOKUP_ERROR", - 23: "TRANSACTIONAL_REQUEST_TOO_LARGE", - 24: "INCORRECT_CREATOR_NAME", - 25: "TASK_LEASE_EXPIRED", - 26: "QUEUE_PAUSED", - 27: "INVALID_TAG", - 10000: "DATASTORE_ERROR", -} -var TaskQueueServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "UNKNOWN_QUEUE": 1, - "TRANSIENT_ERROR": 2, - "INTERNAL_ERROR": 3, - "TASK_TOO_LARGE": 4, - "INVALID_TASK_NAME": 5, - "INVALID_QUEUE_NAME": 6, - "INVALID_URL": 7, - "INVALID_QUEUE_RATE": 8, - "PERMISSION_DENIED": 9, - "TASK_ALREADY_EXISTS": 10, - "TOMBSTONED_TASK": 11, - "INVALID_ETA": 12, - "INVALID_REQUEST": 13, - "UNKNOWN_TASK": 14, - "TOMBSTONED_QUEUE": 15, - "DUPLICATE_TASK_NAME": 16, - "SKIPPED": 17, - "TOO_MANY_TASKS": 18, - "INVALID_PAYLOAD": 19, - "INVALID_RETRY_PARAMETERS": 20, - "INVALID_QUEUE_MODE": 21, - "ACL_LOOKUP_ERROR": 22, - "TRANSACTIONAL_REQUEST_TOO_LARGE": 23, - "INCORRECT_CREATOR_NAME": 24, - "TASK_LEASE_EXPIRED": 25, - "QUEUE_PAUSED": 26, - "INVALID_TAG": 27, - "DATASTORE_ERROR": 10000, -} - -func (x TaskQueueServiceError_ErrorCode) Enum() *TaskQueueServiceError_ErrorCode { - p := new(TaskQueueServiceError_ErrorCode) - *p = x - return p -} -func (x TaskQueueServiceError_ErrorCode) String() string { - return proto.EnumName(TaskQueueServiceError_ErrorCode_name, int32(x)) -} -func (x *TaskQueueServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskQueueServiceError_ErrorCode_value, data, "TaskQueueServiceError_ErrorCode") - if err != nil { - return err - } - *x = TaskQueueServiceError_ErrorCode(value) - return nil -} - -type TaskQueueMode_Mode int32 - -const ( - TaskQueueMode_PUSH TaskQueueMode_Mode = 0 - TaskQueueMode_PULL TaskQueueMode_Mode = 1 -) - -var TaskQueueMode_Mode_name = map[int32]string{ - 0: "PUSH", - 1: "PULL", -} -var TaskQueueMode_Mode_value = map[string]int32{ - "PUSH": 0, - "PULL": 1, -} - -func (x TaskQueueMode_Mode) Enum() *TaskQueueMode_Mode { - p := new(TaskQueueMode_Mode) - *p = x - return p -} -func (x TaskQueueMode_Mode) String() string { - return proto.EnumName(TaskQueueMode_Mode_name, int32(x)) -} -func (x *TaskQueueMode_Mode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskQueueMode_Mode_value, data, "TaskQueueMode_Mode") - if err != nil { - return err - } - *x = TaskQueueMode_Mode(value) - return nil -} - -type TaskQueueAddRequest_RequestMethod int32 - -const ( - TaskQueueAddRequest_GET TaskQueueAddRequest_RequestMethod = 1 - TaskQueueAddRequest_POST TaskQueueAddRequest_RequestMethod = 2 - TaskQueueAddRequest_HEAD TaskQueueAddRequest_RequestMethod = 3 - TaskQueueAddRequest_PUT TaskQueueAddRequest_RequestMethod = 4 - TaskQueueAddRequest_DELETE TaskQueueAddRequest_RequestMethod = 5 -) - -var TaskQueueAddRequest_RequestMethod_name = map[int32]string{ - 1: "GET", - 2: "POST", - 3: "HEAD", - 4: "PUT", - 5: "DELETE", -} -var TaskQueueAddRequest_RequestMethod_value = map[string]int32{ - "GET": 1, - "POST": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5, -} - -func (x TaskQueueAddRequest_RequestMethod) Enum() *TaskQueueAddRequest_RequestMethod { - p := new(TaskQueueAddRequest_RequestMethod) - *p = x - return p -} -func (x TaskQueueAddRequest_RequestMethod) String() string { - return proto.EnumName(TaskQueueAddRequest_RequestMethod_name, int32(x)) -} -func (x *TaskQueueAddRequest_RequestMethod) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskQueueAddRequest_RequestMethod_value, data, "TaskQueueAddRequest_RequestMethod") - if err != nil { - return err - } - *x = TaskQueueAddRequest_RequestMethod(value) - return nil -} - -type TaskQueueQueryTasksResponse_Task_RequestMethod int32 - -const ( - TaskQueueQueryTasksResponse_Task_GET TaskQueueQueryTasksResponse_Task_RequestMethod = 1 - TaskQueueQueryTasksResponse_Task_POST TaskQueueQueryTasksResponse_Task_RequestMethod = 2 - TaskQueueQueryTasksResponse_Task_HEAD TaskQueueQueryTasksResponse_Task_RequestMethod = 3 - TaskQueueQueryTasksResponse_Task_PUT TaskQueueQueryTasksResponse_Task_RequestMethod = 4 - TaskQueueQueryTasksResponse_Task_DELETE TaskQueueQueryTasksResponse_Task_RequestMethod = 5 -) - -var TaskQueueQueryTasksResponse_Task_RequestMethod_name = map[int32]string{ - 1: "GET", - 2: "POST", - 3: "HEAD", - 4: "PUT", - 5: "DELETE", -} -var TaskQueueQueryTasksResponse_Task_RequestMethod_value = map[string]int32{ - "GET": 1, - "POST": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5, -} - -func (x TaskQueueQueryTasksResponse_Task_RequestMethod) Enum() *TaskQueueQueryTasksResponse_Task_RequestMethod { - p := new(TaskQueueQueryTasksResponse_Task_RequestMethod) - *p = x - return p -} -func (x TaskQueueQueryTasksResponse_Task_RequestMethod) String() string { - return proto.EnumName(TaskQueueQueryTasksResponse_Task_RequestMethod_name, int32(x)) -} -func (x *TaskQueueQueryTasksResponse_Task_RequestMethod) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskQueueQueryTasksResponse_Task_RequestMethod_value, data, "TaskQueueQueryTasksResponse_Task_RequestMethod") - if err != nil { - return err - } - *x = TaskQueueQueryTasksResponse_Task_RequestMethod(value) - return nil -} - -type TaskQueueServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueServiceError) Reset() { *m = TaskQueueServiceError{} } -func (m *TaskQueueServiceError) String() string { return proto.CompactTextString(m) } -func (*TaskQueueServiceError) ProtoMessage() {} - -type TaskPayload struct { - XXX_extensions map[int32]proto.Extension `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskPayload) Reset() { *m = TaskPayload{} } -func (m *TaskPayload) String() string { return proto.CompactTextString(m) } -func (*TaskPayload) ProtoMessage() {} - -func (m *TaskPayload) Marshal() ([]byte, error) { - return proto.MarshalMessageSet(m.ExtensionMap()) -} -func (m *TaskPayload) Unmarshal(buf []byte) error { - return proto.UnmarshalMessageSet(buf, m.ExtensionMap()) -} -func (m *TaskPayload) MarshalJSON() ([]byte, error) { - return proto.MarshalMessageSetJSON(m.XXX_extensions) -} -func (m *TaskPayload) UnmarshalJSON(buf []byte) error { - return proto.UnmarshalMessageSetJSON(buf, m.XXX_extensions) -} - -// ensure TaskPayload satisfies proto.Marshaler and proto.Unmarshaler -var _ proto.Marshaler = (*TaskPayload)(nil) -var _ proto.Unmarshaler = (*TaskPayload)(nil) - -var extRange_TaskPayload = []proto.ExtensionRange{ - {10, 2147483646}, -} - -func (*TaskPayload) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_TaskPayload -} -func (m *TaskPayload) ExtensionMap() map[int32]proto.Extension { - if m.XXX_extensions == nil { - m.XXX_extensions = make(map[int32]proto.Extension) - } - return m.XXX_extensions -} - -type TaskQueueRetryParameters struct { - RetryLimit *int32 `protobuf:"varint,1,opt,name=retry_limit" json:"retry_limit,omitempty"` - AgeLimitSec *int64 `protobuf:"varint,2,opt,name=age_limit_sec" json:"age_limit_sec,omitempty"` - MinBackoffSec *float64 `protobuf:"fixed64,3,opt,name=min_backoff_sec,def=0.1" json:"min_backoff_sec,omitempty"` - MaxBackoffSec *float64 `protobuf:"fixed64,4,opt,name=max_backoff_sec,def=3600" json:"max_backoff_sec,omitempty"` - MaxDoublings *int32 `protobuf:"varint,5,opt,name=max_doublings,def=16" json:"max_doublings,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueRetryParameters) Reset() { *m = TaskQueueRetryParameters{} } -func (m *TaskQueueRetryParameters) String() string { return proto.CompactTextString(m) } -func (*TaskQueueRetryParameters) ProtoMessage() {} - -const Default_TaskQueueRetryParameters_MinBackoffSec float64 = 0.1 -const Default_TaskQueueRetryParameters_MaxBackoffSec float64 = 3600 -const Default_TaskQueueRetryParameters_MaxDoublings int32 = 16 - -func (m *TaskQueueRetryParameters) GetRetryLimit() int32 { - if m != nil && m.RetryLimit != nil { - return *m.RetryLimit - } - return 0 -} - -func (m *TaskQueueRetryParameters) GetAgeLimitSec() int64 { - if m != nil && m.AgeLimitSec != nil { - return *m.AgeLimitSec - } - return 0 -} - -func (m *TaskQueueRetryParameters) GetMinBackoffSec() float64 { - if m != nil && m.MinBackoffSec != nil { - return *m.MinBackoffSec - } - return Default_TaskQueueRetryParameters_MinBackoffSec -} - -func (m *TaskQueueRetryParameters) GetMaxBackoffSec() float64 { - if m != nil && m.MaxBackoffSec != nil { - return *m.MaxBackoffSec - } - return Default_TaskQueueRetryParameters_MaxBackoffSec -} - -func (m *TaskQueueRetryParameters) GetMaxDoublings() int32 { - if m != nil && m.MaxDoublings != nil { - return *m.MaxDoublings - } - return Default_TaskQueueRetryParameters_MaxDoublings -} - -type TaskQueueAcl struct { - UserEmail [][]byte `protobuf:"bytes,1,rep,name=user_email" json:"user_email,omitempty"` - WriterEmail [][]byte `protobuf:"bytes,2,rep,name=writer_email" json:"writer_email,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueAcl) Reset() { *m = TaskQueueAcl{} } -func (m *TaskQueueAcl) String() string { return proto.CompactTextString(m) } -func (*TaskQueueAcl) ProtoMessage() {} - -func (m *TaskQueueAcl) GetUserEmail() [][]byte { - if m != nil { - return m.UserEmail - } - return nil -} - -func (m *TaskQueueAcl) GetWriterEmail() [][]byte { - if m != nil { - return m.WriterEmail - } - return nil -} - -type TaskQueueHttpHeader struct { - Key []byte `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueHttpHeader) Reset() { *m = TaskQueueHttpHeader{} } -func (m *TaskQueueHttpHeader) String() string { return proto.CompactTextString(m) } -func (*TaskQueueHttpHeader) ProtoMessage() {} - -func (m *TaskQueueHttpHeader) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *TaskQueueHttpHeader) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -type TaskQueueMode struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueMode) Reset() { *m = TaskQueueMode{} } -func (m *TaskQueueMode) String() string { return proto.CompactTextString(m) } -func (*TaskQueueMode) ProtoMessage() {} - -type TaskQueueAddRequest struct { - QueueName []byte `protobuf:"bytes,1,req,name=queue_name" json:"queue_name,omitempty"` - TaskName []byte `protobuf:"bytes,2,req,name=task_name" json:"task_name,omitempty"` - EtaUsec *int64 `protobuf:"varint,3,req,name=eta_usec" json:"eta_usec,omitempty"` - Method *TaskQueueAddRequest_RequestMethod `protobuf:"varint,5,opt,name=method,enum=appengine.TaskQueueAddRequest_RequestMethod,def=2" json:"method,omitempty"` - Url []byte `protobuf:"bytes,4,opt,name=url" json:"url,omitempty"` - Header []*TaskQueueAddRequest_Header `protobuf:"group,6,rep" json:"header,omitempty"` - Body []byte `protobuf:"bytes,9,opt,name=body" json:"body,omitempty"` - Transaction *appengine.Transaction `protobuf:"bytes,10,opt,name=transaction" json:"transaction,omitempty"` - AppId []byte `protobuf:"bytes,11,opt,name=app_id" json:"app_id,omitempty"` - Crontimetable *TaskQueueAddRequest_CronTimetable `protobuf:"group,12,opt,name=CronTimetable" json:"crontimetable,omitempty"` - Description []byte `protobuf:"bytes,15,opt,name=description" json:"description,omitempty"` - Payload *TaskPayload `protobuf:"bytes,16,opt,name=payload" json:"payload,omitempty"` - RetryParameters *TaskQueueRetryParameters `protobuf:"bytes,17,opt,name=retry_parameters" json:"retry_parameters,omitempty"` - Mode *TaskQueueMode_Mode `protobuf:"varint,18,opt,name=mode,enum=appengine.TaskQueueMode_Mode,def=0" json:"mode,omitempty"` - Tag []byte `protobuf:"bytes,19,opt,name=tag" json:"tag,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueAddRequest) Reset() { *m = TaskQueueAddRequest{} } -func (m *TaskQueueAddRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueAddRequest) ProtoMessage() {} - -const Default_TaskQueueAddRequest_Method TaskQueueAddRequest_RequestMethod = TaskQueueAddRequest_POST -const Default_TaskQueueAddRequest_Mode TaskQueueMode_Mode = TaskQueueMode_PUSH - -func (m *TaskQueueAddRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueAddRequest) GetTaskName() []byte { - if m != nil { - return m.TaskName - } - return nil -} - -func (m *TaskQueueAddRequest) GetEtaUsec() int64 { - if m != nil && m.EtaUsec != nil { - return *m.EtaUsec - } - return 0 -} - -func (m *TaskQueueAddRequest) GetMethod() TaskQueueAddRequest_RequestMethod { - if m != nil && m.Method != nil { - return *m.Method - } - return Default_TaskQueueAddRequest_Method -} - -func (m *TaskQueueAddRequest) GetUrl() []byte { - if m != nil { - return m.Url - } - return nil -} - -func (m *TaskQueueAddRequest) GetHeader() []*TaskQueueAddRequest_Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *TaskQueueAddRequest) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -func (m *TaskQueueAddRequest) GetTransaction() *appengine.Transaction { - if m != nil { - return m.Transaction - } - return nil -} - -func (m *TaskQueueAddRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueAddRequest) GetCrontimetable() *TaskQueueAddRequest_CronTimetable { - if m != nil { - return m.Crontimetable - } - return nil -} - -func (m *TaskQueueAddRequest) GetDescription() []byte { - if m != nil { - return m.Description - } - return nil -} - -func (m *TaskQueueAddRequest) GetPayload() *TaskPayload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *TaskQueueAddRequest) GetRetryParameters() *TaskQueueRetryParameters { - if m != nil { - return m.RetryParameters - } - return nil -} - -func (m *TaskQueueAddRequest) GetMode() TaskQueueMode_Mode { - if m != nil && m.Mode != nil { - return *m.Mode - } - return Default_TaskQueueAddRequest_Mode -} - -func (m *TaskQueueAddRequest) GetTag() []byte { - if m != nil { - return m.Tag - } - return nil -} - -type TaskQueueAddRequest_Header struct { - Key []byte `protobuf:"bytes,7,req,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,8,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueAddRequest_Header) Reset() { *m = TaskQueueAddRequest_Header{} } -func (m *TaskQueueAddRequest_Header) String() string { return proto.CompactTextString(m) } -func (*TaskQueueAddRequest_Header) ProtoMessage() {} - -func (m *TaskQueueAddRequest_Header) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *TaskQueueAddRequest_Header) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -type TaskQueueAddRequest_CronTimetable struct { - Schedule []byte `protobuf:"bytes,13,req,name=schedule" json:"schedule,omitempty"` - Timezone []byte `protobuf:"bytes,14,req,name=timezone" json:"timezone,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueAddRequest_CronTimetable) Reset() { *m = TaskQueueAddRequest_CronTimetable{} } -func (m *TaskQueueAddRequest_CronTimetable) String() string { return proto.CompactTextString(m) } -func (*TaskQueueAddRequest_CronTimetable) ProtoMessage() {} - -func (m *TaskQueueAddRequest_CronTimetable) GetSchedule() []byte { - if m != nil { - return m.Schedule - } - return nil -} - -func (m *TaskQueueAddRequest_CronTimetable) GetTimezone() []byte { - if m != nil { - return m.Timezone - } - return nil -} - -type TaskQueueAddResponse struct { - ChosenTaskName []byte `protobuf:"bytes,1,opt,name=chosen_task_name" json:"chosen_task_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueAddResponse) Reset() { *m = TaskQueueAddResponse{} } -func (m *TaskQueueAddResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueAddResponse) ProtoMessage() {} - -func (m *TaskQueueAddResponse) GetChosenTaskName() []byte { - if m != nil { - return m.ChosenTaskName - } - return nil -} - -type TaskQueueBulkAddRequest struct { - AddRequest []*TaskQueueAddRequest `protobuf:"bytes,1,rep,name=add_request" json:"add_request,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueBulkAddRequest) Reset() { *m = TaskQueueBulkAddRequest{} } -func (m *TaskQueueBulkAddRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueBulkAddRequest) ProtoMessage() {} - -func (m *TaskQueueBulkAddRequest) GetAddRequest() []*TaskQueueAddRequest { - if m != nil { - return m.AddRequest - } - return nil -} - -type TaskQueueBulkAddResponse struct { - Taskresult []*TaskQueueBulkAddResponse_TaskResult `protobuf:"group,1,rep,name=TaskResult" json:"taskresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueBulkAddResponse) Reset() { *m = TaskQueueBulkAddResponse{} } -func (m *TaskQueueBulkAddResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueBulkAddResponse) ProtoMessage() {} - -func (m *TaskQueueBulkAddResponse) GetTaskresult() []*TaskQueueBulkAddResponse_TaskResult { - if m != nil { - return m.Taskresult - } - return nil -} - -type TaskQueueBulkAddResponse_TaskResult struct { - Result *TaskQueueServiceError_ErrorCode `protobuf:"varint,2,req,name=result,enum=appengine.TaskQueueServiceError_ErrorCode" json:"result,omitempty"` - ChosenTaskName []byte `protobuf:"bytes,3,opt,name=chosen_task_name" json:"chosen_task_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueBulkAddResponse_TaskResult) Reset() { *m = TaskQueueBulkAddResponse_TaskResult{} } -func (m *TaskQueueBulkAddResponse_TaskResult) String() string { return proto.CompactTextString(m) } -func (*TaskQueueBulkAddResponse_TaskResult) ProtoMessage() {} - -func (m *TaskQueueBulkAddResponse_TaskResult) GetResult() TaskQueueServiceError_ErrorCode { - if m != nil && m.Result != nil { - return *m.Result - } - return TaskQueueServiceError_OK -} - -func (m *TaskQueueBulkAddResponse_TaskResult) GetChosenTaskName() []byte { - if m != nil { - return m.ChosenTaskName - } - return nil -} - -type TaskQueueDeleteRequest struct { - QueueName []byte `protobuf:"bytes,1,req,name=queue_name" json:"queue_name,omitempty"` - TaskName [][]byte `protobuf:"bytes,2,rep,name=task_name" json:"task_name,omitempty"` - AppId []byte `protobuf:"bytes,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueDeleteRequest) Reset() { *m = TaskQueueDeleteRequest{} } -func (m *TaskQueueDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueDeleteRequest) ProtoMessage() {} - -func (m *TaskQueueDeleteRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueDeleteRequest) GetTaskName() [][]byte { - if m != nil { - return m.TaskName - } - return nil -} - -func (m *TaskQueueDeleteRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type TaskQueueDeleteResponse struct { - Result []TaskQueueServiceError_ErrorCode `protobuf:"varint,3,rep,name=result,enum=appengine.TaskQueueServiceError_ErrorCode" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueDeleteResponse) Reset() { *m = TaskQueueDeleteResponse{} } -func (m *TaskQueueDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueDeleteResponse) ProtoMessage() {} - -func (m *TaskQueueDeleteResponse) GetResult() []TaskQueueServiceError_ErrorCode { - if m != nil { - return m.Result - } - return nil -} - -type TaskQueueForceRunRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - TaskName []byte `protobuf:"bytes,3,req,name=task_name" json:"task_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueForceRunRequest) Reset() { *m = TaskQueueForceRunRequest{} } -func (m *TaskQueueForceRunRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueForceRunRequest) ProtoMessage() {} - -func (m *TaskQueueForceRunRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueForceRunRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueForceRunRequest) GetTaskName() []byte { - if m != nil { - return m.TaskName - } - return nil -} - -type TaskQueueForceRunResponse struct { - Result *TaskQueueServiceError_ErrorCode `protobuf:"varint,3,req,name=result,enum=appengine.TaskQueueServiceError_ErrorCode" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueForceRunResponse) Reset() { *m = TaskQueueForceRunResponse{} } -func (m *TaskQueueForceRunResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueForceRunResponse) ProtoMessage() {} - -func (m *TaskQueueForceRunResponse) GetResult() TaskQueueServiceError_ErrorCode { - if m != nil && m.Result != nil { - return *m.Result - } - return TaskQueueServiceError_OK -} - -type TaskQueueUpdateQueueRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - BucketRefillPerSecond *float64 `protobuf:"fixed64,3,req,name=bucket_refill_per_second" json:"bucket_refill_per_second,omitempty"` - BucketCapacity *int32 `protobuf:"varint,4,req,name=bucket_capacity" json:"bucket_capacity,omitempty"` - UserSpecifiedRate *string `protobuf:"bytes,5,opt,name=user_specified_rate" json:"user_specified_rate,omitempty"` - RetryParameters *TaskQueueRetryParameters `protobuf:"bytes,6,opt,name=retry_parameters" json:"retry_parameters,omitempty"` - MaxConcurrentRequests *int32 `protobuf:"varint,7,opt,name=max_concurrent_requests" json:"max_concurrent_requests,omitempty"` - Mode *TaskQueueMode_Mode `protobuf:"varint,8,opt,name=mode,enum=appengine.TaskQueueMode_Mode,def=0" json:"mode,omitempty"` - Acl *TaskQueueAcl `protobuf:"bytes,9,opt,name=acl" json:"acl,omitempty"` - HeaderOverride []*TaskQueueHttpHeader `protobuf:"bytes,10,rep,name=header_override" json:"header_override,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueUpdateQueueRequest) Reset() { *m = TaskQueueUpdateQueueRequest{} } -func (m *TaskQueueUpdateQueueRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueUpdateQueueRequest) ProtoMessage() {} - -const Default_TaskQueueUpdateQueueRequest_Mode TaskQueueMode_Mode = TaskQueueMode_PUSH - -func (m *TaskQueueUpdateQueueRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueUpdateQueueRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueUpdateQueueRequest) GetBucketRefillPerSecond() float64 { - if m != nil && m.BucketRefillPerSecond != nil { - return *m.BucketRefillPerSecond - } - return 0 -} - -func (m *TaskQueueUpdateQueueRequest) GetBucketCapacity() int32 { - if m != nil && m.BucketCapacity != nil { - return *m.BucketCapacity - } - return 0 -} - -func (m *TaskQueueUpdateQueueRequest) GetUserSpecifiedRate() string { - if m != nil && m.UserSpecifiedRate != nil { - return *m.UserSpecifiedRate - } - return "" -} - -func (m *TaskQueueUpdateQueueRequest) GetRetryParameters() *TaskQueueRetryParameters { - if m != nil { - return m.RetryParameters - } - return nil -} - -func (m *TaskQueueUpdateQueueRequest) GetMaxConcurrentRequests() int32 { - if m != nil && m.MaxConcurrentRequests != nil { - return *m.MaxConcurrentRequests - } - return 0 -} - -func (m *TaskQueueUpdateQueueRequest) GetMode() TaskQueueMode_Mode { - if m != nil && m.Mode != nil { - return *m.Mode - } - return Default_TaskQueueUpdateQueueRequest_Mode -} - -func (m *TaskQueueUpdateQueueRequest) GetAcl() *TaskQueueAcl { - if m != nil { - return m.Acl - } - return nil -} - -func (m *TaskQueueUpdateQueueRequest) GetHeaderOverride() []*TaskQueueHttpHeader { - if m != nil { - return m.HeaderOverride - } - return nil -} - -type TaskQueueUpdateQueueResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueUpdateQueueResponse) Reset() { *m = TaskQueueUpdateQueueResponse{} } -func (m *TaskQueueUpdateQueueResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueUpdateQueueResponse) ProtoMessage() {} - -type TaskQueueFetchQueuesRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - MaxRows *int32 `protobuf:"varint,2,req,name=max_rows" json:"max_rows,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchQueuesRequest) Reset() { *m = TaskQueueFetchQueuesRequest{} } -func (m *TaskQueueFetchQueuesRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchQueuesRequest) ProtoMessage() {} - -func (m *TaskQueueFetchQueuesRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueFetchQueuesRequest) GetMaxRows() int32 { - if m != nil && m.MaxRows != nil { - return *m.MaxRows - } - return 0 -} - -type TaskQueueFetchQueuesResponse struct { - Queue []*TaskQueueFetchQueuesResponse_Queue `protobuf:"group,1,rep" json:"queue,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchQueuesResponse) Reset() { *m = TaskQueueFetchQueuesResponse{} } -func (m *TaskQueueFetchQueuesResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchQueuesResponse) ProtoMessage() {} - -func (m *TaskQueueFetchQueuesResponse) GetQueue() []*TaskQueueFetchQueuesResponse_Queue { - if m != nil { - return m.Queue - } - return nil -} - -type TaskQueueFetchQueuesResponse_Queue struct { - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - BucketRefillPerSecond *float64 `protobuf:"fixed64,3,req,name=bucket_refill_per_second" json:"bucket_refill_per_second,omitempty"` - BucketCapacity *float64 `protobuf:"fixed64,4,req,name=bucket_capacity" json:"bucket_capacity,omitempty"` - UserSpecifiedRate *string `protobuf:"bytes,5,opt,name=user_specified_rate" json:"user_specified_rate,omitempty"` - Paused *bool `protobuf:"varint,6,req,name=paused,def=0" json:"paused,omitempty"` - RetryParameters *TaskQueueRetryParameters `protobuf:"bytes,7,opt,name=retry_parameters" json:"retry_parameters,omitempty"` - MaxConcurrentRequests *int32 `protobuf:"varint,8,opt,name=max_concurrent_requests" json:"max_concurrent_requests,omitempty"` - Mode *TaskQueueMode_Mode `protobuf:"varint,9,opt,name=mode,enum=appengine.TaskQueueMode_Mode,def=0" json:"mode,omitempty"` - Acl *TaskQueueAcl `protobuf:"bytes,10,opt,name=acl" json:"acl,omitempty"` - HeaderOverride []*TaskQueueHttpHeader `protobuf:"bytes,11,rep,name=header_override" json:"header_override,omitempty"` - CreatorName *string `protobuf:"bytes,12,opt,name=creator_name,def=apphosting" json:"creator_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchQueuesResponse_Queue) Reset() { *m = TaskQueueFetchQueuesResponse_Queue{} } -func (m *TaskQueueFetchQueuesResponse_Queue) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchQueuesResponse_Queue) ProtoMessage() {} - -const Default_TaskQueueFetchQueuesResponse_Queue_Paused bool = false -const Default_TaskQueueFetchQueuesResponse_Queue_Mode TaskQueueMode_Mode = TaskQueueMode_PUSH -const Default_TaskQueueFetchQueuesResponse_Queue_CreatorName string = "apphosting" - -func (m *TaskQueueFetchQueuesResponse_Queue) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetBucketRefillPerSecond() float64 { - if m != nil && m.BucketRefillPerSecond != nil { - return *m.BucketRefillPerSecond - } - return 0 -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetBucketCapacity() float64 { - if m != nil && m.BucketCapacity != nil { - return *m.BucketCapacity - } - return 0 -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetUserSpecifiedRate() string { - if m != nil && m.UserSpecifiedRate != nil { - return *m.UserSpecifiedRate - } - return "" -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetPaused() bool { - if m != nil && m.Paused != nil { - return *m.Paused - } - return Default_TaskQueueFetchQueuesResponse_Queue_Paused -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetRetryParameters() *TaskQueueRetryParameters { - if m != nil { - return m.RetryParameters - } - return nil -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetMaxConcurrentRequests() int32 { - if m != nil && m.MaxConcurrentRequests != nil { - return *m.MaxConcurrentRequests - } - return 0 -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetMode() TaskQueueMode_Mode { - if m != nil && m.Mode != nil { - return *m.Mode - } - return Default_TaskQueueFetchQueuesResponse_Queue_Mode -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetAcl() *TaskQueueAcl { - if m != nil { - return m.Acl - } - return nil -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetHeaderOverride() []*TaskQueueHttpHeader { - if m != nil { - return m.HeaderOverride - } - return nil -} - -func (m *TaskQueueFetchQueuesResponse_Queue) GetCreatorName() string { - if m != nil && m.CreatorName != nil { - return *m.CreatorName - } - return Default_TaskQueueFetchQueuesResponse_Queue_CreatorName -} - -type TaskQueueFetchQueueStatsRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - QueueName [][]byte `protobuf:"bytes,2,rep,name=queue_name" json:"queue_name,omitempty"` - MaxNumTasks *int32 `protobuf:"varint,3,opt,name=max_num_tasks,def=0" json:"max_num_tasks,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchQueueStatsRequest) Reset() { *m = TaskQueueFetchQueueStatsRequest{} } -func (m *TaskQueueFetchQueueStatsRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchQueueStatsRequest) ProtoMessage() {} - -const Default_TaskQueueFetchQueueStatsRequest_MaxNumTasks int32 = 0 - -func (m *TaskQueueFetchQueueStatsRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueFetchQueueStatsRequest) GetQueueName() [][]byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueFetchQueueStatsRequest) GetMaxNumTasks() int32 { - if m != nil && m.MaxNumTasks != nil { - return *m.MaxNumTasks - } - return Default_TaskQueueFetchQueueStatsRequest_MaxNumTasks -} - -type TaskQueueScannerQueueInfo struct { - ExecutedLastMinute *int64 `protobuf:"varint,1,req,name=executed_last_minute" json:"executed_last_minute,omitempty"` - ExecutedLastHour *int64 `protobuf:"varint,2,req,name=executed_last_hour" json:"executed_last_hour,omitempty"` - SamplingDurationSeconds *float64 `protobuf:"fixed64,3,req,name=sampling_duration_seconds" json:"sampling_duration_seconds,omitempty"` - RequestsInFlight *int32 `protobuf:"varint,4,opt,name=requests_in_flight" json:"requests_in_flight,omitempty"` - EnforcedRate *float64 `protobuf:"fixed64,5,opt,name=enforced_rate" json:"enforced_rate,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueScannerQueueInfo) Reset() { *m = TaskQueueScannerQueueInfo{} } -func (m *TaskQueueScannerQueueInfo) String() string { return proto.CompactTextString(m) } -func (*TaskQueueScannerQueueInfo) ProtoMessage() {} - -func (m *TaskQueueScannerQueueInfo) GetExecutedLastMinute() int64 { - if m != nil && m.ExecutedLastMinute != nil { - return *m.ExecutedLastMinute - } - return 0 -} - -func (m *TaskQueueScannerQueueInfo) GetExecutedLastHour() int64 { - if m != nil && m.ExecutedLastHour != nil { - return *m.ExecutedLastHour - } - return 0 -} - -func (m *TaskQueueScannerQueueInfo) GetSamplingDurationSeconds() float64 { - if m != nil && m.SamplingDurationSeconds != nil { - return *m.SamplingDurationSeconds - } - return 0 -} - -func (m *TaskQueueScannerQueueInfo) GetRequestsInFlight() int32 { - if m != nil && m.RequestsInFlight != nil { - return *m.RequestsInFlight - } - return 0 -} - -func (m *TaskQueueScannerQueueInfo) GetEnforcedRate() float64 { - if m != nil && m.EnforcedRate != nil { - return *m.EnforcedRate - } - return 0 -} - -type TaskQueueFetchQueueStatsResponse struct { - Queuestats []*TaskQueueFetchQueueStatsResponse_QueueStats `protobuf:"group,1,rep,name=QueueStats" json:"queuestats,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchQueueStatsResponse) Reset() { *m = TaskQueueFetchQueueStatsResponse{} } -func (m *TaskQueueFetchQueueStatsResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchQueueStatsResponse) ProtoMessage() {} - -func (m *TaskQueueFetchQueueStatsResponse) GetQueuestats() []*TaskQueueFetchQueueStatsResponse_QueueStats { - if m != nil { - return m.Queuestats - } - return nil -} - -type TaskQueueFetchQueueStatsResponse_QueueStats struct { - NumTasks *int32 `protobuf:"varint,2,req,name=num_tasks" json:"num_tasks,omitempty"` - OldestEtaUsec *int64 `protobuf:"varint,3,req,name=oldest_eta_usec" json:"oldest_eta_usec,omitempty"` - ScannerInfo *TaskQueueScannerQueueInfo `protobuf:"bytes,4,opt,name=scanner_info" json:"scanner_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchQueueStatsResponse_QueueStats) Reset() { - *m = TaskQueueFetchQueueStatsResponse_QueueStats{} -} -func (m *TaskQueueFetchQueueStatsResponse_QueueStats) String() string { - return proto.CompactTextString(m) -} -func (*TaskQueueFetchQueueStatsResponse_QueueStats) ProtoMessage() {} - -func (m *TaskQueueFetchQueueStatsResponse_QueueStats) GetNumTasks() int32 { - if m != nil && m.NumTasks != nil { - return *m.NumTasks - } - return 0 -} - -func (m *TaskQueueFetchQueueStatsResponse_QueueStats) GetOldestEtaUsec() int64 { - if m != nil && m.OldestEtaUsec != nil { - return *m.OldestEtaUsec - } - return 0 -} - -func (m *TaskQueueFetchQueueStatsResponse_QueueStats) GetScannerInfo() *TaskQueueScannerQueueInfo { - if m != nil { - return m.ScannerInfo - } - return nil -} - -type TaskQueuePauseQueueRequest struct { - AppId []byte `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - Pause *bool `protobuf:"varint,3,req,name=pause" json:"pause,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueuePauseQueueRequest) Reset() { *m = TaskQueuePauseQueueRequest{} } -func (m *TaskQueuePauseQueueRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueuePauseQueueRequest) ProtoMessage() {} - -func (m *TaskQueuePauseQueueRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueuePauseQueueRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueuePauseQueueRequest) GetPause() bool { - if m != nil && m.Pause != nil { - return *m.Pause - } - return false -} - -type TaskQueuePauseQueueResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueuePauseQueueResponse) Reset() { *m = TaskQueuePauseQueueResponse{} } -func (m *TaskQueuePauseQueueResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueuePauseQueueResponse) ProtoMessage() {} - -type TaskQueuePurgeQueueRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueuePurgeQueueRequest) Reset() { *m = TaskQueuePurgeQueueRequest{} } -func (m *TaskQueuePurgeQueueRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueuePurgeQueueRequest) ProtoMessage() {} - -func (m *TaskQueuePurgeQueueRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueuePurgeQueueRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -type TaskQueuePurgeQueueResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueuePurgeQueueResponse) Reset() { *m = TaskQueuePurgeQueueResponse{} } -func (m *TaskQueuePurgeQueueResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueuePurgeQueueResponse) ProtoMessage() {} - -type TaskQueueDeleteQueueRequest struct { - AppId []byte `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueDeleteQueueRequest) Reset() { *m = TaskQueueDeleteQueueRequest{} } -func (m *TaskQueueDeleteQueueRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueDeleteQueueRequest) ProtoMessage() {} - -func (m *TaskQueueDeleteQueueRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueDeleteQueueRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -type TaskQueueDeleteQueueResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueDeleteQueueResponse) Reset() { *m = TaskQueueDeleteQueueResponse{} } -func (m *TaskQueueDeleteQueueResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueDeleteQueueResponse) ProtoMessage() {} - -type TaskQueueDeleteGroupRequest struct { - AppId []byte `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueDeleteGroupRequest) Reset() { *m = TaskQueueDeleteGroupRequest{} } -func (m *TaskQueueDeleteGroupRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueDeleteGroupRequest) ProtoMessage() {} - -func (m *TaskQueueDeleteGroupRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -type TaskQueueDeleteGroupResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueDeleteGroupResponse) Reset() { *m = TaskQueueDeleteGroupResponse{} } -func (m *TaskQueueDeleteGroupResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueDeleteGroupResponse) ProtoMessage() {} - -type TaskQueueQueryTasksRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - StartTaskName []byte `protobuf:"bytes,3,opt,name=start_task_name" json:"start_task_name,omitempty"` - StartEtaUsec *int64 `protobuf:"varint,4,opt,name=start_eta_usec" json:"start_eta_usec,omitempty"` - StartTag []byte `protobuf:"bytes,6,opt,name=start_tag" json:"start_tag,omitempty"` - MaxRows *int32 `protobuf:"varint,5,opt,name=max_rows,def=1" json:"max_rows,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryTasksRequest) Reset() { *m = TaskQueueQueryTasksRequest{} } -func (m *TaskQueueQueryTasksRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryTasksRequest) ProtoMessage() {} - -const Default_TaskQueueQueryTasksRequest_MaxRows int32 = 1 - -func (m *TaskQueueQueryTasksRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueQueryTasksRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueQueryTasksRequest) GetStartTaskName() []byte { - if m != nil { - return m.StartTaskName - } - return nil -} - -func (m *TaskQueueQueryTasksRequest) GetStartEtaUsec() int64 { - if m != nil && m.StartEtaUsec != nil { - return *m.StartEtaUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksRequest) GetStartTag() []byte { - if m != nil { - return m.StartTag - } - return nil -} - -func (m *TaskQueueQueryTasksRequest) GetMaxRows() int32 { - if m != nil && m.MaxRows != nil { - return *m.MaxRows - } - return Default_TaskQueueQueryTasksRequest_MaxRows -} - -type TaskQueueQueryTasksResponse struct { - Task []*TaskQueueQueryTasksResponse_Task `protobuf:"group,1,rep" json:"task,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryTasksResponse) Reset() { *m = TaskQueueQueryTasksResponse{} } -func (m *TaskQueueQueryTasksResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryTasksResponse) ProtoMessage() {} - -func (m *TaskQueueQueryTasksResponse) GetTask() []*TaskQueueQueryTasksResponse_Task { - if m != nil { - return m.Task - } - return nil -} - -type TaskQueueQueryTasksResponse_Task struct { - TaskName []byte `protobuf:"bytes,2,req,name=task_name" json:"task_name,omitempty"` - EtaUsec *int64 `protobuf:"varint,3,req,name=eta_usec" json:"eta_usec,omitempty"` - Url []byte `protobuf:"bytes,4,opt,name=url" json:"url,omitempty"` - Method *TaskQueueQueryTasksResponse_Task_RequestMethod `protobuf:"varint,5,opt,name=method,enum=appengine.TaskQueueQueryTasksResponse_Task_RequestMethod" json:"method,omitempty"` - RetryCount *int32 `protobuf:"varint,6,opt,name=retry_count,def=0" json:"retry_count,omitempty"` - Header []*TaskQueueQueryTasksResponse_Task_Header `protobuf:"group,7,rep" json:"header,omitempty"` - BodySize *int32 `protobuf:"varint,10,opt,name=body_size" json:"body_size,omitempty"` - Body []byte `protobuf:"bytes,11,opt,name=body" json:"body,omitempty"` - CreationTimeUsec *int64 `protobuf:"varint,12,req,name=creation_time_usec" json:"creation_time_usec,omitempty"` - Crontimetable *TaskQueueQueryTasksResponse_Task_CronTimetable `protobuf:"group,13,opt,name=CronTimetable" json:"crontimetable,omitempty"` - Runlog *TaskQueueQueryTasksResponse_Task_RunLog `protobuf:"group,16,opt,name=RunLog" json:"runlog,omitempty"` - Description []byte `protobuf:"bytes,21,opt,name=description" json:"description,omitempty"` - Payload *TaskPayload `protobuf:"bytes,22,opt,name=payload" json:"payload,omitempty"` - RetryParameters *TaskQueueRetryParameters `protobuf:"bytes,23,opt,name=retry_parameters" json:"retry_parameters,omitempty"` - FirstTryUsec *int64 `protobuf:"varint,24,opt,name=first_try_usec" json:"first_try_usec,omitempty"` - Tag []byte `protobuf:"bytes,25,opt,name=tag" json:"tag,omitempty"` - ExecutionCount *int32 `protobuf:"varint,26,opt,name=execution_count,def=0" json:"execution_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryTasksResponse_Task) Reset() { *m = TaskQueueQueryTasksResponse_Task{} } -func (m *TaskQueueQueryTasksResponse_Task) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryTasksResponse_Task) ProtoMessage() {} - -const Default_TaskQueueQueryTasksResponse_Task_RetryCount int32 = 0 -const Default_TaskQueueQueryTasksResponse_Task_ExecutionCount int32 = 0 - -func (m *TaskQueueQueryTasksResponse_Task) GetTaskName() []byte { - if m != nil { - return m.TaskName - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetEtaUsec() int64 { - if m != nil && m.EtaUsec != nil { - return *m.EtaUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task) GetUrl() []byte { - if m != nil { - return m.Url - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetMethod() TaskQueueQueryTasksResponse_Task_RequestMethod { - if m != nil && m.Method != nil { - return *m.Method - } - return TaskQueueQueryTasksResponse_Task_GET -} - -func (m *TaskQueueQueryTasksResponse_Task) GetRetryCount() int32 { - if m != nil && m.RetryCount != nil { - return *m.RetryCount - } - return Default_TaskQueueQueryTasksResponse_Task_RetryCount -} - -func (m *TaskQueueQueryTasksResponse_Task) GetHeader() []*TaskQueueQueryTasksResponse_Task_Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetBodySize() int32 { - if m != nil && m.BodySize != nil { - return *m.BodySize - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetCreationTimeUsec() int64 { - if m != nil && m.CreationTimeUsec != nil { - return *m.CreationTimeUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task) GetCrontimetable() *TaskQueueQueryTasksResponse_Task_CronTimetable { - if m != nil { - return m.Crontimetable - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetRunlog() *TaskQueueQueryTasksResponse_Task_RunLog { - if m != nil { - return m.Runlog - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetDescription() []byte { - if m != nil { - return m.Description - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetPayload() *TaskPayload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetRetryParameters() *TaskQueueRetryParameters { - if m != nil { - return m.RetryParameters - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetFirstTryUsec() int64 { - if m != nil && m.FirstTryUsec != nil { - return *m.FirstTryUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task) GetTag() []byte { - if m != nil { - return m.Tag - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task) GetExecutionCount() int32 { - if m != nil && m.ExecutionCount != nil { - return *m.ExecutionCount - } - return Default_TaskQueueQueryTasksResponse_Task_ExecutionCount -} - -type TaskQueueQueryTasksResponse_Task_Header struct { - Key []byte `protobuf:"bytes,8,req,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,9,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryTasksResponse_Task_Header) Reset() { - *m = TaskQueueQueryTasksResponse_Task_Header{} -} -func (m *TaskQueueQueryTasksResponse_Task_Header) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryTasksResponse_Task_Header) ProtoMessage() {} - -func (m *TaskQueueQueryTasksResponse_Task_Header) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task_Header) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -type TaskQueueQueryTasksResponse_Task_CronTimetable struct { - Schedule []byte `protobuf:"bytes,14,req,name=schedule" json:"schedule,omitempty"` - Timezone []byte `protobuf:"bytes,15,req,name=timezone" json:"timezone,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryTasksResponse_Task_CronTimetable) Reset() { - *m = TaskQueueQueryTasksResponse_Task_CronTimetable{} -} -func (m *TaskQueueQueryTasksResponse_Task_CronTimetable) String() string { - return proto.CompactTextString(m) -} -func (*TaskQueueQueryTasksResponse_Task_CronTimetable) ProtoMessage() {} - -func (m *TaskQueueQueryTasksResponse_Task_CronTimetable) GetSchedule() []byte { - if m != nil { - return m.Schedule - } - return nil -} - -func (m *TaskQueueQueryTasksResponse_Task_CronTimetable) GetTimezone() []byte { - if m != nil { - return m.Timezone - } - return nil -} - -type TaskQueueQueryTasksResponse_Task_RunLog struct { - DispatchedUsec *int64 `protobuf:"varint,17,req,name=dispatched_usec" json:"dispatched_usec,omitempty"` - LagUsec *int64 `protobuf:"varint,18,req,name=lag_usec" json:"lag_usec,omitempty"` - ElapsedUsec *int64 `protobuf:"varint,19,req,name=elapsed_usec" json:"elapsed_usec,omitempty"` - ResponseCode *int64 `protobuf:"varint,20,opt,name=response_code" json:"response_code,omitempty"` - RetryReason *string `protobuf:"bytes,27,opt,name=retry_reason" json:"retry_reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryTasksResponse_Task_RunLog) Reset() { - *m = TaskQueueQueryTasksResponse_Task_RunLog{} -} -func (m *TaskQueueQueryTasksResponse_Task_RunLog) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryTasksResponse_Task_RunLog) ProtoMessage() {} - -func (m *TaskQueueQueryTasksResponse_Task_RunLog) GetDispatchedUsec() int64 { - if m != nil && m.DispatchedUsec != nil { - return *m.DispatchedUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task_RunLog) GetLagUsec() int64 { - if m != nil && m.LagUsec != nil { - return *m.LagUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task_RunLog) GetElapsedUsec() int64 { - if m != nil && m.ElapsedUsec != nil { - return *m.ElapsedUsec - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task_RunLog) GetResponseCode() int64 { - if m != nil && m.ResponseCode != nil { - return *m.ResponseCode - } - return 0 -} - -func (m *TaskQueueQueryTasksResponse_Task_RunLog) GetRetryReason() string { - if m != nil && m.RetryReason != nil { - return *m.RetryReason - } - return "" -} - -type TaskQueueFetchTaskRequest struct { - AppId []byte `protobuf:"bytes,1,opt,name=app_id" json:"app_id,omitempty"` - QueueName []byte `protobuf:"bytes,2,req,name=queue_name" json:"queue_name,omitempty"` - TaskName []byte `protobuf:"bytes,3,req,name=task_name" json:"task_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchTaskRequest) Reset() { *m = TaskQueueFetchTaskRequest{} } -func (m *TaskQueueFetchTaskRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchTaskRequest) ProtoMessage() {} - -func (m *TaskQueueFetchTaskRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueFetchTaskRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueFetchTaskRequest) GetTaskName() []byte { - if m != nil { - return m.TaskName - } - return nil -} - -type TaskQueueFetchTaskResponse struct { - Task *TaskQueueQueryTasksResponse `protobuf:"bytes,1,req,name=task" json:"task,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueFetchTaskResponse) Reset() { *m = TaskQueueFetchTaskResponse{} } -func (m *TaskQueueFetchTaskResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueFetchTaskResponse) ProtoMessage() {} - -func (m *TaskQueueFetchTaskResponse) GetTask() *TaskQueueQueryTasksResponse { - if m != nil { - return m.Task - } - return nil -} - -type TaskQueueUpdateStorageLimitRequest struct { - AppId []byte `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"` - Limit *int64 `protobuf:"varint,2,req,name=limit" json:"limit,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueUpdateStorageLimitRequest) Reset() { *m = TaskQueueUpdateStorageLimitRequest{} } -func (m *TaskQueueUpdateStorageLimitRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueUpdateStorageLimitRequest) ProtoMessage() {} - -func (m *TaskQueueUpdateStorageLimitRequest) GetAppId() []byte { - if m != nil { - return m.AppId - } - return nil -} - -func (m *TaskQueueUpdateStorageLimitRequest) GetLimit() int64 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return 0 -} - -type TaskQueueUpdateStorageLimitResponse struct { - NewLimit *int64 `protobuf:"varint,1,req,name=new_limit" json:"new_limit,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueUpdateStorageLimitResponse) Reset() { *m = TaskQueueUpdateStorageLimitResponse{} } -func (m *TaskQueueUpdateStorageLimitResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueUpdateStorageLimitResponse) ProtoMessage() {} - -func (m *TaskQueueUpdateStorageLimitResponse) GetNewLimit() int64 { - if m != nil && m.NewLimit != nil { - return *m.NewLimit - } - return 0 -} - -type TaskQueueQueryAndOwnTasksRequest struct { - QueueName []byte `protobuf:"bytes,1,req,name=queue_name" json:"queue_name,omitempty"` - LeaseSeconds *float64 `protobuf:"fixed64,2,req,name=lease_seconds" json:"lease_seconds,omitempty"` - MaxTasks *int64 `protobuf:"varint,3,req,name=max_tasks" json:"max_tasks,omitempty"` - GroupByTag *bool `protobuf:"varint,4,opt,name=group_by_tag,def=0" json:"group_by_tag,omitempty"` - Tag []byte `protobuf:"bytes,5,opt,name=tag" json:"tag,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryAndOwnTasksRequest) Reset() { *m = TaskQueueQueryAndOwnTasksRequest{} } -func (m *TaskQueueQueryAndOwnTasksRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryAndOwnTasksRequest) ProtoMessage() {} - -const Default_TaskQueueQueryAndOwnTasksRequest_GroupByTag bool = false - -func (m *TaskQueueQueryAndOwnTasksRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueQueryAndOwnTasksRequest) GetLeaseSeconds() float64 { - if m != nil && m.LeaseSeconds != nil { - return *m.LeaseSeconds - } - return 0 -} - -func (m *TaskQueueQueryAndOwnTasksRequest) GetMaxTasks() int64 { - if m != nil && m.MaxTasks != nil { - return *m.MaxTasks - } - return 0 -} - -func (m *TaskQueueQueryAndOwnTasksRequest) GetGroupByTag() bool { - if m != nil && m.GroupByTag != nil { - return *m.GroupByTag - } - return Default_TaskQueueQueryAndOwnTasksRequest_GroupByTag -} - -func (m *TaskQueueQueryAndOwnTasksRequest) GetTag() []byte { - if m != nil { - return m.Tag - } - return nil -} - -type TaskQueueQueryAndOwnTasksResponse struct { - Task []*TaskQueueQueryAndOwnTasksResponse_Task `protobuf:"group,1,rep" json:"task,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryAndOwnTasksResponse) Reset() { *m = TaskQueueQueryAndOwnTasksResponse{} } -func (m *TaskQueueQueryAndOwnTasksResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryAndOwnTasksResponse) ProtoMessage() {} - -func (m *TaskQueueQueryAndOwnTasksResponse) GetTask() []*TaskQueueQueryAndOwnTasksResponse_Task { - if m != nil { - return m.Task - } - return nil -} - -type TaskQueueQueryAndOwnTasksResponse_Task struct { - TaskName []byte `protobuf:"bytes,2,req,name=task_name" json:"task_name,omitempty"` - EtaUsec *int64 `protobuf:"varint,3,req,name=eta_usec" json:"eta_usec,omitempty"` - RetryCount *int32 `protobuf:"varint,4,opt,name=retry_count,def=0" json:"retry_count,omitempty"` - Body []byte `protobuf:"bytes,5,opt,name=body" json:"body,omitempty"` - Tag []byte `protobuf:"bytes,6,opt,name=tag" json:"tag,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueQueryAndOwnTasksResponse_Task) Reset() { - *m = TaskQueueQueryAndOwnTasksResponse_Task{} -} -func (m *TaskQueueQueryAndOwnTasksResponse_Task) String() string { return proto.CompactTextString(m) } -func (*TaskQueueQueryAndOwnTasksResponse_Task) ProtoMessage() {} - -const Default_TaskQueueQueryAndOwnTasksResponse_Task_RetryCount int32 = 0 - -func (m *TaskQueueQueryAndOwnTasksResponse_Task) GetTaskName() []byte { - if m != nil { - return m.TaskName - } - return nil -} - -func (m *TaskQueueQueryAndOwnTasksResponse_Task) GetEtaUsec() int64 { - if m != nil && m.EtaUsec != nil { - return *m.EtaUsec - } - return 0 -} - -func (m *TaskQueueQueryAndOwnTasksResponse_Task) GetRetryCount() int32 { - if m != nil && m.RetryCount != nil { - return *m.RetryCount - } - return Default_TaskQueueQueryAndOwnTasksResponse_Task_RetryCount -} - -func (m *TaskQueueQueryAndOwnTasksResponse_Task) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -func (m *TaskQueueQueryAndOwnTasksResponse_Task) GetTag() []byte { - if m != nil { - return m.Tag - } - return nil -} - -type TaskQueueModifyTaskLeaseRequest struct { - QueueName []byte `protobuf:"bytes,1,req,name=queue_name" json:"queue_name,omitempty"` - TaskName []byte `protobuf:"bytes,2,req,name=task_name" json:"task_name,omitempty"` - EtaUsec *int64 `protobuf:"varint,3,req,name=eta_usec" json:"eta_usec,omitempty"` - LeaseSeconds *float64 `protobuf:"fixed64,4,req,name=lease_seconds" json:"lease_seconds,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueModifyTaskLeaseRequest) Reset() { *m = TaskQueueModifyTaskLeaseRequest{} } -func (m *TaskQueueModifyTaskLeaseRequest) String() string { return proto.CompactTextString(m) } -func (*TaskQueueModifyTaskLeaseRequest) ProtoMessage() {} - -func (m *TaskQueueModifyTaskLeaseRequest) GetQueueName() []byte { - if m != nil { - return m.QueueName - } - return nil -} - -func (m *TaskQueueModifyTaskLeaseRequest) GetTaskName() []byte { - if m != nil { - return m.TaskName - } - return nil -} - -func (m *TaskQueueModifyTaskLeaseRequest) GetEtaUsec() int64 { - if m != nil && m.EtaUsec != nil { - return *m.EtaUsec - } - return 0 -} - -func (m *TaskQueueModifyTaskLeaseRequest) GetLeaseSeconds() float64 { - if m != nil && m.LeaseSeconds != nil { - return *m.LeaseSeconds - } - return 0 -} - -type TaskQueueModifyTaskLeaseResponse struct { - UpdatedEtaUsec *int64 `protobuf:"varint,1,req,name=updated_eta_usec" json:"updated_eta_usec,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskQueueModifyTaskLeaseResponse) Reset() { *m = TaskQueueModifyTaskLeaseResponse{} } -func (m *TaskQueueModifyTaskLeaseResponse) String() string { return proto.CompactTextString(m) } -func (*TaskQueueModifyTaskLeaseResponse) ProtoMessage() {} - -func (m *TaskQueueModifyTaskLeaseResponse) GetUpdatedEtaUsec() int64 { - if m != nil && m.UpdatedEtaUsec != nil { - return *m.UpdatedEtaUsec - } - return 0 -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/taskqueue/taskqueue_service.proto b/vendor/google.golang.org/appengine/internal/taskqueue/taskqueue_service.proto deleted file mode 100644 index 419aaf570..000000000 --- a/vendor/google.golang.org/appengine/internal/taskqueue/taskqueue_service.proto +++ /dev/null @@ -1,342 +0,0 @@ -syntax = "proto2"; -option go_package = "taskqueue"; - -import "google.golang.org/appengine/internal/datastore/datastore_v3.proto"; - -package appengine; - -message TaskQueueServiceError { - enum ErrorCode { - OK = 0; - UNKNOWN_QUEUE = 1; - TRANSIENT_ERROR = 2; - INTERNAL_ERROR = 3; - TASK_TOO_LARGE = 4; - INVALID_TASK_NAME = 5; - INVALID_QUEUE_NAME = 6; - INVALID_URL = 7; - INVALID_QUEUE_RATE = 8; - PERMISSION_DENIED = 9; - TASK_ALREADY_EXISTS = 10; - TOMBSTONED_TASK = 11; - INVALID_ETA = 12; - INVALID_REQUEST = 13; - UNKNOWN_TASK = 14; - TOMBSTONED_QUEUE = 15; - DUPLICATE_TASK_NAME = 16; - SKIPPED = 17; - TOO_MANY_TASKS = 18; - INVALID_PAYLOAD = 19; - INVALID_RETRY_PARAMETERS = 20; - INVALID_QUEUE_MODE = 21; - ACL_LOOKUP_ERROR = 22; - TRANSACTIONAL_REQUEST_TOO_LARGE = 23; - INCORRECT_CREATOR_NAME = 24; - TASK_LEASE_EXPIRED = 25; - QUEUE_PAUSED = 26; - INVALID_TAG = 27; - - // Reserved range for the Datastore error codes. - // Original Datastore error code is shifted by DATASTORE_ERROR offset. - DATASTORE_ERROR = 10000; - } -} - -message TaskPayload { - extensions 10 to max; - option message_set_wire_format = true; -} - -message TaskQueueRetryParameters { - optional int32 retry_limit = 1; - optional int64 age_limit_sec = 2; - - optional double min_backoff_sec = 3 [default = 0.1]; - optional double max_backoff_sec = 4 [default = 3600]; - optional int32 max_doublings = 5 [default = 16]; -} - -message TaskQueueAcl { - repeated bytes user_email = 1; - repeated bytes writer_email = 2; -} - -message TaskQueueHttpHeader { - required bytes key = 1; - required bytes value = 2; -} - -message TaskQueueMode { - enum Mode { - PUSH = 0; - PULL = 1; - } -} - -message TaskQueueAddRequest { - required bytes queue_name = 1; - required bytes task_name = 2; - required int64 eta_usec = 3; - - enum RequestMethod { - GET = 1; - POST = 2; - HEAD = 3; - PUT = 4; - DELETE = 5; - } - optional RequestMethod method = 5 [default=POST]; - - optional bytes url = 4; - - repeated group Header = 6 { - required bytes key = 7; - required bytes value = 8; - } - - optional bytes body = 9 [ctype=CORD]; - optional Transaction transaction = 10; - optional bytes app_id = 11; - - optional group CronTimetable = 12 { - required bytes schedule = 13; - required bytes timezone = 14; - } - - optional bytes description = 15; - optional TaskPayload payload = 16; - optional TaskQueueRetryParameters retry_parameters = 17; - optional TaskQueueMode.Mode mode = 18 [default=PUSH]; - optional bytes tag = 19; -} - -message TaskQueueAddResponse { - optional bytes chosen_task_name = 1; -} - -message TaskQueueBulkAddRequest { - repeated TaskQueueAddRequest add_request = 1; -} - -message TaskQueueBulkAddResponse { - repeated group TaskResult = 1 { - required TaskQueueServiceError.ErrorCode result = 2; - optional bytes chosen_task_name = 3; - } -} - -message TaskQueueDeleteRequest { - required bytes queue_name = 1; - repeated bytes task_name = 2; - optional bytes app_id = 3; -} - -message TaskQueueDeleteResponse { - repeated TaskQueueServiceError.ErrorCode result = 3; -} - -message TaskQueueForceRunRequest { - optional bytes app_id = 1; - required bytes queue_name = 2; - required bytes task_name = 3; -} - -message TaskQueueForceRunResponse { - required TaskQueueServiceError.ErrorCode result = 3; -} - -message TaskQueueUpdateQueueRequest { - optional bytes app_id = 1; - required bytes queue_name = 2; - required double bucket_refill_per_second = 3; - required int32 bucket_capacity = 4; - optional string user_specified_rate = 5; - optional TaskQueueRetryParameters retry_parameters = 6; - optional int32 max_concurrent_requests = 7; - optional TaskQueueMode.Mode mode = 8 [default = PUSH]; - optional TaskQueueAcl acl = 9; - repeated TaskQueueHttpHeader header_override = 10; -} - -message TaskQueueUpdateQueueResponse { -} - -message TaskQueueFetchQueuesRequest { - optional bytes app_id = 1; - required int32 max_rows = 2; -} - -message TaskQueueFetchQueuesResponse { - repeated group Queue = 1 { - required bytes queue_name = 2; - required double bucket_refill_per_second = 3; - required double bucket_capacity = 4; - optional string user_specified_rate = 5; - required bool paused = 6 [default=false]; - optional TaskQueueRetryParameters retry_parameters = 7; - optional int32 max_concurrent_requests = 8; - optional TaskQueueMode.Mode mode = 9 [default = PUSH]; - optional TaskQueueAcl acl = 10; - repeated TaskQueueHttpHeader header_override = 11; - optional string creator_name = 12 [ctype=CORD, default="apphosting"]; - } -} - -message TaskQueueFetchQueueStatsRequest { - optional bytes app_id = 1; - repeated bytes queue_name = 2; - optional int32 max_num_tasks = 3 [default = 0]; -} - -message TaskQueueScannerQueueInfo { - required int64 executed_last_minute = 1; - required int64 executed_last_hour = 2; - required double sampling_duration_seconds = 3; - optional int32 requests_in_flight = 4; - optional double enforced_rate = 5; -} - -message TaskQueueFetchQueueStatsResponse { - repeated group QueueStats = 1 { - required int32 num_tasks = 2; - required int64 oldest_eta_usec = 3; - optional TaskQueueScannerQueueInfo scanner_info = 4; - } -} -message TaskQueuePauseQueueRequest { - required bytes app_id = 1; - required bytes queue_name = 2; - required bool pause = 3; -} - -message TaskQueuePauseQueueResponse { -} - -message TaskQueuePurgeQueueRequest { - optional bytes app_id = 1; - required bytes queue_name = 2; -} - -message TaskQueuePurgeQueueResponse { -} - -message TaskQueueDeleteQueueRequest { - required bytes app_id = 1; - required bytes queue_name = 2; -} - -message TaskQueueDeleteQueueResponse { -} - -message TaskQueueDeleteGroupRequest { - required bytes app_id = 1; -} - -message TaskQueueDeleteGroupResponse { -} - -message TaskQueueQueryTasksRequest { - optional bytes app_id = 1; - required bytes queue_name = 2; - - optional bytes start_task_name = 3; - optional int64 start_eta_usec = 4; - optional bytes start_tag = 6; - optional int32 max_rows = 5 [default = 1]; -} - -message TaskQueueQueryTasksResponse { - repeated group Task = 1 { - required bytes task_name = 2; - required int64 eta_usec = 3; - optional bytes url = 4; - - enum RequestMethod { - GET = 1; - POST = 2; - HEAD = 3; - PUT = 4; - DELETE = 5; - } - optional RequestMethod method = 5; - - optional int32 retry_count = 6 [default=0]; - - repeated group Header = 7 { - required bytes key = 8; - required bytes value = 9; - } - - optional int32 body_size = 10; - optional bytes body = 11 [ctype=CORD]; - required int64 creation_time_usec = 12; - - optional group CronTimetable = 13 { - required bytes schedule = 14; - required bytes timezone = 15; - } - - optional group RunLog = 16 { - required int64 dispatched_usec = 17; - required int64 lag_usec = 18; - required int64 elapsed_usec = 19; - optional int64 response_code = 20; - optional string retry_reason = 27; - } - - optional bytes description = 21; - optional TaskPayload payload = 22; - optional TaskQueueRetryParameters retry_parameters = 23; - optional int64 first_try_usec = 24; - optional bytes tag = 25; - optional int32 execution_count = 26 [default=0]; - } -} - -message TaskQueueFetchTaskRequest { - optional bytes app_id = 1; - required bytes queue_name = 2; - required bytes task_name = 3; -} - -message TaskQueueFetchTaskResponse { - required TaskQueueQueryTasksResponse task = 1; -} - -message TaskQueueUpdateStorageLimitRequest { - required bytes app_id = 1; - required int64 limit = 2; -} - -message TaskQueueUpdateStorageLimitResponse { - required int64 new_limit = 1; -} - -message TaskQueueQueryAndOwnTasksRequest { - required bytes queue_name = 1; - required double lease_seconds = 2; - required int64 max_tasks = 3; - optional bool group_by_tag = 4 [default=false]; - optional bytes tag = 5; -} - -message TaskQueueQueryAndOwnTasksResponse { - repeated group Task = 1 { - required bytes task_name = 2; - required int64 eta_usec = 3; - optional int32 retry_count = 4 [default=0]; - optional bytes body = 5 [ctype=CORD]; - optional bytes tag = 6; - } -} - -message TaskQueueModifyTaskLeaseRequest { - required bytes queue_name = 1; - required bytes task_name = 2; - required int64 eta_usec = 3; - required double lease_seconds = 4; -} - -message TaskQueueModifyTaskLeaseResponse { - required int64 updated_eta_usec = 1; -} diff --git a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go b/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go deleted file mode 100644 index e559522c6..000000000 --- a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go +++ /dev/null @@ -1,353 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto -// DO NOT EDIT! - -/* -Package urlfetch is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto - -It has these top-level messages: - URLFetchServiceError - URLFetchRequest - URLFetchResponse -*/ -package urlfetch - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type URLFetchServiceError_ErrorCode int32 - -const ( - URLFetchServiceError_OK URLFetchServiceError_ErrorCode = 0 - URLFetchServiceError_INVALID_URL URLFetchServiceError_ErrorCode = 1 - URLFetchServiceError_FETCH_ERROR URLFetchServiceError_ErrorCode = 2 - URLFetchServiceError_UNSPECIFIED_ERROR URLFetchServiceError_ErrorCode = 3 - URLFetchServiceError_RESPONSE_TOO_LARGE URLFetchServiceError_ErrorCode = 4 - URLFetchServiceError_DEADLINE_EXCEEDED URLFetchServiceError_ErrorCode = 5 - URLFetchServiceError_SSL_CERTIFICATE_ERROR URLFetchServiceError_ErrorCode = 6 - URLFetchServiceError_DNS_ERROR URLFetchServiceError_ErrorCode = 7 - URLFetchServiceError_CLOSED URLFetchServiceError_ErrorCode = 8 - URLFetchServiceError_INTERNAL_TRANSIENT_ERROR URLFetchServiceError_ErrorCode = 9 - URLFetchServiceError_TOO_MANY_REDIRECTS URLFetchServiceError_ErrorCode = 10 - URLFetchServiceError_MALFORMED_REPLY URLFetchServiceError_ErrorCode = 11 - URLFetchServiceError_CONNECTION_ERROR URLFetchServiceError_ErrorCode = 12 -) - -var URLFetchServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "INVALID_URL", - 2: "FETCH_ERROR", - 3: "UNSPECIFIED_ERROR", - 4: "RESPONSE_TOO_LARGE", - 5: "DEADLINE_EXCEEDED", - 6: "SSL_CERTIFICATE_ERROR", - 7: "DNS_ERROR", - 8: "CLOSED", - 9: "INTERNAL_TRANSIENT_ERROR", - 10: "TOO_MANY_REDIRECTS", - 11: "MALFORMED_REPLY", - 12: "CONNECTION_ERROR", -} -var URLFetchServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "INVALID_URL": 1, - "FETCH_ERROR": 2, - "UNSPECIFIED_ERROR": 3, - "RESPONSE_TOO_LARGE": 4, - "DEADLINE_EXCEEDED": 5, - "SSL_CERTIFICATE_ERROR": 6, - "DNS_ERROR": 7, - "CLOSED": 8, - "INTERNAL_TRANSIENT_ERROR": 9, - "TOO_MANY_REDIRECTS": 10, - "MALFORMED_REPLY": 11, - "CONNECTION_ERROR": 12, -} - -func (x URLFetchServiceError_ErrorCode) Enum() *URLFetchServiceError_ErrorCode { - p := new(URLFetchServiceError_ErrorCode) - *p = x - return p -} -func (x URLFetchServiceError_ErrorCode) String() string { - return proto.EnumName(URLFetchServiceError_ErrorCode_name, int32(x)) -} -func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(URLFetchServiceError_ErrorCode_value, data, "URLFetchServiceError_ErrorCode") - if err != nil { - return err - } - *x = URLFetchServiceError_ErrorCode(value) - return nil -} - -type URLFetchRequest_RequestMethod int32 - -const ( - URLFetchRequest_GET URLFetchRequest_RequestMethod = 1 - URLFetchRequest_POST URLFetchRequest_RequestMethod = 2 - URLFetchRequest_HEAD URLFetchRequest_RequestMethod = 3 - URLFetchRequest_PUT URLFetchRequest_RequestMethod = 4 - URLFetchRequest_DELETE URLFetchRequest_RequestMethod = 5 - URLFetchRequest_PATCH URLFetchRequest_RequestMethod = 6 -) - -var URLFetchRequest_RequestMethod_name = map[int32]string{ - 1: "GET", - 2: "POST", - 3: "HEAD", - 4: "PUT", - 5: "DELETE", - 6: "PATCH", -} -var URLFetchRequest_RequestMethod_value = map[string]int32{ - "GET": 1, - "POST": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5, - "PATCH": 6, -} - -func (x URLFetchRequest_RequestMethod) Enum() *URLFetchRequest_RequestMethod { - p := new(URLFetchRequest_RequestMethod) - *p = x - return p -} -func (x URLFetchRequest_RequestMethod) String() string { - return proto.EnumName(URLFetchRequest_RequestMethod_name, int32(x)) -} -func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod") - if err != nil { - return err - } - *x = URLFetchRequest_RequestMethod(value) - return nil -} - -type URLFetchServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} } -func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) } -func (*URLFetchServiceError) ProtoMessage() {} - -type URLFetchRequest struct { - Method *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"` - Url *string `protobuf:"bytes,2,req" json:"Url,omitempty"` - Header []*URLFetchRequest_Header `protobuf:"group,3,rep" json:"header,omitempty"` - Payload []byte `protobuf:"bytes,6,opt" json:"Payload,omitempty"` - FollowRedirects *bool `protobuf:"varint,7,opt,def=1" json:"FollowRedirects,omitempty"` - Deadline *float64 `protobuf:"fixed64,8,opt" json:"Deadline,omitempty"` - MustValidateServerCertificate *bool `protobuf:"varint,9,opt,def=1" json:"MustValidateServerCertificate,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} } -func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) } -func (*URLFetchRequest) ProtoMessage() {} - -const Default_URLFetchRequest_FollowRedirects bool = true -const Default_URLFetchRequest_MustValidateServerCertificate bool = true - -func (m *URLFetchRequest) GetMethod() URLFetchRequest_RequestMethod { - if m != nil && m.Method != nil { - return *m.Method - } - return URLFetchRequest_GET -} - -func (m *URLFetchRequest) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *URLFetchRequest) GetHeader() []*URLFetchRequest_Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *URLFetchRequest) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *URLFetchRequest) GetFollowRedirects() bool { - if m != nil && m.FollowRedirects != nil { - return *m.FollowRedirects - } - return Default_URLFetchRequest_FollowRedirects -} - -func (m *URLFetchRequest) GetDeadline() float64 { - if m != nil && m.Deadline != nil { - return *m.Deadline - } - return 0 -} - -func (m *URLFetchRequest) GetMustValidateServerCertificate() bool { - if m != nil && m.MustValidateServerCertificate != nil { - return *m.MustValidateServerCertificate - } - return Default_URLFetchRequest_MustValidateServerCertificate -} - -type URLFetchRequest_Header struct { - Key *string `protobuf:"bytes,4,req" json:"Key,omitempty"` - Value *string `protobuf:"bytes,5,req" json:"Value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} } -func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) } -func (*URLFetchRequest_Header) ProtoMessage() {} - -func (m *URLFetchRequest_Header) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *URLFetchRequest_Header) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type URLFetchResponse struct { - Content []byte `protobuf:"bytes,1,opt" json:"Content,omitempty"` - StatusCode *int32 `protobuf:"varint,2,req" json:"StatusCode,omitempty"` - Header []*URLFetchResponse_Header `protobuf:"group,3,rep" json:"header,omitempty"` - ContentWasTruncated *bool `protobuf:"varint,6,opt,def=0" json:"ContentWasTruncated,omitempty"` - ExternalBytesSent *int64 `protobuf:"varint,7,opt" json:"ExternalBytesSent,omitempty"` - ExternalBytesReceived *int64 `protobuf:"varint,8,opt" json:"ExternalBytesReceived,omitempty"` - FinalUrl *string `protobuf:"bytes,9,opt" json:"FinalUrl,omitempty"` - ApiCpuMilliseconds *int64 `protobuf:"varint,10,opt,def=0" json:"ApiCpuMilliseconds,omitempty"` - ApiBytesSent *int64 `protobuf:"varint,11,opt,def=0" json:"ApiBytesSent,omitempty"` - ApiBytesReceived *int64 `protobuf:"varint,12,opt,def=0" json:"ApiBytesReceived,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} } -func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) } -func (*URLFetchResponse) ProtoMessage() {} - -const Default_URLFetchResponse_ContentWasTruncated bool = false -const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0 -const Default_URLFetchResponse_ApiBytesSent int64 = 0 -const Default_URLFetchResponse_ApiBytesReceived int64 = 0 - -func (m *URLFetchResponse) GetContent() []byte { - if m != nil { - return m.Content - } - return nil -} - -func (m *URLFetchResponse) GetStatusCode() int32 { - if m != nil && m.StatusCode != nil { - return *m.StatusCode - } - return 0 -} - -func (m *URLFetchResponse) GetHeader() []*URLFetchResponse_Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *URLFetchResponse) GetContentWasTruncated() bool { - if m != nil && m.ContentWasTruncated != nil { - return *m.ContentWasTruncated - } - return Default_URLFetchResponse_ContentWasTruncated -} - -func (m *URLFetchResponse) GetExternalBytesSent() int64 { - if m != nil && m.ExternalBytesSent != nil { - return *m.ExternalBytesSent - } - return 0 -} - -func (m *URLFetchResponse) GetExternalBytesReceived() int64 { - if m != nil && m.ExternalBytesReceived != nil { - return *m.ExternalBytesReceived - } - return 0 -} - -func (m *URLFetchResponse) GetFinalUrl() string { - if m != nil && m.FinalUrl != nil { - return *m.FinalUrl - } - return "" -} - -func (m *URLFetchResponse) GetApiCpuMilliseconds() int64 { - if m != nil && m.ApiCpuMilliseconds != nil { - return *m.ApiCpuMilliseconds - } - return Default_URLFetchResponse_ApiCpuMilliseconds -} - -func (m *URLFetchResponse) GetApiBytesSent() int64 { - if m != nil && m.ApiBytesSent != nil { - return *m.ApiBytesSent - } - return Default_URLFetchResponse_ApiBytesSent -} - -func (m *URLFetchResponse) GetApiBytesReceived() int64 { - if m != nil && m.ApiBytesReceived != nil { - return *m.ApiBytesReceived - } - return Default_URLFetchResponse_ApiBytesReceived -} - -type URLFetchResponse_Header struct { - Key *string `protobuf:"bytes,4,req" json:"Key,omitempty"` - Value *string `protobuf:"bytes,5,req" json:"Value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} } -func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) } -func (*URLFetchResponse_Header) ProtoMessage() {} - -func (m *URLFetchResponse_Header) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *URLFetchResponse_Header) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto b/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto deleted file mode 100644 index f695edf6a..000000000 --- a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto +++ /dev/null @@ -1,64 +0,0 @@ -syntax = "proto2"; -option go_package = "urlfetch"; - -package appengine; - -message URLFetchServiceError { - enum ErrorCode { - OK = 0; - INVALID_URL = 1; - FETCH_ERROR = 2; - UNSPECIFIED_ERROR = 3; - RESPONSE_TOO_LARGE = 4; - DEADLINE_EXCEEDED = 5; - SSL_CERTIFICATE_ERROR = 6; - DNS_ERROR = 7; - CLOSED = 8; - INTERNAL_TRANSIENT_ERROR = 9; - TOO_MANY_REDIRECTS = 10; - MALFORMED_REPLY = 11; - CONNECTION_ERROR = 12; - } -} - -message URLFetchRequest { - enum RequestMethod { - GET = 1; - POST = 2; - HEAD = 3; - PUT = 4; - DELETE = 5; - PATCH = 6; - } - required RequestMethod Method = 1; - required string Url = 2; - repeated group Header = 3 { - required string Key = 4; - required string Value = 5; - } - optional bytes Payload = 6 [ctype=CORD]; - - optional bool FollowRedirects = 7 [default=true]; - - optional double Deadline = 8; - - optional bool MustValidateServerCertificate = 9 [default=true]; -} - -message URLFetchResponse { - optional bytes Content = 1; - required int32 StatusCode = 2; - repeated group Header = 3 { - required string Key = 4; - required string Value = 5; - } - optional bool ContentWasTruncated = 6 [default=false]; - optional int64 ExternalBytesSent = 7; - optional int64 ExternalBytesReceived = 8; - - optional string FinalUrl = 9; - - optional int64 ApiCpuMilliseconds = 10 [default=0]; - optional int64 ApiBytesSent = 11 [default=0]; - optional int64 ApiBytesReceived = 12 [default=0]; -} diff --git a/vendor/google.golang.org/appengine/internal/user/user_service.pb.go b/vendor/google.golang.org/appengine/internal/user/user_service.pb.go deleted file mode 100644 index 67627d904..000000000 --- a/vendor/google.golang.org/appengine/internal/user/user_service.pb.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/user/user_service.proto -// DO NOT EDIT! - -/* -Package user is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/user/user_service.proto - -It has these top-level messages: - UserServiceError - CreateLoginURLRequest - CreateLoginURLResponse - CreateLogoutURLRequest - CreateLogoutURLResponse - GetOAuthUserRequest - GetOAuthUserResponse - CheckOAuthSignatureRequest - CheckOAuthSignatureResponse -*/ -package user - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type UserServiceError_ErrorCode int32 - -const ( - UserServiceError_OK UserServiceError_ErrorCode = 0 - UserServiceError_REDIRECT_URL_TOO_LONG UserServiceError_ErrorCode = 1 - UserServiceError_NOT_ALLOWED UserServiceError_ErrorCode = 2 - UserServiceError_OAUTH_INVALID_TOKEN UserServiceError_ErrorCode = 3 - UserServiceError_OAUTH_INVALID_REQUEST UserServiceError_ErrorCode = 4 - UserServiceError_OAUTH_ERROR UserServiceError_ErrorCode = 5 -) - -var UserServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "REDIRECT_URL_TOO_LONG", - 2: "NOT_ALLOWED", - 3: "OAUTH_INVALID_TOKEN", - 4: "OAUTH_INVALID_REQUEST", - 5: "OAUTH_ERROR", -} -var UserServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "REDIRECT_URL_TOO_LONG": 1, - "NOT_ALLOWED": 2, - "OAUTH_INVALID_TOKEN": 3, - "OAUTH_INVALID_REQUEST": 4, - "OAUTH_ERROR": 5, -} - -func (x UserServiceError_ErrorCode) Enum() *UserServiceError_ErrorCode { - p := new(UserServiceError_ErrorCode) - *p = x - return p -} -func (x UserServiceError_ErrorCode) String() string { - return proto.EnumName(UserServiceError_ErrorCode_name, int32(x)) -} -func (x *UserServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(UserServiceError_ErrorCode_value, data, "UserServiceError_ErrorCode") - if err != nil { - return err - } - *x = UserServiceError_ErrorCode(value) - return nil -} - -type UserServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *UserServiceError) Reset() { *m = UserServiceError{} } -func (m *UserServiceError) String() string { return proto.CompactTextString(m) } -func (*UserServiceError) ProtoMessage() {} - -type CreateLoginURLRequest struct { - DestinationUrl *string `protobuf:"bytes,1,req,name=destination_url" json:"destination_url,omitempty"` - AuthDomain *string `protobuf:"bytes,2,opt,name=auth_domain" json:"auth_domain,omitempty"` - FederatedIdentity *string `protobuf:"bytes,3,opt,name=federated_identity,def=" json:"federated_identity,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CreateLoginURLRequest) Reset() { *m = CreateLoginURLRequest{} } -func (m *CreateLoginURLRequest) String() string { return proto.CompactTextString(m) } -func (*CreateLoginURLRequest) ProtoMessage() {} - -func (m *CreateLoginURLRequest) GetDestinationUrl() string { - if m != nil && m.DestinationUrl != nil { - return *m.DestinationUrl - } - return "" -} - -func (m *CreateLoginURLRequest) GetAuthDomain() string { - if m != nil && m.AuthDomain != nil { - return *m.AuthDomain - } - return "" -} - -func (m *CreateLoginURLRequest) GetFederatedIdentity() string { - if m != nil && m.FederatedIdentity != nil { - return *m.FederatedIdentity - } - return "" -} - -type CreateLoginURLResponse struct { - LoginUrl *string `protobuf:"bytes,1,req,name=login_url" json:"login_url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CreateLoginURLResponse) Reset() { *m = CreateLoginURLResponse{} } -func (m *CreateLoginURLResponse) String() string { return proto.CompactTextString(m) } -func (*CreateLoginURLResponse) ProtoMessage() {} - -func (m *CreateLoginURLResponse) GetLoginUrl() string { - if m != nil && m.LoginUrl != nil { - return *m.LoginUrl - } - return "" -} - -type CreateLogoutURLRequest struct { - DestinationUrl *string `protobuf:"bytes,1,req,name=destination_url" json:"destination_url,omitempty"` - AuthDomain *string `protobuf:"bytes,2,opt,name=auth_domain" json:"auth_domain,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CreateLogoutURLRequest) Reset() { *m = CreateLogoutURLRequest{} } -func (m *CreateLogoutURLRequest) String() string { return proto.CompactTextString(m) } -func (*CreateLogoutURLRequest) ProtoMessage() {} - -func (m *CreateLogoutURLRequest) GetDestinationUrl() string { - if m != nil && m.DestinationUrl != nil { - return *m.DestinationUrl - } - return "" -} - -func (m *CreateLogoutURLRequest) GetAuthDomain() string { - if m != nil && m.AuthDomain != nil { - return *m.AuthDomain - } - return "" -} - -type CreateLogoutURLResponse struct { - LogoutUrl *string `protobuf:"bytes,1,req,name=logout_url" json:"logout_url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CreateLogoutURLResponse) Reset() { *m = CreateLogoutURLResponse{} } -func (m *CreateLogoutURLResponse) String() string { return proto.CompactTextString(m) } -func (*CreateLogoutURLResponse) ProtoMessage() {} - -func (m *CreateLogoutURLResponse) GetLogoutUrl() string { - if m != nil && m.LogoutUrl != nil { - return *m.LogoutUrl - } - return "" -} - -type GetOAuthUserRequest struct { - Scope *string `protobuf:"bytes,1,opt,name=scope" json:"scope,omitempty"` - Scopes []string `protobuf:"bytes,2,rep,name=scopes" json:"scopes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *GetOAuthUserRequest) Reset() { *m = GetOAuthUserRequest{} } -func (m *GetOAuthUserRequest) String() string { return proto.CompactTextString(m) } -func (*GetOAuthUserRequest) ProtoMessage() {} - -func (m *GetOAuthUserRequest) GetScope() string { - if m != nil && m.Scope != nil { - return *m.Scope - } - return "" -} - -func (m *GetOAuthUserRequest) GetScopes() []string { - if m != nil { - return m.Scopes - } - return nil -} - -type GetOAuthUserResponse struct { - Email *string `protobuf:"bytes,1,req,name=email" json:"email,omitempty"` - UserId *string `protobuf:"bytes,2,req,name=user_id" json:"user_id,omitempty"` - AuthDomain *string `protobuf:"bytes,3,req,name=auth_domain" json:"auth_domain,omitempty"` - UserOrganization *string `protobuf:"bytes,4,opt,name=user_organization,def=" json:"user_organization,omitempty"` - IsAdmin *bool `protobuf:"varint,5,opt,name=is_admin,def=0" json:"is_admin,omitempty"` - ClientId *string `protobuf:"bytes,6,opt,name=client_id,def=" json:"client_id,omitempty"` - Scopes []string `protobuf:"bytes,7,rep,name=scopes" json:"scopes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *GetOAuthUserResponse) Reset() { *m = GetOAuthUserResponse{} } -func (m *GetOAuthUserResponse) String() string { return proto.CompactTextString(m) } -func (*GetOAuthUserResponse) ProtoMessage() {} - -const Default_GetOAuthUserResponse_IsAdmin bool = false - -func (m *GetOAuthUserResponse) GetEmail() string { - if m != nil && m.Email != nil { - return *m.Email - } - return "" -} - -func (m *GetOAuthUserResponse) GetUserId() string { - if m != nil && m.UserId != nil { - return *m.UserId - } - return "" -} - -func (m *GetOAuthUserResponse) GetAuthDomain() string { - if m != nil && m.AuthDomain != nil { - return *m.AuthDomain - } - return "" -} - -func (m *GetOAuthUserResponse) GetUserOrganization() string { - if m != nil && m.UserOrganization != nil { - return *m.UserOrganization - } - return "" -} - -func (m *GetOAuthUserResponse) GetIsAdmin() bool { - if m != nil && m.IsAdmin != nil { - return *m.IsAdmin - } - return Default_GetOAuthUserResponse_IsAdmin -} - -func (m *GetOAuthUserResponse) GetClientId() string { - if m != nil && m.ClientId != nil { - return *m.ClientId - } - return "" -} - -func (m *GetOAuthUserResponse) GetScopes() []string { - if m != nil { - return m.Scopes - } - return nil -} - -type CheckOAuthSignatureRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CheckOAuthSignatureRequest) Reset() { *m = CheckOAuthSignatureRequest{} } -func (m *CheckOAuthSignatureRequest) String() string { return proto.CompactTextString(m) } -func (*CheckOAuthSignatureRequest) ProtoMessage() {} - -type CheckOAuthSignatureResponse struct { - OauthConsumerKey *string `protobuf:"bytes,1,req,name=oauth_consumer_key" json:"oauth_consumer_key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CheckOAuthSignatureResponse) Reset() { *m = CheckOAuthSignatureResponse{} } -func (m *CheckOAuthSignatureResponse) String() string { return proto.CompactTextString(m) } -func (*CheckOAuthSignatureResponse) ProtoMessage() {} - -func (m *CheckOAuthSignatureResponse) GetOauthConsumerKey() string { - if m != nil && m.OauthConsumerKey != nil { - return *m.OauthConsumerKey - } - return "" -} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/user/user_service.proto b/vendor/google.golang.org/appengine/internal/user/user_service.proto deleted file mode 100644 index f3e969346..000000000 --- a/vendor/google.golang.org/appengine/internal/user/user_service.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto2"; -option go_package = "user"; - -package appengine; - -message UserServiceError { - enum ErrorCode { - OK = 0; - REDIRECT_URL_TOO_LONG = 1; - NOT_ALLOWED = 2; - OAUTH_INVALID_TOKEN = 3; - OAUTH_INVALID_REQUEST = 4; - OAUTH_ERROR = 5; - } -} - -message CreateLoginURLRequest { - required string destination_url = 1; - optional string auth_domain = 2; - optional string federated_identity = 3 [default = ""]; -} - -message CreateLoginURLResponse { - required string login_url = 1; -} - -message CreateLogoutURLRequest { - required string destination_url = 1; - optional string auth_domain = 2; -} - -message CreateLogoutURLResponse { - required string logout_url = 1; -} - -message GetOAuthUserRequest { - optional string scope = 1; - - repeated string scopes = 2; -} - -message GetOAuthUserResponse { - required string email = 1; - required string user_id = 2; - required string auth_domain = 3; - optional string user_organization = 4 [default = ""]; - optional bool is_admin = 5 [default = false]; - optional string client_id = 6 [default = ""]; - - repeated string scopes = 7; -} - -message CheckOAuthSignatureRequest { -} - -message CheckOAuthSignatureResponse { - required string oauth_consumer_key = 1; -} diff --git a/vendor/google.golang.org/appengine/internal/xmpp/xmpp_service.pb.go b/vendor/google.golang.org/appengine/internal/xmpp/xmpp_service.pb.go deleted file mode 100644 index be1e9865a..000000000 --- a/vendor/google.golang.org/appengine/internal/xmpp/xmpp_service.pb.go +++ /dev/null @@ -1,425 +0,0 @@ -// Code generated by protoc-gen-go. -// source: google.golang.org/appengine/internal/xmpp/xmpp_service.proto -// DO NOT EDIT! - -/* -Package xmpp is a generated protocol buffer package. - -It is generated from these files: - google.golang.org/appengine/internal/xmpp/xmpp_service.proto - -It has these top-level messages: - XmppServiceError - PresenceRequest - PresenceResponse - BulkPresenceRequest - BulkPresenceResponse - XmppMessageRequest - XmppMessageResponse - XmppSendPresenceRequest - XmppSendPresenceResponse - XmppInviteRequest - XmppInviteResponse -*/ -package xmpp - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type XmppServiceError_ErrorCode int32 - -const ( - XmppServiceError_UNSPECIFIED_ERROR XmppServiceError_ErrorCode = 1 - XmppServiceError_INVALID_JID XmppServiceError_ErrorCode = 2 - XmppServiceError_NO_BODY XmppServiceError_ErrorCode = 3 - XmppServiceError_INVALID_XML XmppServiceError_ErrorCode = 4 - XmppServiceError_INVALID_TYPE XmppServiceError_ErrorCode = 5 - XmppServiceError_INVALID_SHOW XmppServiceError_ErrorCode = 6 - XmppServiceError_EXCEEDED_MAX_SIZE XmppServiceError_ErrorCode = 7 - XmppServiceError_APPID_ALIAS_REQUIRED XmppServiceError_ErrorCode = 8 - XmppServiceError_NONDEFAULT_MODULE XmppServiceError_ErrorCode = 9 -) - -var XmppServiceError_ErrorCode_name = map[int32]string{ - 1: "UNSPECIFIED_ERROR", - 2: "INVALID_JID", - 3: "NO_BODY", - 4: "INVALID_XML", - 5: "INVALID_TYPE", - 6: "INVALID_SHOW", - 7: "EXCEEDED_MAX_SIZE", - 8: "APPID_ALIAS_REQUIRED", - 9: "NONDEFAULT_MODULE", -} -var XmppServiceError_ErrorCode_value = map[string]int32{ - "UNSPECIFIED_ERROR": 1, - "INVALID_JID": 2, - "NO_BODY": 3, - "INVALID_XML": 4, - "INVALID_TYPE": 5, - "INVALID_SHOW": 6, - "EXCEEDED_MAX_SIZE": 7, - "APPID_ALIAS_REQUIRED": 8, - "NONDEFAULT_MODULE": 9, -} - -func (x XmppServiceError_ErrorCode) Enum() *XmppServiceError_ErrorCode { - p := new(XmppServiceError_ErrorCode) - *p = x - return p -} -func (x XmppServiceError_ErrorCode) String() string { - return proto.EnumName(XmppServiceError_ErrorCode_name, int32(x)) -} -func (x *XmppServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(XmppServiceError_ErrorCode_value, data, "XmppServiceError_ErrorCode") - if err != nil { - return err - } - *x = XmppServiceError_ErrorCode(value) - return nil -} - -type PresenceResponse_SHOW int32 - -const ( - PresenceResponse_NORMAL PresenceResponse_SHOW = 0 - PresenceResponse_AWAY PresenceResponse_SHOW = 1 - PresenceResponse_DO_NOT_DISTURB PresenceResponse_SHOW = 2 - PresenceResponse_CHAT PresenceResponse_SHOW = 3 - PresenceResponse_EXTENDED_AWAY PresenceResponse_SHOW = 4 -) - -var PresenceResponse_SHOW_name = map[int32]string{ - 0: "NORMAL", - 1: "AWAY", - 2: "DO_NOT_DISTURB", - 3: "CHAT", - 4: "EXTENDED_AWAY", -} -var PresenceResponse_SHOW_value = map[string]int32{ - "NORMAL": 0, - "AWAY": 1, - "DO_NOT_DISTURB": 2, - "CHAT": 3, - "EXTENDED_AWAY": 4, -} - -func (x PresenceResponse_SHOW) Enum() *PresenceResponse_SHOW { - p := new(PresenceResponse_SHOW) - *p = x - return p -} -func (x PresenceResponse_SHOW) String() string { - return proto.EnumName(PresenceResponse_SHOW_name, int32(x)) -} -func (x *PresenceResponse_SHOW) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PresenceResponse_SHOW_value, data, "PresenceResponse_SHOW") - if err != nil { - return err - } - *x = PresenceResponse_SHOW(value) - return nil -} - -type XmppMessageResponse_XmppMessageStatus int32 - -const ( - XmppMessageResponse_NO_ERROR XmppMessageResponse_XmppMessageStatus = 0 - XmppMessageResponse_INVALID_JID XmppMessageResponse_XmppMessageStatus = 1 - XmppMessageResponse_OTHER_ERROR XmppMessageResponse_XmppMessageStatus = 2 -) - -var XmppMessageResponse_XmppMessageStatus_name = map[int32]string{ - 0: "NO_ERROR", - 1: "INVALID_JID", - 2: "OTHER_ERROR", -} -var XmppMessageResponse_XmppMessageStatus_value = map[string]int32{ - "NO_ERROR": 0, - "INVALID_JID": 1, - "OTHER_ERROR": 2, -} - -func (x XmppMessageResponse_XmppMessageStatus) Enum() *XmppMessageResponse_XmppMessageStatus { - p := new(XmppMessageResponse_XmppMessageStatus) - *p = x - return p -} -func (x XmppMessageResponse_XmppMessageStatus) String() string { - return proto.EnumName(XmppMessageResponse_XmppMessageStatus_name, int32(x)) -} -func (x *XmppMessageResponse_XmppMessageStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(XmppMessageResponse_XmppMessageStatus_value, data, "XmppMessageResponse_XmppMessageStatus") - if err != nil { - return err - } - *x = XmppMessageResponse_XmppMessageStatus(value) - return nil -} - -type XmppServiceError struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppServiceError) Reset() { *m = XmppServiceError{} } -func (m *XmppServiceError) String() string { return proto.CompactTextString(m) } -func (*XmppServiceError) ProtoMessage() {} - -type PresenceRequest struct { - Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"` - FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PresenceRequest) Reset() { *m = PresenceRequest{} } -func (m *PresenceRequest) String() string { return proto.CompactTextString(m) } -func (*PresenceRequest) ProtoMessage() {} - -func (m *PresenceRequest) GetJid() string { - if m != nil && m.Jid != nil { - return *m.Jid - } - return "" -} - -func (m *PresenceRequest) GetFromJid() string { - if m != nil && m.FromJid != nil { - return *m.FromJid - } - return "" -} - -type PresenceResponse struct { - IsAvailable *bool `protobuf:"varint,1,req,name=is_available" json:"is_available,omitempty"` - Presence *PresenceResponse_SHOW `protobuf:"varint,2,opt,name=presence,enum=appengine.PresenceResponse_SHOW" json:"presence,omitempty"` - Valid *bool `protobuf:"varint,3,opt,name=valid" json:"valid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PresenceResponse) Reset() { *m = PresenceResponse{} } -func (m *PresenceResponse) String() string { return proto.CompactTextString(m) } -func (*PresenceResponse) ProtoMessage() {} - -func (m *PresenceResponse) GetIsAvailable() bool { - if m != nil && m.IsAvailable != nil { - return *m.IsAvailable - } - return false -} - -func (m *PresenceResponse) GetPresence() PresenceResponse_SHOW { - if m != nil && m.Presence != nil { - return *m.Presence - } - return PresenceResponse_NORMAL -} - -func (m *PresenceResponse) GetValid() bool { - if m != nil && m.Valid != nil { - return *m.Valid - } - return false -} - -type BulkPresenceRequest struct { - Jid []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"` - FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BulkPresenceRequest) Reset() { *m = BulkPresenceRequest{} } -func (m *BulkPresenceRequest) String() string { return proto.CompactTextString(m) } -func (*BulkPresenceRequest) ProtoMessage() {} - -func (m *BulkPresenceRequest) GetJid() []string { - if m != nil { - return m.Jid - } - return nil -} - -func (m *BulkPresenceRequest) GetFromJid() string { - if m != nil && m.FromJid != nil { - return *m.FromJid - } - return "" -} - -type BulkPresenceResponse struct { - PresenceResponse []*PresenceResponse `protobuf:"bytes,1,rep,name=presence_response" json:"presence_response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BulkPresenceResponse) Reset() { *m = BulkPresenceResponse{} } -func (m *BulkPresenceResponse) String() string { return proto.CompactTextString(m) } -func (*BulkPresenceResponse) ProtoMessage() {} - -func (m *BulkPresenceResponse) GetPresenceResponse() []*PresenceResponse { - if m != nil { - return m.PresenceResponse - } - return nil -} - -type XmppMessageRequest struct { - Jid []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"` - Body *string `protobuf:"bytes,2,req,name=body" json:"body,omitempty"` - RawXml *bool `protobuf:"varint,3,opt,name=raw_xml,def=0" json:"raw_xml,omitempty"` - Type *string `protobuf:"bytes,4,opt,name=type,def=chat" json:"type,omitempty"` - FromJid *string `protobuf:"bytes,5,opt,name=from_jid" json:"from_jid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppMessageRequest) Reset() { *m = XmppMessageRequest{} } -func (m *XmppMessageRequest) String() string { return proto.CompactTextString(m) } -func (*XmppMessageRequest) ProtoMessage() {} - -const Default_XmppMessageRequest_RawXml bool = false -const Default_XmppMessageRequest_Type string = "chat" - -func (m *XmppMessageRequest) GetJid() []string { - if m != nil { - return m.Jid - } - return nil -} - -func (m *XmppMessageRequest) GetBody() string { - if m != nil && m.Body != nil { - return *m.Body - } - return "" -} - -func (m *XmppMessageRequest) GetRawXml() bool { - if m != nil && m.RawXml != nil { - return *m.RawXml - } - return Default_XmppMessageRequest_RawXml -} - -func (m *XmppMessageRequest) GetType() string { - if m != nil && m.Type != nil { - return *m.Type - } - return Default_XmppMessageRequest_Type -} - -func (m *XmppMessageRequest) GetFromJid() string { - if m != nil && m.FromJid != nil { - return *m.FromJid - } - return "" -} - -type XmppMessageResponse struct { - Status []XmppMessageResponse_XmppMessageStatus `protobuf:"varint,1,rep,name=status,enum=appengine.XmppMessageResponse_XmppMessageStatus" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppMessageResponse) Reset() { *m = XmppMessageResponse{} } -func (m *XmppMessageResponse) String() string { return proto.CompactTextString(m) } -func (*XmppMessageResponse) ProtoMessage() {} - -func (m *XmppMessageResponse) GetStatus() []XmppMessageResponse_XmppMessageStatus { - if m != nil { - return m.Status - } - return nil -} - -type XmppSendPresenceRequest struct { - Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"` - Type *string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` - Show *string `protobuf:"bytes,3,opt,name=show" json:"show,omitempty"` - Status *string `protobuf:"bytes,4,opt,name=status" json:"status,omitempty"` - FromJid *string `protobuf:"bytes,5,opt,name=from_jid" json:"from_jid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppSendPresenceRequest) Reset() { *m = XmppSendPresenceRequest{} } -func (m *XmppSendPresenceRequest) String() string { return proto.CompactTextString(m) } -func (*XmppSendPresenceRequest) ProtoMessage() {} - -func (m *XmppSendPresenceRequest) GetJid() string { - if m != nil && m.Jid != nil { - return *m.Jid - } - return "" -} - -func (m *XmppSendPresenceRequest) GetType() string { - if m != nil && m.Type != nil { - return *m.Type - } - return "" -} - -func (m *XmppSendPresenceRequest) GetShow() string { - if m != nil && m.Show != nil { - return *m.Show - } - return "" -} - -func (m *XmppSendPresenceRequest) GetStatus() string { - if m != nil && m.Status != nil { - return *m.Status - } - return "" -} - -func (m *XmppSendPresenceRequest) GetFromJid() string { - if m != nil && m.FromJid != nil { - return *m.FromJid - } - return "" -} - -type XmppSendPresenceResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppSendPresenceResponse) Reset() { *m = XmppSendPresenceResponse{} } -func (m *XmppSendPresenceResponse) String() string { return proto.CompactTextString(m) } -func (*XmppSendPresenceResponse) ProtoMessage() {} - -type XmppInviteRequest struct { - Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"` - FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppInviteRequest) Reset() { *m = XmppInviteRequest{} } -func (m *XmppInviteRequest) String() string { return proto.CompactTextString(m) } -func (*XmppInviteRequest) ProtoMessage() {} - -func (m *XmppInviteRequest) GetJid() string { - if m != nil && m.Jid != nil { - return *m.Jid - } - return "" -} - -func (m *XmppInviteRequest) GetFromJid() string { - if m != nil && m.FromJid != nil { - return *m.FromJid - } - return "" -} - -type XmppInviteResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *XmppInviteResponse) Reset() { *m = XmppInviteResponse{} } -func (m *XmppInviteResponse) String() string { return proto.CompactTextString(m) } -func (*XmppInviteResponse) ProtoMessage() {} - -func init() { -} diff --git a/vendor/google.golang.org/appengine/internal/xmpp/xmpp_service.proto b/vendor/google.golang.org/appengine/internal/xmpp/xmpp_service.proto deleted file mode 100644 index 472d52ebf..000000000 --- a/vendor/google.golang.org/appengine/internal/xmpp/xmpp_service.proto +++ /dev/null @@ -1,83 +0,0 @@ -syntax = "proto2"; -option go_package = "xmpp"; - -package appengine; - -message XmppServiceError { - enum ErrorCode { - UNSPECIFIED_ERROR = 1; - INVALID_JID = 2; - NO_BODY = 3; - INVALID_XML = 4; - INVALID_TYPE = 5; - INVALID_SHOW = 6; - EXCEEDED_MAX_SIZE = 7; - APPID_ALIAS_REQUIRED = 8; - NONDEFAULT_MODULE = 9; - } -} - -message PresenceRequest { - required string jid = 1; - optional string from_jid = 2; -} - -message PresenceResponse { - enum SHOW { - NORMAL = 0; - AWAY = 1; - DO_NOT_DISTURB = 2; - CHAT = 3; - EXTENDED_AWAY = 4; - } - - required bool is_available = 1; - optional SHOW presence = 2; - optional bool valid = 3; -} - -message BulkPresenceRequest { - repeated string jid = 1; - optional string from_jid = 2; -} - -message BulkPresenceResponse { - repeated PresenceResponse presence_response = 1; -} - -message XmppMessageRequest { - repeated string jid = 1; - required string body = 2; - optional bool raw_xml = 3 [ default = false ]; - optional string type = 4 [ default = "chat" ]; - optional string from_jid = 5; -} - -message XmppMessageResponse { - enum XmppMessageStatus { - NO_ERROR = 0; - INVALID_JID = 1; - OTHER_ERROR = 2; - } - - repeated XmppMessageStatus status = 1; -} - -message XmppSendPresenceRequest { - required string jid = 1; - optional string type = 2; - optional string show = 3; - optional string status = 4; - optional string from_jid = 5; -} - -message XmppSendPresenceResponse { -} - -message XmppInviteRequest { - required string jid = 1; - optional string from_jid = 2; -} - -message XmppInviteResponse { -} diff --git a/vendor/google.golang.org/appengine/log/api.go b/vendor/google.golang.org/appengine/log/api.go deleted file mode 100644 index 24d58601b..000000000 --- a/vendor/google.golang.org/appengine/log/api.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2015 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package log - -// This file implements the logging API. - -import ( - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -// Debugf formats its arguments according to the format, analogous to fmt.Printf, -// and records the text as a log message at Debug level. The message will be associated -// with the request linked with the provided context. -func Debugf(ctx context.Context, format string, args ...interface{}) { - internal.Logf(ctx, 0, format, args...) -} - -// Infof is like Debugf, but at Info level. -func Infof(ctx context.Context, format string, args ...interface{}) { - internal.Logf(ctx, 1, format, args...) -} - -// Warningf is like Debugf, but at Warning level. -func Warningf(ctx context.Context, format string, args ...interface{}) { - internal.Logf(ctx, 2, format, args...) -} - -// Errorf is like Debugf, but at Error level. -func Errorf(ctx context.Context, format string, args ...interface{}) { - internal.Logf(ctx, 3, format, args...) -} - -// Criticalf is like Debugf, but at Critical level. -func Criticalf(ctx context.Context, format string, args ...interface{}) { - internal.Logf(ctx, 4, format, args...) -} diff --git a/vendor/google.golang.org/appengine/log/log.go b/vendor/google.golang.org/appengine/log/log.go deleted file mode 100644 index cd89e5ced..000000000 --- a/vendor/google.golang.org/appengine/log/log.go +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package log provides the means of querying an application's logs from -within an App Engine application. - -Example: - c := appengine.NewContext(r) - query := &log.Query{ - AppLogs: true, - Versions: []string{"1"}, - } - - for results := query.Run(c); ; { - record, err := results.Next() - if err == log.Done { - log.Infof(c, "Done processing results") - break - } - if err != nil { - log.Errorf(c, "Failed to retrieve next log: %v", err) - break - } - log.Infof(c, "Saw record %v", record) - } -*/ -package log - -import ( - "errors" - "fmt" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/log" -) - -// Query defines a logs query. -type Query struct { - // Start time specifies the earliest log to return (inclusive). - StartTime time.Time - - // End time specifies the latest log to return (exclusive). - EndTime time.Time - - // Offset specifies a position within the log stream to resume reading from, - // and should come from a previously returned Record's field of the same name. - Offset []byte - - // Incomplete controls whether active (incomplete) requests should be included. - Incomplete bool - - // AppLogs indicates if application-level logs should be included. - AppLogs bool - - // ApplyMinLevel indicates if MinLevel should be used to filter results. - ApplyMinLevel bool - - // If ApplyMinLevel is true, only logs for requests with at least one - // application log of MinLevel or higher will be returned. - MinLevel int - - // Versions is the major version IDs whose logs should be retrieved. - // Logs for specific modules can be retrieved by the specifying versions - // in the form "module:version"; the default module is used if no module - // is specified. - Versions []string - - // A list of requests to search for instead of a time-based scan. Cannot be - // combined with filtering options such as StartTime, EndTime, Offset, - // Incomplete, ApplyMinLevel, or Versions. - RequestIDs []string -} - -// AppLog represents a single application-level log. -type AppLog struct { - Time time.Time - Level int - Message string -} - -// Record contains all the information for a single web request. -type Record struct { - AppID string - ModuleID string - VersionID string - RequestID []byte - IP string - Nickname string - AppEngineRelease string - - // The time when this request started. - StartTime time.Time - - // The time when this request finished. - EndTime time.Time - - // Opaque cursor into the result stream. - Offset []byte - - // The time required to process the request. - Latency time.Duration - MCycles int64 - Method string - Resource string - HTTPVersion string - Status int32 - - // The size of the request sent back to the client, in bytes. - ResponseSize int64 - Referrer string - UserAgent string - URLMapEntry string - Combined string - Host string - - // The estimated cost of this request, in dollars. - Cost float64 - TaskQueueName string - TaskName string - WasLoadingRequest bool - PendingTime time.Duration - Finished bool - AppLogs []AppLog - - // Mostly-unique identifier for the instance that handled the request if available. - InstanceID string -} - -// Result represents the result of a query. -type Result struct { - logs []*Record - context context.Context - request *pb.LogReadRequest - resultsSeen bool - err error -} - -// Next returns the next log record, -func (qr *Result) Next() (*Record, error) { - if qr.err != nil { - return nil, qr.err - } - if len(qr.logs) > 0 { - lr := qr.logs[0] - qr.logs = qr.logs[1:] - return lr, nil - } - - if qr.request.Offset == nil && qr.resultsSeen { - return nil, Done - } - - if err := qr.run(); err != nil { - // Errors here may be retried, so don't store the error. - return nil, err - } - - return qr.Next() -} - -// Done is returned when a query iteration has completed. -var Done = errors.New("log: query has no more results") - -// protoToAppLogs takes as input an array of pointers to LogLines, the internal -// Protocol Buffer representation of a single application-level log, -// and converts it to an array of AppLogs, the external representation -// of an application-level log. -func protoToAppLogs(logLines []*pb.LogLine) []AppLog { - appLogs := make([]AppLog, len(logLines)) - - for i, line := range logLines { - appLogs[i] = AppLog{ - Time: time.Unix(0, *line.Time*1e3), - Level: int(*line.Level), - Message: *line.LogMessage, - } - } - - return appLogs -} - -// protoToRecord converts a RequestLog, the internal Protocol Buffer -// representation of a single request-level log, to a Record, its -// corresponding external representation. -func protoToRecord(rl *pb.RequestLog) *Record { - offset, err := proto.Marshal(rl.Offset) - if err != nil { - offset = nil - } - return &Record{ - AppID: *rl.AppId, - ModuleID: rl.GetModuleId(), - VersionID: *rl.VersionId, - RequestID: rl.RequestId, - Offset: offset, - IP: *rl.Ip, - Nickname: rl.GetNickname(), - AppEngineRelease: string(rl.GetAppEngineRelease()), - StartTime: time.Unix(0, *rl.StartTime*1e3), - EndTime: time.Unix(0, *rl.EndTime*1e3), - Latency: time.Duration(*rl.Latency) * time.Microsecond, - MCycles: *rl.Mcycles, - Method: *rl.Method, - Resource: *rl.Resource, - HTTPVersion: *rl.HttpVersion, - Status: *rl.Status, - ResponseSize: *rl.ResponseSize, - Referrer: rl.GetReferrer(), - UserAgent: rl.GetUserAgent(), - URLMapEntry: *rl.UrlMapEntry, - Combined: *rl.Combined, - Host: rl.GetHost(), - Cost: rl.GetCost(), - TaskQueueName: rl.GetTaskQueueName(), - TaskName: rl.GetTaskName(), - WasLoadingRequest: rl.GetWasLoadingRequest(), - PendingTime: time.Duration(rl.GetPendingTime()) * time.Microsecond, - Finished: rl.GetFinished(), - AppLogs: protoToAppLogs(rl.Line), - InstanceID: string(rl.GetCloneKey()), - } -} - -// Run starts a query for log records, which contain request and application -// level log information. -func (params *Query) Run(c context.Context) *Result { - req, err := makeRequest(params, internal.FullyQualifiedAppID(c), appengine.VersionID(c)) - return &Result{ - context: c, - request: req, - err: err, - } -} - -func makeRequest(params *Query, appID, versionID string) (*pb.LogReadRequest, error) { - req := &pb.LogReadRequest{} - req.AppId = &appID - if !params.StartTime.IsZero() { - req.StartTime = proto.Int64(params.StartTime.UnixNano() / 1e3) - } - if !params.EndTime.IsZero() { - req.EndTime = proto.Int64(params.EndTime.UnixNano() / 1e3) - } - if len(params.Offset) > 0 { - var offset pb.LogOffset - if err := proto.Unmarshal(params.Offset, &offset); err != nil { - return nil, fmt.Errorf("bad Offset: %v", err) - } - req.Offset = &offset - } - if params.Incomplete { - req.IncludeIncomplete = ¶ms.Incomplete - } - if params.AppLogs { - req.IncludeAppLogs = ¶ms.AppLogs - } - if params.ApplyMinLevel { - req.MinimumLogLevel = proto.Int32(int32(params.MinLevel)) - } - if params.Versions == nil { - // If no versions were specified, default to the default module at - // the major version being used by this module. - if i := strings.Index(versionID, "."); i >= 0 { - versionID = versionID[:i] - } - req.VersionId = []string{versionID} - } else { - req.ModuleVersion = make([]*pb.LogModuleVersion, 0, len(params.Versions)) - for _, v := range params.Versions { - var m *string - if i := strings.Index(v, ":"); i >= 0 { - m, v = proto.String(v[:i]), v[i+1:] - } - req.ModuleVersion = append(req.ModuleVersion, &pb.LogModuleVersion{ - ModuleId: m, - VersionId: proto.String(v), - }) - } - } - if params.RequestIDs != nil { - ids := make([][]byte, len(params.RequestIDs)) - for i, v := range params.RequestIDs { - ids[i] = []byte(v) - } - req.RequestId = ids - } - - return req, nil -} - -// run takes the query Result produced by a call to Run and updates it with -// more Records. The updated Result contains a new set of logs as well as an -// offset to where more logs can be found. We also convert the items in the -// response from their internal representations to external versions of the -// same structs. -func (r *Result) run() error { - res := &pb.LogReadResponse{} - if err := internal.Call(r.context, "logservice", "Read", r.request, res); err != nil { - return err - } - - r.logs = make([]*Record, len(res.Log)) - r.request.Offset = res.Offset - r.resultsSeen = true - - for i, log := range res.Log { - r.logs[i] = protoToRecord(log) - } - - return nil -} - -func init() { - internal.RegisterErrorCodeMap("logservice", pb.LogServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/appengine/mail/mail.go b/vendor/google.golang.org/appengine/mail/mail.go deleted file mode 100644 index be0eb518c..000000000 --- a/vendor/google.golang.org/appengine/mail/mail.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package mail provides the means of sending email from an -App Engine application. - -Example: - msg := &mail.Message{ - Sender: "romeo@montague.com", - To: []string{"Juliet "}, - Subject: "See you tonight", - Body: "Don't forget our plans. Hark, 'til later.", - } - if err := mail.Send(c, msg); err != nil { - log.Errorf(c, "Alas, my user, the email failed to sendeth: %v", err) - } -*/ -package mail - -import ( - "net/mail" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - bpb "google.golang.org/appengine/internal/base" - pb "google.golang.org/appengine/internal/mail" -) - -// A Message represents an email message. -// Addresses may be of any form permitted by RFC 822. -type Message struct { - // Sender must be set, and must be either an application admin - // or the currently signed-in user. - Sender string - ReplyTo string // may be empty - - // At least one of these slices must have a non-zero length, - // except when calling SendToAdmins. - To, Cc, Bcc []string - - Subject string - - // At least one of Body or HTMLBody must be non-empty. - Body string - HTMLBody string - - Attachments []Attachment - - // Extra mail headers. - // See https://cloud.google.com/appengine/docs/go/mail/ - // for permissible headers. - Headers mail.Header -} - -// An Attachment represents an email attachment. -type Attachment struct { - // Name must be set to a valid file name. - Name string - Data []byte - ContentID string -} - -// Send sends an email message. -func Send(c context.Context, msg *Message) error { - return send(c, "Send", msg) -} - -// SendToAdmins sends an email message to the application's administrators. -func SendToAdmins(c context.Context, msg *Message) error { - return send(c, "SendToAdmins", msg) -} - -func send(c context.Context, method string, msg *Message) error { - req := &pb.MailMessage{ - Sender: &msg.Sender, - To: msg.To, - Cc: msg.Cc, - Bcc: msg.Bcc, - Subject: &msg.Subject, - } - if msg.ReplyTo != "" { - req.ReplyTo = &msg.ReplyTo - } - if msg.Body != "" { - req.TextBody = &msg.Body - } - if msg.HTMLBody != "" { - req.HtmlBody = &msg.HTMLBody - } - if len(msg.Attachments) > 0 { - req.Attachment = make([]*pb.MailAttachment, len(msg.Attachments)) - for i, att := range msg.Attachments { - req.Attachment[i] = &pb.MailAttachment{ - FileName: proto.String(att.Name), - Data: att.Data, - } - if att.ContentID != "" { - req.Attachment[i].ContentID = proto.String(att.ContentID) - } - } - } - for key, vs := range msg.Headers { - for _, v := range vs { - req.Header = append(req.Header, &pb.MailHeader{ - Name: proto.String(key), - Value: proto.String(v), - }) - } - } - res := &bpb.VoidProto{} - if err := internal.Call(c, "mail", method, req, res); err != nil { - return err - } - return nil -} - -func init() { - internal.RegisterErrorCodeMap("mail", pb.MailServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/appengine/memcache/memcache.go b/vendor/google.golang.org/appengine/memcache/memcache.go deleted file mode 100644 index 515505504..000000000 --- a/vendor/google.golang.org/appengine/memcache/memcache.go +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package memcache provides a client for App Engine's distributed in-memory -// key-value store for small chunks of arbitrary data. -// -// The fundamental operations get and set items, keyed by a string. -// -// item0, err := memcache.Get(c, "key") -// if err != nil && err != memcache.ErrCacheMiss { -// return err -// } -// if err == nil { -// fmt.Fprintf(w, "memcache hit: Key=%q Val=[% x]\n", item0.Key, item0.Value) -// } else { -// fmt.Fprintf(w, "memcache miss\n") -// } -// -// and -// -// item1 := &memcache.Item{ -// Key: "foo", -// Value: []byte("bar"), -// } -// if err := memcache.Set(c, item1); err != nil { -// return err -// } -package memcache - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "errors" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/memcache" -) - -var ( - // ErrCacheMiss means that an operation failed - // because the item wasn't present. - ErrCacheMiss = errors.New("memcache: cache miss") - // ErrCASConflict means that a CompareAndSwap call failed due to the - // cached value being modified between the Get and the CompareAndSwap. - // If the cached value was simply evicted rather than replaced, - // ErrNotStored will be returned instead. - ErrCASConflict = errors.New("memcache: compare-and-swap conflict") - // ErrNoStats means that no statistics were available. - ErrNoStats = errors.New("memcache: no statistics available") - // ErrNotStored means that a conditional write operation (i.e. Add or - // CompareAndSwap) failed because the condition was not satisfied. - ErrNotStored = errors.New("memcache: item not stored") - // ErrServerError means that a server error occurred. - ErrServerError = errors.New("memcache: server error") -) - -// Item is the unit of memcache gets and sets. -type Item struct { - // Key is the Item's key (250 bytes maximum). - Key string - // Value is the Item's value. - Value []byte - // Object is the Item's value for use with a Codec. - Object interface{} - // Flags are server-opaque flags whose semantics are entirely up to the - // App Engine app. - Flags uint32 - // Expiration is the maximum duration that the item will stay - // in the cache. - // The zero value means the Item has no expiration time. - // Subsecond precision is ignored. - // This is not set when getting items. - Expiration time.Duration - // casID is a client-opaque value used for compare-and-swap operations. - // Zero means that compare-and-swap is not used. - casID uint64 -} - -const ( - secondsIn30Years = 60 * 60 * 24 * 365 * 30 // from memcache server code - thirtyYears = time.Duration(secondsIn30Years) * time.Second -) - -// protoToItem converts a protocol buffer item to a Go struct. -func protoToItem(p *pb.MemcacheGetResponse_Item) *Item { - return &Item{ - Key: string(p.Key), - Value: p.Value, - Flags: p.GetFlags(), - casID: p.GetCasId(), - } -} - -// If err is an appengine.MultiError, return its first element. Otherwise, return err. -func singleError(err error) error { - if me, ok := err.(appengine.MultiError); ok { - return me[0] - } - return err -} - -// Get gets the item for the given key. ErrCacheMiss is returned for a memcache -// cache miss. The key must be at most 250 bytes in length. -func Get(c context.Context, key string) (*Item, error) { - m, err := GetMulti(c, []string{key}) - if err != nil { - return nil, err - } - if _, ok := m[key]; !ok { - return nil, ErrCacheMiss - } - return m[key], nil -} - -// GetMulti is a batch version of Get. The returned map from keys to items may -// have fewer elements than the input slice, due to memcache cache misses. -// Each key must be at most 250 bytes in length. -func GetMulti(c context.Context, key []string) (map[string]*Item, error) { - if len(key) == 0 { - return nil, nil - } - keyAsBytes := make([][]byte, len(key)) - for i, k := range key { - keyAsBytes[i] = []byte(k) - } - req := &pb.MemcacheGetRequest{ - Key: keyAsBytes, - ForCas: proto.Bool(true), - } - res := &pb.MemcacheGetResponse{} - if err := internal.Call(c, "memcache", "Get", req, res); err != nil { - return nil, err - } - m := make(map[string]*Item, len(res.Item)) - for _, p := range res.Item { - t := protoToItem(p) - m[t.Key] = t - } - return m, nil -} - -// Delete deletes the item for the given key. -// ErrCacheMiss is returned if the specified item can not be found. -// The key must be at most 250 bytes in length. -func Delete(c context.Context, key string) error { - return singleError(DeleteMulti(c, []string{key})) -} - -// DeleteMulti is a batch version of Delete. -// If any keys cannot be found, an appengine.MultiError is returned. -// Each key must be at most 250 bytes in length. -func DeleteMulti(c context.Context, key []string) error { - if len(key) == 0 { - return nil - } - req := &pb.MemcacheDeleteRequest{ - Item: make([]*pb.MemcacheDeleteRequest_Item, len(key)), - } - for i, k := range key { - req.Item[i] = &pb.MemcacheDeleteRequest_Item{Key: []byte(k)} - } - res := &pb.MemcacheDeleteResponse{} - if err := internal.Call(c, "memcache", "Delete", req, res); err != nil { - return err - } - if len(res.DeleteStatus) != len(key) { - return ErrServerError - } - me, any := make(appengine.MultiError, len(key)), false - for i, s := range res.DeleteStatus { - switch s { - case pb.MemcacheDeleteResponse_DELETED: - // OK - case pb.MemcacheDeleteResponse_NOT_FOUND: - me[i] = ErrCacheMiss - any = true - default: - me[i] = ErrServerError - any = true - } - } - if any { - return me - } - return nil -} - -// Increment atomically increments the decimal value in the given key -// by delta and returns the new value. The value must fit in a uint64. -// Overflow wraps around, and underflow is capped to zero. The -// provided delta may be negative. If the key doesn't exist in -// memcache, the provided initial value is used to atomically -// populate it before the delta is applied. -// The key must be at most 250 bytes in length. -func Increment(c context.Context, key string, delta int64, initialValue uint64) (newValue uint64, err error) { - return incr(c, key, delta, &initialValue) -} - -// IncrementExisting works like Increment but assumes that the key -// already exists in memcache and doesn't take an initial value. -// IncrementExisting can save work if calculating the initial value is -// expensive. -// An error is returned if the specified item can not be found. -func IncrementExisting(c context.Context, key string, delta int64) (newValue uint64, err error) { - return incr(c, key, delta, nil) -} - -func incr(c context.Context, key string, delta int64, initialValue *uint64) (newValue uint64, err error) { - req := &pb.MemcacheIncrementRequest{ - Key: []byte(key), - InitialValue: initialValue, - } - if delta >= 0 { - req.Delta = proto.Uint64(uint64(delta)) - } else { - req.Delta = proto.Uint64(uint64(-delta)) - req.Direction = pb.MemcacheIncrementRequest_DECREMENT.Enum() - } - res := &pb.MemcacheIncrementResponse{} - err = internal.Call(c, "memcache", "Increment", req, res) - if err != nil { - return - } - if res.NewValue == nil { - return 0, ErrCacheMiss - } - return *res.NewValue, nil -} - -// set sets the given items using the given conflict resolution policy. -// appengine.MultiError may be returned. -func set(c context.Context, item []*Item, value [][]byte, policy pb.MemcacheSetRequest_SetPolicy) error { - if len(item) == 0 { - return nil - } - req := &pb.MemcacheSetRequest{ - Item: make([]*pb.MemcacheSetRequest_Item, len(item)), - } - for i, t := range item { - p := &pb.MemcacheSetRequest_Item{ - Key: []byte(t.Key), - } - if value == nil { - p.Value = t.Value - } else { - p.Value = value[i] - } - if t.Flags != 0 { - p.Flags = proto.Uint32(t.Flags) - } - if t.Expiration != 0 { - // In the .proto file, MemcacheSetRequest_Item uses a fixed32 (i.e. unsigned) - // for expiration time, while MemcacheGetRequest_Item uses int32 (i.e. signed). - // Throughout this .go file, we use int32. - // Also, in the proto, the expiration value is either a duration (in seconds) - // or an absolute Unix timestamp (in seconds), depending on whether the - // value is less than or greater than or equal to 30 years, respectively. - if t.Expiration < time.Second { - // Because an Expiration of 0 means no expiration, we take - // care here to translate an item with an expiration - // Duration between 0-1 seconds as immediately expiring - // (saying it expired a few seconds ago), rather than - // rounding it down to 0 and making it live forever. - p.ExpirationTime = proto.Uint32(uint32(time.Now().Unix()) - 5) - } else if t.Expiration >= thirtyYears { - p.ExpirationTime = proto.Uint32(uint32(time.Now().Unix()) + uint32(t.Expiration/time.Second)) - } else { - p.ExpirationTime = proto.Uint32(uint32(t.Expiration / time.Second)) - } - } - if t.casID != 0 { - p.CasId = proto.Uint64(t.casID) - p.ForCas = proto.Bool(true) - } - p.SetPolicy = policy.Enum() - req.Item[i] = p - } - res := &pb.MemcacheSetResponse{} - if err := internal.Call(c, "memcache", "Set", req, res); err != nil { - return err - } - if len(res.SetStatus) != len(item) { - return ErrServerError - } - me, any := make(appengine.MultiError, len(item)), false - for i, st := range res.SetStatus { - var err error - switch st { - case pb.MemcacheSetResponse_STORED: - // OK - case pb.MemcacheSetResponse_NOT_STORED: - err = ErrNotStored - case pb.MemcacheSetResponse_EXISTS: - err = ErrCASConflict - default: - err = ErrServerError - } - if err != nil { - me[i] = err - any = true - } - } - if any { - return me - } - return nil -} - -// Set writes the given item, unconditionally. -func Set(c context.Context, item *Item) error { - return singleError(set(c, []*Item{item}, nil, pb.MemcacheSetRequest_SET)) -} - -// SetMulti is a batch version of Set. -// appengine.MultiError may be returned. -func SetMulti(c context.Context, item []*Item) error { - return set(c, item, nil, pb.MemcacheSetRequest_SET) -} - -// Add writes the given item, if no value already exists for its key. -// ErrNotStored is returned if that condition is not met. -func Add(c context.Context, item *Item) error { - return singleError(set(c, []*Item{item}, nil, pb.MemcacheSetRequest_ADD)) -} - -// AddMulti is a batch version of Add. -// appengine.MultiError may be returned. -func AddMulti(c context.Context, item []*Item) error { - return set(c, item, nil, pb.MemcacheSetRequest_ADD) -} - -// CompareAndSwap writes the given item that was previously returned by Get, -// if the value was neither modified or evicted between the Get and the -// CompareAndSwap calls. The item's Key should not change between calls but -// all other item fields may differ. -// ErrCASConflict is returned if the value was modified in between the calls. -// ErrNotStored is returned if the value was evicted in between the calls. -func CompareAndSwap(c context.Context, item *Item) error { - return singleError(set(c, []*Item{item}, nil, pb.MemcacheSetRequest_CAS)) -} - -// CompareAndSwapMulti is a batch version of CompareAndSwap. -// appengine.MultiError may be returned. -func CompareAndSwapMulti(c context.Context, item []*Item) error { - return set(c, item, nil, pb.MemcacheSetRequest_CAS) -} - -// Codec represents a symmetric pair of functions that implement a codec. -// Items stored into or retrieved from memcache using a Codec have their -// values marshaled or unmarshaled. -// -// All the methods provided for Codec behave analogously to the package level -// function with same name. -type Codec struct { - Marshal func(interface{}) ([]byte, error) - Unmarshal func([]byte, interface{}) error -} - -// Get gets the item for the given key and decodes the obtained value into v. -// ErrCacheMiss is returned for a memcache cache miss. -// The key must be at most 250 bytes in length. -func (cd Codec) Get(c context.Context, key string, v interface{}) (*Item, error) { - i, err := Get(c, key) - if err != nil { - return nil, err - } - if err := cd.Unmarshal(i.Value, v); err != nil { - return nil, err - } - return i, nil -} - -func (cd Codec) set(c context.Context, items []*Item, policy pb.MemcacheSetRequest_SetPolicy) error { - var vs [][]byte - var me appengine.MultiError - for i, item := range items { - v, err := cd.Marshal(item.Object) - if err != nil { - if me == nil { - me = make(appengine.MultiError, len(items)) - } - me[i] = err - continue - } - if me == nil { - vs = append(vs, v) - } - } - if me != nil { - return me - } - - return set(c, items, vs, policy) -} - -// Set writes the given item, unconditionally. -func (cd Codec) Set(c context.Context, item *Item) error { - return singleError(cd.set(c, []*Item{item}, pb.MemcacheSetRequest_SET)) -} - -// SetMulti is a batch version of Set. -// appengine.MultiError may be returned. -func (cd Codec) SetMulti(c context.Context, items []*Item) error { - return cd.set(c, items, pb.MemcacheSetRequest_SET) -} - -// Add writes the given item, if no value already exists for its key. -// ErrNotStored is returned if that condition is not met. -func (cd Codec) Add(c context.Context, item *Item) error { - return singleError(cd.set(c, []*Item{item}, pb.MemcacheSetRequest_ADD)) -} - -// AddMulti is a batch version of Add. -// appengine.MultiError may be returned. -func (cd Codec) AddMulti(c context.Context, items []*Item) error { - return cd.set(c, items, pb.MemcacheSetRequest_ADD) -} - -// CompareAndSwap writes the given item that was previously returned by Get, -// if the value was neither modified or evicted between the Get and the -// CompareAndSwap calls. The item's Key should not change between calls but -// all other item fields may differ. -// ErrCASConflict is returned if the value was modified in between the calls. -// ErrNotStored is returned if the value was evicted in between the calls. -func (cd Codec) CompareAndSwap(c context.Context, item *Item) error { - return singleError(cd.set(c, []*Item{item}, pb.MemcacheSetRequest_CAS)) -} - -// CompareAndSwapMulti is a batch version of CompareAndSwap. -// appengine.MultiError may be returned. -func (cd Codec) CompareAndSwapMulti(c context.Context, items []*Item) error { - return cd.set(c, items, pb.MemcacheSetRequest_CAS) -} - -var ( - // Gob is a Codec that uses the gob package. - Gob = Codec{gobMarshal, gobUnmarshal} - // JSON is a Codec that uses the json package. - JSON = Codec{json.Marshal, json.Unmarshal} -) - -func gobMarshal(v interface{}) ([]byte, error) { - var buf bytes.Buffer - if err := gob.NewEncoder(&buf).Encode(v); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -func gobUnmarshal(data []byte, v interface{}) error { - return gob.NewDecoder(bytes.NewBuffer(data)).Decode(v) -} - -// Statistics represents a set of statistics about the memcache cache. -// This may include items that have expired but have not yet been removed from the cache. -type Statistics struct { - Hits uint64 // Counter of cache hits - Misses uint64 // Counter of cache misses - ByteHits uint64 // Counter of bytes transferred for gets - - Items uint64 // Items currently in the cache - Bytes uint64 // Size of all items currently in the cache - - Oldest int64 // Age of access of the oldest item, in seconds -} - -// Stats retrieves the current memcache statistics. -func Stats(c context.Context) (*Statistics, error) { - req := &pb.MemcacheStatsRequest{} - res := &pb.MemcacheStatsResponse{} - if err := internal.Call(c, "memcache", "Stats", req, res); err != nil { - return nil, err - } - if res.Stats == nil { - return nil, ErrNoStats - } - return &Statistics{ - Hits: *res.Stats.Hits, - Misses: *res.Stats.Misses, - ByteHits: *res.Stats.ByteHits, - Items: *res.Stats.Items, - Bytes: *res.Stats.Bytes, - Oldest: int64(*res.Stats.OldestItemAge), - }, nil -} - -// Flush flushes all items from memcache. -func Flush(c context.Context) error { - req := &pb.MemcacheFlushRequest{} - res := &pb.MemcacheFlushResponse{} - return internal.Call(c, "memcache", "FlushAll", req, res) -} - -func namespaceMod(m proto.Message, namespace string) { - switch m := m.(type) { - case *pb.MemcacheDeleteRequest: - if m.NameSpace == nil { - m.NameSpace = &namespace - } - case *pb.MemcacheGetRequest: - if m.NameSpace == nil { - m.NameSpace = &namespace - } - case *pb.MemcacheIncrementRequest: - if m.NameSpace == nil { - m.NameSpace = &namespace - } - case *pb.MemcacheSetRequest: - if m.NameSpace == nil { - m.NameSpace = &namespace - } - // MemcacheFlushRequest, MemcacheStatsRequest do not apply namespace. - } -} - -func init() { - internal.RegisterErrorCodeMap("memcache", pb.MemcacheServiceError_ErrorCode_name) - internal.NamespaceMods["memcache"] = namespaceMod -} diff --git a/vendor/google.golang.org/appengine/module/module.go b/vendor/google.golang.org/appengine/module/module.go deleted file mode 100644 index aaf020cc4..000000000 --- a/vendor/google.golang.org/appengine/module/module.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2013 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package module provides functions for interacting with modules. - -The appengine package contains functions that report the identity of the app, -including the module name. -*/ -package module - -import ( - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/modules" -) - -// List returns the names of modules belonging to this application. -func List(c context.Context) ([]string, error) { - req := &pb.GetModulesRequest{} - res := &pb.GetModulesResponse{} - err := internal.Call(c, "modules", "GetModules", req, res) - return res.Module, err -} - -// NumInstances returns the number of instances of the given module/version. -// If either argument is the empty string it means the default. -func NumInstances(c context.Context, module, version string) (int, error) { - req := &pb.GetNumInstancesRequest{} - if module != "" { - req.Module = &module - } - if version != "" { - req.Version = &version - } - res := &pb.GetNumInstancesResponse{} - - if err := internal.Call(c, "modules", "GetNumInstances", req, res); err != nil { - return 0, err - } - return int(*res.Instances), nil -} - -// SetNumInstances sets the number of instances of the given module.version to the -// specified value. If either module or version are the empty string it means the -// default. -func SetNumInstances(c context.Context, module, version string, instances int) error { - req := &pb.SetNumInstancesRequest{} - if module != "" { - req.Module = &module - } - if version != "" { - req.Version = &version - } - req.Instances = proto.Int64(int64(instances)) - res := &pb.SetNumInstancesResponse{} - return internal.Call(c, "modules", "SetNumInstances", req, res) -} - -// Versions returns the names of the versions that belong to the specified module. -// If module is the empty string, it means the default module. -func Versions(c context.Context, module string) ([]string, error) { - req := &pb.GetVersionsRequest{} - if module != "" { - req.Module = &module - } - res := &pb.GetVersionsResponse{} - err := internal.Call(c, "modules", "GetVersions", req, res) - return res.GetVersion(), err -} - -// DefaultVersion returns the default version of the specified module. -// If module is the empty string, it means the default module. -func DefaultVersion(c context.Context, module string) (string, error) { - req := &pb.GetDefaultVersionRequest{} - if module != "" { - req.Module = &module - } - res := &pb.GetDefaultVersionResponse{} - err := internal.Call(c, "modules", "GetDefaultVersion", req, res) - return res.GetVersion(), err -} - -// Start starts the specified version of the specified module. -// If either module or version are the empty string, it means the default. -func Start(c context.Context, module, version string) error { - req := &pb.StartModuleRequest{} - if module != "" { - req.Module = &module - } - if version != "" { - req.Version = &version - } - res := &pb.StartModuleResponse{} - return internal.Call(c, "modules", "StartModule", req, res) -} - -// Stop stops the specified version of the specified module. -// If either module or version are the empty string, it means the default. -func Stop(c context.Context, module, version string) error { - req := &pb.StopModuleRequest{} - if module != "" { - req.Module = &module - } - if version != "" { - req.Version = &version - } - res := &pb.StopModuleResponse{} - return internal.Call(c, "modules", "StopModule", req, res) -} diff --git a/vendor/google.golang.org/appengine/remote_api/client.go b/vendor/google.golang.org/appengine/remote_api/client.go deleted file mode 100644 index dbe219dbb..000000000 --- a/vendor/google.golang.org/appengine/remote_api/client.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2013 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package remote_api - -// This file provides the client for connecting remotely to a user's production -// application. - -import ( - "bytes" - "fmt" - "io/ioutil" - "log" - "math/rand" - "net/http" - "net/url" - "regexp" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/remote_api" -) - -// NewRemoteContext returns a context that gives access to the production -// APIs for the application at the given host. All communication will be -// performed over SSL unless the host is localhost. -func NewRemoteContext(host string, client *http.Client) (context.Context, error) { - // Add an appcfg header to outgoing requests. - t := client.Transport - if t == nil { - t = http.DefaultTransport - } - client.Transport = &headerAddingRoundTripper{t} - - url := url.URL{ - Scheme: "https", - Host: host, - Path: "/_ah/remote_api", - } - if host == "localhost" || strings.HasPrefix(host, "localhost:") { - url.Scheme = "http" - } - u := url.String() - appID, err := getAppID(client, u) - if err != nil { - return nil, fmt.Errorf("unable to contact server: %v", err) - } - rc := &remoteContext{ - client: client, - url: u, - } - ctx := internal.WithCallOverride(context.Background(), rc.call) - ctx = internal.WithLogOverride(ctx, rc.logf) - ctx = internal.WithAppIDOverride(ctx, appID) - return ctx, nil -} - -type remoteContext struct { - client *http.Client - url string -} - -var logLevels = map[int64]string{ - 0: "DEBUG", - 1: "INFO", - 2: "WARNING", - 3: "ERROR", - 4: "CRITICAL", -} - -func (c *remoteContext) logf(level int64, format string, args ...interface{}) { - log.Printf(logLevels[level]+": "+format, args...) -} - -func (c *remoteContext) call(ctx context.Context, service, method string, in, out proto.Message) error { - req, err := proto.Marshal(in) - if err != nil { - return fmt.Errorf("error marshalling request: %v", err) - } - - remReq := &pb.Request{ - ServiceName: proto.String(service), - Method: proto.String(method), - Request: req, - // NOTE(djd): RequestId is unused in the server. - } - - req, err = proto.Marshal(remReq) - if err != nil { - return fmt.Errorf("proto.Marshal: %v", err) - } - - // TODO(djd): Respect ctx.Deadline()? - resp, err := c.client.Post(c.url, "application/octet-stream", bytes.NewReader(req)) - if err != nil { - return fmt.Errorf("error sending request: %v", err) - } - defer resp.Body.Close() - - body, err := ioutil.ReadAll(resp.Body) - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("bad response %d; body: %q", resp.StatusCode, body) - } - if err != nil { - return fmt.Errorf("failed reading response: %v", err) - } - remResp := &pb.Response{} - if err := proto.Unmarshal(body, remResp); err != nil { - return fmt.Errorf("error unmarshalling response: %v", err) - } - - if ae := remResp.GetApplicationError(); ae != nil { - return &internal.APIError{ - Code: ae.GetCode(), - Detail: ae.GetDetail(), - Service: service, - } - } - - if remResp.Response == nil { - return fmt.Errorf("unexpected response: %s", proto.MarshalTextString(remResp)) - } - - return proto.Unmarshal(remResp.Response, out) -} - -// This is a forgiving regexp designed to parse the app ID from YAML. -var appIDRE = regexp.MustCompile(`app_id["']?\s*:\s*['"]?([-a-z0-9.:~]+)`) - -func getAppID(client *http.Client, url string) (string, error) { - // Generate a pseudo-random token for handshaking. - token := strconv.Itoa(rand.New(rand.NewSource(time.Now().UnixNano())).Int()) - - resp, err := client.Get(fmt.Sprintf("%s?rtok=%s", url, token)) - if err != nil { - return "", err - } - defer resp.Body.Close() - - body, err := ioutil.ReadAll(resp.Body) - if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("bad response %d; body: %q", resp.StatusCode, body) - } - if err != nil { - return "", fmt.Errorf("failed reading response: %v", err) - } - - // Check the token is present in response. - if !bytes.Contains(body, []byte(token)) { - return "", fmt.Errorf("token not found: want %q; body %q", token, body) - } - - match := appIDRE.FindSubmatch(body) - if match == nil { - return "", fmt.Errorf("app ID not found: body %q", body) - } - - return string(match[1]), nil -} - -type headerAddingRoundTripper struct { - Wrapped http.RoundTripper -} - -func (t *headerAddingRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - r.Header.Set("X-Appcfg-Api-Version", "1") - return t.Wrapped.RoundTrip(r) -} diff --git a/vendor/google.golang.org/appengine/remote_api/remote_api.go b/vendor/google.golang.org/appengine/remote_api/remote_api.go deleted file mode 100644 index e46157ef4..000000000 --- a/vendor/google.golang.org/appengine/remote_api/remote_api.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2012 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package remote_api implements the /_ah/remote_api endpoint. -This endpoint is used by offline tools such as the bulk loader. -*/ -package remote_api - -import ( - "fmt" - "io" - "io/ioutil" - "net/http" - "strconv" - - "github.com/golang/protobuf/proto" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/remote_api" - "google.golang.org/appengine/log" - "google.golang.org/appengine/user" -) - -func init() { - http.HandleFunc("/_ah/remote_api", handle) -} - -func handle(w http.ResponseWriter, req *http.Request) { - c := appengine.NewContext(req) - - u := user.Current(c) - if u == nil { - u, _ = user.CurrentOAuth(c, "") - } - - if u == nil || !u.Admin { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - w.WriteHeader(http.StatusUnauthorized) - io.WriteString(w, "You must be logged in as an administrator to access this.\n") - return - } - if req.Header.Get("X-Appcfg-Api-Version") == "" { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - w.WriteHeader(http.StatusForbidden) - io.WriteString(w, "This request did not contain a necessary header.\n") - return - } - - if req.Method != "POST" { - // Response must be YAML. - rtok := req.FormValue("rtok") - if rtok == "" { - rtok = "0" - } - w.Header().Set("Content-Type", "text/yaml; charset=utf-8") - fmt.Fprintf(w, `{app_id: %q, rtok: %q}`, internal.FullyQualifiedAppID(c), rtok) - return - } - - defer req.Body.Close() - body, err := ioutil.ReadAll(req.Body) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - log.Errorf(c, "Failed reading body: %v", err) - return - } - remReq := &pb.Request{} - if err := proto.Unmarshal(body, remReq); err != nil { - w.WriteHeader(http.StatusBadRequest) - log.Errorf(c, "Bad body: %v", err) - return - } - - service, method := *remReq.ServiceName, *remReq.Method - if !requestSupported(service, method) { - w.WriteHeader(http.StatusBadRequest) - log.Errorf(c, "Unsupported RPC /%s.%s", service, method) - return - } - - rawReq := &rawMessage{remReq.Request} - rawRes := &rawMessage{} - err = internal.Call(c, service, method, rawReq, rawRes) - - remRes := &pb.Response{} - if err == nil { - remRes.Response = rawRes.buf - } else if ae, ok := err.(*internal.APIError); ok { - remRes.ApplicationError = &pb.ApplicationError{ - Code: &ae.Code, - Detail: &ae.Detail, - } - } else { - // This shouldn't normally happen. - log.Errorf(c, "appengine/remote_api: Unexpected error of type %T: %v", err, err) - remRes.ApplicationError = &pb.ApplicationError{ - Code: proto.Int32(0), - Detail: proto.String(err.Error()), - } - } - out, err := proto.Marshal(remRes) - if err != nil { - // This should not be possible. - w.WriteHeader(500) - log.Errorf(c, "proto.Marshal: %v", err) - return - } - - log.Infof(c, "Spooling %d bytes of response to /%s.%s", len(out), service, method) - w.Header().Set("Content-Type", "application/octet-stream") - w.Header().Set("Content-Length", strconv.Itoa(len(out))) - w.Write(out) -} - -// rawMessage is a protocol buffer type that is already serialised. -// This allows the remote_api code here to handle messages -// without having to know the real type. -type rawMessage struct { - buf []byte -} - -func (rm *rawMessage) Marshal() ([]byte, error) { - return rm.buf, nil -} - -func (rm *rawMessage) Unmarshal(buf []byte) error { - rm.buf = make([]byte, len(buf)) - copy(rm.buf, buf) - return nil -} - -func requestSupported(service, method string) bool { - // This list of supported services is taken from SERVICE_PB_MAP in remote_api_services.py - switch service { - case "app_identity_service", "blobstore", "capability_service", "channel", "datastore_v3", - "datastore_v4", "file", "images", "logservice", "mail", "matcher", "memcache", "remote_datastore", - "remote_socket", "search", "modules", "system", "taskqueue", "urlfetch", "user", "xmpp": - return true - } - return false -} - -// Methods to satisfy proto.Message. -func (rm *rawMessage) Reset() { rm.buf = nil } -func (rm *rawMessage) String() string { return strconv.Quote(string(rm.buf)) } -func (*rawMessage) ProtoMessage() {} diff --git a/vendor/google.golang.org/appengine/search/field.go b/vendor/google.golang.org/appengine/search/field.go deleted file mode 100644 index b4c31c0c9..000000000 --- a/vendor/google.golang.org/appengine/search/field.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2014 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package search - -import ( - "fmt" - "reflect" -) - -// Field is a name/value pair. A search index's document can be loaded and -// saved as a sequence of Fields. -type Field struct { - // Name is the field name. - Name string - // Value is the field value. The valid types are: - // - string, - // - search.Atom, - // - search.HTML, - // - time.Time (stored with millisecond precision), - // - float64, - // - GeoPoint. - Value interface{} - // Language is a two-letter ISO 693-1 code for the field's language, - // defaulting to "en" if nothing is specified. It may only be specified for - // fields of type string and search.HTML. - Language string - // Derived marks fields that were calculated as a result of a - // FieldExpression provided to Search. This field is ignored when saving a - // document. - Derived bool -} - -// DocumentMetadata is a struct containing information describing a given document. -type DocumentMetadata struct { - // Rank is an integer specifying the order the document will be returned in - // search results. If zero, the rank will be set to the number of seconds since - // 2011-01-01 00:00:00 UTC when being Put into an index. - Rank int -} - -// FieldLoadSaver can be converted from and to a slice of Fields -// with additional document metadata. -type FieldLoadSaver interface { - Load([]Field, *DocumentMetadata) error - Save() ([]Field, *DocumentMetadata, error) -} - -// FieldList converts a []Field to implement FieldLoadSaver. -type FieldList []Field - -// Load loads all of the provided fields into l. -// It does not first reset *l to an empty slice. -func (l *FieldList) Load(f []Field, _ *DocumentMetadata) error { - *l = append(*l, f...) - return nil -} - -// Save returns all of l's fields as a slice of Fields. -func (l *FieldList) Save() ([]Field, *DocumentMetadata, error) { - return *l, nil, nil -} - -var _ FieldLoadSaver = (*FieldList)(nil) - -// structFLS adapts a struct to be a FieldLoadSaver. -type structFLS struct { - reflect.Value -} - -func (s structFLS) Load(fields []Field, _ *DocumentMetadata) (err error) { - for _, field := range fields { - f := s.FieldByName(field.Name) - if !f.IsValid() { - err = &ErrFieldMismatch{ - FieldName: field.Name, - Reason: "no such struct field", - } - continue - } - if !f.CanSet() { - err = &ErrFieldMismatch{ - FieldName: field.Name, - Reason: "cannot set struct field", - } - continue - } - v := reflect.ValueOf(field.Value) - if ft, vt := f.Type(), v.Type(); ft != vt { - err = &ErrFieldMismatch{ - FieldName: field.Name, - Reason: fmt.Sprintf("type mismatch: %v for %v data", ft, vt), - } - continue - } - f.Set(v) - } - return err -} - -func (s structFLS) Save() ([]Field, *DocumentMetadata, error) { - fields := make([]Field, 0, s.NumField()) - for i := 0; i < s.NumField(); i++ { - f := s.Field(i) - if !f.CanSet() { - continue - } - fields = append(fields, Field{ - Name: s.Type().Field(i).Name, - Value: f.Interface(), - }) - } - return fields, nil, nil -} - -// newStructFLS returns a FieldLoadSaver for the struct pointer p. -func newStructFLS(p interface{}) (FieldLoadSaver, error) { - v := reflect.ValueOf(p) - if v.Kind() != reflect.Ptr || v.IsNil() || v.Elem().Kind() != reflect.Struct { - return nil, ErrInvalidDocumentType - } - return structFLS{v.Elem()}, nil -} - -// LoadStruct loads the fields from f to dst. dst must be a struct pointer. -func LoadStruct(dst interface{}, f []Field) error { - x, err := newStructFLS(dst) - if err != nil { - return err - } - return x.Load(f, nil) -} - -// SaveStruct returns the fields from src as a slice of Field. -// src must be a struct pointer. -func SaveStruct(src interface{}) ([]Field, error) { - x, err := newStructFLS(src) - if err != nil { - return nil, err - } - fs, _, err := x.Save() - return fs, err -} diff --git a/vendor/google.golang.org/appengine/search/search.go b/vendor/google.golang.org/appengine/search/search.go deleted file mode 100644 index 92b7a5bc3..000000000 --- a/vendor/google.golang.org/appengine/search/search.go +++ /dev/null @@ -1,854 +0,0 @@ -// Copyright 2012 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package search provides a client for App Engine's search service. - -Indexes contains documents, and a document's contents are a mapping from case- -sensitive field names to values. In Go, documents are represented by struct -pointers, and the valid types for a struct's fields are: - - string, - - search.Atom, - - search.HTML, - - time.Time (stored with millisecond precision), - - float64 (value between -2,147,483,647 and 2,147,483,647 inclusive), - - appengine.GeoPoint. - -Documents can also be represented by any type implementing the FieldLoadSaver -interface. - -Example code: - - type Doc struct { - Author string - Comment string - Creation time.Time - } - - index, err := search.Open("comments") - if err != nil { - return err - } - newID, err := index.Put(c, "", &Doc{ - Author: "gopher", - Comment: "the truth of the matter", - Creation: time.Now(), - }) - if err != nil { - return err - } - -Searching an index for a query will result in an iterator. As with an iterator -from package datastore, pass a destination struct to Next to decode the next -result. Next will return Done when the iterator is exhausted. - - for t := index.Search(c, "Comment:truth", nil); ; { - var doc Doc - id, err := t.Next(&doc) - if err == search.Done { - break - } - if err != nil { - return err - } - fmt.Fprintf(w, "%s -> %#v\n", id, doc) - } - -Call List to iterate over documents. - - for t := index.List(c, nil); ; { - var doc Doc - id, err := t.Next(&doc) - if err == search.Done { - break - } - if err != nil { - return err - } - fmt.Fprintf(w, "%s -> %#v\n", id, doc) - } - -A single document can also be retrieved by its ID. Pass a destination struct -to Get to hold the resulting document. - - var doc Doc - err := index.Get(c, id, &doc) - if err != nil { - return err - } - -Queries are expressed as strings, plus some optional parameters. The query -language is described at -https://cloud.google.com/appengine/docs/go/search/query_strings - -Note that in Go, field names come from the struct field definition and begin -with an upper case letter. -*/ -package search - -// TODO: let Put specify the document language: "en", "fr", etc. Also: order_id?? storage?? -// TODO: Index.GetAll (or Iterator.GetAll)? -// TODO: struct <-> protobuf tests. -// TODO: enforce Python's MIN_NUMBER_VALUE and MIN_DATE (which would disallow a zero -// time.Time)? _MAXIMUM_STRING_LENGTH? - -import ( - "errors" - "fmt" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/search" -) - -var ( - // ErrInvalidDocumentType is returned when methods like Put, Get or Next - // are passed a dst or src argument of invalid type. - ErrInvalidDocumentType = errors.New("search: invalid document type") - - // ErrNoSuchDocument is returned when no document was found for a given ID. - ErrNoSuchDocument = errors.New("search: no such document") -) - -// ErrFieldMismatch is returned when a field is to be loaded into a different -// than the one it was stored from, or when a field is missing or unexported in -// the destination struct. -type ErrFieldMismatch struct { - FieldName string - Reason string -} - -func (e *ErrFieldMismatch) Error() string { - return fmt.Sprintf("search: cannot load field %q: %s", e.FieldName, e.Reason) -} - -// Atom is a document field whose contents are indexed as a single indivisible -// string. -type Atom string - -// HTML is a document field whose contents are indexed as HTML. Only text nodes -// are indexed: "foobar" will be treated as "foobar". -type HTML string - -// validIndexNameOrDocID is the Go equivalent of Python's -// _ValidateVisiblePrintableAsciiNotReserved. -func validIndexNameOrDocID(s string) bool { - if strings.HasPrefix(s, "!") { - return false - } - for _, c := range s { - if c < 0x21 || 0x7f <= c { - return false - } - } - return true -} - -var ( - fieldNameRE = regexp.MustCompile(`^[A-Z][A-Za-z0-9_]*$`) - languageRE = regexp.MustCompile(`^[a-z]{2}$`) -) - -// validFieldName is the Go equivalent of Python's _CheckFieldName. -func validFieldName(s string) bool { - return len(s) <= 500 && fieldNameRE.MatchString(s) -} - -// validDocRank checks that the ranks is in the range [0, 2^31). -func validDocRank(r int) bool { - return 0 <= r && r <= (1<<31-1) -} - -// validLanguage checks that a language looks like ISO 639-1. -func validLanguage(s string) bool { - return languageRE.MatchString(s) -} - -// validFloat checks that f is in the range [-2147483647, 2147483647]. -func validFloat(f float64) bool { - return -(1<<31-1) <= f && f <= (1<<31-1) -} - -// Index is an index of documents. -type Index struct { - spec pb.IndexSpec -} - -// orderIDEpoch forms the basis for populating OrderId on documents. -var orderIDEpoch = time.Date(2011, 1, 1, 0, 0, 0, 0, time.UTC) - -// Open opens the index with the given name. The index is created if it does -// not already exist. -// -// The name is a human-readable ASCII string. It must contain no whitespace -// characters and not start with "!". -func Open(name string) (*Index, error) { - if !validIndexNameOrDocID(name) { - return nil, fmt.Errorf("search: invalid index name %q", name) - } - return &Index{ - spec: pb.IndexSpec{ - Name: &name, - }, - }, nil -} - -// Put saves src to the index. If id is empty, a new ID is allocated by the -// service and returned. If id is not empty, any existing index entry for that -// ID is replaced. -// -// The ID is a human-readable ASCII string. It must contain no whitespace -// characters and not start with "!". -// -// src must be a non-nil struct pointer or implement the FieldLoadSaver -// interface. -func (x *Index) Put(c context.Context, id string, src interface{}) (string, error) { - fields, meta, err := saveDoc(src) - if err != nil { - return "", err - } - d := &pb.Document{ - Field: fields, - OrderId: proto.Int32(int32(time.Since(orderIDEpoch).Seconds())), - } - if meta != nil { - if meta.Rank != 0 { - if !validDocRank(meta.Rank) { - return "", fmt.Errorf("search: invalid rank %d, must be [0, 2^31)", meta.Rank) - } - *d.OrderId = int32(meta.Rank) - } - } - if id != "" { - if !validIndexNameOrDocID(id) { - return "", fmt.Errorf("search: invalid ID %q", id) - } - d.Id = proto.String(id) - } - req := &pb.IndexDocumentRequest{ - Params: &pb.IndexDocumentParams{ - Document: []*pb.Document{d}, - IndexSpec: &x.spec, - }, - } - res := &pb.IndexDocumentResponse{} - if err := internal.Call(c, "search", "IndexDocument", req, res); err != nil { - return "", err - } - if len(res.Status) > 0 { - if s := res.Status[0]; s.GetCode() != pb.SearchServiceError_OK { - return "", fmt.Errorf("search: %s: %s", s.GetCode(), s.GetErrorDetail()) - } - } - if len(res.Status) != 1 || len(res.DocId) != 1 { - return "", fmt.Errorf("search: internal error: wrong number of results (%d Statuses, %d DocIDs)", - len(res.Status), len(res.DocId)) - } - return res.DocId[0], nil -} - -// Get loads the document with the given ID into dst. -// -// The ID is a human-readable ASCII string. It must be non-empty, contain no -// whitespace characters and not start with "!". -// -// dst must be a non-nil struct pointer or implement the FieldLoadSaver -// interface. -// -// ErrFieldMismatch is returned when a field is to be loaded into a different -// type than the one it was stored from, or when a field is missing or -// unexported in the destination struct. ErrFieldMismatch is only returned if -// dst is a struct pointer. It is up to the callee to decide whether this error -// is fatal, recoverable, or ignorable. -func (x *Index) Get(c context.Context, id string, dst interface{}) error { - if id == "" || !validIndexNameOrDocID(id) { - return fmt.Errorf("search: invalid ID %q", id) - } - req := &pb.ListDocumentsRequest{ - Params: &pb.ListDocumentsParams{ - IndexSpec: &x.spec, - StartDocId: proto.String(id), - Limit: proto.Int32(1), - }, - } - res := &pb.ListDocumentsResponse{} - if err := internal.Call(c, "search", "ListDocuments", req, res); err != nil { - return err - } - if res.Status == nil || res.Status.GetCode() != pb.SearchServiceError_OK { - return fmt.Errorf("search: %s: %s", res.Status.GetCode(), res.Status.GetErrorDetail()) - } - if len(res.Document) != 1 || res.Document[0].GetId() != id { - return ErrNoSuchDocument - } - metadata := &DocumentMetadata{ - Rank: int(res.Document[0].GetOrderId()), - } - return loadDoc(dst, res.Document[0].Field, nil, metadata) -} - -// Delete deletes a document from the index. -func (x *Index) Delete(c context.Context, id string) error { - req := &pb.DeleteDocumentRequest{ - Params: &pb.DeleteDocumentParams{ - DocId: []string{id}, - IndexSpec: &x.spec, - }, - } - res := &pb.DeleteDocumentResponse{} - if err := internal.Call(c, "search", "DeleteDocument", req, res); err != nil { - return err - } - if len(res.Status) != 1 { - return fmt.Errorf("search: internal error: wrong number of results (%d)", len(res.Status)) - } - if s := res.Status[0]; s.GetCode() != pb.SearchServiceError_OK { - return fmt.Errorf("search: %s: %s", s.GetCode(), s.GetErrorDetail()) - } - return nil -} - -// List lists all of the documents in an index. The documents are returned in -// increasing ID order. -func (x *Index) List(c context.Context, opts *ListOptions) *Iterator { - t := &Iterator{ - c: c, - index: x, - count: -1, - listInclusive: true, - more: moreList, - limit: -1, - } - if opts != nil { - t.listStartID = opts.StartID - if opts.Limit > 0 { - t.limit = opts.Limit - } - t.idsOnly = opts.IDsOnly - } - return t -} - -func moreList(t *Iterator) error { - req := &pb.ListDocumentsRequest{ - Params: &pb.ListDocumentsParams{ - IndexSpec: &t.index.spec, - }, - } - if t.listStartID != "" { - req.Params.StartDocId = &t.listStartID - req.Params.IncludeStartDoc = &t.listInclusive - } - if t.limit > 0 { - req.Params.Limit = proto.Int32(int32(t.limit)) - } - if t.idsOnly { - req.Params.KeysOnly = &t.idsOnly - } - - res := &pb.ListDocumentsResponse{} - if err := internal.Call(t.c, "search", "ListDocuments", req, res); err != nil { - return err - } - if res.Status == nil || res.Status.GetCode() != pb.SearchServiceError_OK { - return fmt.Errorf("search: %s: %s", res.Status.GetCode(), res.Status.GetErrorDetail()) - } - t.listRes = res.Document - t.listStartID, t.listInclusive, t.more = "", false, nil - if len(res.Document) != 0 { - if id := res.Document[len(res.Document)-1].GetId(); id != "" { - t.listStartID, t.more = id, moreList - } - } - return nil -} - -// ListOptions are the options for listing documents in an index. Passing a nil -// *ListOptions is equivalent to using the default values. -type ListOptions struct { - // StartID is the inclusive lower bound for the ID of the returned - // documents. The zero value means all documents will be returned. - StartID string - - // Limit is the maximum number of documents to return. The zero value - // indicates no limit. - Limit int - - // IDsOnly indicates that only document IDs should be returned for the list - // operation; no document fields are populated. - IDsOnly bool -} - -// Search searches the index for the given query. -func (x *Index) Search(c context.Context, query string, opts *SearchOptions) *Iterator { - t := &Iterator{ - c: c, - index: x, - searchQuery: query, - more: moreSearch, - limit: -1, - } - if opts != nil { - if opts.Limit > 0 { - t.limit = opts.Limit - } - t.fields = opts.Fields - t.idsOnly = opts.IDsOnly - t.sort = opts.Sort - t.exprs = opts.Expressions - } - return t -} - -func moreSearch(t *Iterator) error { - req := &pb.SearchRequest{ - Params: &pb.SearchParams{ - IndexSpec: &t.index.spec, - Query: &t.searchQuery, - CursorType: pb.SearchParams_SINGLE.Enum(), - FieldSpec: &pb.FieldSpec{ - Name: t.fields, - }, - }, - } - if t.limit > 0 { - req.Params.Limit = proto.Int32(int32(t.limit)) - } - if t.idsOnly { - req.Params.KeysOnly = &t.idsOnly - } - if t.sort != nil { - if err := sortToProto(t.sort, req.Params); err != nil { - return err - } - } - for _, e := range t.exprs { - req.Params.FieldSpec.Expression = append(req.Params.FieldSpec.Expression, &pb.FieldSpec_Expression{ - Name: proto.String(e.Name), - Expression: proto.String(e.Expr), - }) - } - - if t.searchCursor != nil { - req.Params.Cursor = t.searchCursor - } - res := &pb.SearchResponse{} - if err := internal.Call(t.c, "search", "Search", req, res); err != nil { - return err - } - if res.Status == nil || res.Status.GetCode() != pb.SearchServiceError_OK { - return fmt.Errorf("search: %s: %s", res.Status.GetCode(), res.Status.GetErrorDetail()) - } - t.searchRes = res.Result - t.count = int(*res.MatchedCount) - if res.Cursor != nil { - t.searchCursor, t.more = res.Cursor, moreSearch - } else { - t.searchCursor, t.more = nil, nil - } - return nil -} - -// SearchOptions are the options for searching an index. Passing a nil -// *SearchOptions is equivalent to using the default values. -type SearchOptions struct { - // Limit is the maximum number of documents to return. The zero value - // indicates no limit. - Limit int - - // IDsOnly indicates that only document IDs should be returned for the search - // operation; no document fields are populated. - IDsOnly bool - - // Sort controls the ordering of search results. - Sort *SortOptions - - // Fields specifies which document fields to include in the results. If omitted, - // all document fields are returned. No more than 100 fields may be specified. - Fields []string - - // Expressions specifies additional computed fields to add to each returned - // document. - Expressions []FieldExpression - - // TODO: cursor, offset, maybe others. -} - -// FieldExpression defines a custom expression to evaluate for each result. -type FieldExpression struct { - // Name is the name to use for the computed field. - Name string - - // Expr is evaluated to provide a custom content snippet for each document. - // See https://cloud.google.com/appengine/docs/go/search/options for - // the supported expression syntax. - Expr string -} - -// SortOptions control the ordering and scoring of search results. -type SortOptions struct { - // Expressions is a slice of expressions representing a multi-dimensional - // sort. - Expressions []SortExpression - - // Scorer, when specified, will cause the documents to be scored according to - // search term frequency. - Scorer Scorer - - // Limit is the maximum number of objects to score and/or sort. Limit cannot - // be more than 10,000. The zero value indicates a default limit. - Limit int -} - -// SortExpression defines a single dimension for sorting a document. -type SortExpression struct { - // Expr is evaluated to provide a sorting value for each document. - // See https://cloud.google.com/appengine/docs/go/search/options for - // the supported expression syntax. - Expr string - - // Reverse causes the documents to be sorted in ascending order. - Reverse bool - - // The default value to use when no field is present or the expresion - // cannot be calculated for a document. For text sorts, Default must - // be of type string; for numeric sorts, float64. - Default interface{} -} - -// A Scorer defines how a document is scored. -type Scorer interface { - toProto(*pb.ScorerSpec) -} - -type enumScorer struct { - enum pb.ScorerSpec_Scorer -} - -func (e enumScorer) toProto(spec *pb.ScorerSpec) { - spec.Scorer = e.enum.Enum() -} - -var ( - // MatchScorer assigns a score based on term frequency in a document. - MatchScorer Scorer = enumScorer{pb.ScorerSpec_MATCH_SCORER} - - // RescoringMatchScorer assigns a score based on the quality of the query - // match. It is similar to a MatchScorer but uses a more complex scoring - // algorithm based on match term frequency and other factors like field type. - // Please be aware that this algorithm is continually refined and can change - // over time without notice. This means that the ordering of search results - // that use this scorer can also change without notice. - RescoringMatchScorer Scorer = enumScorer{pb.ScorerSpec_RESCORING_MATCH_SCORER} -) - -func sortToProto(sort *SortOptions, params *pb.SearchParams) error { - for _, e := range sort.Expressions { - spec := &pb.SortSpec{ - SortExpression: proto.String(e.Expr), - } - if e.Reverse { - spec.SortDescending = proto.Bool(false) - } - if e.Default != nil { - switch d := e.Default.(type) { - case float64: - spec.DefaultValueNumeric = &d - case string: - spec.DefaultValueText = &d - default: - return fmt.Errorf("search: invalid Default type %T for expression %q", d, e.Expr) - } - } - params.SortSpec = append(params.SortSpec, spec) - } - - spec := &pb.ScorerSpec{} - if sort.Limit > 0 { - spec.Limit = proto.Int32(int32(sort.Limit)) - params.ScorerSpec = spec - } - if sort.Scorer != nil { - sort.Scorer.toProto(spec) - params.ScorerSpec = spec - } - - return nil -} - -// Iterator is the result of searching an index for a query or listing an -// index. -type Iterator struct { - c context.Context - index *Index - err error - - listRes []*pb.Document - listStartID string - listInclusive bool - - searchRes []*pb.SearchResult - searchQuery string - searchCursor *string - sort *SortOptions - - fields []string - exprs []FieldExpression - - more func(*Iterator) error - - count int - limit int // items left to return; -1 for unlimited. - idsOnly bool -} - -// Done is returned when a query iteration has completed. -var Done = errors.New("search: query has no more results") - -// Count returns an approximation of the number of documents matched by the -// query. It is only valid to call for iterators returned by Search. -func (t *Iterator) Count() int { return t.count } - -// Next returns the ID of the next result. When there are no more results, -// Done is returned as the error. -// -// dst must be a non-nil struct pointer, implement the FieldLoadSaver -// interface, or be a nil interface value. If a non-nil dst is provided, it -// will be filled with the indexed fields. dst is ignored if this iterator was -// created with an IDsOnly option. -func (t *Iterator) Next(dst interface{}) (string, error) { - if t.err == nil && len(t.listRes)+len(t.searchRes) == 0 && t.more != nil { - t.err = t.more(t) - } - if t.err != nil { - return "", t.err - } - - var doc *pb.Document - var exprs []*pb.Field - switch { - case len(t.listRes) != 0: - doc = t.listRes[0] - t.listRes = t.listRes[1:] - case len(t.searchRes) != 0: - doc = t.searchRes[0].Document - exprs = t.searchRes[0].Expression - t.searchRes = t.searchRes[1:] - default: - return "", Done - } - if doc == nil { - return "", errors.New("search: internal error: no document returned") - } - if !t.idsOnly && dst != nil { - metadata := &DocumentMetadata{ - Rank: int(doc.GetOrderId()), - } - if err := loadDoc(dst, doc.Field, exprs, metadata); err != nil { - return "", err - } - } - if t.limit > 0 { - t.limit-- - if t.limit == 0 { - t.more = nil // prevent further fetches - } - } - return doc.GetId(), nil -} - -// saveDoc converts from a struct pointer or FieldLoadSaver to protobufs. -func saveDoc(src interface{}) ([]*pb.Field, *DocumentMetadata, error) { - var err error - var fields []Field - var meta *DocumentMetadata - switch x := src.(type) { - case FieldLoadSaver: - fields, meta, err = x.Save() - default: - fields, err = SaveStruct(src) - } - if err != nil { - return nil, nil, err - } - f, err := fieldsToProto(fields) - return f, meta, err -} - -func fieldsToProto(src []Field) ([]*pb.Field, error) { - // Maps to catch duplicate time or numeric fields. - timeFields, numericFields := make(map[string]bool), make(map[string]bool) - dst := make([]*pb.Field, 0, len(src)) - for _, f := range src { - if !validFieldName(f.Name) { - return nil, fmt.Errorf("search: invalid field name %q", f.Name) - } - fieldValue := &pb.FieldValue{} - switch x := f.Value.(type) { - case string: - fieldValue.Type = pb.FieldValue_TEXT.Enum() - fieldValue.StringValue = proto.String(x) - case Atom: - fieldValue.Type = pb.FieldValue_ATOM.Enum() - fieldValue.StringValue = proto.String(string(x)) - case HTML: - fieldValue.Type = pb.FieldValue_HTML.Enum() - fieldValue.StringValue = proto.String(string(x)) - case time.Time: - if timeFields[f.Name] { - return nil, fmt.Errorf("search: duplicate time field %q", f.Name) - } - timeFields[f.Name] = true - fieldValue.Type = pb.FieldValue_DATE.Enum() - fieldValue.StringValue = proto.String(strconv.FormatInt(x.UnixNano()/1e6, 10)) - case float64: - if numericFields[f.Name] { - return nil, fmt.Errorf("search: duplicate numeric field %q", f.Name) - } - if !validFloat(x) { - return nil, fmt.Errorf("search: numeric field %q with invalid value %f", f.Name, x) - } - numericFields[f.Name] = true - fieldValue.Type = pb.FieldValue_NUMBER.Enum() - fieldValue.StringValue = proto.String(strconv.FormatFloat(x, 'e', -1, 64)) - case appengine.GeoPoint: - if !x.Valid() { - return nil, fmt.Errorf( - "search: GeoPoint field %q with invalid value %v", - f.Name, x) - } - fieldValue.Type = pb.FieldValue_GEO.Enum() - fieldValue.Geo = &pb.FieldValue_Geo{ - Lat: proto.Float64(x.Lat), - Lng: proto.Float64(x.Lng), - } - default: - return nil, fmt.Errorf("search: unsupported field type: %v", reflect.TypeOf(f.Value)) - } - if f.Language != "" { - switch f.Value.(type) { - case string, HTML: - if !validLanguage(f.Language) { - return nil, fmt.Errorf("search: invalid language for field %q: %q", f.Name, f.Language) - } - fieldValue.Language = proto.String(f.Language) - default: - return nil, fmt.Errorf("search: setting language not supported for field %q of type %T", f.Name, f.Value) - } - } - if p := fieldValue.StringValue; p != nil && !utf8.ValidString(*p) { - return nil, fmt.Errorf("search: %q field is invalid UTF-8: %q", f.Name, *p) - } - dst = append(dst, &pb.Field{ - Name: proto.String(f.Name), - Value: fieldValue, - }) - } - return dst, nil -} - -// loadDoc converts from protobufs and document metadata to a struct pointer or -// FieldLoadSaver/FieldMetadataLoadSaver. Two slices of fields may be provided: -// src represents the document's stored fields; exprs is the derived expressions -// requested by the developer. The latter may be empty. -func loadDoc(dst interface{}, src, exprs []*pb.Field, meta *DocumentMetadata) (err error) { - fields, err := protoToFields(src) - if err != nil { - return err - } - if len(exprs) > 0 { - exprFields, err := protoToFields(exprs) - if err != nil { - return err - } - // Mark each field as derived. - for i := range exprFields { - exprFields[i].Derived = true - } - fields = append(fields, exprFields...) - } - switch x := dst.(type) { - case FieldLoadSaver: - return x.Load(fields, meta) - default: - return LoadStruct(dst, fields) - } -} - -func protoToFields(fields []*pb.Field) ([]Field, error) { - dst := make([]Field, 0, len(fields)) - for _, field := range fields { - fieldValue := field.GetValue() - f := Field{ - Name: field.GetName(), - } - switch fieldValue.GetType() { - case pb.FieldValue_TEXT: - f.Value = fieldValue.GetStringValue() - f.Language = fieldValue.GetLanguage() - case pb.FieldValue_ATOM: - f.Value = Atom(fieldValue.GetStringValue()) - case pb.FieldValue_HTML: - f.Value = HTML(fieldValue.GetStringValue()) - f.Language = fieldValue.GetLanguage() - case pb.FieldValue_DATE: - sv := fieldValue.GetStringValue() - millis, err := strconv.ParseInt(sv, 10, 64) - if err != nil { - return nil, fmt.Errorf("search: internal error: bad time.Time encoding %q: %v", sv, err) - } - f.Value = time.Unix(0, millis*1e6) - case pb.FieldValue_NUMBER: - sv := fieldValue.GetStringValue() - x, err := strconv.ParseFloat(sv, 64) - if err != nil { - return nil, err - } - f.Value = x - case pb.FieldValue_GEO: - geoValue := fieldValue.GetGeo() - geoPoint := appengine.GeoPoint{geoValue.GetLat(), geoValue.GetLng()} - if !geoPoint.Valid() { - return nil, fmt.Errorf("search: internal error: invalid GeoPoint encoding: %v", geoPoint) - } - f.Value = geoPoint - default: - return nil, fmt.Errorf("search: internal error: unknown data type %s", fieldValue.GetType()) - } - dst = append(dst, f) - } - return dst, nil -} - -func namespaceMod(m proto.Message, namespace string) { - set := func(s **string) { - if *s == nil { - *s = &namespace - } - } - switch m := m.(type) { - case *pb.IndexDocumentRequest: - set(&m.Params.IndexSpec.Namespace) - case *pb.ListDocumentsRequest: - set(&m.Params.IndexSpec.Namespace) - case *pb.DeleteDocumentRequest: - set(&m.Params.IndexSpec.Namespace) - case *pb.SearchRequest: - set(&m.Params.IndexSpec.Namespace) - } -} - -func init() { - internal.RegisterErrorCodeMap("search", pb.SearchServiceError_ErrorCode_name) - internal.NamespaceMods["search"] = namespaceMod -} diff --git a/vendor/google.golang.org/appengine/taskqueue/ns_classic.go b/vendor/google.golang.org/appengine/taskqueue/ns_classic.go deleted file mode 100644 index f8aa96e4d..000000000 --- a/vendor/google.golang.org/appengine/taskqueue/ns_classic.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build appengine - -package taskqueue - -import ( - basepb "appengine_internal/base" - - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -func getDefaultNamespace(ctx context.Context) string { - c := internal.ClassicContextFromContext(ctx) - s := &basepb.StringProto{} - c.Call("__go__", "GetDefaultNamespace", &basepb.VoidProto{}, s, nil) - return s.GetValue() -} diff --git a/vendor/google.golang.org/appengine/taskqueue/ns_vm.go b/vendor/google.golang.org/appengine/taskqueue/ns_vm.go deleted file mode 100644 index af3d84130..000000000 --- a/vendor/google.golang.org/appengine/taskqueue/ns_vm.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !appengine - -package taskqueue - -import ( - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -func getDefaultNamespace(ctx context.Context) string { - return internal.IncomingHeaders(ctx).Get(defaultNamespace) -} diff --git a/vendor/google.golang.org/appengine/taskqueue/taskqueue.go b/vendor/google.golang.org/appengine/taskqueue/taskqueue.go deleted file mode 100644 index 848ea5f44..000000000 --- a/vendor/google.golang.org/appengine/taskqueue/taskqueue.go +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package taskqueue provides a client for App Engine's taskqueue service. -Using this service, applications may perform work outside a user's request. - -A Task may be constructed manually; alternatively, since the most common -taskqueue operation is to add a single POST task, NewPOSTTask makes it easy. - - t := taskqueue.NewPOSTTask("/worker", url.Values{ - "key": {key}, - }) - taskqueue.Add(c, t, "") // add t to the default queue -*/ -package taskqueue - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - dspb "google.golang.org/appengine/internal/datastore" - pb "google.golang.org/appengine/internal/taskqueue" -) - -var ( - // ErrTaskAlreadyAdded is the error returned by Add and AddMulti when a task has already been added with a particular name. - ErrTaskAlreadyAdded = errors.New("taskqueue: task has already been added") -) - -// RetryOptions let you control whether to retry a task and the backoff intervals between tries. -type RetryOptions struct { - // Number of tries/leases after which the task fails permanently and is deleted. - // If AgeLimit is also set, both limits must be exceeded for the task to fail permanently. - RetryLimit int32 - - // Maximum time allowed since the task's first try before the task fails permanently and is deleted (only for push tasks). - // If RetryLimit is also set, both limits must be exceeded for the task to fail permanently. - AgeLimit time.Duration - - // Minimum time between successive tries (only for push tasks). - MinBackoff time.Duration - - // Maximum time between successive tries (only for push tasks). - MaxBackoff time.Duration - - // Maximum number of times to double the interval between successive tries before the intervals increase linearly (only for push tasks). - MaxDoublings int32 - - // If MaxDoublings is zero, set ApplyZeroMaxDoublings to true to override the default non-zero value. - // Otherwise a zero MaxDoublings is ignored and the default is used. - ApplyZeroMaxDoublings bool -} - -// toRetryParameter converts RetryOptions to pb.TaskQueueRetryParameters. -func (opt *RetryOptions) toRetryParameters() *pb.TaskQueueRetryParameters { - params := &pb.TaskQueueRetryParameters{} - if opt.RetryLimit > 0 { - params.RetryLimit = proto.Int32(opt.RetryLimit) - } - if opt.AgeLimit > 0 { - params.AgeLimitSec = proto.Int64(int64(opt.AgeLimit.Seconds())) - } - if opt.MinBackoff > 0 { - params.MinBackoffSec = proto.Float64(opt.MinBackoff.Seconds()) - } - if opt.MaxBackoff > 0 { - params.MaxBackoffSec = proto.Float64(opt.MaxBackoff.Seconds()) - } - if opt.MaxDoublings > 0 || (opt.MaxDoublings == 0 && opt.ApplyZeroMaxDoublings) { - params.MaxDoublings = proto.Int32(opt.MaxDoublings) - } - return params -} - -// A Task represents a task to be executed. -type Task struct { - // Path is the worker URL for the task. - // If unset, it will default to /_ah/queue/. - Path string - - // Payload is the data for the task. - // This will be delivered as the HTTP request body. - // It is only used when Method is POST, PUT or PULL. - // url.Values' Encode method may be used to generate this for POST requests. - Payload []byte - - // Additional HTTP headers to pass at the task's execution time. - // To schedule the task to be run with an alternate app version - // or backend, set the "Host" header. - Header http.Header - - // Method is the HTTP method for the task ("GET", "POST", etc.), - // or "PULL" if this is task is destined for a pull-based queue. - // If empty, this defaults to "POST". - Method string - - // A name for the task. - // If empty, a name will be chosen. - Name string - - // Delay specifies the duration the task queue service must wait - // before executing the task. - // Either Delay or ETA may be set, but not both. - Delay time.Duration - - // ETA specifies the earliest time a task may be executed (push queues) - // or leased (pull queues). - // Either Delay or ETA may be set, but not both. - ETA time.Time - - // The number of times the task has been dispatched or leased. - RetryCount int32 - - // Tag for the task. Only used when Method is PULL. - Tag string - - // Retry options for this task. May be nil. - RetryOptions *RetryOptions -} - -func (t *Task) method() string { - if t.Method == "" { - return "POST" - } - return t.Method -} - -// NewPOSTTask creates a Task that will POST to a path with the given form data. -func NewPOSTTask(path string, params url.Values) *Task { - h := make(http.Header) - h.Set("Content-Type", "application/x-www-form-urlencoded") - return &Task{ - Path: path, - Payload: []byte(params.Encode()), - Header: h, - Method: "POST", - } -} - -var ( - currentNamespace = http.CanonicalHeaderKey("X-AppEngine-Current-Namespace") - defaultNamespace = http.CanonicalHeaderKey("X-AppEngine-Default-Namespace") -) - -func newAddReq(c context.Context, task *Task, queueName string) (*pb.TaskQueueAddRequest, error) { - if queueName == "" { - queueName = "default" - } - path := task.Path - if path == "" { - path = "/_ah/queue/" + queueName - } - eta := task.ETA - if eta.IsZero() { - eta = time.Now().Add(task.Delay) - } else if task.Delay != 0 { - panic("taskqueue: both Delay and ETA are set") - } - req := &pb.TaskQueueAddRequest{ - QueueName: []byte(queueName), - TaskName: []byte(task.Name), - EtaUsec: proto.Int64(eta.UnixNano() / 1e3), - } - method := task.method() - if method == "PULL" { - // Pull-based task - req.Body = task.Payload - req.Mode = pb.TaskQueueMode_PULL.Enum() - if task.Tag != "" { - req.Tag = []byte(task.Tag) - } - } else { - // HTTP-based task - if v, ok := pb.TaskQueueAddRequest_RequestMethod_value[method]; ok { - req.Method = pb.TaskQueueAddRequest_RequestMethod(v).Enum() - } else { - return nil, fmt.Errorf("taskqueue: bad method %q", method) - } - req.Url = []byte(path) - for k, vs := range task.Header { - for _, v := range vs { - req.Header = append(req.Header, &pb.TaskQueueAddRequest_Header{ - Key: []byte(k), - Value: []byte(v), - }) - } - } - if method == "POST" || method == "PUT" { - req.Body = task.Payload - } - - // Namespace headers. - if _, ok := task.Header[currentNamespace]; !ok { - // Fetch the current namespace of this request. - ns := internal.NamespaceFromContext(c) - req.Header = append(req.Header, &pb.TaskQueueAddRequest_Header{ - Key: []byte(currentNamespace), - Value: []byte(ns), - }) - } - if _, ok := task.Header[defaultNamespace]; !ok { - // Fetch the X-AppEngine-Default-Namespace header of this request. - if ns := getDefaultNamespace(c); ns != "" { - req.Header = append(req.Header, &pb.TaskQueueAddRequest_Header{ - Key: []byte(defaultNamespace), - Value: []byte(ns), - }) - } - } - } - - if task.RetryOptions != nil { - req.RetryParameters = task.RetryOptions.toRetryParameters() - } - - return req, nil -} - -var alreadyAddedErrors = map[pb.TaskQueueServiceError_ErrorCode]bool{ - pb.TaskQueueServiceError_TASK_ALREADY_EXISTS: true, - pb.TaskQueueServiceError_TOMBSTONED_TASK: true, -} - -// Add adds the task to a named queue. -// An empty queue name means that the default queue will be used. -// Add returns an equivalent Task with defaults filled in, including setting -// the task's Name field to the chosen name if the original was empty. -func Add(c context.Context, task *Task, queueName string) (*Task, error) { - req, err := newAddReq(c, task, queueName) - if err != nil { - return nil, err - } - res := &pb.TaskQueueAddResponse{} - if err := internal.Call(c, "taskqueue", "Add", req, res); err != nil { - apiErr, ok := err.(*internal.APIError) - if ok && alreadyAddedErrors[pb.TaskQueueServiceError_ErrorCode(apiErr.Code)] { - return nil, ErrTaskAlreadyAdded - } - return nil, err - } - resultTask := *task - resultTask.Method = task.method() - if task.Name == "" { - resultTask.Name = string(res.ChosenTaskName) - } - return &resultTask, nil -} - -// AddMulti adds multiple tasks to a named queue. -// An empty queue name means that the default queue will be used. -// AddMulti returns a slice of equivalent tasks with defaults filled in, including setting -// each task's Name field to the chosen name if the original was empty. -// If a given task is badly formed or could not be added, an appengine.MultiError is returned. -func AddMulti(c context.Context, tasks []*Task, queueName string) ([]*Task, error) { - req := &pb.TaskQueueBulkAddRequest{ - AddRequest: make([]*pb.TaskQueueAddRequest, len(tasks)), - } - me, any := make(appengine.MultiError, len(tasks)), false - for i, t := range tasks { - req.AddRequest[i], me[i] = newAddReq(c, t, queueName) - any = any || me[i] != nil - } - if any { - return nil, me - } - res := &pb.TaskQueueBulkAddResponse{} - if err := internal.Call(c, "taskqueue", "BulkAdd", req, res); err != nil { - return nil, err - } - if len(res.Taskresult) != len(tasks) { - return nil, errors.New("taskqueue: server error") - } - tasksOut := make([]*Task, len(tasks)) - for i, tr := range res.Taskresult { - tasksOut[i] = new(Task) - *tasksOut[i] = *tasks[i] - tasksOut[i].Method = tasksOut[i].method() - if tasksOut[i].Name == "" { - tasksOut[i].Name = string(tr.ChosenTaskName) - } - if *tr.Result != pb.TaskQueueServiceError_OK { - if alreadyAddedErrors[*tr.Result] { - me[i] = ErrTaskAlreadyAdded - } else { - me[i] = &internal.APIError{ - Service: "taskqueue", - Code: int32(*tr.Result), - } - } - any = true - } - } - if any { - return tasksOut, me - } - return tasksOut, nil -} - -// Delete deletes a task from a named queue. -func Delete(c context.Context, task *Task, queueName string) error { - err := DeleteMulti(c, []*Task{task}, queueName) - if me, ok := err.(appengine.MultiError); ok { - return me[0] - } - return err -} - -// DeleteMulti deletes multiple tasks from a named queue. -// If a given task could not be deleted, an appengine.MultiError is returned. -func DeleteMulti(c context.Context, tasks []*Task, queueName string) error { - taskNames := make([][]byte, len(tasks)) - for i, t := range tasks { - taskNames[i] = []byte(t.Name) - } - if queueName == "" { - queueName = "default" - } - req := &pb.TaskQueueDeleteRequest{ - QueueName: []byte(queueName), - TaskName: taskNames, - } - res := &pb.TaskQueueDeleteResponse{} - if err := internal.Call(c, "taskqueue", "Delete", req, res); err != nil { - return err - } - if a, b := len(req.TaskName), len(res.Result); a != b { - return fmt.Errorf("taskqueue: internal error: requested deletion of %d tasks, got %d results", a, b) - } - me, any := make(appengine.MultiError, len(res.Result)), false - for i, ec := range res.Result { - if ec != pb.TaskQueueServiceError_OK { - me[i] = &internal.APIError{ - Service: "taskqueue", - Code: int32(ec), - } - any = true - } - } - if any { - return me - } - return nil -} - -func lease(c context.Context, maxTasks int, queueName string, leaseTime int, groupByTag bool, tag []byte) ([]*Task, error) { - if queueName == "" { - queueName = "default" - } - req := &pb.TaskQueueQueryAndOwnTasksRequest{ - QueueName: []byte(queueName), - LeaseSeconds: proto.Float64(float64(leaseTime)), - MaxTasks: proto.Int64(int64(maxTasks)), - GroupByTag: proto.Bool(groupByTag), - Tag: tag, - } - res := &pb.TaskQueueQueryAndOwnTasksResponse{} - if err := internal.Call(c, "taskqueue", "QueryAndOwnTasks", req, res); err != nil { - return nil, err - } - tasks := make([]*Task, len(res.Task)) - for i, t := range res.Task { - tasks[i] = &Task{ - Payload: t.Body, - Name: string(t.TaskName), - Method: "PULL", - ETA: time.Unix(0, *t.EtaUsec*1e3), - RetryCount: *t.RetryCount, - Tag: string(t.Tag), - } - } - return tasks, nil -} - -// Lease leases tasks from a queue. -// leaseTime is in seconds. -// The number of tasks fetched will be at most maxTasks. -func Lease(c context.Context, maxTasks int, queueName string, leaseTime int) ([]*Task, error) { - return lease(c, maxTasks, queueName, leaseTime, false, nil) -} - -// LeaseByTag leases tasks from a queue, grouped by tag. -// If tag is empty, then the returned tasks are grouped by the tag of the task with earliest ETA. -// leaseTime is in seconds. -// The number of tasks fetched will be at most maxTasks. -func LeaseByTag(c context.Context, maxTasks int, queueName string, leaseTime int, tag string) ([]*Task, error) { - return lease(c, maxTasks, queueName, leaseTime, true, []byte(tag)) -} - -// Purge removes all tasks from a queue. -func Purge(c context.Context, queueName string) error { - if queueName == "" { - queueName = "default" - } - req := &pb.TaskQueuePurgeQueueRequest{ - QueueName: []byte(queueName), - } - res := &pb.TaskQueuePurgeQueueResponse{} - return internal.Call(c, "taskqueue", "PurgeQueue", req, res) -} - -// ModifyLease modifies the lease of a task. -// Used to request more processing time, or to abandon processing. -// leaseTime is in seconds and must not be negative. -func ModifyLease(c context.Context, task *Task, queueName string, leaseTime int) error { - if queueName == "" { - queueName = "default" - } - req := &pb.TaskQueueModifyTaskLeaseRequest{ - QueueName: []byte(queueName), - TaskName: []byte(task.Name), - EtaUsec: proto.Int64(task.ETA.UnixNano() / 1e3), // Used to verify ownership. - LeaseSeconds: proto.Float64(float64(leaseTime)), - } - res := &pb.TaskQueueModifyTaskLeaseResponse{} - if err := internal.Call(c, "taskqueue", "ModifyTaskLease", req, res); err != nil { - return err - } - task.ETA = time.Unix(0, *res.UpdatedEtaUsec*1e3) - return nil -} - -// QueueStatistics represents statistics about a single task queue. -type QueueStatistics struct { - Tasks int // may be an approximation - OldestETA time.Time // zero if there are no pending tasks - - Executed1Minute int // tasks executed in the last minute - InFlight int // tasks executing now - EnforcedRate float64 // requests per second -} - -// QueueStats retrieves statistics about queues. -func QueueStats(c context.Context, queueNames []string) ([]QueueStatistics, error) { - req := &pb.TaskQueueFetchQueueStatsRequest{ - QueueName: make([][]byte, len(queueNames)), - } - for i, q := range queueNames { - if q == "" { - q = "default" - } - req.QueueName[i] = []byte(q) - } - res := &pb.TaskQueueFetchQueueStatsResponse{} - if err := internal.Call(c, "taskqueue", "FetchQueueStats", req, res); err != nil { - return nil, err - } - qs := make([]QueueStatistics, len(res.Queuestats)) - for i, qsg := range res.Queuestats { - qs[i] = QueueStatistics{ - Tasks: int(*qsg.NumTasks), - } - if eta := *qsg.OldestEtaUsec; eta > -1 { - qs[i].OldestETA = time.Unix(0, eta*1e3) - } - if si := qsg.ScannerInfo; si != nil { - qs[i].Executed1Minute = int(*si.ExecutedLastMinute) - qs[i].InFlight = int(si.GetRequestsInFlight()) - qs[i].EnforcedRate = si.GetEnforcedRate() - } - } - return qs, nil -} - -func setTransaction(x *pb.TaskQueueAddRequest, t *dspb.Transaction) { - x.Transaction = t -} - -func init() { - internal.RegisterErrorCodeMap("taskqueue", pb.TaskQueueServiceError_ErrorCode_name) - - // Datastore error codes are shifted by DATASTORE_ERROR when presented through taskqueue. - dsCode := int32(pb.TaskQueueServiceError_DATASTORE_ERROR) + int32(dspb.Error_TIMEOUT) - internal.RegisterTimeoutErrorCode("taskqueue", dsCode) - - // Transaction registration. - internal.RegisterTransactionSetter(setTransaction) - internal.RegisterTransactionSetter(func(x *pb.TaskQueueBulkAddRequest, t *dspb.Transaction) { - for _, req := range x.AddRequest { - setTransaction(req, t) - } - }) -} diff --git a/vendor/google.golang.org/appengine/urlfetch/urlfetch.go b/vendor/google.golang.org/appengine/urlfetch/urlfetch.go deleted file mode 100644 index ba3d17c71..000000000 --- a/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package urlfetch provides an http.RoundTripper implementation -// for fetching URLs via App Engine's urlfetch service. -package urlfetch - -import ( - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/urlfetch" -) - -// Transport is an implementation of http.RoundTripper for -// App Engine. Users should generally create an http.Client using -// this transport and use the Client rather than using this transport -// directly. -type Transport struct { - Context context.Context - - // Controls whether the application checks the validity of SSL certificates - // over HTTPS connections. A value of false (the default) instructs the - // application to send a request to the server only if the certificate is - // valid and signed by a trusted certificate authority (CA), and also - // includes a hostname that matches the certificate. A value of true - // instructs the application to perform no certificate validation. - AllowInvalidServerCertificate bool -} - -// Verify statically that *Transport implements http.RoundTripper. -var _ http.RoundTripper = (*Transport)(nil) - -// Client returns an *http.Client using a default urlfetch Transport. This -// client will have the default deadline of 5 seconds, and will check the -// validity of SSL certificates. -// -// Any deadline of the provided context will be used for requests through this client; -// if the client does not have a deadline then a 5 second default is used. -func Client(ctx context.Context) *http.Client { - return &http.Client{ - Transport: &Transport{ - Context: ctx, - }, - } -} - -type bodyReader struct { - content []byte - truncated bool - closed bool -} - -// ErrTruncatedBody is the error returned after the final Read() from a -// response's Body if the body has been truncated by App Engine's proxy. -var ErrTruncatedBody = errors.New("urlfetch: truncated body") - -func statusCodeToText(code int) string { - if t := http.StatusText(code); t != "" { - return t - } - return strconv.Itoa(code) -} - -func (br *bodyReader) Read(p []byte) (n int, err error) { - if br.closed { - if br.truncated { - return 0, ErrTruncatedBody - } - return 0, io.EOF - } - n = copy(p, br.content) - if n > 0 { - br.content = br.content[n:] - return - } - if br.truncated { - br.closed = true - return 0, ErrTruncatedBody - } - return 0, io.EOF -} - -func (br *bodyReader) Close() error { - br.closed = true - br.content = nil - return nil -} - -// A map of the URL Fetch-accepted methods that take a request body. -var methodAcceptsRequestBody = map[string]bool{ - "POST": true, - "PUT": true, - "PATCH": true, -} - -// urlString returns a valid string given a URL. This function is necessary because -// the String method of URL doesn't correctly handle URLs with non-empty Opaque values. -// See http://code.google.com/p/go/issues/detail?id=4860. -func urlString(u *url.URL) string { - if u.Opaque == "" || strings.HasPrefix(u.Opaque, "//") { - return u.String() - } - aux := *u - aux.Opaque = "//" + aux.Host + aux.Opaque - return aux.String() -} - -// RoundTrip issues a single HTTP request and returns its response. Per the -// http.RoundTripper interface, RoundTrip only returns an error if there -// was an unsupported request or the URL Fetch proxy fails. -// Note that HTTP response codes such as 5xx, 403, 404, etc are not -// errors as far as the transport is concerned and will be returned -// with err set to nil. -func (t *Transport) RoundTrip(req *http.Request) (res *http.Response, err error) { - methNum, ok := pb.URLFetchRequest_RequestMethod_value[req.Method] - if !ok { - return nil, fmt.Errorf("urlfetch: unsupported HTTP method %q", req.Method) - } - - method := pb.URLFetchRequest_RequestMethod(methNum) - - freq := &pb.URLFetchRequest{ - Method: &method, - Url: proto.String(urlString(req.URL)), - FollowRedirects: proto.Bool(false), // http.Client's responsibility - MustValidateServerCertificate: proto.Bool(!t.AllowInvalidServerCertificate), - } - if deadline, ok := t.Context.Deadline(); ok { - freq.Deadline = proto.Float64(deadline.Sub(time.Now()).Seconds()) - } - - for k, vals := range req.Header { - for _, val := range vals { - freq.Header = append(freq.Header, &pb.URLFetchRequest_Header{ - Key: proto.String(k), - Value: proto.String(val), - }) - } - } - if methodAcceptsRequestBody[req.Method] && req.Body != nil { - // Avoid a []byte copy if req.Body has a Bytes method. - switch b := req.Body.(type) { - case interface { - Bytes() []byte - }: - freq.Payload = b.Bytes() - default: - freq.Payload, err = ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - } - } - - fres := &pb.URLFetchResponse{} - if err := internal.Call(t.Context, "urlfetch", "Fetch", freq, fres); err != nil { - return nil, err - } - - res = &http.Response{} - res.StatusCode = int(*fres.StatusCode) - res.Status = fmt.Sprintf("%d %s", res.StatusCode, statusCodeToText(res.StatusCode)) - res.Header = make(http.Header) - res.Request = req - - // Faked: - res.ProtoMajor = 1 - res.ProtoMinor = 1 - res.Proto = "HTTP/1.1" - res.Close = true - - for _, h := range fres.Header { - hkey := http.CanonicalHeaderKey(*h.Key) - hval := *h.Value - if hkey == "Content-Length" { - // Will get filled in below for all but HEAD requests. - if req.Method == "HEAD" { - res.ContentLength, _ = strconv.ParseInt(hval, 10, 64) - } - continue - } - res.Header.Add(hkey, hval) - } - - if req.Method != "HEAD" { - res.ContentLength = int64(len(fres.Content)) - } - - truncated := fres.GetContentWasTruncated() - res.Body = &bodyReader{content: fres.Content, truncated: truncated} - return -} - -func init() { - internal.RegisterErrorCodeMap("urlfetch", pb.URLFetchServiceError_ErrorCode_name) - internal.RegisterTimeoutErrorCode("urlfetch", int32(pb.URLFetchServiceError_DEADLINE_EXCEEDED)) -} diff --git a/vendor/google.golang.org/appengine/user/oauth.go b/vendor/google.golang.org/appengine/user/oauth.go deleted file mode 100644 index 727a080d5..000000000 --- a/vendor/google.golang.org/appengine/user/oauth.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2012 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package user - -import ( - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/user" -) - -// CurrentOAuth returns the user associated with the OAuth consumer making this -// request. If the OAuth consumer did not make a valid OAuth request, or the -// scope is non-empty and the current user does not have this scope, this method -// will return an error. -func CurrentOAuth(c context.Context, scope string) (*User, error) { - req := &pb.GetOAuthUserRequest{} - if scope != "" { - req.Scope = &scope - } - res := &pb.GetOAuthUserResponse{} - - err := internal.Call(c, "user", "GetOAuthUser", req, res) - if err != nil { - return nil, err - } - return &User{ - Email: *res.Email, - AuthDomain: *res.AuthDomain, - Admin: res.GetIsAdmin(), - ID: *res.UserId, - }, nil -} - -// OAuthConsumerKey returns the OAuth consumer key provided with the current -// request. This method will return an error if the OAuth request was invalid. -func OAuthConsumerKey(c context.Context) (string, error) { - req := &pb.CheckOAuthSignatureRequest{} - res := &pb.CheckOAuthSignatureResponse{} - - err := internal.Call(c, "user", "CheckOAuthSignature", req, res) - if err != nil { - return "", err - } - return *res.OauthConsumerKey, err -} diff --git a/vendor/google.golang.org/appengine/user/user.go b/vendor/google.golang.org/appengine/user/user.go deleted file mode 100644 index 619f53572..000000000 --- a/vendor/google.golang.org/appengine/user/user.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package user provides a client for App Engine's user authentication service. -package user - -import ( - "strings" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/user" -) - -// User represents a user of the application. -type User struct { - Email string - AuthDomain string - Admin bool - - // ID is the unique permanent ID of the user. - // It is populated if the Email is associated - // with a Google account, or empty otherwise. - ID string - - FederatedIdentity string - FederatedProvider string -} - -// String returns a displayable name for the user. -func (u *User) String() string { - if u.AuthDomain != "" && strings.HasSuffix(u.Email, "@"+u.AuthDomain) { - return u.Email[:len(u.Email)-len("@"+u.AuthDomain)] - } - if u.FederatedIdentity != "" { - return u.FederatedIdentity - } - return u.Email -} - -// LoginURL returns a URL that, when visited, prompts the user to sign in, -// then redirects the user to the URL specified by dest. -func LoginURL(c context.Context, dest string) (string, error) { - return LoginURLFederated(c, dest, "") -} - -// LoginURLFederated is like LoginURL but accepts a user's OpenID identifier. -func LoginURLFederated(c context.Context, dest, identity string) (string, error) { - req := &pb.CreateLoginURLRequest{ - DestinationUrl: proto.String(dest), - } - if identity != "" { - req.FederatedIdentity = proto.String(identity) - } - res := &pb.CreateLoginURLResponse{} - if err := internal.Call(c, "user", "CreateLoginURL", req, res); err != nil { - return "", err - } - return *res.LoginUrl, nil -} - -// LogoutURL returns a URL that, when visited, signs the user out, -// then redirects the user to the URL specified by dest. -func LogoutURL(c context.Context, dest string) (string, error) { - req := &pb.CreateLogoutURLRequest{ - DestinationUrl: proto.String(dest), - } - res := &pb.CreateLogoutURLResponse{} - if err := internal.Call(c, "user", "CreateLogoutURL", req, res); err != nil { - return "", err - } - return *res.LogoutUrl, nil -} - -func init() { - internal.RegisterErrorCodeMap("user", pb.UserServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/appengine/user/user_classic.go b/vendor/google.golang.org/appengine/user/user_classic.go deleted file mode 100644 index 9f37a08cf..000000000 --- a/vendor/google.golang.org/appengine/user/user_classic.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build appengine - -package user - -import ( - "appengine/user" - - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -func Current(ctx context.Context) *User { - u := user.Current(internal.ClassicContextFromContext(ctx)) - if u == nil { - return nil - } - // Map appengine/user.User to this package's User type. - return &User{ - Email: u.Email, - AuthDomain: u.AuthDomain, - Admin: u.Admin, - ID: u.ID, - FederatedIdentity: u.FederatedIdentity, - FederatedProvider: u.FederatedProvider, - } -} - -func IsAdmin(ctx context.Context) bool { - return user.IsAdmin(internal.ClassicContextFromContext(ctx)) -} diff --git a/vendor/google.golang.org/appengine/user/user_vm.go b/vendor/google.golang.org/appengine/user/user_vm.go deleted file mode 100644 index 38dc6324a..000000000 --- a/vendor/google.golang.org/appengine/user/user_vm.go +++ /dev/null @@ -1,34 +0,0 @@ -// +build !appengine - -package user - -import ( - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -// Current returns the currently logged-in user, -// or nil if the user is not signed in. -func Current(c context.Context) *User { - h := internal.IncomingHeaders(c) - u := &User{ - Email: h.Get("X-AppEngine-User-Email"), - AuthDomain: h.Get("X-AppEngine-Auth-Domain"), - ID: h.Get("X-AppEngine-User-Id"), - Admin: h.Get("X-AppEngine-User-Is-Admin") == "1", - FederatedIdentity: h.Get("X-AppEngine-Federated-Identity"), - FederatedProvider: h.Get("X-AppEngine-Federated-Provider"), - } - if u.Email == "" && u.FederatedIdentity == "" { - return nil - } - return u -} - -// IsAdmin returns true if the current user is signed in and -// is currently registered as an administrator of the application. -func IsAdmin(c context.Context) bool { - h := internal.IncomingHeaders(c) - return h.Get("X-AppEngine-User-Is-Admin") == "1" -} diff --git a/vendor/google.golang.org/appengine/xmpp/xmpp.go b/vendor/google.golang.org/appengine/xmpp/xmpp.go deleted file mode 100644 index bbc27538a..000000000 --- a/vendor/google.golang.org/appengine/xmpp/xmpp.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -/* -Package xmpp provides the means to send and receive instant messages -to and from users of XMPP-compatible services. - -To send a message, - m := &xmpp.Message{ - To: []string{"kaylee@example.com"}, - Body: `Hi! How's the carrot?`, - } - err := m.Send(c) - -To receive messages, - func init() { - xmpp.Handle(handleChat) - } - - func handleChat(c context.Context, m *xmpp.Message) { - // ... - } -*/ -package xmpp - -import ( - "errors" - "fmt" - "net/http" - - "golang.org/x/net/context" - - "google.golang.org/appengine" - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/xmpp" -) - -// Message represents an incoming chat message. -type Message struct { - // Sender is the JID of the sender. - // Optional for outgoing messages. - Sender string - - // To is the intended recipients of the message. - // Incoming messages will have exactly one element. - To []string - - // Body is the body of the message. - Body string - - // Type is the message type, per RFC 3921. - // It defaults to "chat". - Type string - - // RawXML is whether the body contains raw XML. - RawXML bool -} - -// Presence represents an outgoing presence update. -type Presence struct { - // Sender is the JID (optional). - Sender string - - // The intended recipient of the presence update. - To string - - // Type, per RFC 3921 (optional). Defaults to "available". - Type string - - // State of presence (optional). - // Valid values: "away", "chat", "xa", "dnd" (RFC 3921). - State string - - // Free text status message (optional). - Status string -} - -var ( - ErrPresenceUnavailable = errors.New("xmpp: presence unavailable") - ErrInvalidJID = errors.New("xmpp: invalid JID") -) - -// Handle arranges for f to be called for incoming XMPP messages. -// Only messages of type "chat" or "normal" will be handled. -func Handle(f func(c context.Context, m *Message)) { - http.HandleFunc("/_ah/xmpp/message/chat/", func(_ http.ResponseWriter, r *http.Request) { - f(appengine.NewContext(r), &Message{ - Sender: r.FormValue("from"), - To: []string{r.FormValue("to")}, - Body: r.FormValue("body"), - }) - }) -} - -// Send sends a message. -// If any failures occur with specific recipients, the error will be an appengine.MultiError. -func (m *Message) Send(c context.Context) error { - req := &pb.XmppMessageRequest{ - Jid: m.To, - Body: &m.Body, - RawXml: &m.RawXML, - } - if m.Type != "" && m.Type != "chat" { - req.Type = &m.Type - } - if m.Sender != "" { - req.FromJid = &m.Sender - } - res := &pb.XmppMessageResponse{} - if err := internal.Call(c, "xmpp", "SendMessage", req, res); err != nil { - return err - } - - if len(res.Status) != len(req.Jid) { - return fmt.Errorf("xmpp: sent message to %d JIDs, but only got %d statuses back", len(req.Jid), len(res.Status)) - } - me, any := make(appengine.MultiError, len(req.Jid)), false - for i, st := range res.Status { - if st != pb.XmppMessageResponse_NO_ERROR { - me[i] = errors.New(st.String()) - any = true - } - } - if any { - return me - } - return nil -} - -// Invite sends an invitation. If the from address is an empty string -// the default (yourapp@appspot.com/bot) will be used. -func Invite(c context.Context, to, from string) error { - req := &pb.XmppInviteRequest{ - Jid: &to, - } - if from != "" { - req.FromJid = &from - } - res := &pb.XmppInviteResponse{} - return internal.Call(c, "xmpp", "SendInvite", req, res) -} - -// Send sends a presence update. -func (p *Presence) Send(c context.Context) error { - req := &pb.XmppSendPresenceRequest{ - Jid: &p.To, - } - if p.State != "" { - req.Show = &p.State - } - if p.Type != "" { - req.Type = &p.Type - } - if p.Sender != "" { - req.FromJid = &p.Sender - } - if p.Status != "" { - req.Status = &p.Status - } - res := &pb.XmppSendPresenceResponse{} - return internal.Call(c, "xmpp", "SendPresence", req, res) -} - -var presenceMap = map[pb.PresenceResponse_SHOW]string{ - pb.PresenceResponse_NORMAL: "", - pb.PresenceResponse_AWAY: "away", - pb.PresenceResponse_DO_NOT_DISTURB: "dnd", - pb.PresenceResponse_CHAT: "chat", - pb.PresenceResponse_EXTENDED_AWAY: "xa", -} - -// GetPresence retrieves a user's presence. -// If the from address is an empty string the default -// (yourapp@appspot.com/bot) will be used. -// Possible return values are "", "away", "dnd", "chat", "xa". -// ErrPresenceUnavailable is returned if the presence is unavailable. -func GetPresence(c context.Context, to string, from string) (string, error) { - req := &pb.PresenceRequest{ - Jid: &to, - } - if from != "" { - req.FromJid = &from - } - res := &pb.PresenceResponse{} - if err := internal.Call(c, "xmpp", "GetPresence", req, res); err != nil { - return "", err - } - if !*res.IsAvailable || res.Presence == nil { - return "", ErrPresenceUnavailable - } - presence, ok := presenceMap[*res.Presence] - if ok { - return presence, nil - } - return "", fmt.Errorf("xmpp: unknown presence %v", *res.Presence) -} - -// GetPresenceMulti retrieves multiple users' presence. -// If the from address is an empty string the default -// (yourapp@appspot.com/bot) will be used. -// Possible return values are "", "away", "dnd", "chat", "xa". -// If any presence is unavailable, an appengine.MultiError is returned -func GetPresenceMulti(c context.Context, to []string, from string) ([]string, error) { - req := &pb.BulkPresenceRequest{ - Jid: to, - } - if from != "" { - req.FromJid = &from - } - res := &pb.BulkPresenceResponse{} - - if err := internal.Call(c, "xmpp", "BulkGetPresence", req, res); err != nil { - return nil, err - } - - presences := make([]string, 0, len(res.PresenceResponse)) - errs := appengine.MultiError{} - - addResult := func(presence string, err error) { - presences = append(presences, presence) - errs = append(errs, err) - } - - anyErr := false - for _, subres := range res.PresenceResponse { - if !subres.GetValid() { - anyErr = true - addResult("", ErrInvalidJID) - continue - } - if !*subres.IsAvailable || subres.Presence == nil { - anyErr = true - addResult("", ErrPresenceUnavailable) - continue - } - presence, ok := presenceMap[*subres.Presence] - if ok { - addResult(presence, nil) - } else { - anyErr = true - addResult("", fmt.Errorf("xmpp: unknown presence %q", *subres.Presence)) - } - } - if anyErr { - return presences, errs - } - return presences, nil -} - -func init() { - internal.RegisterErrorCodeMap("xmpp", pb.XmppServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.pb.go b/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.pb.go deleted file mode 100644 index 9cb9be528..000000000 --- a/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.pb.go +++ /dev/null @@ -1,1633 +0,0 @@ -// Code generated by protoc-gen-go. -// source: datastore_v1.proto -// DO NOT EDIT! - -/* -Package datastore is a generated protocol buffer package. - -It is generated from these files: - datastore_v1.proto - -It has these top-level messages: - PartitionId - Key - Value - Property - Entity - EntityResult - Query - KindExpression - PropertyReference - PropertyExpression - PropertyOrder - Filter - CompositeFilter - PropertyFilter - GqlQuery - GqlQueryArg - QueryResultBatch - Mutation - MutationResult - ReadOptions - LookupRequest - LookupResponse - RunQueryRequest - RunQueryResponse - BeginTransactionRequest - BeginTransactionResponse - RollbackRequest - RollbackResponse - CommitRequest - CommitResponse - AllocateIdsRequest - AllocateIdsResponse -*/ -package datastore - -import proto "github.com/golang/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -// Specifies what data the 'entity' field contains. -// A ResultType is either implied (for example, in LookupResponse.found it -// is always FULL) or specified by context (for example, in message -// QueryResultBatch, field 'entity_result_type' specifies a ResultType -// for all the values in field 'entity_result'). -type EntityResult_ResultType int32 - -const ( - EntityResult_FULL EntityResult_ResultType = 1 - EntityResult_PROJECTION EntityResult_ResultType = 2 - // The entity may have no key. - // A property value may have meaning 18. - EntityResult_KEY_ONLY EntityResult_ResultType = 3 -) - -var EntityResult_ResultType_name = map[int32]string{ - 1: "FULL", - 2: "PROJECTION", - 3: "KEY_ONLY", -} -var EntityResult_ResultType_value = map[string]int32{ - "FULL": 1, - "PROJECTION": 2, - "KEY_ONLY": 3, -} - -func (x EntityResult_ResultType) Enum() *EntityResult_ResultType { - p := new(EntityResult_ResultType) - *p = x - return p -} -func (x EntityResult_ResultType) String() string { - return proto.EnumName(EntityResult_ResultType_name, int32(x)) -} -func (x *EntityResult_ResultType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EntityResult_ResultType_value, data, "EntityResult_ResultType") - if err != nil { - return err - } - *x = EntityResult_ResultType(value) - return nil -} - -type PropertyExpression_AggregationFunction int32 - -const ( - PropertyExpression_FIRST PropertyExpression_AggregationFunction = 1 -) - -var PropertyExpression_AggregationFunction_name = map[int32]string{ - 1: "FIRST", -} -var PropertyExpression_AggregationFunction_value = map[string]int32{ - "FIRST": 1, -} - -func (x PropertyExpression_AggregationFunction) Enum() *PropertyExpression_AggregationFunction { - p := new(PropertyExpression_AggregationFunction) - *p = x - return p -} -func (x PropertyExpression_AggregationFunction) String() string { - return proto.EnumName(PropertyExpression_AggregationFunction_name, int32(x)) -} -func (x *PropertyExpression_AggregationFunction) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PropertyExpression_AggregationFunction_value, data, "PropertyExpression_AggregationFunction") - if err != nil { - return err - } - *x = PropertyExpression_AggregationFunction(value) - return nil -} - -type PropertyOrder_Direction int32 - -const ( - PropertyOrder_ASCENDING PropertyOrder_Direction = 1 - PropertyOrder_DESCENDING PropertyOrder_Direction = 2 -) - -var PropertyOrder_Direction_name = map[int32]string{ - 1: "ASCENDING", - 2: "DESCENDING", -} -var PropertyOrder_Direction_value = map[string]int32{ - "ASCENDING": 1, - "DESCENDING": 2, -} - -func (x PropertyOrder_Direction) Enum() *PropertyOrder_Direction { - p := new(PropertyOrder_Direction) - *p = x - return p -} -func (x PropertyOrder_Direction) String() string { - return proto.EnumName(PropertyOrder_Direction_name, int32(x)) -} -func (x *PropertyOrder_Direction) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PropertyOrder_Direction_value, data, "PropertyOrder_Direction") - if err != nil { - return err - } - *x = PropertyOrder_Direction(value) - return nil -} - -type CompositeFilter_Operator int32 - -const ( - CompositeFilter_AND CompositeFilter_Operator = 1 -) - -var CompositeFilter_Operator_name = map[int32]string{ - 1: "AND", -} -var CompositeFilter_Operator_value = map[string]int32{ - "AND": 1, -} - -func (x CompositeFilter_Operator) Enum() *CompositeFilter_Operator { - p := new(CompositeFilter_Operator) - *p = x - return p -} -func (x CompositeFilter_Operator) String() string { - return proto.EnumName(CompositeFilter_Operator_name, int32(x)) -} -func (x *CompositeFilter_Operator) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CompositeFilter_Operator_value, data, "CompositeFilter_Operator") - if err != nil { - return err - } - *x = CompositeFilter_Operator(value) - return nil -} - -type PropertyFilter_Operator int32 - -const ( - PropertyFilter_LESS_THAN PropertyFilter_Operator = 1 - PropertyFilter_LESS_THAN_OR_EQUAL PropertyFilter_Operator = 2 - PropertyFilter_GREATER_THAN PropertyFilter_Operator = 3 - PropertyFilter_GREATER_THAN_OR_EQUAL PropertyFilter_Operator = 4 - PropertyFilter_EQUAL PropertyFilter_Operator = 5 - PropertyFilter_HAS_ANCESTOR PropertyFilter_Operator = 11 -) - -var PropertyFilter_Operator_name = map[int32]string{ - 1: "LESS_THAN", - 2: "LESS_THAN_OR_EQUAL", - 3: "GREATER_THAN", - 4: "GREATER_THAN_OR_EQUAL", - 5: "EQUAL", - 11: "HAS_ANCESTOR", -} -var PropertyFilter_Operator_value = map[string]int32{ - "LESS_THAN": 1, - "LESS_THAN_OR_EQUAL": 2, - "GREATER_THAN": 3, - "GREATER_THAN_OR_EQUAL": 4, - "EQUAL": 5, - "HAS_ANCESTOR": 11, -} - -func (x PropertyFilter_Operator) Enum() *PropertyFilter_Operator { - p := new(PropertyFilter_Operator) - *p = x - return p -} -func (x PropertyFilter_Operator) String() string { - return proto.EnumName(PropertyFilter_Operator_name, int32(x)) -} -func (x *PropertyFilter_Operator) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PropertyFilter_Operator_value, data, "PropertyFilter_Operator") - if err != nil { - return err - } - *x = PropertyFilter_Operator(value) - return nil -} - -// The possible values for the 'more_results' field. -type QueryResultBatch_MoreResultsType int32 - -const ( - QueryResultBatch_NOT_FINISHED QueryResultBatch_MoreResultsType = 1 - QueryResultBatch_MORE_RESULTS_AFTER_LIMIT QueryResultBatch_MoreResultsType = 2 - // results after the limit. - QueryResultBatch_NO_MORE_RESULTS QueryResultBatch_MoreResultsType = 3 -) - -var QueryResultBatch_MoreResultsType_name = map[int32]string{ - 1: "NOT_FINISHED", - 2: "MORE_RESULTS_AFTER_LIMIT", - 3: "NO_MORE_RESULTS", -} -var QueryResultBatch_MoreResultsType_value = map[string]int32{ - "NOT_FINISHED": 1, - "MORE_RESULTS_AFTER_LIMIT": 2, - "NO_MORE_RESULTS": 3, -} - -func (x QueryResultBatch_MoreResultsType) Enum() *QueryResultBatch_MoreResultsType { - p := new(QueryResultBatch_MoreResultsType) - *p = x - return p -} -func (x QueryResultBatch_MoreResultsType) String() string { - return proto.EnumName(QueryResultBatch_MoreResultsType_name, int32(x)) -} -func (x *QueryResultBatch_MoreResultsType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(QueryResultBatch_MoreResultsType_value, data, "QueryResultBatch_MoreResultsType") - if err != nil { - return err - } - *x = QueryResultBatch_MoreResultsType(value) - return nil -} - -type ReadOptions_ReadConsistency int32 - -const ( - ReadOptions_DEFAULT ReadOptions_ReadConsistency = 0 - ReadOptions_STRONG ReadOptions_ReadConsistency = 1 - ReadOptions_EVENTUAL ReadOptions_ReadConsistency = 2 -) - -var ReadOptions_ReadConsistency_name = map[int32]string{ - 0: "DEFAULT", - 1: "STRONG", - 2: "EVENTUAL", -} -var ReadOptions_ReadConsistency_value = map[string]int32{ - "DEFAULT": 0, - "STRONG": 1, - "EVENTUAL": 2, -} - -func (x ReadOptions_ReadConsistency) Enum() *ReadOptions_ReadConsistency { - p := new(ReadOptions_ReadConsistency) - *p = x - return p -} -func (x ReadOptions_ReadConsistency) String() string { - return proto.EnumName(ReadOptions_ReadConsistency_name, int32(x)) -} -func (x *ReadOptions_ReadConsistency) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ReadOptions_ReadConsistency_value, data, "ReadOptions_ReadConsistency") - if err != nil { - return err - } - *x = ReadOptions_ReadConsistency(value) - return nil -} - -type BeginTransactionRequest_IsolationLevel int32 - -const ( - BeginTransactionRequest_SNAPSHOT BeginTransactionRequest_IsolationLevel = 0 - // conflict if their mutations conflict. For example: - // Read(A),Write(B) may not conflict with Read(B),Write(A), - // but Read(B),Write(B) does conflict with Read(B),Write(B). - BeginTransactionRequest_SERIALIZABLE BeginTransactionRequest_IsolationLevel = 1 -) - -var BeginTransactionRequest_IsolationLevel_name = map[int32]string{ - 0: "SNAPSHOT", - 1: "SERIALIZABLE", -} -var BeginTransactionRequest_IsolationLevel_value = map[string]int32{ - "SNAPSHOT": 0, - "SERIALIZABLE": 1, -} - -func (x BeginTransactionRequest_IsolationLevel) Enum() *BeginTransactionRequest_IsolationLevel { - p := new(BeginTransactionRequest_IsolationLevel) - *p = x - return p -} -func (x BeginTransactionRequest_IsolationLevel) String() string { - return proto.EnumName(BeginTransactionRequest_IsolationLevel_name, int32(x)) -} -func (x *BeginTransactionRequest_IsolationLevel) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(BeginTransactionRequest_IsolationLevel_value, data, "BeginTransactionRequest_IsolationLevel") - if err != nil { - return err - } - *x = BeginTransactionRequest_IsolationLevel(value) - return nil -} - -type CommitRequest_Mode int32 - -const ( - CommitRequest_TRANSACTIONAL CommitRequest_Mode = 1 - CommitRequest_NON_TRANSACTIONAL CommitRequest_Mode = 2 -) - -var CommitRequest_Mode_name = map[int32]string{ - 1: "TRANSACTIONAL", - 2: "NON_TRANSACTIONAL", -} -var CommitRequest_Mode_value = map[string]int32{ - "TRANSACTIONAL": 1, - "NON_TRANSACTIONAL": 2, -} - -func (x CommitRequest_Mode) Enum() *CommitRequest_Mode { - p := new(CommitRequest_Mode) - *p = x - return p -} -func (x CommitRequest_Mode) String() string { - return proto.EnumName(CommitRequest_Mode_name, int32(x)) -} -func (x *CommitRequest_Mode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CommitRequest_Mode_value, data, "CommitRequest_Mode") - if err != nil { - return err - } - *x = CommitRequest_Mode(value) - return nil -} - -// An identifier for a particular subset of entities. -// -// Entities are partitioned into various subsets, each used by different -// datasets and different namespaces within a dataset and so forth. -// -// All input partition IDs are normalized before use. -// A partition ID is normalized as follows: -// If the partition ID is unset or is set to an empty partition ID, replace it -// with the context partition ID. -// Otherwise, if the partition ID has no dataset ID, assign it the context -// partition ID's dataset ID. -// Unless otherwise documented, the context partition ID has the dataset ID set -// to the context dataset ID and no other partition dimension set. -// -// A partition ID is empty if all of its fields are unset. -// -// Partition dimension: -// A dimension may be unset. -// A dimension's value must never be "". -// A dimension's value must match [A-Za-z\d\.\-_]{1,100} -// If the value of any dimension matches regex "__.*__", -// the partition is reserved/read-only. -// A reserved/read-only partition ID is forbidden in certain documented contexts. -// -// Dataset ID: -// A dataset id's value must never be "". -// A dataset id's value must match -// ([a-z\d\-]{1,100}~)?([a-z\d][a-z\d\-\.]{0,99}:)?([a-z\d][a-z\d\-]{0,99} -type PartitionId struct { - // The dataset ID. - DatasetId *string `protobuf:"bytes,3,opt,name=dataset_id" json:"dataset_id,omitempty"` - // The namespace. - Namespace *string `protobuf:"bytes,4,opt,name=namespace" json:"namespace,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PartitionId) Reset() { *m = PartitionId{} } -func (m *PartitionId) String() string { return proto.CompactTextString(m) } -func (*PartitionId) ProtoMessage() {} - -func (m *PartitionId) GetDatasetId() string { - if m != nil && m.DatasetId != nil { - return *m.DatasetId - } - return "" -} - -func (m *PartitionId) GetNamespace() string { - if m != nil && m.Namespace != nil { - return *m.Namespace - } - return "" -} - -// A unique identifier for an entity. -// If a key's partition id or any of its path kinds or names are -// reserved/read-only, the key is reserved/read-only. -// A reserved/read-only key is forbidden in certain documented contexts. -type Key struct { - // Entities are partitioned into subsets, currently identified by a dataset - // (usually implicitly specified by the project) and namespace ID. - // Queries are scoped to a single partition. - PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id" json:"partition_id,omitempty"` - // The entity path. - // An entity path consists of one or more elements composed of a kind and a - // string or numerical identifier, which identify entities. The first - // element identifies a root entity, the second element identifies - // a child of the root entity, the third element a child of the - // second entity, and so forth. The entities identified by all prefixes of - // the path are called the element's ancestors. - // An entity path is always fully complete: ALL of the entity's ancestors - // are required to be in the path along with the entity identifier itself. - // The only exception is that in some documented cases, the identifier in the - // last path element (for the entity) itself may be omitted. A path can never - // be empty. - PathElement []*Key_PathElement `protobuf:"bytes,2,rep,name=path_element" json:"path_element,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Key) Reset() { *m = Key{} } -func (m *Key) String() string { return proto.CompactTextString(m) } -func (*Key) ProtoMessage() {} - -func (m *Key) GetPartitionId() *PartitionId { - if m != nil { - return m.PartitionId - } - return nil -} - -func (m *Key) GetPathElement() []*Key_PathElement { - if m != nil { - return m.PathElement - } - return nil -} - -// A (kind, ID/name) pair used to construct a key path. -// -// At most one of name or ID may be set. -// If either is set, the element is complete. -// If neither is set, the element is incomplete. -type Key_PathElement struct { - // The kind of the entity. - // A kind matching regex "__.*__" is reserved/read-only. - // A kind must not contain more than 500 characters. - // Cannot be "". - Kind *string `protobuf:"bytes,1,req,name=kind" json:"kind,omitempty"` - // The ID of the entity. - // Never equal to zero. Values less than zero are discouraged and will not - // be supported in the future. - Id *int64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` - // The name of the entity. - // A name matching regex "__.*__" is reserved/read-only. - // A name must not be more than 500 characters. - // Cannot be "". - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Key_PathElement) Reset() { *m = Key_PathElement{} } -func (m *Key_PathElement) String() string { return proto.CompactTextString(m) } -func (*Key_PathElement) ProtoMessage() {} - -func (m *Key_PathElement) GetKind() string { - if m != nil && m.Kind != nil { - return *m.Kind - } - return "" -} - -func (m *Key_PathElement) GetId() int64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *Key_PathElement) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -// A message that can hold any of the supported value types and associated -// metadata. -// -// At most one of the Value fields may be set. -// If none are set the value is "null". -// -type Value struct { - // A boolean value. - BooleanValue *bool `protobuf:"varint,1,opt,name=boolean_value" json:"boolean_value,omitempty"` - // An integer value. - IntegerValue *int64 `protobuf:"varint,2,opt,name=integer_value" json:"integer_value,omitempty"` - // A double value. - DoubleValue *float64 `protobuf:"fixed64,3,opt,name=double_value" json:"double_value,omitempty"` - // A timestamp value. - TimestampMicrosecondsValue *int64 `protobuf:"varint,4,opt,name=timestamp_microseconds_value" json:"timestamp_microseconds_value,omitempty"` - // A key value. - KeyValue *Key `protobuf:"bytes,5,opt,name=key_value" json:"key_value,omitempty"` - // A blob key value. - BlobKeyValue *string `protobuf:"bytes,16,opt,name=blob_key_value" json:"blob_key_value,omitempty"` - // A UTF-8 encoded string value. - StringValue *string `protobuf:"bytes,17,opt,name=string_value" json:"string_value,omitempty"` - // A blob value. - BlobValue []byte `protobuf:"bytes,18,opt,name=blob_value" json:"blob_value,omitempty"` - // An entity value. - // May have no key. - // May have a key with an incomplete key path. - // May have a reserved/read-only key. - EntityValue *Entity `protobuf:"bytes,6,opt,name=entity_value" json:"entity_value,omitempty"` - // A list value. - // Cannot contain another list value. - // Cannot also have a meaning and indexing set. - ListValue []*Value `protobuf:"bytes,7,rep,name=list_value" json:"list_value,omitempty"` - // The meaning field is reserved and should not be used. - Meaning *int32 `protobuf:"varint,14,opt,name=meaning" json:"meaning,omitempty"` - // If the value should be indexed. - // - // The indexed property may be set for a - // null value. - // When indexed is true, stringValue - // is limited to 500 characters and the blob value is limited to 500 bytes. - // Exception: If meaning is set to 2, string_value is limited to 2038 - // characters regardless of indexed. - // When indexed is true, meaning 15 and 22 are not allowed, and meaning 16 - // will be ignored on input (and will never be set on output). - // Input values by default have indexed set to - // true; however, you can explicitly set indexed to - // true if you want. (An output value never has - // indexed explicitly set to true.) If a value is - // itself an entity, it cannot have indexed set to - // true. - // Exception: An entity value with meaning 9, 20 or 21 may be indexed. - Indexed *bool `protobuf:"varint,15,opt,name=indexed,def=1" json:"indexed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value) Reset() { *m = Value{} } -func (m *Value) String() string { return proto.CompactTextString(m) } -func (*Value) ProtoMessage() {} - -const Default_Value_Indexed bool = true - -func (m *Value) GetBooleanValue() bool { - if m != nil && m.BooleanValue != nil { - return *m.BooleanValue - } - return false -} - -func (m *Value) GetIntegerValue() int64 { - if m != nil && m.IntegerValue != nil { - return *m.IntegerValue - } - return 0 -} - -func (m *Value) GetDoubleValue() float64 { - if m != nil && m.DoubleValue != nil { - return *m.DoubleValue - } - return 0 -} - -func (m *Value) GetTimestampMicrosecondsValue() int64 { - if m != nil && m.TimestampMicrosecondsValue != nil { - return *m.TimestampMicrosecondsValue - } - return 0 -} - -func (m *Value) GetKeyValue() *Key { - if m != nil { - return m.KeyValue - } - return nil -} - -func (m *Value) GetBlobKeyValue() string { - if m != nil && m.BlobKeyValue != nil { - return *m.BlobKeyValue - } - return "" -} - -func (m *Value) GetStringValue() string { - if m != nil && m.StringValue != nil { - return *m.StringValue - } - return "" -} - -func (m *Value) GetBlobValue() []byte { - if m != nil { - return m.BlobValue - } - return nil -} - -func (m *Value) GetEntityValue() *Entity { - if m != nil { - return m.EntityValue - } - return nil -} - -func (m *Value) GetListValue() []*Value { - if m != nil { - return m.ListValue - } - return nil -} - -func (m *Value) GetMeaning() int32 { - if m != nil && m.Meaning != nil { - return *m.Meaning - } - return 0 -} - -func (m *Value) GetIndexed() bool { - if m != nil && m.Indexed != nil { - return *m.Indexed - } - return Default_Value_Indexed -} - -// An entity property. -type Property struct { - // The name of the property. - // A property name matching regex "__.*__" is reserved. - // A reserved property name is forbidden in certain documented contexts. - // The name must not contain more than 500 characters. - // Cannot be "". - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - // The value(s) of the property. - // Each value can have only one value property populated. For example, - // you cannot have a values list of { value: { integerValue: 22, - // stringValue: "a" } }, but you can have { value: { listValue: - // [ { integerValue: 22 }, { stringValue: "a" } ] }. - Value *Value `protobuf:"bytes,4,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Property) Reset() { *m = Property{} } -func (m *Property) String() string { return proto.CompactTextString(m) } -func (*Property) ProtoMessage() {} - -func (m *Property) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Property) GetValue() *Value { - if m != nil { - return m.Value - } - return nil -} - -// An entity. -// -// An entity is limited to 1 megabyte when stored. That roughly -// corresponds to a limit of 1 megabyte for the serialized form of this -// message. -type Entity struct { - // The entity's key. - // - // An entity must have a key, unless otherwise documented (for example, - // an entity in Value.entityValue may have no key). - // An entity's kind is its key's path's last element's kind, - // or null if it has no key. - Key *Key `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - // The entity's properties. - // Each property's name must be unique for its entity. - Property []*Property `protobuf:"bytes,2,rep,name=property" json:"property,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Entity) Reset() { *m = Entity{} } -func (m *Entity) String() string { return proto.CompactTextString(m) } -func (*Entity) ProtoMessage() {} - -func (m *Entity) GetKey() *Key { - if m != nil { - return m.Key - } - return nil -} - -func (m *Entity) GetProperty() []*Property { - if m != nil { - return m.Property - } - return nil -} - -// The result of fetching an entity from the datastore. -type EntityResult struct { - // The resulting entity. - Entity *Entity `protobuf:"bytes,1,req,name=entity" json:"entity,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *EntityResult) Reset() { *m = EntityResult{} } -func (m *EntityResult) String() string { return proto.CompactTextString(m) } -func (*EntityResult) ProtoMessage() {} - -func (m *EntityResult) GetEntity() *Entity { - if m != nil { - return m.Entity - } - return nil -} - -// A query. -type Query struct { - // The projection to return. If not set the entire entity is returned. - Projection []*PropertyExpression `protobuf:"bytes,2,rep,name=projection" json:"projection,omitempty"` - // The kinds to query (if empty, returns entities from all kinds). - Kind []*KindExpression `protobuf:"bytes,3,rep,name=kind" json:"kind,omitempty"` - // The filter to apply (optional). - Filter *Filter `protobuf:"bytes,4,opt,name=filter" json:"filter,omitempty"` - // The order to apply to the query results (if empty, order is unspecified). - Order []*PropertyOrder `protobuf:"bytes,5,rep,name=order" json:"order,omitempty"` - // The properties to group by (if empty, no grouping is applied to the - // result set). - GroupBy []*PropertyReference `protobuf:"bytes,6,rep,name=group_by" json:"group_by,omitempty"` - // A starting point for the query results. Optional. Query cursors are - // returned in query result batches. - StartCursor []byte `protobuf:"bytes,7,opt,name=start_cursor" json:"start_cursor,omitempty"` - // An ending point for the query results. Optional. Query cursors are - // returned in query result batches. - EndCursor []byte `protobuf:"bytes,8,opt,name=end_cursor" json:"end_cursor,omitempty"` - // The number of results to skip. Applies before limit, but after all other - // constraints (optional, defaults to 0). - Offset *int32 `protobuf:"varint,10,opt,name=offset,def=0" json:"offset,omitempty"` - // The maximum number of results to return. Applies after all other - // constraints. Optional. - Limit *int32 `protobuf:"varint,11,opt,name=limit" json:"limit,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Query) Reset() { *m = Query{} } -func (m *Query) String() string { return proto.CompactTextString(m) } -func (*Query) ProtoMessage() {} - -const Default_Query_Offset int32 = 0 - -func (m *Query) GetProjection() []*PropertyExpression { - if m != nil { - return m.Projection - } - return nil -} - -func (m *Query) GetKind() []*KindExpression { - if m != nil { - return m.Kind - } - return nil -} - -func (m *Query) GetFilter() *Filter { - if m != nil { - return m.Filter - } - return nil -} - -func (m *Query) GetOrder() []*PropertyOrder { - if m != nil { - return m.Order - } - return nil -} - -func (m *Query) GetGroupBy() []*PropertyReference { - if m != nil { - return m.GroupBy - } - return nil -} - -func (m *Query) GetStartCursor() []byte { - if m != nil { - return m.StartCursor - } - return nil -} - -func (m *Query) GetEndCursor() []byte { - if m != nil { - return m.EndCursor - } - return nil -} - -func (m *Query) GetOffset() int32 { - if m != nil && m.Offset != nil { - return *m.Offset - } - return Default_Query_Offset -} - -func (m *Query) GetLimit() int32 { - if m != nil && m.Limit != nil { - return *m.Limit - } - return 0 -} - -// A representation of a kind. -type KindExpression struct { - // The name of the kind. - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *KindExpression) Reset() { *m = KindExpression{} } -func (m *KindExpression) String() string { return proto.CompactTextString(m) } -func (*KindExpression) ProtoMessage() {} - -func (m *KindExpression) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -// A reference to a property relative to the kind expressions. -// exactly. -type PropertyReference struct { - // The name of the property. - Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PropertyReference) Reset() { *m = PropertyReference{} } -func (m *PropertyReference) String() string { return proto.CompactTextString(m) } -func (*PropertyReference) ProtoMessage() {} - -func (m *PropertyReference) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -// A representation of a property in a projection. -type PropertyExpression struct { - // The property to project. - Property *PropertyReference `protobuf:"bytes,1,req,name=property" json:"property,omitempty"` - // The aggregation function to apply to the property. Optional. - // Can only be used when grouping by at least one property. Must - // then be set on all properties in the projection that are not - // being grouped by. - AggregationFunction *PropertyExpression_AggregationFunction `protobuf:"varint,2,opt,name=aggregation_function,enum=datastore.PropertyExpression_AggregationFunction" json:"aggregation_function,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PropertyExpression) Reset() { *m = PropertyExpression{} } -func (m *PropertyExpression) String() string { return proto.CompactTextString(m) } -func (*PropertyExpression) ProtoMessage() {} - -func (m *PropertyExpression) GetProperty() *PropertyReference { - if m != nil { - return m.Property - } - return nil -} - -func (m *PropertyExpression) GetAggregationFunction() PropertyExpression_AggregationFunction { - if m != nil && m.AggregationFunction != nil { - return *m.AggregationFunction - } - return PropertyExpression_FIRST -} - -// The desired order for a specific property. -type PropertyOrder struct { - // The property to order by. - Property *PropertyReference `protobuf:"bytes,1,req,name=property" json:"property,omitempty"` - // The direction to order by. - Direction *PropertyOrder_Direction `protobuf:"varint,2,opt,name=direction,enum=datastore.PropertyOrder_Direction,def=1" json:"direction,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PropertyOrder) Reset() { *m = PropertyOrder{} } -func (m *PropertyOrder) String() string { return proto.CompactTextString(m) } -func (*PropertyOrder) ProtoMessage() {} - -const Default_PropertyOrder_Direction PropertyOrder_Direction = PropertyOrder_ASCENDING - -func (m *PropertyOrder) GetProperty() *PropertyReference { - if m != nil { - return m.Property - } - return nil -} - -func (m *PropertyOrder) GetDirection() PropertyOrder_Direction { - if m != nil && m.Direction != nil { - return *m.Direction - } - return Default_PropertyOrder_Direction -} - -// A holder for any type of filter. Exactly one field should be specified. -type Filter struct { - // A composite filter. - CompositeFilter *CompositeFilter `protobuf:"bytes,1,opt,name=composite_filter" json:"composite_filter,omitempty"` - // A filter on a property. - PropertyFilter *PropertyFilter `protobuf:"bytes,2,opt,name=property_filter" json:"property_filter,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Filter) Reset() { *m = Filter{} } -func (m *Filter) String() string { return proto.CompactTextString(m) } -func (*Filter) ProtoMessage() {} - -func (m *Filter) GetCompositeFilter() *CompositeFilter { - if m != nil { - return m.CompositeFilter - } - return nil -} - -func (m *Filter) GetPropertyFilter() *PropertyFilter { - if m != nil { - return m.PropertyFilter - } - return nil -} - -// A filter that merges the multiple other filters using the given operation. -type CompositeFilter struct { - // The operator for combining multiple filters. - Operator *CompositeFilter_Operator `protobuf:"varint,1,req,name=operator,enum=datastore.CompositeFilter_Operator" json:"operator,omitempty"` - // The list of filters to combine. - // Must contain at least one filter. - Filter []*Filter `protobuf:"bytes,2,rep,name=filter" json:"filter,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CompositeFilter) Reset() { *m = CompositeFilter{} } -func (m *CompositeFilter) String() string { return proto.CompactTextString(m) } -func (*CompositeFilter) ProtoMessage() {} - -func (m *CompositeFilter) GetOperator() CompositeFilter_Operator { - if m != nil && m.Operator != nil { - return *m.Operator - } - return CompositeFilter_AND -} - -func (m *CompositeFilter) GetFilter() []*Filter { - if m != nil { - return m.Filter - } - return nil -} - -// A filter on a specific property. -type PropertyFilter struct { - // The property to filter by. - Property *PropertyReference `protobuf:"bytes,1,req,name=property" json:"property,omitempty"` - // The operator to filter by. - Operator *PropertyFilter_Operator `protobuf:"varint,2,req,name=operator,enum=datastore.PropertyFilter_Operator" json:"operator,omitempty"` - // The value to compare the property to. - Value *Value `protobuf:"bytes,3,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PropertyFilter) Reset() { *m = PropertyFilter{} } -func (m *PropertyFilter) String() string { return proto.CompactTextString(m) } -func (*PropertyFilter) ProtoMessage() {} - -func (m *PropertyFilter) GetProperty() *PropertyReference { - if m != nil { - return m.Property - } - return nil -} - -func (m *PropertyFilter) GetOperator() PropertyFilter_Operator { - if m != nil && m.Operator != nil { - return *m.Operator - } - return PropertyFilter_LESS_THAN -} - -func (m *PropertyFilter) GetValue() *Value { - if m != nil { - return m.Value - } - return nil -} - -// A GQL query. -type GqlQuery struct { - QueryString *string `protobuf:"bytes,1,req,name=query_string" json:"query_string,omitempty"` - // When false, the query string must not contain a literal. - AllowLiteral *bool `protobuf:"varint,2,opt,name=allow_literal,def=0" json:"allow_literal,omitempty"` - // A named argument must set field GqlQueryArg.name. - // No two named arguments may have the same name. - // For each non-reserved named binding site in the query string, - // there must be a named argument with that name, - // but not necessarily the inverse. - NameArg []*GqlQueryArg `protobuf:"bytes,3,rep,name=name_arg" json:"name_arg,omitempty"` - // Numbered binding site @1 references the first numbered argument, - // effectively using 1-based indexing, rather than the usual 0. - // A numbered argument must NOT set field GqlQueryArg.name. - // For each binding site numbered i in query_string, - // there must be an ith numbered argument. - // The inverse must also be true. - NumberArg []*GqlQueryArg `protobuf:"bytes,4,rep,name=number_arg" json:"number_arg,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *GqlQuery) Reset() { *m = GqlQuery{} } -func (m *GqlQuery) String() string { return proto.CompactTextString(m) } -func (*GqlQuery) ProtoMessage() {} - -const Default_GqlQuery_AllowLiteral bool = false - -func (m *GqlQuery) GetQueryString() string { - if m != nil && m.QueryString != nil { - return *m.QueryString - } - return "" -} - -func (m *GqlQuery) GetAllowLiteral() bool { - if m != nil && m.AllowLiteral != nil { - return *m.AllowLiteral - } - return Default_GqlQuery_AllowLiteral -} - -func (m *GqlQuery) GetNameArg() []*GqlQueryArg { - if m != nil { - return m.NameArg - } - return nil -} - -func (m *GqlQuery) GetNumberArg() []*GqlQueryArg { - if m != nil { - return m.NumberArg - } - return nil -} - -// A binding argument for a GQL query. -// Exactly one of fields value and cursor must be set. -type GqlQueryArg struct { - // Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". - // Must not match regex "__.*__". - // Must not be "". - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *Value `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - Cursor []byte `protobuf:"bytes,3,opt,name=cursor" json:"cursor,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *GqlQueryArg) Reset() { *m = GqlQueryArg{} } -func (m *GqlQueryArg) String() string { return proto.CompactTextString(m) } -func (*GqlQueryArg) ProtoMessage() {} - -func (m *GqlQueryArg) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *GqlQueryArg) GetValue() *Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *GqlQueryArg) GetCursor() []byte { - if m != nil { - return m.Cursor - } - return nil -} - -// A batch of results produced by a query. -type QueryResultBatch struct { - // The result type for every entity in entityResults. - EntityResultType *EntityResult_ResultType `protobuf:"varint,1,req,name=entity_result_type,enum=datastore.EntityResult_ResultType" json:"entity_result_type,omitempty"` - // The results for this batch. - EntityResult []*EntityResult `protobuf:"bytes,2,rep,name=entity_result" json:"entity_result,omitempty"` - // A cursor that points to the position after the last result in the batch. - // May be absent. - EndCursor []byte `protobuf:"bytes,4,opt,name=end_cursor" json:"end_cursor,omitempty"` - // The state of the query after the current batch. - MoreResults *QueryResultBatch_MoreResultsType `protobuf:"varint,5,req,name=more_results,enum=datastore.QueryResultBatch_MoreResultsType" json:"more_results,omitempty"` - // The number of results skipped because of Query.offset. - SkippedResults *int32 `protobuf:"varint,6,opt,name=skipped_results" json:"skipped_results,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *QueryResultBatch) Reset() { *m = QueryResultBatch{} } -func (m *QueryResultBatch) String() string { return proto.CompactTextString(m) } -func (*QueryResultBatch) ProtoMessage() {} - -func (m *QueryResultBatch) GetEntityResultType() EntityResult_ResultType { - if m != nil && m.EntityResultType != nil { - return *m.EntityResultType - } - return EntityResult_FULL -} - -func (m *QueryResultBatch) GetEntityResult() []*EntityResult { - if m != nil { - return m.EntityResult - } - return nil -} - -func (m *QueryResultBatch) GetEndCursor() []byte { - if m != nil { - return m.EndCursor - } - return nil -} - -func (m *QueryResultBatch) GetMoreResults() QueryResultBatch_MoreResultsType { - if m != nil && m.MoreResults != nil { - return *m.MoreResults - } - return QueryResultBatch_NOT_FINISHED -} - -func (m *QueryResultBatch) GetSkippedResults() int32 { - if m != nil && m.SkippedResults != nil { - return *m.SkippedResults - } - return 0 -} - -// A set of changes to apply. -// -// No entity in this message may have a reserved property name, -// not even a property in an entity in a value. -// No value in this message may have meaning 18, -// not even a value in an entity in another value. -// -// If entities with duplicate keys are present, an arbitrary choice will -// be made as to which is written. -type Mutation struct { - // Entities to upsert. - // Each upserted entity's key must have a complete path and - // must not be reserved/read-only. - Upsert []*Entity `protobuf:"bytes,1,rep,name=upsert" json:"upsert,omitempty"` - // Entities to update. - // Each updated entity's key must have a complete path and - // must not be reserved/read-only. - Update []*Entity `protobuf:"bytes,2,rep,name=update" json:"update,omitempty"` - // Entities to insert. - // Each inserted entity's key must have a complete path and - // must not be reserved/read-only. - Insert []*Entity `protobuf:"bytes,3,rep,name=insert" json:"insert,omitempty"` - // Insert entities with a newly allocated ID. - // Each inserted entity's key must omit the final identifier in its path and - // must not be reserved/read-only. - InsertAutoId []*Entity `protobuf:"bytes,4,rep,name=insert_auto_id" json:"insert_auto_id,omitempty"` - // Keys of entities to delete. - // Each key must have a complete key path and must not be reserved/read-only. - Delete []*Key `protobuf:"bytes,5,rep,name=delete" json:"delete,omitempty"` - // Ignore a user specified read-only period. Optional. - Force *bool `protobuf:"varint,6,opt,name=force" json:"force,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Mutation) Reset() { *m = Mutation{} } -func (m *Mutation) String() string { return proto.CompactTextString(m) } -func (*Mutation) ProtoMessage() {} - -func (m *Mutation) GetUpsert() []*Entity { - if m != nil { - return m.Upsert - } - return nil -} - -func (m *Mutation) GetUpdate() []*Entity { - if m != nil { - return m.Update - } - return nil -} - -func (m *Mutation) GetInsert() []*Entity { - if m != nil { - return m.Insert - } - return nil -} - -func (m *Mutation) GetInsertAutoId() []*Entity { - if m != nil { - return m.InsertAutoId - } - return nil -} - -func (m *Mutation) GetDelete() []*Key { - if m != nil { - return m.Delete - } - return nil -} - -func (m *Mutation) GetForce() bool { - if m != nil && m.Force != nil { - return *m.Force - } - return false -} - -// The result of applying a mutation. -type MutationResult struct { - // Number of index writes. - IndexUpdates *int32 `protobuf:"varint,1,req,name=index_updates" json:"index_updates,omitempty"` - // Keys for insertAutoId entities. One per entity from the - // request, in the same order. - InsertAutoIdKey []*Key `protobuf:"bytes,2,rep,name=insert_auto_id_key" json:"insert_auto_id_key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MutationResult) Reset() { *m = MutationResult{} } -func (m *MutationResult) String() string { return proto.CompactTextString(m) } -func (*MutationResult) ProtoMessage() {} - -func (m *MutationResult) GetIndexUpdates() int32 { - if m != nil && m.IndexUpdates != nil { - return *m.IndexUpdates - } - return 0 -} - -func (m *MutationResult) GetInsertAutoIdKey() []*Key { - if m != nil { - return m.InsertAutoIdKey - } - return nil -} - -// Options shared by read requests. -type ReadOptions struct { - // The read consistency to use. - // Cannot be set when transaction is set. - // Lookup and ancestor queries default to STRONG, global queries default to - // EVENTUAL and cannot be set to STRONG. - ReadConsistency *ReadOptions_ReadConsistency `protobuf:"varint,1,opt,name=read_consistency,enum=datastore.ReadOptions_ReadConsistency,def=0" json:"read_consistency,omitempty"` - // The transaction to use. Optional. - Transaction []byte `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReadOptions) Reset() { *m = ReadOptions{} } -func (m *ReadOptions) String() string { return proto.CompactTextString(m) } -func (*ReadOptions) ProtoMessage() {} - -const Default_ReadOptions_ReadConsistency ReadOptions_ReadConsistency = ReadOptions_DEFAULT - -func (m *ReadOptions) GetReadConsistency() ReadOptions_ReadConsistency { - if m != nil && m.ReadConsistency != nil { - return *m.ReadConsistency - } - return Default_ReadOptions_ReadConsistency -} - -func (m *ReadOptions) GetTransaction() []byte { - if m != nil { - return m.Transaction - } - return nil -} - -// The request for Lookup. -type LookupRequest struct { - // Options for this lookup request. Optional. - ReadOptions *ReadOptions `protobuf:"bytes,1,opt,name=read_options" json:"read_options,omitempty"` - // Keys of entities to look up from the datastore. - Key []*Key `protobuf:"bytes,3,rep,name=key" json:"key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *LookupRequest) Reset() { *m = LookupRequest{} } -func (m *LookupRequest) String() string { return proto.CompactTextString(m) } -func (*LookupRequest) ProtoMessage() {} - -func (m *LookupRequest) GetReadOptions() *ReadOptions { - if m != nil { - return m.ReadOptions - } - return nil -} - -func (m *LookupRequest) GetKey() []*Key { - if m != nil { - return m.Key - } - return nil -} - -// The response for Lookup. -type LookupResponse struct { - // Entities found as ResultType.FULL entities. - Found []*EntityResult `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"` - // Entities not found as ResultType.KEY_ONLY entities. - Missing []*EntityResult `protobuf:"bytes,2,rep,name=missing" json:"missing,omitempty"` - // A list of keys that were not looked up due to resource constraints. - Deferred []*Key `protobuf:"bytes,3,rep,name=deferred" json:"deferred,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *LookupResponse) Reset() { *m = LookupResponse{} } -func (m *LookupResponse) String() string { return proto.CompactTextString(m) } -func (*LookupResponse) ProtoMessage() {} - -func (m *LookupResponse) GetFound() []*EntityResult { - if m != nil { - return m.Found - } - return nil -} - -func (m *LookupResponse) GetMissing() []*EntityResult { - if m != nil { - return m.Missing - } - return nil -} - -func (m *LookupResponse) GetDeferred() []*Key { - if m != nil { - return m.Deferred - } - return nil -} - -// The request for RunQuery. -type RunQueryRequest struct { - // The options for this query. - ReadOptions *ReadOptions `protobuf:"bytes,1,opt,name=read_options" json:"read_options,omitempty"` - // Entities are partitioned into subsets, identified by a dataset (usually - // implicitly specified by the project) and namespace ID. Queries are scoped - // to a single partition. - // This partition ID is normalized with the standard default context - // partition ID, but all other partition IDs in RunQueryRequest are - // normalized with this partition ID as the context partition ID. - PartitionId *PartitionId `protobuf:"bytes,2,opt,name=partition_id" json:"partition_id,omitempty"` - // The query to run. - // Either this field or field gql_query must be set, but not both. - Query *Query `protobuf:"bytes,3,opt,name=query" json:"query,omitempty"` - // The GQL query to run. - // Either this field or field query must be set, but not both. - GqlQuery *GqlQuery `protobuf:"bytes,7,opt,name=gql_query" json:"gql_query,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RunQueryRequest) Reset() { *m = RunQueryRequest{} } -func (m *RunQueryRequest) String() string { return proto.CompactTextString(m) } -func (*RunQueryRequest) ProtoMessage() {} - -func (m *RunQueryRequest) GetReadOptions() *ReadOptions { - if m != nil { - return m.ReadOptions - } - return nil -} - -func (m *RunQueryRequest) GetPartitionId() *PartitionId { - if m != nil { - return m.PartitionId - } - return nil -} - -func (m *RunQueryRequest) GetQuery() *Query { - if m != nil { - return m.Query - } - return nil -} - -func (m *RunQueryRequest) GetGqlQuery() *GqlQuery { - if m != nil { - return m.GqlQuery - } - return nil -} - -// The response for RunQuery. -type RunQueryResponse struct { - // A batch of query results (always present). - Batch *QueryResultBatch `protobuf:"bytes,1,opt,name=batch" json:"batch,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RunQueryResponse) Reset() { *m = RunQueryResponse{} } -func (m *RunQueryResponse) String() string { return proto.CompactTextString(m) } -func (*RunQueryResponse) ProtoMessage() {} - -func (m *RunQueryResponse) GetBatch() *QueryResultBatch { - if m != nil { - return m.Batch - } - return nil -} - -// The request for BeginTransaction. -type BeginTransactionRequest struct { - // The transaction isolation level. - IsolationLevel *BeginTransactionRequest_IsolationLevel `protobuf:"varint,1,opt,name=isolation_level,enum=datastore.BeginTransactionRequest_IsolationLevel,def=0" json:"isolation_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BeginTransactionRequest) Reset() { *m = BeginTransactionRequest{} } -func (m *BeginTransactionRequest) String() string { return proto.CompactTextString(m) } -func (*BeginTransactionRequest) ProtoMessage() {} - -const Default_BeginTransactionRequest_IsolationLevel BeginTransactionRequest_IsolationLevel = BeginTransactionRequest_SNAPSHOT - -func (m *BeginTransactionRequest) GetIsolationLevel() BeginTransactionRequest_IsolationLevel { - if m != nil && m.IsolationLevel != nil { - return *m.IsolationLevel - } - return Default_BeginTransactionRequest_IsolationLevel -} - -// The response for BeginTransaction. -type BeginTransactionResponse struct { - // The transaction identifier (always present). - Transaction []byte `protobuf:"bytes,1,opt,name=transaction" json:"transaction,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BeginTransactionResponse) Reset() { *m = BeginTransactionResponse{} } -func (m *BeginTransactionResponse) String() string { return proto.CompactTextString(m) } -func (*BeginTransactionResponse) ProtoMessage() {} - -func (m *BeginTransactionResponse) GetTransaction() []byte { - if m != nil { - return m.Transaction - } - return nil -} - -// The request for Rollback. -type RollbackRequest struct { - // The transaction identifier, returned by a call to - // beginTransaction. - Transaction []byte `protobuf:"bytes,1,req,name=transaction" json:"transaction,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RollbackRequest) Reset() { *m = RollbackRequest{} } -func (m *RollbackRequest) String() string { return proto.CompactTextString(m) } -func (*RollbackRequest) ProtoMessage() {} - -func (m *RollbackRequest) GetTransaction() []byte { - if m != nil { - return m.Transaction - } - return nil -} - -// The response for Rollback. -type RollbackResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *RollbackResponse) Reset() { *m = RollbackResponse{} } -func (m *RollbackResponse) String() string { return proto.CompactTextString(m) } -func (*RollbackResponse) ProtoMessage() {} - -// The request for Commit. -type CommitRequest struct { - // The transaction identifier, returned by a call to - // beginTransaction. Must be set when mode is TRANSACTIONAL. - Transaction []byte `protobuf:"bytes,1,opt,name=transaction" json:"transaction,omitempty"` - // The mutation to perform. Optional. - Mutation *Mutation `protobuf:"bytes,2,opt,name=mutation" json:"mutation,omitempty"` - // The type of commit to perform. Either TRANSACTIONAL or NON_TRANSACTIONAL. - Mode *CommitRequest_Mode `protobuf:"varint,5,opt,name=mode,enum=datastore.CommitRequest_Mode,def=1" json:"mode,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CommitRequest) Reset() { *m = CommitRequest{} } -func (m *CommitRequest) String() string { return proto.CompactTextString(m) } -func (*CommitRequest) ProtoMessage() {} - -const Default_CommitRequest_Mode CommitRequest_Mode = CommitRequest_TRANSACTIONAL - -func (m *CommitRequest) GetTransaction() []byte { - if m != nil { - return m.Transaction - } - return nil -} - -func (m *CommitRequest) GetMutation() *Mutation { - if m != nil { - return m.Mutation - } - return nil -} - -func (m *CommitRequest) GetMode() CommitRequest_Mode { - if m != nil && m.Mode != nil { - return *m.Mode - } - return Default_CommitRequest_Mode -} - -// The response for Commit. -type CommitResponse struct { - // The result of performing the mutation (if any). - MutationResult *MutationResult `protobuf:"bytes,1,opt,name=mutation_result" json:"mutation_result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CommitResponse) Reset() { *m = CommitResponse{} } -func (m *CommitResponse) String() string { return proto.CompactTextString(m) } -func (*CommitResponse) ProtoMessage() {} - -func (m *CommitResponse) GetMutationResult() *MutationResult { - if m != nil { - return m.MutationResult - } - return nil -} - -// The request for AllocateIds. -type AllocateIdsRequest struct { - // A list of keys with incomplete key paths to allocate IDs for. - // No key may be reserved/read-only. - Key []*Key `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AllocateIdsRequest) Reset() { *m = AllocateIdsRequest{} } -func (m *AllocateIdsRequest) String() string { return proto.CompactTextString(m) } -func (*AllocateIdsRequest) ProtoMessage() {} - -func (m *AllocateIdsRequest) GetKey() []*Key { - if m != nil { - return m.Key - } - return nil -} - -// The response for AllocateIds. -type AllocateIdsResponse struct { - // The keys specified in the request (in the same order), each with - // its key path completed with a newly allocated ID. - Key []*Key `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AllocateIdsResponse) Reset() { *m = AllocateIdsResponse{} } -func (m *AllocateIdsResponse) String() string { return proto.CompactTextString(m) } -func (*AllocateIdsResponse) ProtoMessage() {} - -func (m *AllocateIdsResponse) GetKey() []*Key { - if m != nil { - return m.Key - } - return nil -} - -func init() { - proto.RegisterEnum("datastore.EntityResult_ResultType", EntityResult_ResultType_name, EntityResult_ResultType_value) - proto.RegisterEnum("datastore.PropertyExpression_AggregationFunction", PropertyExpression_AggregationFunction_name, PropertyExpression_AggregationFunction_value) - proto.RegisterEnum("datastore.PropertyOrder_Direction", PropertyOrder_Direction_name, PropertyOrder_Direction_value) - proto.RegisterEnum("datastore.CompositeFilter_Operator", CompositeFilter_Operator_name, CompositeFilter_Operator_value) - proto.RegisterEnum("datastore.PropertyFilter_Operator", PropertyFilter_Operator_name, PropertyFilter_Operator_value) - proto.RegisterEnum("datastore.QueryResultBatch_MoreResultsType", QueryResultBatch_MoreResultsType_name, QueryResultBatch_MoreResultsType_value) - proto.RegisterEnum("datastore.ReadOptions_ReadConsistency", ReadOptions_ReadConsistency_name, ReadOptions_ReadConsistency_value) - proto.RegisterEnum("datastore.BeginTransactionRequest_IsolationLevel", BeginTransactionRequest_IsolationLevel_name, BeginTransactionRequest_IsolationLevel_value) - proto.RegisterEnum("datastore.CommitRequest_Mode", CommitRequest_Mode_name, CommitRequest_Mode_value) -} diff --git a/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.proto b/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.proto deleted file mode 100644 index d752beaa5..000000000 --- a/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.proto +++ /dev/null @@ -1,606 +0,0 @@ -// Copyright 2013 Google Inc. All Rights Reserved. -// -// 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. -// -// The datastore v1 service proto definitions - -syntax = "proto2"; - -package datastore; -option java_package = "com.google.api.services.datastore"; - - -// An identifier for a particular subset of entities. -// -// Entities are partitioned into various subsets, each used by different -// datasets and different namespaces within a dataset and so forth. -// -// All input partition IDs are normalized before use. -// A partition ID is normalized as follows: -// If the partition ID is unset or is set to an empty partition ID, replace it -// with the context partition ID. -// Otherwise, if the partition ID has no dataset ID, assign it the context -// partition ID's dataset ID. -// Unless otherwise documented, the context partition ID has the dataset ID set -// to the context dataset ID and no other partition dimension set. -// -// A partition ID is empty if all of its fields are unset. -// -// Partition dimension: -// A dimension may be unset. -// A dimension's value must never be "". -// A dimension's value must match [A-Za-z\d\.\-_]{1,100} -// If the value of any dimension matches regex "__.*__", -// the partition is reserved/read-only. -// A reserved/read-only partition ID is forbidden in certain documented contexts. -// -// Dataset ID: -// A dataset id's value must never be "". -// A dataset id's value must match -// ([a-z\d\-]{1,100}~)?([a-z\d][a-z\d\-\.]{0,99}:)?([a-z\d][a-z\d\-]{0,99} -message PartitionId { - // The dataset ID. - optional string dataset_id = 3; - // The namespace. - optional string namespace = 4; -} - -// A unique identifier for an entity. -// If a key's partition id or any of its path kinds or names are -// reserved/read-only, the key is reserved/read-only. -// A reserved/read-only key is forbidden in certain documented contexts. -message Key { - // Entities are partitioned into subsets, currently identified by a dataset - // (usually implicitly specified by the project) and namespace ID. - // Queries are scoped to a single partition. - optional PartitionId partition_id = 1; - - // A (kind, ID/name) pair used to construct a key path. - // - // At most one of name or ID may be set. - // If either is set, the element is complete. - // If neither is set, the element is incomplete. - message PathElement { - // The kind of the entity. - // A kind matching regex "__.*__" is reserved/read-only. - // A kind must not contain more than 500 characters. - // Cannot be "". - required string kind = 1; - // The ID of the entity. - // Never equal to zero. Values less than zero are discouraged and will not - // be supported in the future. - optional int64 id = 2; - // The name of the entity. - // A name matching regex "__.*__" is reserved/read-only. - // A name must not be more than 500 characters. - // Cannot be "". - optional string name = 3; - } - - // The entity path. - // An entity path consists of one or more elements composed of a kind and a - // string or numerical identifier, which identify entities. The first - // element identifies a root entity, the second element identifies - // a child of the root entity, the third element a child of the - // second entity, and so forth. The entities identified by all prefixes of - // the path are called the element's ancestors. - // An entity path is always fully complete: ALL of the entity's ancestors - // are required to be in the path along with the entity identifier itself. - // The only exception is that in some documented cases, the identifier in the - // last path element (for the entity) itself may be omitted. A path can never - // be empty. - repeated PathElement path_element = 2; -} - -// A message that can hold any of the supported value types and associated -// metadata. -// -// At most one of the Value fields may be set. -// If none are set the value is "null". -// -message Value { - // A boolean value. - optional bool boolean_value = 1; - // An integer value. - optional int64 integer_value = 2; - // A double value. - optional double double_value = 3; - // A timestamp value. - optional int64 timestamp_microseconds_value = 4; - // A key value. - optional Key key_value = 5; - // A blob key value. - optional string blob_key_value = 16; - // A UTF-8 encoded string value. - optional string string_value = 17; - // A blob value. - optional bytes blob_value = 18; - // An entity value. - // May have no key. - // May have a key with an incomplete key path. - // May have a reserved/read-only key. - optional Entity entity_value = 6; - // A list value. - // Cannot contain another list value. - // Cannot also have a meaning and indexing set. - repeated Value list_value = 7; - - // The meaning field is reserved and should not be used. - optional int32 meaning = 14; - - // If the value should be indexed. - // - // The indexed property may be set for a - // null value. - // When indexed is true, stringValue - // is limited to 500 characters and the blob value is limited to 500 bytes. - // Exception: If meaning is set to 2, string_value is limited to 2038 - // characters regardless of indexed. - // When indexed is true, meaning 15 and 22 are not allowed, and meaning 16 - // will be ignored on input (and will never be set on output). - // Input values by default have indexed set to - // true; however, you can explicitly set indexed to - // true if you want. (An output value never has - // indexed explicitly set to true.) If a value is - // itself an entity, it cannot have indexed set to - // true. - // Exception: An entity value with meaning 9, 20 or 21 may be indexed. - optional bool indexed = 15 [default = true]; -} - -// An entity property. -message Property { - // The name of the property. - // A property name matching regex "__.*__" is reserved. - // A reserved property name is forbidden in certain documented contexts. - // The name must not contain more than 500 characters. - // Cannot be "". - required string name = 1; - - // The value(s) of the property. - // Each value can have only one value property populated. For example, - // you cannot have a values list of { value: { integerValue: 22, - // stringValue: "a" } }, but you can have { value: { listValue: - // [ { integerValue: 22 }, { stringValue: "a" } ] }. - required Value value = 4; -} - -// An entity. -// -// An entity is limited to 1 megabyte when stored. That roughly -// corresponds to a limit of 1 megabyte for the serialized form of this -// message. -message Entity { - // The entity's key. - // - // An entity must have a key, unless otherwise documented (for example, - // an entity in Value.entityValue may have no key). - // An entity's kind is its key's path's last element's kind, - // or null if it has no key. - optional Key key = 1; - // The entity's properties. - // Each property's name must be unique for its entity. - repeated Property property = 2; -} - -// The result of fetching an entity from the datastore. -message EntityResult { - // Specifies what data the 'entity' field contains. - // A ResultType is either implied (for example, in LookupResponse.found it - // is always FULL) or specified by context (for example, in message - // QueryResultBatch, field 'entity_result_type' specifies a ResultType - // for all the values in field 'entity_result'). - enum ResultType { - FULL = 1; // The entire entity. - PROJECTION = 2; // A projected subset of properties. - // The entity may have no key. - // A property value may have meaning 18. - KEY_ONLY = 3; // Only the key. - } - - // The resulting entity. - required Entity entity = 1; -} - -// A query. -message Query { - // The projection to return. If not set the entire entity is returned. - repeated PropertyExpression projection = 2; - - // The kinds to query (if empty, returns entities from all kinds). - repeated KindExpression kind = 3; - - // The filter to apply (optional). - optional Filter filter = 4; - - // The order to apply to the query results (if empty, order is unspecified). - repeated PropertyOrder order = 5; - - // The properties to group by (if empty, no grouping is applied to the - // result set). - repeated PropertyReference group_by = 6; - - // A starting point for the query results. Optional. Query cursors are - // returned in query result batches. - optional bytes /* serialized QueryCursor */ start_cursor = 7; - - // An ending point for the query results. Optional. Query cursors are - // returned in query result batches. - optional bytes /* serialized QueryCursor */ end_cursor = 8; - - // The number of results to skip. Applies before limit, but after all other - // constraints (optional, defaults to 0). - optional int32 offset = 10 [default=0]; - - // The maximum number of results to return. Applies after all other - // constraints. Optional. - optional int32 limit = 11; -} - -// A representation of a kind. -message KindExpression { - // The name of the kind. - required string name = 1; -} - -// A reference to a property relative to the kind expressions. -// exactly. -message PropertyReference { - // The name of the property. - required string name = 2; -} - -// A representation of a property in a projection. -message PropertyExpression { - enum AggregationFunction { - FIRST = 1; - } - // The property to project. - required PropertyReference property = 1; - // The aggregation function to apply to the property. Optional. - // Can only be used when grouping by at least one property. Must - // then be set on all properties in the projection that are not - // being grouped by. - optional AggregationFunction aggregation_function = 2; -} - -// The desired order for a specific property. -message PropertyOrder { - enum Direction { - ASCENDING = 1; - DESCENDING = 2; - } - // The property to order by. - required PropertyReference property = 1; - // The direction to order by. - optional Direction direction = 2 [default=ASCENDING]; -} - -// A holder for any type of filter. Exactly one field should be specified. -message Filter { - // A composite filter. - optional CompositeFilter composite_filter = 1; - // A filter on a property. - optional PropertyFilter property_filter = 2; -} - -// A filter that merges the multiple other filters using the given operation. -message CompositeFilter { - enum Operator { - AND = 1; - } - - // The operator for combining multiple filters. - required Operator operator = 1; - // The list of filters to combine. - // Must contain at least one filter. - repeated Filter filter = 2; -} - -// A filter on a specific property. -message PropertyFilter { - enum Operator { - LESS_THAN = 1; - LESS_THAN_OR_EQUAL = 2; - GREATER_THAN = 3; - GREATER_THAN_OR_EQUAL = 4; - EQUAL = 5; - - HAS_ANCESTOR = 11; - } - - // The property to filter by. - required PropertyReference property = 1; - // The operator to filter by. - required Operator operator = 2; - // The value to compare the property to. - required Value value = 3; -} - -// A GQL query. -message GqlQuery { - required string query_string = 1; - // When false, the query string must not contain a literal. - optional bool allow_literal = 2 [default = false]; - // A named argument must set field GqlQueryArg.name. - // No two named arguments may have the same name. - // For each non-reserved named binding site in the query string, - // there must be a named argument with that name, - // but not necessarily the inverse. - repeated GqlQueryArg name_arg = 3; - // Numbered binding site @1 references the first numbered argument, - // effectively using 1-based indexing, rather than the usual 0. - // A numbered argument must NOT set field GqlQueryArg.name. - // For each binding site numbered i in query_string, - // there must be an ith numbered argument. - // The inverse must also be true. - repeated GqlQueryArg number_arg = 4; -} - -// A binding argument for a GQL query. -// Exactly one of fields value and cursor must be set. -message GqlQueryArg { - // Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". - // Must not match regex "__.*__". - // Must not be "". - optional string name = 1; - optional Value value = 2; - optional bytes cursor = 3; -} - -// A batch of results produced by a query. -message QueryResultBatch { - // The possible values for the 'more_results' field. - enum MoreResultsType { - NOT_FINISHED = 1; // There are additional batches to fetch from this query. - MORE_RESULTS_AFTER_LIMIT = 2; // The query is finished, but there are more - // results after the limit. - NO_MORE_RESULTS = 3; // The query has been exhausted. - } - - // The result type for every entity in entityResults. - required EntityResult.ResultType entity_result_type = 1; - // The results for this batch. - repeated EntityResult entity_result = 2; - - // A cursor that points to the position after the last result in the batch. - // May be absent. - optional bytes /* serialized QueryCursor */ end_cursor = 4; - - // The state of the query after the current batch. - required MoreResultsType more_results = 5; - - // The number of results skipped because of Query.offset. - optional int32 skipped_results = 6; -} - -// A set of changes to apply. -// -// No entity in this message may have a reserved property name, -// not even a property in an entity in a value. -// No value in this message may have meaning 18, -// not even a value in an entity in another value. -// -// If entities with duplicate keys are present, an arbitrary choice will -// be made as to which is written. -message Mutation { - // Entities to upsert. - // Each upserted entity's key must have a complete path and - // must not be reserved/read-only. - repeated Entity upsert = 1; - // Entities to update. - // Each updated entity's key must have a complete path and - // must not be reserved/read-only. - repeated Entity update = 2; - // Entities to insert. - // Each inserted entity's key must have a complete path and - // must not be reserved/read-only. - repeated Entity insert = 3; - // Insert entities with a newly allocated ID. - // Each inserted entity's key must omit the final identifier in its path and - // must not be reserved/read-only. - repeated Entity insert_auto_id = 4; - // Keys of entities to delete. - // Each key must have a complete key path and must not be reserved/read-only. - repeated Key delete = 5; - // Ignore a user specified read-only period. Optional. - optional bool force = 6; -} - -// The result of applying a mutation. -message MutationResult { - // Number of index writes. - required int32 index_updates = 1; - // Keys for insertAutoId entities. One per entity from the - // request, in the same order. - repeated Key insert_auto_id_key = 2; -} - -// Options shared by read requests. -message ReadOptions { - enum ReadConsistency { - DEFAULT = 0; - STRONG = 1; - EVENTUAL = 2; - } - - // The read consistency to use. - // Cannot be set when transaction is set. - // Lookup and ancestor queries default to STRONG, global queries default to - // EVENTUAL and cannot be set to STRONG. - optional ReadConsistency read_consistency = 1 [default=DEFAULT]; - - // The transaction to use. Optional. - optional bytes /* serialized Transaction */ transaction = 2; -} - -// The request for Lookup. -message LookupRequest { - - // Options for this lookup request. Optional. - optional ReadOptions read_options = 1; - // Keys of entities to look up from the datastore. - repeated Key key = 3; -} - -// The response for Lookup. -message LookupResponse { - - // The order of results in these fields is undefined and has no relation to - // the order of the keys in the input. - - // Entities found as ResultType.FULL entities. - repeated EntityResult found = 1; - - // Entities not found as ResultType.KEY_ONLY entities. - repeated EntityResult missing = 2; - - // A list of keys that were not looked up due to resource constraints. - repeated Key deferred = 3; -} - - -// The request for RunQuery. -message RunQueryRequest { - - // The options for this query. - optional ReadOptions read_options = 1; - - // Entities are partitioned into subsets, identified by a dataset (usually - // implicitly specified by the project) and namespace ID. Queries are scoped - // to a single partition. - // This partition ID is normalized with the standard default context - // partition ID, but all other partition IDs in RunQueryRequest are - // normalized with this partition ID as the context partition ID. - optional PartitionId partition_id = 2; - - // The query to run. - // Either this field or field gql_query must be set, but not both. - optional Query query = 3; - // The GQL query to run. - // Either this field or field query must be set, but not both. - optional GqlQuery gql_query = 7; -} - -// The response for RunQuery. -message RunQueryResponse { - - // A batch of query results (always present). - optional QueryResultBatch batch = 1; - -} - -// The request for BeginTransaction. -message BeginTransactionRequest { - - enum IsolationLevel { - SNAPSHOT = 0; // Read from a consistent snapshot. Concurrent transactions - // conflict if their mutations conflict. For example: - // Read(A),Write(B) may not conflict with Read(B),Write(A), - // but Read(B),Write(B) does conflict with Read(B),Write(B). - SERIALIZABLE = 1; // Read from a consistent snapshot. Concurrent - // transactions conflict if they cannot be serialized. - // For example Read(A),Write(B) does conflict with - // Read(B),Write(A) but Read(A) may not conflict with - // Write(A). - } - - // The transaction isolation level. - optional IsolationLevel isolation_level = 1 [default=SNAPSHOT]; -} - -// The response for BeginTransaction. -message BeginTransactionResponse { - - // The transaction identifier (always present). - optional bytes /* serialized Transaction */ transaction = 1; -} - -// The request for Rollback. -message RollbackRequest { - - // The transaction identifier, returned by a call to - // beginTransaction. - required bytes /* serialized Transaction */ transaction = 1; -} - -// The response for Rollback. -message RollbackResponse { -// Empty -} - -// The request for Commit. -message CommitRequest { - - enum Mode { - TRANSACTIONAL = 1; - NON_TRANSACTIONAL = 2; - } - - // The transaction identifier, returned by a call to - // beginTransaction. Must be set when mode is TRANSACTIONAL. - optional bytes /* serialized Transaction */ transaction = 1; - // The mutation to perform. Optional. - optional Mutation mutation = 2; - // The type of commit to perform. Either TRANSACTIONAL or NON_TRANSACTIONAL. - optional Mode mode = 5 [default=TRANSACTIONAL]; -} - -// The response for Commit. -message CommitResponse { - - // The result of performing the mutation (if any). - optional MutationResult mutation_result = 1; -} - -// The request for AllocateIds. -message AllocateIdsRequest { - - // A list of keys with incomplete key paths to allocate IDs for. - // No key may be reserved/read-only. - repeated Key key = 1; -} - -// The response for AllocateIds. -message AllocateIdsResponse { - - // The keys specified in the request (in the same order), each with - // its key path completed with a newly allocated ID. - repeated Key key = 1; -} - -// Each rpc normalizes the partition IDs of the keys in its input entities, -// and always returns entities with keys with normalized partition IDs. -// (Note that applies to all entities, including entities in values.) -service DatastoreService { - // Look up some entities by key. - rpc Lookup(LookupRequest) returns (LookupResponse) { - }; - // Query for entities. - rpc RunQuery(RunQueryRequest) returns (RunQueryResponse) { - }; - // Begin a new transaction. - rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) { - }; - // Commit a transaction, optionally creating, deleting or modifying some - // entities. - rpc Commit(CommitRequest) returns (CommitResponse) { - }; - // Roll back a transaction. - rpc Rollback(RollbackRequest) returns (RollbackResponse) { - }; - // Allocate IDs for incomplete keys (useful for referencing an entity before - // it is inserted). - rpc AllocateIds(AllocateIdsRequest) returns (AllocateIdsResponse) { - }; -} diff --git a/vendor/google.golang.org/cloud/internal/opts/option.go b/vendor/google.golang.org/cloud/internal/opts/option.go deleted file mode 100644 index 844d31044..000000000 --- a/vendor/google.golang.org/cloud/internal/opts/option.go +++ /dev/null @@ -1,25 +0,0 @@ -// Package opts holds the DialOpts struct, configurable by -// cloud.ClientOptions to set up transports for cloud packages. -// -// This is a separate page to prevent cycles between the core -// cloud packages. -package opts - -import ( - "net/http" - - "golang.org/x/oauth2" - "google.golang.org/grpc" -) - -type DialOpt struct { - Endpoint string - Scopes []string - UserAgent string - - TokenSource oauth2.TokenSource - - HTTPClient *http.Client - GRPCClient *grpc.ClientConn - GRPCDialOpts []grpc.DialOption -} diff --git a/vendor/google.golang.org/cloud/internal/testutil/context.go b/vendor/google.golang.org/cloud/internal/testutil/context.go deleted file mode 100644 index c10142757..000000000 --- a/vendor/google.golang.org/cloud/internal/testutil/context.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// 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. - -// Package testutil contains helper functions for writing tests. -package testutil - -import ( - "io/ioutil" - "log" - "os" - - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "google.golang.org/cloud" -) - -const ( - envProjID = "GCLOUD_TESTS_GOLANG_PROJECT_ID" - envPrivateKey = "GCLOUD_TESTS_GOLANG_KEY" -) - -// ProjID returns the project ID to use in integration tests, or the empty -// string if none is configured. -func ProjID() string { - projID := os.Getenv(envProjID) - if projID == "" { - return "" - } - return projID -} - -// TokenSource returns the OAuth2 token source to use in integration tests, -// or nil if none is configured. TokenSource will log.Fatal if the token -// source is specified but missing or invalid. -func TokenSource(ctx context.Context, scopes ...string) oauth2.TokenSource { - key := os.Getenv(envPrivateKey) - if key == "" { - return nil - } - jsonKey, err := ioutil.ReadFile(key) - if err != nil { - log.Fatalf("Cannot read the JSON key file, err: %v", err) - } - conf, err := google.JWTConfigFromJSON(jsonKey, scopes...) - if err != nil { - log.Fatalf("google.JWTConfigFromJSON: %v", err) - } - return conf.TokenSource(ctx) -} - -// TODO(djd): Delete this function when it's no longer used. -func Context(scopes ...string) context.Context { - ctx := oauth2.NoContext - ts := TokenSource(ctx, scopes...) - if ts == nil { - return nil - } - return cloud.NewContext(ProjID(), oauth2.NewClient(ctx, ts)) -} diff --git a/vendor/google.golang.org/cloud/internal/transport/cancelreq.go b/vendor/google.golang.org/cloud/internal/transport/cancelreq.go deleted file mode 100644 index ddae71cce..000000000 --- a/vendor/google.golang.org/cloud/internal/transport/cancelreq.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// 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. - -// +build go1.5 - -package transport - -import "net/http" - -// makeReqCancel returns a closure that cancels the given http.Request -// when called. -func makeReqCancel(req *http.Request) func(http.RoundTripper) { - c := make(chan struct{}) - req.Cancel = c - return func(http.RoundTripper) { - close(c) - } -} diff --git a/vendor/google.golang.org/cloud/internal/transport/cancelreq_legacy.go b/vendor/google.golang.org/cloud/internal/transport/cancelreq_legacy.go deleted file mode 100644 index c11a4ddeb..000000000 --- a/vendor/google.golang.org/cloud/internal/transport/cancelreq_legacy.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// 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. - -// +build !go1.5 - -package transport - -import "net/http" - -// makeReqCancel returns a closure that cancels the given http.Request -// when called. -func makeReqCancel(req *http.Request) func(http.RoundTripper) { - // Go 1.4 and prior do not have a reliable way of cancelling a request. - // Transport.CancelRequest will only work if the request is already in-flight. - return func(r http.RoundTripper) { - if t, ok := r.(*http.Transport); ok { - t.CancelRequest(req) - } - } -} diff --git a/vendor/google.golang.org/cloud/internal/transport/dial.go b/vendor/google.golang.org/cloud/internal/transport/dial.go deleted file mode 100644 index ae2baf9fd..000000000 --- a/vendor/google.golang.org/cloud/internal/transport/dial.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// 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. - -package transport - -import ( - "errors" - "fmt" - "net/http" - - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "google.golang.org/cloud" - "google.golang.org/cloud/internal/opts" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/oauth" -) - -// ErrHTTP is returned when on a non-200 HTTP response. -type ErrHTTP struct { - StatusCode int - Body []byte - err error -} - -func (e *ErrHTTP) Error() string { - if e.err == nil { - return fmt.Sprintf("error during call, http status code: %v %s", e.StatusCode, e.Body) - } - return e.err.Error() -} - -// NewHTTPClient returns an HTTP client for use communicating with a Google cloud -// service, configured with the given ClientOptions. It also returns the endpoint -// for the service as specified in the options. -func NewHTTPClient(ctx context.Context, opt ...cloud.ClientOption) (*http.Client, string, error) { - var o opts.DialOpt - for _, opt := range opt { - opt.Resolve(&o) - } - if o.GRPCClient != nil { - return nil, "", errors.New("unsupported GRPC base transport specified") - } - // TODO(djd): Wrap all http.Clients with appropriate internal version to add - // UserAgent header and prepend correct endpoint. - if o.HTTPClient != nil { - return o.HTTPClient, o.Endpoint, nil - } - if o.TokenSource == nil { - var err error - o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...) - if err != nil { - return nil, "", fmt.Errorf("google.DefaultTokenSource: %v", err) - } - } - return oauth2.NewClient(ctx, o.TokenSource), o.Endpoint, nil -} - -// NewProtoClient returns a ProtoClient for communicating with a Google cloud service, -// configured with the given ClientOptions. -func NewProtoClient(ctx context.Context, opt ...cloud.ClientOption) (*ProtoClient, error) { - var o opts.DialOpt - for _, opt := range opt { - opt.Resolve(&o) - } - if o.GRPCClient != nil { - return nil, errors.New("unsupported GRPC base transport specified") - } - var client *http.Client - switch { - case o.HTTPClient != nil: - if o.TokenSource != nil { - return nil, errors.New("at most one of WithTokenSource or WithBaseHTTP may be provided") - } - client = o.HTTPClient - case o.TokenSource != nil: - client = oauth2.NewClient(ctx, o.TokenSource) - default: - var err error - client, err = google.DefaultClient(ctx, o.Scopes...) - if err != nil { - return nil, err - } - } - - return &ProtoClient{ - client: client, - endpoint: o.Endpoint, - userAgent: o.UserAgent, - }, nil -} - -// DialGRPC returns a GRPC connection for use communicating with a Google cloud -// service, configured with the given ClientOptions. -func DialGRPC(ctx context.Context, opt ...cloud.ClientOption) (*grpc.ClientConn, error) { - var o opts.DialOpt - for _, opt := range opt { - opt.Resolve(&o) - } - if o.HTTPClient != nil { - return nil, errors.New("unsupported HTTP base transport specified") - } - if o.GRPCClient != nil { - return o.GRPCClient, nil - } - if o.TokenSource == nil { - var err error - o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...) - if err != nil { - return nil, fmt.Errorf("google.DefaultTokenSource: %v", err) - } - } - grpcOpts := []grpc.DialOption{ - grpc.WithPerRPCCredentials(oauth.TokenSource{o.TokenSource}), - grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")), - } - grpcOpts = append(grpcOpts, o.GRPCDialOpts...) - if o.UserAgent != "" { - grpcOpts = append(grpcOpts, grpc.WithUserAgent(o.UserAgent)) - } - return grpc.Dial(o.Endpoint, grpcOpts...) -} diff --git a/vendor/google.golang.org/cloud/internal/transport/proto.go b/vendor/google.golang.org/cloud/internal/transport/proto.go deleted file mode 100644 index 05b11cde1..000000000 --- a/vendor/google.golang.org/cloud/internal/transport/proto.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// 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. - -package transport - -import ( - "bytes" - "io/ioutil" - "net/http" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" -) - -type ProtoClient struct { - client *http.Client - endpoint string - userAgent string -} - -func (c *ProtoClient) Call(ctx context.Context, method string, req, resp proto.Message) error { - payload, err := proto.Marshal(req) - if err != nil { - return err - } - - httpReq, err := http.NewRequest("POST", c.endpoint+method, bytes.NewReader(payload)) - if err != nil { - return err - } - httpReq.Header.Set("Content-Type", "application/x-protobuf") - if ua := c.userAgent; ua != "" { - httpReq.Header.Set("User-Agent", ua) - } - - errc := make(chan error, 1) - cancel := makeReqCancel(httpReq) - - go func() { - r, err := c.client.Do(httpReq) - if err != nil { - errc <- err - return - } - defer r.Body.Close() - - body, err := ioutil.ReadAll(r.Body) - if r.StatusCode != http.StatusOK { - err = &ErrHTTP{ - StatusCode: r.StatusCode, - Body: body, - err: err, - } - } - if err != nil { - errc <- err - return - } - errc <- proto.Unmarshal(body, resp) - }() - - select { - case <-ctx.Done(): - cancel(c.client.Transport) // Cancel the HTTP request. - return ctx.Err() - case err := <-errc: - return err - } -}